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§

source

type Error: Error + Send + 'static

The error type.

source

type Transaction: Send + 'static

The transaction type used by the backend.

Required Methods§

source

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.

source

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.

Implementations on Foreign Types§

source§

impl<B: BlockT, T, E: Error + Send + 'static, Transaction> BlockImport<B> for Arc<T>where for<'r> &'r T: BlockImport<B, Error = E, Transaction = Transaction>, T: Send + Sync, Transaction: Send + 'static,

§

type Error = E

§

type Transaction = Transaction

source§

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,

source§

fn import_block<'life0, 'async_trait>( &'life0 mut self, block: BlockImportParams<B, 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,

Implementors§

source§

impl<B: BlockT, Transaction> BlockImport<B> for BoxBlockImport<B, Transaction>where Transaction: Send + 'static,

§

type Error = Error

§

type Transaction = Transaction

impl<Block, BE, Runtime, I> BlockImport<Block> for BeefyBlockImport<Block, BE, Runtime, I>where Block: BlockT, BE: Backend<Block>, I: BlockImport<Block, Error = ConsensusError, Transaction = TransactionFor<Runtime, Block>> + Send + Sync, Runtime: ProvideRuntimeApi<Block> + Send + Sync, Runtime::Api: BeefyApi<Block>,

impl<Block, Client, Inner> BlockImport<Block> for BabeBlockImport<Block, Client, Inner>where Block: BlockT, Inner: BlockImport<Block, Transaction = TransactionFor<Client, Block>> + Send + Sync, Inner::Error: Into<ConsensusError>, Client: HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + ProvideRuntimeApi<Block> + Send + Sync, Client::Api: BabeApi<Block> + ApiExt<Block>,

impl<BE, Block: BlockT, Client, SC> BlockImport<Block> for GrandpaBlockImport<BE, Block, Client, SC>where NumberFor<Block>: BlockNumberOps, BE: Backend<Block>, Client: ClientForGrandpa<Block, BE>, Client::Api: GrandpaApi<Block>, for<'a> &'a Client: BlockImport<Block, Error = ConsensusError, Transaction = TransactionFor<Client, Block>>, TransactionFor<Client, Block>: 'static, SC: Send,