Trait sp_consensus::block_import::BlockImport[][src]

pub trait BlockImport<B: BlockT> {
    type Error: Error + Send + 'static;
    type Transaction;
    fn check_block(
        &mut self,
        block: BlockCheckParams<B>
    ) -> Result<ImportResult, Self::Error>;
fn import_block(
        &mut self,
        block: BlockImportParams<B, Self::Transaction>,
        cache: HashMap<CacheKeyId, Vec<u8>>
    ) -> Result<ImportResult, Self::Error>; }
[]

Block import trait.

Associated Types

type Error: Error + Send + 'static[src][]

The error type.

type Transaction[src][]

The transaction type used by the backend.

Required methods

fn check_block(
    &mut self,
    block: BlockCheckParams<B>
) -> Result<ImportResult, Self::Error>
[src][]

Check block preconditions.

fn import_block(
    &mut self,
    block: BlockImportParams<B, Self::Transaction>,
    cache: HashMap<CacheKeyId, Vec<u8>>
) -> Result<ImportResult, Self::Error>
[src][]

Import a block.

Cached data can be accessed through the blockchain cache.

Implementations on Foreign Types

impl<B: BlockT, T, E: Error + Send + 'static, Transaction> BlockImport<B> for Arc<T> where
    &'r T: BlockImport<B, Error = E, Transaction = Transaction>, 
[src][]

type Error = E

type Transaction = Transaction

Implementors

impl<B: BlockT, Transaction> BlockImport<B> for BoxBlockImport<B, Transaction>[src][+]

type Error = Error

type Transaction = Transaction

fn check_block(
    &mut self,
    block: BlockCheckParams<B>
) -> Result<ImportResult, Self::Error>
[src][]

Check block preconditions.

fn import_block(
    &mut self,
    block: BlockImportParams<B, Transaction>,
    cache: HashMap<CacheKeyId, Vec<u8>>
) -> Result<ImportResult, Self::Error>
[src][]

Import a block.

Cached data can be accessed through the blockchain cache.

impl<Block: BlockT, C, I, P> BlockImport<Block> for AuraBlockImport<Block, C, I, P> where
    I: BlockImport<Block, Transaction = TransactionFor<C, Block>> + Send + Sync,
    I::Error: Into<ConsensusError>,
    C: HeaderBackend<Block> + ProvideRuntimeApi<Block>,
    P: Pair + Send + Sync + 'static,
    P::Public: Clone + Eq + Send + Sync + Hash + Debug + Encode + Decode,
    P::Signature: Encode + Decode

impl<Block, Client, Inner> BlockImport<Block> for BabeBlockImport<Block, Client, Inner> where
    Block: BlockT,
    Inner: BlockImport<Block, Transaction = TransactionFor<Client, Block>> + Send + Sync,
    Inner::Error: Into<ConsensusError>,
    Client: HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + ProvideRuntimeApi<Block> + ProvideCache<Block> + Send + Sync,
    Client::Api: BabeApi<Block> + ApiExt<Block>, 

impl<BE, Block: BlockT, Client, SC> BlockImport<Block> for GrandpaBlockImport<BE, Block, Client, SC> where
    NumberFor<Block>: BlockNumberOps,
    DigestFor<Block>: Encode,
    BE: Backend<Block>,
    Client: ClientForGrandpa<Block, BE>,
    &'a Client: BlockImport<Block, Error = ConsensusError, Transaction = TransactionFor<Client, Block>>,