Trait frame_try_runtime::TryRuntime
source · pub trait TryRuntime<Block: BlockT>: Core<Block> {
fn on_runtime_upgrade(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<(Weight, Weight), ApiError> { ... }
fn on_runtime_upgrade_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(Weight, Weight), ApiError> { ... }
fn execute_block(
&self,
__runtime_api_at_param__: &BlockId<Block>,
block: Block,
state_root_check: bool,
try_state: TryStateSelect
) -> Result<Weight, ApiError> { ... }
fn execute_block_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
block: Block,
state_root_check: bool,
try_state: TryStateSelect
) -> Result<Weight, ApiError> { ... }
}
Expand description
Runtime api for testing the execution of a runtime upgrade.
Provided Methods§
sourcefn on_runtime_upgrade(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<(Weight, Weight), ApiError>
fn on_runtime_upgrade(
&self,
__runtime_api_at_param__: &BlockId<Block>
) -> Result<(Weight, Weight), ApiError>
dry-run runtime upgrades, returning the total weight consumed.
This should do EXACTLY the same operations as the runtime would have done in the case of a runtime upgrade (e.g. pallet ordering must be the same)
Returns the consumed weight of the migration in case of a successful one, combined with the total allowed block weight of the runtime.
sourcefn on_runtime_upgrade_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(Weight, Weight), ApiError>
fn on_runtime_upgrade_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext
) -> Result<(Weight, Weight), ApiError>
dry-run runtime upgrades, returning the total weight consumed.
This should do EXACTLY the same operations as the runtime would have done in the case of a runtime upgrade (e.g. pallet ordering must be the same)
Returns the consumed weight of the migration in case of a successful one, combined with the total allowed block weight of the runtime.
sourcefn execute_block(
&self,
__runtime_api_at_param__: &BlockId<Block>,
block: Block,
state_root_check: bool,
try_state: TryStateSelect
) -> Result<Weight, ApiError>
fn execute_block(
&self,
__runtime_api_at_param__: &BlockId<Block>,
block: Block,
state_root_check: bool,
try_state: TryStateSelect
) -> Result<Weight, ApiError>
Execute the given block, but don’t check that its state root matches that of yours.
This is only sensible where the incoming block is from a different network, yet it has the same block format as the runtime implementing this API.
sourcefn execute_block_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
block: Block,
state_root_check: bool,
try_state: TryStateSelect
) -> Result<Weight, ApiError>
fn execute_block_with_context(
&self,
__runtime_api_at_param__: &BlockId<Block>,
context: ExecutionContext,
block: Block,
state_root_check: bool,
try_state: TryStateSelect
) -> Result<Weight, ApiError>
Execute the given block, but don’t check that its state root matches that of yours.
This is only sensible where the incoming block is from a different network, yet it has the same block format as the runtime implementing this API.