referrerpolicy=no-referrer-when-downgrade
pub trait ClientBlockImportExt<Block: BlockT>: Sized {
    // Required methods
    fn import<'life0, 'async_trait>(
        &'life0 self,
        origin: BlockOrigin,
        block: Block,
    ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn import_as_best<'life0, 'async_trait>(
        &'life0 self,
        origin: BlockOrigin,
        block: Block,
    ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn import_as_final<'life0, 'async_trait>(
        &'life0 self,
        origin: BlockOrigin,
        block: Block,
    ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn import_justified<'life0, 'async_trait>(
        &'life0 self,
        origin: BlockOrigin,
        block: Block,
        justifications: Justifications,
    ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Extension trait for a test client around block importing.

Required Methods§

source

fn import<'life0, 'async_trait>( &'life0 self, origin: BlockOrigin, block: Block, ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Import block to the chain. No finality.

source

fn import_as_best<'life0, 'async_trait>( &'life0 self, origin: BlockOrigin, block: Block, ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Import a block and make it our best block if possible.

source

fn import_as_final<'life0, 'async_trait>( &'life0 self, origin: BlockOrigin, block: Block, ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Import a block and finalize it.

source

fn import_justified<'life0, 'async_trait>( &'life0 self, origin: BlockOrigin, block: Block, justifications: Justifications, ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Import block with justification(s), finalizes block.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<Block: BlockT, T> ClientBlockImportExt<Block> for Arc<T>
where for<'r> &'r T: BlockImport<Block, Error = Error>, T: Send + Sync,

This implementation is required, because of the weird api requirements around BlockImport.

source§

fn import<'life0, 'async_trait>( &'life0 self, origin: BlockOrigin, block: Block, ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn import_as_best<'life0, 'async_trait>( &'life0 self, origin: BlockOrigin, block: Block, ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn import_as_final<'life0, 'async_trait>( &'life0 self, origin: BlockOrigin, block: Block, ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn import_justified<'life0, 'async_trait>( &'life0 self, origin: BlockOrigin, block: Block, justifications: Justifications, ) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl<B, E, RA, Block: BlockT> ClientBlockImportExt<Block> for Client<B, E, Block, RA>
where Self: BlockImport<Block, Error = Error>, RA: Send + Sync, B: Send + Sync, E: Send + Sync,