mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 15:41:02 +00:00
CheckInherentError can now report when something would be valid (#1204)
* CheckInherentError can now report when something would be valid * set timestamp inherent to next valid block time * return max timestamp for valid-after when checking
This commit is contained in:
committed by
Bastian Köcher
parent
93b212d2cc
commit
9bccc9661c
@@ -1177,7 +1177,7 @@ impl<C, A> BaseProposer<<C as AuthoringApi>::Block> for Proposer<C, A> where
|
||||
&inherent,
|
||||
) {
|
||||
Ok(Ok(())) => None,
|
||||
Ok(Err(BlockBuilderError::TimestampInFuture(timestamp))) => Some(timestamp),
|
||||
Ok(Err(BlockBuilderError::ValidAtTimestamp(timestamp))) => Some(timestamp),
|
||||
Ok(Err(e)) => {
|
||||
debug!(target: "rhd", "Invalid proposal (check_inherents): {:?}", e);
|
||||
return Box::new(future::ok(false));
|
||||
|
||||
@@ -487,7 +487,10 @@ impl BasicInherentData {
|
||||
#[derive(Encode)]
|
||||
#[cfg_attr(feature = "std", derive(Decode))]
|
||||
pub enum CheckInherentError {
|
||||
TimestampInFuture(u64),
|
||||
/// The inherents are generally valid but a delay until the given timestamp
|
||||
/// is required.
|
||||
ValidAtTimestamp(u64),
|
||||
/// Some other error has occurred.
|
||||
Other(RuntimeString),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user