Trait sc_transaction_pool::ChainApi[][src]

pub trait ChainApi: Send + Sync {
    type Block: BlockT;
    type Error: From<Error> + IntoPoolError;
    type ValidationFuture: Future<Output = Result<TransactionValidity, Self::Error>> + Send + Unpin;
    type BodyFuture: Future<Output = Result<Option<Vec<<Self::Block as Block>::Extrinsic>>, Self::Error>> + Unpin + Send + 'static;
    fn validate_transaction(
        at: &BlockId<Self::Block>,
        source: TransactionSource,
        uxt: <<Self as ChainApi>::Block as Block>::Extrinsic
    ) -> Self::ValidationFuture;
fn block_id_to_number(
        at: &BlockId<Self::Block>
    ) -> Result<Option<NumberFor<<Self as ChainApi>::Block>>, Self::Error>;
fn block_id_to_hash(
        at: &BlockId<Self::Block>
    ) -> Result<Option<<Self::Block as BlockT>::Hash>, Self::Error>;
fn hash_and_length(
        uxt: &<<Self as ChainApi>::Block as Block>::Extrinsic
    ) -> (<<Self as ChainApi>::Block as Block>::Hash, usize);
fn block_body(&self, at: &BlockId<Self::Block>) -> Self::BodyFuture;
fn block_header(
        at: &BlockId<Self::Block>
    ) -> Result<Option<<Self::Block as BlockT>::Header>, Self::Error>; }
Expand description

Concrete extrinsic validation and query logic.

Associated Types

Block type.

Error type.

Validate transaction future.

Body future (since block body might be remote)

Required methods

Verify extrinsic at given block.

Returns a block number given the block id.

Returns a block hash given the block id.

Returns hash and encoding length of the extrinsic.

Returns a block body given the block id.

Returns a block header given the block id.