Trait ExecuteBlock
pub trait ExecuteBlock<Block>where
Block: Block,{
// Required methods
fn verify_and_remove_seal(block: &mut <Block as Block>::LazyBlock);
fn execute_verified_block(block: <Block as Block>::LazyBlock);
// Provided method
fn execute_block(block: <Block as Block>::LazyBlock) { ... }
}Expand description
Something that can execute a given block.
Executing a block means that all extrinsics in a given block will be executed and the resulting header will be checked against the header of the given block.
Required Methods§
fn verify_and_remove_seal(block: &mut <Block as Block>::LazyBlock)
fn verify_and_remove_seal(block: &mut <Block as Block>::LazyBlock)
Verify and remove seal.
Verifies any seal meant for the consensus logic represented by the implementation. An implementation may also chooses to not verify anything.
§Panic
Panics if a seal is invalid or if a seal is required, but not present.
fn execute_verified_block(block: <Block as Block>::LazyBlock)
fn execute_verified_block(block: <Block as Block>::LazyBlock)
Executes the given block after it was verified by [Self::verify_and_remove_seal].
§Panic
Panics when an extrinsics panics or the resulting header doesn’t match the expected header.
Provided Methods§
fn execute_block(block: <Block as Block>::LazyBlock)
fn execute_block(block: <Block as Block>::LazyBlock)
Execute the given block.
This will execute all extrinsics in the block and check that the resulting header is correct.
This function is a wrapper around Self::verify_and_remove_seal and
Self::execute_verified_block.
§Panic
Panics when an extrinsics panics or the resulting header doesn’t match the expected header or the seal is invalid.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade> ExecuteBlock<Block> for Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where
System: Config + IsInherent<<Block as Block>::Extrinsic>,
Block: Block<Header = <<System as Config>::Block as HeaderProvider>::HeaderT, Hash = <System as Config>::Hash>,
Context: Default,
AllPalletsWithSystem: OnRuntimeUpgrade + BeforeAllRuntimeMigrations + OnInitializeWithWeightRegistration<System> + OnIdle<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnFinalize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OffchainWorker<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnPoll<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number>,
COnRuntimeUpgrade: OnRuntimeUpgrade,
<Block as Block>::Extrinsic: Checkable<Context> + Codec,
<<Block as Block>::Extrinsic as Checkable<Context>>::Checked: Applyable + GetDispatchInfo,
<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
<<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call as Dispatchable>::RuntimeOrigin: From<Option<<System as Config>::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call = <<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call>,
TODO: The OnRuntimeUpgrade generic parameter in Executive is deprecated and will be
removed in a future version. Once removed, this #[allow(deprecated)] attribute
can be safely deleted.