Trait polkadot_service::BlockImport
source · pub trait BlockImport<B>where
B: Block,{
type Error: 'static + Error + Send;
type Transaction: 'static + Send;
fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Self::Transaction>,
cache: HashMap<[u8; 4], Vec<u8, Global>, RandomState>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Block import trait.
Required Associated Types§
sourcetype Transaction: 'static + Send
type Transaction: 'static + Send
The transaction type used by the backend.
Required Methods§
sourcefn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait,
fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait,
Check block preconditions.
sourcefn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Self::Transaction>,
cache: HashMap<[u8; 4], Vec<u8, Global>, RandomState>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait,
fn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Self::Transaction>,
cache: HashMap<[u8; 4], Vec<u8, Global>, RandomState>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait,
Import a block.
Cached data can be accessed through the blockchain cache.
Trait Implementations§
source§impl<B, Transaction> BlockImport<B> for Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>where
B: Block,
Transaction: 'static + Send,
impl<B, Transaction> BlockImport<B> for Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>where
B: Block,
Transaction: 'static + Send,
source§fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>: 'async_trait,
fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>: 'async_trait,
Check block preconditions.
source§fn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Transaction>,
cache: HashMap<[u8; 4], Vec<u8, Global>, RandomState>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>: 'async_trait,
fn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Transaction>,
cache: HashMap<[u8; 4], Vec<u8, Global>, RandomState>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>: 'async_trait,
Import a block.
Cached data can be accessed through the blockchain cache.
§type Transaction = Transaction
type Transaction = Transaction
The transaction type used by the backend.
Implementations on Foreign Types§
source§impl<BE, Block, Client, SC> BlockImport<Block> for GrandpaBlockImport<BE, Block, Client, SC>where
Block: Block,
<<Block as Block>::Header as Header>::Number: BlockNumberOps,
BE: Backend<Block>,
Client: ClientForGrandpa<Block, BE>,
<Client as ProvideRuntimeApi<Block>>::Api: GrandpaApi<Block>,
&'a Client: for<'a> BlockImport<Block, Error = Error, Transaction = <<<Client as ProvideRuntimeApi<Block>>::Api as ApiExt<Block>>::StateBackend as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction>,
<<<Client as ProvideRuntimeApi<Block>>::Api as ApiExt<Block>>::StateBackend as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction: 'static,
SC: Send,
impl<BE, Block, Client, SC> BlockImport<Block> for GrandpaBlockImport<BE, Block, Client, SC>where
Block: Block,
<<Block as Block>::Header as Header>::Number: BlockNumberOps,
BE: Backend<Block>,
Client: ClientForGrandpa<Block, BE>,
<Client as ProvideRuntimeApi<Block>>::Api: GrandpaApi<Block>,
&'a Client: for<'a> BlockImport<Block, Error = Error, Transaction = <<<Client as ProvideRuntimeApi<Block>>::Api as ApiExt<Block>>::StateBackend as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction>,
<<<Client as ProvideRuntimeApi<Block>>::Api as ApiExt<Block>>::StateBackend as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction: 'static,
SC: Send,
type Error = Error
type Transaction = <<<Client as ProvideRuntimeApi<Block>>::Api as ApiExt<Block>>::StateBackend as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction
fn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<Block, <GrandpaBlockImport<BE, Block, Client, SC> as BlockImport<Block>>::Transaction>,
new_cache: HashMap<[u8; 4], Vec<u8, Global>, RandomState>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <GrandpaBlockImport<BE, Block, Client, SC> as BlockImport<Block>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
GrandpaBlockImport<BE, Block, Client, SC>: 'async_trait,
fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<Block>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <GrandpaBlockImport<BE, Block, Client, SC> as BlockImport<Block>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
GrandpaBlockImport<BE, Block, Client, SC>: 'async_trait,
source§impl<B, Transaction> BlockImport<B> for Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>where
B: Block,
Transaction: 'static + Send,
impl<B, Transaction> BlockImport<B> for Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>where
B: Block,
Transaction: 'static + Send,
source§fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>: 'async_trait,
fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>: 'async_trait,
Check block preconditions.
source§fn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Transaction>,
cache: HashMap<[u8; 4], Vec<u8, Global>, RandomState>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>: 'async_trait,
fn import_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockImportParams<B, Transaction>,
cache: HashMap<[u8; 4], Vec<u8, Global>, RandomState>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Send + Sync + 'static, Global>: 'async_trait,
Import a block.
Cached data can be accessed through the blockchain cache.