referrerpolicy=no-referrer-when-downgrade
sc_consensus::block_import

Trait BlockImport

Source
pub trait BlockImport<B: BlockT> {
    type Error: Error + Send + 'static;

    // Required methods
    fn check_block<'life0, 'async_trait>(
        &'life0 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 self,
        block: BlockImportParams<B>,
    ) -> 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.

Required Methods§

Source

fn check_block<'life0, 'async_trait>( &'life0 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 self, block: BlockImportParams<B>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Import a block.

Implementations on Foreign Types§

Source§

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

Source§

type Error = E

Source§

fn check_block<'life0, 'async_trait>( &'life0 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 self, block: BlockImportParams<B>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl<B: BlockT> BlockImport<B> for BoxBlockImport<B>

Source§

type Error = Error

impl<Block, BI, Client> BlockImport<Block> for SlotBasedBlockImport<Block, BI, Client>
where Block: BlockT, BI: BlockImport<Block> + Send + Sync, BI::Error: Into<Error>, Client: ProvideRuntimeApi<Block> + CallApiAt<Block> + Send + Sync, Client::StateBackend: Send, Client::Api: Core<Block>,

impl<Block, BI, BE> BlockImport<Block> for ParachainBlockImport<Block, BI, BE>
where Block: BlockT, BI: BlockImport<Block> + Send + Sync, BE: Backend<Block>,

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

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

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 = Error>, SC: Send + Sync,

impl<B, I, C, S, Algorithm, CIDP> BlockImport<B> for PowBlockImport<B, I, C, S, Algorithm, CIDP>
where B: BlockT, I: BlockImport<B> + Send + Sync, I::Error: Into<Error>, S: SelectChain<B>, C: ProvideRuntimeApi<B> + Send + Sync + HeaderBackend<B> + AuxStore + BlockOf, C::Api: BlockBuilderApi<B>, Algorithm: PowAlgorithm<B> + Send + Sync, Algorithm::Difficulty: 'static + Send, CIDP: CreateInherentDataProviders<B, ()> + Send + Sync,

impl<B, E, Block, RA> BlockImport<Block> for &Client<B, E, Block, RA>
where B: Backend<Block>, E: CallExecutor<Block> + Send + Sync, Block: BlockT, Client<B, E, Block, RA>: ProvideRuntimeApi<Block>, <Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: CoreApi<Block> + ApiExt<Block>, RA: Sync + Send,

impl<B, E, Block, RA> BlockImport<Block> for Client<B, E, Block, RA>
where B: Backend<Block>, E: CallExecutor<Block> + Send + Sync, Block: BlockT, Self: ProvideRuntimeApi<Block>, <Self as ProvideRuntimeApi<Block>>::Api: CoreApi<Block> + ApiExt<Block>, RA: Sync + Send,