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§
sourcefn execution_strategy(&self) -> BlockExecutionStrategy
fn execution_strategy(&self) -> BlockExecutionStrategy
Returns the type of block execution strategy used.
sourcefn execute_block(
&self,
parent_hash: Block::Hash,
block: Block,
) -> Result<ExecuteBlockResult<Block>>
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.
Provided Methods§
sourcefn is_in_memory_backend_used(&self) -> bool
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.