Trait sc_consensus::block_import::BlockImport
source · pub trait BlockImport<B: BlockT> {
type Error: Error + Send + 'static;
type Transaction: Send + 'static;
// Required methods
fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Self::Transaction>,
cache: HashMap<CacheKeyId, Vec<u8>>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Block import trait.
Required Associated Types§
sourcetype Transaction: Send + 'static
type Transaction: Send + 'static
The transaction type used by the backend.
Required Methods§
sourcefn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_block<'life0, 'async_trait>( &'life0 mut self, block: BlockCheckParams<B> ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Check block preconditions.
sourcefn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Self::Transaction>,
cache: HashMap<CacheKeyId, Vec<u8>>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn import_block<'life0, 'async_trait>( &'life0 mut self, block: BlockImportParams<B, Self::Transaction>, cache: HashMap<CacheKeyId, Vec<u8>> ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Import a block.
Cached data can be accessed through the blockchain cache.