Trait sp_consensus::block_import::BlockImport
source · [−]pub trait BlockImport<B: BlockT> {
type Error: Error + Send + 'static;
type Transaction;
fn check_block(
&mut self,
block: BlockCheckParams<B>
) -> Result<ImportResult, Self::Error>;
fn import_block(
&mut self,
block: BlockImportParams<B, Self::Transaction>,
cache: HashMap<CacheKeyId, Vec<u8>>
) -> Result<ImportResult, Self::Error>;
}
Expand description
Block import trait.
Associated Types
type Transaction
type Transaction
The transaction type used by the backend.
Required methods
fn check_block(
&mut self,
block: BlockCheckParams<B>
) -> Result<ImportResult, Self::Error>
fn check_block(
&mut self,
block: BlockCheckParams<B>
) -> Result<ImportResult, Self::Error>
Check block preconditions.
fn import_block(
&mut self,
block: BlockImportParams<B, Self::Transaction>,
cache: HashMap<CacheKeyId, Vec<u8>>
) -> Result<ImportResult, Self::Error>
fn import_block(
&mut self,
block: BlockImportParams<B, Self::Transaction>,
cache: HashMap<CacheKeyId, Vec<u8>>
) -> Result<ImportResult, Self::Error>
Import a block.
Cached data can be accessed through the blockchain cache.