Trait polkadot_service::BlockImport
source · pub trait BlockImport<B>where
B: Block,{
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 'life0: 'async_trait,
Self: '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 'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Block import trait.
Required Associated Types§
Required Methods§
sourcefn check_block<'life0, 'async_trait>(
&'life0 self,
block: BlockCheckParams<B>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn check_block<'life0, 'async_trait>(
&'life0 self,
block: BlockCheckParams<B>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Check block preconditions.
sourcefn import_block<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<B>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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
'life0: 'async_trait,
Self: 'async_trait,
Import a block.
Trait Implementations§
source§impl<B> BlockImport<B> for Box<dyn BlockImport<B, Error = Error> + Send + Sync>where
B: Block,
impl<B> BlockImport<B> for Box<dyn BlockImport<B, Error = Error> + Send + Sync>where
B: Block,
source§fn check_block<'life0, 'async_trait>(
&'life0 self,
block: BlockCheckParams<B>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error> + Send + Sync> as BlockImport<B>>::Error>> + Send + 'async_trait>>
fn check_block<'life0, 'async_trait>( &'life0 self, block: BlockCheckParams<B>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error> + Send + Sync> as BlockImport<B>>::Error>> + Send + 'async_trait>>
Check block preconditions.
source§fn import_block<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<B>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error> + Send + Sync> as BlockImport<B>>::Error>> + Send + 'async_trait>>
fn import_block<'life0, 'async_trait>( &'life0 self, block: BlockImportParams<B>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error> + Send + Sync> as BlockImport<B>>::Error>> + Send + 'async_trait>>
Import a block.
Implementations on Foreign Types§
source§impl<B> BlockImport<B> for Box<dyn BlockImport<B, Error = Error> + Send + Sync>where
B: Block,
impl<B> BlockImport<B> for Box<dyn BlockImport<B, Error = Error> + Send + Sync>where
B: Block,
source§fn check_block<'life0, 'async_trait>(
&'life0 self,
block: BlockCheckParams<B>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error> + Send + Sync> as BlockImport<B>>::Error>> + Send + 'async_trait>>
fn check_block<'life0, 'async_trait>( &'life0 self, block: BlockCheckParams<B>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error> + Send + Sync> as BlockImport<B>>::Error>> + Send + 'async_trait>>
Check block preconditions.
source§fn import_block<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<B>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error> + Send + Sync> as BlockImport<B>>::Error>> + Send + 'async_trait>>
fn import_block<'life0, 'async_trait>( &'life0 self, block: BlockImportParams<B>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error> + Send + Sync> as BlockImport<B>>::Error>> + Send + 'async_trait>>
Import a block.
type Error = Error
§impl<B, E, Block, RA> BlockImport<Block> for &Client<B, E, Block, RA>where
B: Backend<Block>,
E: CallExecutor<Block> + Send + Sync,
Block: Block,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<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: Block,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api: Core<Block> + ApiExt<Block>,
RA: Sync + Send,
NOTE: only use this implementation when you are sure there are NO consensus-level BlockImport objects. Otherwise, importing blocks directly into the client would be bypassing important verification work.
§fn import_block<'life0, 'async_trait>(
&'life0 self,
import_block: BlockImportParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <&Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
&Client<B, E, Block, RA>: 'async_trait,
fn import_block<'life0, 'async_trait>(
&'life0 self,
import_block: BlockImportParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <&Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
&Client<B, E, Block, RA>: 'async_trait,
Import a checked and validated block.
NOTE: only use this implementation when there are NO consensus-level BlockImport objects. Otherwise, importing blocks directly into the client would be bypassing important verification work.
If you are not sure that there are no BlockImport objects provided by the consensus algorithm, don’t use this function.
§fn check_block<'life0, 'async_trait>(
&'life0 self,
block: BlockCheckParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <&Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
&Client<B, E, Block, RA>: 'async_trait,
fn check_block<'life0, 'async_trait>(
&'life0 self,
block: BlockCheckParams<Block>,
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <&Client<B, E, Block, RA> as BlockImport<Block>>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
&Client<B, E, Block, RA>: 'async_trait,
Check block preconditions.