Struct frame_executive::Executive
source · pub struct Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade = ()>(_);
Expand description
Main entry point for certain runtime actions as e.g. execute_block
.
Generic parameters:
System
: Something that implementsframe_system::Config
Block
: The block type of the runtimeContext
: The context that is used when checking an extrinsic.UnsignedValidator
: The unsigned transaction validator of the runtime.AllPalletsWithSystem
: Tuple that contains all pallets including frame system pallet. Will be used to call hooks e.g.on_initialize
.OnRuntimeUpgrade
: Custom logic that should be called after a runtime upgrade. Modules are already called byAllPalletsWithSystem
. It will be called before all modules will be called.
Implementations§
source§impl<System: Config + EnsureInherentsAreFirst<Block>, Block: Block<Header = HeaderFor<System>, Hash = System::Hash>, Context: Default, UnsignedValidator, AllPalletsWithSystem: OnRuntimeUpgrade + OnInitialize<BlockNumberFor<System>> + OnIdle<BlockNumberFor<System>> + OnFinalize<BlockNumberFor<System>> + OffchainWorker<BlockNumberFor<System>> + TryState<BlockNumberFor<System>>, COnRuntimeUpgrade: OnRuntimeUpgrade> Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where
Block::Extrinsic: Checkable<Context> + Codec,
CheckedOf<Block::Extrinsic, Context>: Applyable + GetDispatchInfo,
CallOf<Block::Extrinsic, Context>: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call = CallOf<Block::Extrinsic, Context>>,
impl<System: Config + EnsureInherentsAreFirst<Block>, Block: Block<Header = HeaderFor<System>, Hash = System::Hash>, Context: Default, UnsignedValidator, AllPalletsWithSystem: OnRuntimeUpgrade + OnInitialize<BlockNumberFor<System>> + OnIdle<BlockNumberFor<System>> + OnFinalize<BlockNumberFor<System>> + OffchainWorker<BlockNumberFor<System>> + TryState<BlockNumberFor<System>>, COnRuntimeUpgrade: OnRuntimeUpgrade> Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where Block::Extrinsic: Checkable<Context> + Codec, CheckedOf<Block::Extrinsic, Context>: Applyable + GetDispatchInfo, CallOf<Block::Extrinsic, Context>: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>, OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>, UnsignedValidator: ValidateUnsigned<Call = CallOf<Block::Extrinsic, Context>>,
sourcepub fn try_execute_block(
block: Block,
state_root_check: bool,
signature_check: bool,
select: TryStateSelect
) -> Result<Weight, &'static str>
pub fn try_execute_block( block: Block, state_root_check: bool, signature_check: bool, select: TryStateSelect ) -> Result<Weight, &'static str>
Execute given block, but don’t as strict is the normal block execution.
Some checks can be disabled via:
state_root_check
signature_check
Should only be used for testing ONLY.
sourcepub fn try_runtime_upgrade(
checks: UpgradeCheckSelect
) -> Result<Weight, TryRuntimeError>
pub fn try_runtime_upgrade( checks: UpgradeCheckSelect ) -> Result<Weight, TryRuntimeError>
Execute all OnRuntimeUpgrade
of this runtime, including the pre and post migration checks.
Runs the try-state code both before and after the migration function if checks
is set to
true
. Also, if set to true
, it runs the pre_upgrade
and post_upgrade
hooks.
source§impl<System: Config + EnsureInherentsAreFirst<Block>, Block: Block<Header = HeaderFor<System>, Hash = System::Hash>, Context: Default, UnsignedValidator, AllPalletsWithSystem: OnRuntimeUpgrade + OnInitialize<BlockNumberFor<System>> + OnIdle<BlockNumberFor<System>> + OnFinalize<BlockNumberFor<System>> + OffchainWorker<BlockNumberFor<System>>, COnRuntimeUpgrade: OnRuntimeUpgrade> Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where
Block::Extrinsic: Checkable<Context> + Codec,
CheckedOf<Block::Extrinsic, Context>: Applyable + GetDispatchInfo,
CallOf<Block::Extrinsic, Context>: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call = CallOf<Block::Extrinsic, Context>>,
impl<System: Config + EnsureInherentsAreFirst<Block>, Block: Block<Header = HeaderFor<System>, Hash = System::Hash>, Context: Default, UnsignedValidator, AllPalletsWithSystem: OnRuntimeUpgrade + OnInitialize<BlockNumberFor<System>> + OnIdle<BlockNumberFor<System>> + OnFinalize<BlockNumberFor<System>> + OffchainWorker<BlockNumberFor<System>>, COnRuntimeUpgrade: OnRuntimeUpgrade> Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where Block::Extrinsic: Checkable<Context> + Codec, CheckedOf<Block::Extrinsic, Context>: Applyable + GetDispatchInfo, CallOf<Block::Extrinsic, Context>: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>, OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>, UnsignedValidator: ValidateUnsigned<Call = CallOf<Block::Extrinsic, Context>>,
sourcepub fn execute_on_runtime_upgrade() -> Weight
pub fn execute_on_runtime_upgrade() -> Weight
Execute all OnRuntimeUpgrade
of this runtime, and return the aggregate weight.
sourcepub fn initialize_block(header: &HeaderFor<System>)
pub fn initialize_block(header: &HeaderFor<System>)
Start the execution of a particular block.
sourcepub fn execute_block(block: Block)
pub fn execute_block(block: Block)
Actually execute all transitions for block
.
sourcepub fn finalize_block() -> HeaderFor<System>
pub fn finalize_block() -> HeaderFor<System>
Finalize the block - it is up the caller to ensure that all header fields are valid except state-root.
sourcepub fn apply_extrinsic(uxt: Block::Extrinsic) -> ApplyExtrinsicResult
pub fn apply_extrinsic(uxt: Block::Extrinsic) -> ApplyExtrinsicResult
Apply extrinsic outside of the block execution function.
This doesn’t attempt to validate anything regarding the block, but it builds a list of uxt hashes.
sourcepub fn validate_transaction(
source: TransactionSource,
uxt: Block::Extrinsic,
block_hash: Block::Hash
) -> TransactionValidity
pub fn validate_transaction( source: TransactionSource, uxt: Block::Extrinsic, block_hash: Block::Hash ) -> TransactionValidity
Check a given signed transaction for validity. This doesn’t execute any side-effects; it merely checks whether the transaction would panic if it were included or not.
Changes made to storage should be discarded.
sourcepub fn offchain_worker(header: &HeaderFor<System>)
pub fn offchain_worker(header: &HeaderFor<System>)
Start an offchain worker and generate extrinsics.
Trait Implementations§
source§impl<System: Config + EnsureInherentsAreFirst<Block>, Block: Block<Header = HeaderFor<System>, Hash = System::Hash>, Context: Default, UnsignedValidator, AllPalletsWithSystem: OnRuntimeUpgrade + OnInitialize<BlockNumberFor<System>> + OnIdle<BlockNumberFor<System>> + OnFinalize<BlockNumberFor<System>> + OffchainWorker<BlockNumberFor<System>>, COnRuntimeUpgrade: OnRuntimeUpgrade> ExecuteBlock<Block> for Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where
Block::Extrinsic: Checkable<Context> + Codec,
CheckedOf<Block::Extrinsic, Context>: Applyable + GetDispatchInfo,
CallOf<Block::Extrinsic, Context>: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call = CallOf<Block::Extrinsic, Context>>,
impl<System: Config + EnsureInherentsAreFirst<Block>, Block: Block<Header = HeaderFor<System>, Hash = System::Hash>, Context: Default, UnsignedValidator, AllPalletsWithSystem: OnRuntimeUpgrade + OnInitialize<BlockNumberFor<System>> + OnIdle<BlockNumberFor<System>> + OnFinalize<BlockNumberFor<System>> + OffchainWorker<BlockNumberFor<System>>, COnRuntimeUpgrade: OnRuntimeUpgrade> ExecuteBlock<Block> for Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where Block::Extrinsic: Checkable<Context> + Codec, CheckedOf<Block::Extrinsic, Context>: Applyable + GetDispatchInfo, CallOf<Block::Extrinsic, Context>: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>, OriginOf<Block::Extrinsic, Context>: From<Option<System::AccountId>>, UnsignedValidator: ValidateUnsigned<Call = CallOf<Block::Extrinsic, Context>>,
source§fn execute_block(block: Block)
fn execute_block(block: Block)
block
. Read moreAuto Trait Implementations§
impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade> RefUnwindSafe for Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade>where AllPalletsWithSystem: RefUnwindSafe, Block: RefUnwindSafe, Context: RefUnwindSafe, OnRuntimeUpgrade: RefUnwindSafe, System: RefUnwindSafe, UnsignedValidator: RefUnwindSafe,
impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade> Send for Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade>where AllPalletsWithSystem: Send, Block: Send, Context: Send, OnRuntimeUpgrade: Send, System: Send, UnsignedValidator: Send,
impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade> Sync for Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade>where AllPalletsWithSystem: Sync, Block: Sync, Context: Sync, OnRuntimeUpgrade: Sync, System: Sync, UnsignedValidator: Sync,
impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade> Unpin for Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade>where AllPalletsWithSystem: Unpin, Block: Unpin, Context: Unpin, OnRuntimeUpgrade: Unpin, System: Unpin, UnsignedValidator: Unpin,
impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade> UnwindSafe for Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, OnRuntimeUpgrade>where AllPalletsWithSystem: UnwindSafe, Block: UnwindSafe, Context: UnwindSafe, OnRuntimeUpgrade: UnwindSafe, System: UnwindSafe, UnsignedValidator: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.