Trait substrate_test_client::client_ext::ClientBlockImportExt [−][src]
pub trait ClientBlockImportExt<Block: BlockT>: Sized { fn import<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; fn import_as_best<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; fn import_as_final<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; fn import_justified<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block,
justifications: Justifications
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; }
Expand description
Extension trait for a test client around block importing.
Required methods
fn import<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn import<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Import block to the chain. No finality.
fn import_as_best<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn import_as_best<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Import a block and make it our best block if possible.
fn import_as_final<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn import_as_final<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Import a block and finalize it.
fn import_justified<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block,
justifications: Justifications
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn import_justified<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block,
justifications: Justifications
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Import block with justification(s), finalizes block.
Implementations on Foreign Types
impl<Block: BlockT, T, Transaction> ClientBlockImportExt<Block> for Arc<T> where
for<'r> &'r T: BlockImport<Block, Error = ConsensusError, Transaction = Transaction>,
Transaction: Send + 'static,
T: Send + Sync,
impl<Block: BlockT, T, Transaction> ClientBlockImportExt<Block> for Arc<T> where
for<'r> &'r T: BlockImport<Block, Error = ConsensusError, Transaction = Transaction>,
Transaction: Send + 'static,
T: Send + Sync,
This implementation is required, because of the weird api requirements around BlockImport
.
fn import<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn import_as_best<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn import_as_final<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn import_justified<'life0, 'async_trait>(
&'life0 mut self,
origin: BlockOrigin,
block: Block,
justifications: Justifications
) -> Pin<Box<dyn Future<Output = Result<(), ConsensusError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Implementors
impl<B, E, RA, Block: BlockT> ClientBlockImportExt<Block> for Client<B, E, Block, RA> where
Self: BlockImport<Block, Error = ConsensusError>,
RA: Send,
B: Send + Sync,
E: Send,
<Self as BlockImport<Block>>::Transaction: Send,