Trait sc_consensus_nakamoto::BlockExecutor

source ·
pub trait BlockExecutor<Block: BlockT>: Send + Sync {
    // Required methods
    fn execution_strategy(&self) -> BlockExecutionStrategy;
    fn execute_block(
        &self,
        parent_hash: Block::Hash,
        block: Block,
    ) -> Result<ExecuteBlockResult<Block>>;
    fn import_block<'life0, 'async_trait>(
        &'life0 mut self,
        import_params: BlockImportParams<Block>,
    ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn is_in_memory_backend_used(&self) -> bool { ... }
}
Expand description

Trait for executing and importing the block.

Required Methods§

source

fn execution_strategy(&self) -> BlockExecutionStrategy

Returns the type of block execution strategy used.

source

fn execute_block( &self, parent_hash: Block::Hash, block: Block, ) -> Result<ExecuteBlockResult<Block>>

Executes the given block on top of the state specified by the parent hash.

source

fn import_block<'life0, 'async_trait>( &'life0 mut self, import_params: BlockImportParams<Block>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Imports the block using the given import params.

Provided Methods§

source

fn is_in_memory_backend_used(&self) -> bool

Determines whether the block should be imported in the executor.

import_block only makes sense for the executor using in memory backend.

Implementors§

source§

impl<Block, BE, Client, BI> BlockExecutor<Block> for RuntimeBlockExecutor<Block, Client, BE, BI>
where Block: BlockT, BE: Backend<Block>, Client: HeaderBackend<Block> + BlockBackend<Block> + AuxStore + ProvideRuntimeApi<Block> + StorageProvider<Block, BE> + CallApiAt<Block>, Client::Api: Core<Block> + Subcoin<Block>, BI: BlockImport<Block> + Send + Sync,

source§

impl<Block, BE, Client, TransactionAdapter, BI> BlockExecutor<Block> for OffRuntimeBlockExecutor<Block, Client, BE, TransactionAdapter, BI>
where Block: BlockT, BE: Backend<Block>, Client: HeaderBackend<Block> + BlockBackend<Block> + AuxStore + ProvideRuntimeApi<Block> + StorageProvider<Block, BE> + CallApiAt<Block>, Client::Api: Core<Block> + Subcoin<Block>, TransactionAdapter: BitcoinTransactionAdapter<Block> + Send + Sync, BI: BlockImport<Block> + Send + Sync + 'static,

source§

impl<Block, DiskRuntime, InMemoryRuntime, DiskOffRuntime, InMemoryOffRuntime> BlockExecutor<Block> for BenchmarkAllExecutor<Block, DiskRuntime, InMemoryRuntime, DiskOffRuntime, InMemoryOffRuntime>
where Block: BlockT, DiskRuntime: BlockExecutor<Block>, InMemoryRuntime: BlockExecutor<Block>, DiskOffRuntime: BlockExecutor<Block>, InMemoryOffRuntime: BlockExecutor<Block>,

source§

impl<Block: BlockT> BlockExecutor<Block> for BenchmarkRuntimeBlockExecutor<Block>