Trait polkadot_service::BlockImport [−][src]
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.
Associated Types
type Transaction: 'static + Send
type Transaction: 'static + Send
The transaction type used by the backend.
Required methods
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 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.
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,
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.
Implementations on Foreign Types
impl<BE, Block, Client, SC> BlockImport<Block> for GrandpaBlockImport<BE, Block, Client, SC> where
Block: Block,
BE: Backend<Block>,
Client: ClientForGrandpa<Block, BE>,
SC: Send,
<<Block as Block>::Header as Header>::Number: BlockNumberOps,
<Client as ProvideRuntimeApi<Block>>::Api: GrandpaApi<Block>,
&'a Client: for<'a> BlockImport<Block>,
<<<Client as ProvideRuntimeApi<Block>>::Api as ApiExt<Block>>::StateBackend as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction: 'static,
<&'a Client as BlockImport<Block>>::Error == Error,
<&'a Client as BlockImport<Block>>::Transaction == <<<Client as ProvideRuntimeApi<Block>>::Api as ApiExt<Block>>::StateBackend as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction,
impl<BE, Block, Client, SC> BlockImport<Block> for GrandpaBlockImport<BE, Block, Client, SC> where
Block: Block,
BE: Backend<Block>,
Client: ClientForGrandpa<Block, BE>,
SC: Send,
<<Block as Block>::Header as Header>::Number: BlockNumberOps,
<Client as ProvideRuntimeApi<Block>>::Api: GrandpaApi<Block>,
&'a Client: for<'a> BlockImport<Block>,
<<<Client as ProvideRuntimeApi<Block>>::Api as ApiExt<Block>>::StateBackend as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction: 'static,
<&'a Client as BlockImport<Block>>::Error == Error,
<&'a Client as BlockImport<Block>>::Transaction == <<<Client as ProvideRuntimeApi<Block>>::Api as ApiExt<Block>>::StateBackend as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction,
type Transaction = <<<Client as ProvideRuntimeApi<Block>>::Api as ApiExt<Block>>::StateBackend as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction
pub 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,
pub 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,
impl<B, T, E, Transaction> BlockImport<B> for Arc<T> where
E: 'static + Error + Send,
B: Block,
T: Send + Sync,
Transaction: 'static + Send,
&'r T: for<'r> BlockImport<B>,
<&'r T as BlockImport<B>>::Error == E,
<&'r T as BlockImport<B>>::Transaction == Transaction,
impl<B, T, E, Transaction> BlockImport<B> for Arc<T> where
E: 'static + Error + Send,
B: Block,
T: Send + Sync,
Transaction: 'static + Send,
&'r T: for<'r> BlockImport<B>,
<&'r T as BlockImport<B>>::Error == E,
<&'r T as BlockImport<B>>::Transaction == Transaction,
type Error = E
type Transaction = Transaction
pub fn check_block<'life0, 'async_trait>(
&'life0 mut self,
block: BlockCheckParams<B>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, <Arc<T> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
Arc<T>: 'async_trait,
pub 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, <Arc<T> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
Arc<T>: 'async_trait,
impl<B, Transaction> BlockImport<B> for Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Sync + Send + 'static, Global> where
B: Block,
Transaction: 'static + Send,
impl<B, Transaction> BlockImport<B> for Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Sync + Send + 'static, Global> where
B: Block,
Transaction: 'static + Send,
pub 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> + Sync + Send + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Sync + Send + 'static, Global>: 'async_trait,
pub 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> + Sync + Send + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Sync + Send + 'static, Global>: 'async_trait,
Check block preconditions.
pub 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> + Sync + Send + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Sync + Send + 'static, Global>: 'async_trait,
pub 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> + Sync + Send + 'static, Global> as BlockImport<B>>::Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
Box<dyn BlockImport<B, Error = Error, Transaction = Transaction> + Sync + Send + 'static, Global>: 'async_trait,
Import a block.
Cached data can be accessed through the blockchain cache.