[][src]Trait substrate_transaction_graph::ChainApi

pub trait ChainApi: Send + Sync {
    type Block: Block;
    type Hash: Hash + Eq + Member + Serialize;
    type Error: From<Error> + IntoPoolError;
    fn validate_transaction(
        &self,
        at: &BlockId<Self::Block>,
        uxt: ExtrinsicFor<Self>
    ) -> Result<TransactionValidity, Self::Error>;
fn block_id_to_number(
        &self,
        at: &BlockId<Self::Block>
    ) -> Result<Option<NumberFor<Self>>, Self::Error>;
fn block_id_to_hash(
        &self,
        at: &BlockId<Self::Block>
    ) -> Result<Option<BlockHash<Self>>, Self::Error>;
fn hash_and_length(&self, uxt: &ExtrinsicFor<Self>) -> (Self::Hash, usize); }

Concrete extrinsic validation and query logic.

Associated Types

type Block: Block

Block type.

type Hash: Hash + Eq + Member + Serialize

Transaction Hash type

type Error: From<Error> + IntoPoolError

Error type.

Loading content...

Required methods

fn validate_transaction(
    &self,
    at: &BlockId<Self::Block>,
    uxt: ExtrinsicFor<Self>
) -> Result<TransactionValidity, Self::Error>

Verify extrinsic at given block.

fn block_id_to_number(
    &self,
    at: &BlockId<Self::Block>
) -> Result<Option<NumberFor<Self>>, Self::Error>

Returns a block number given the block id.

fn block_id_to_hash(
    &self,
    at: &BlockId<Self::Block>
) -> Result<Option<BlockHash<Self>>, Self::Error>

Returns a block hash given the block id.

fn hash_and_length(&self, uxt: &ExtrinsicFor<Self>) -> (Self::Hash, usize)

Returns hash and encoding length of the extrinsic.

Loading content...

Implementors

Loading content...