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