[][src]Trait sc_transaction_graph::ChainApi

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;
    pub fn validate_transaction(
        &self,
        at: &BlockId<Self::Block>,
        source: TransactionSource,
        uxt: ExtrinsicFor<Self>
    ) -> Self::ValidationFuture;
pub fn block_id_to_number(
        &self,
        at: &BlockId<Self::Block>
    ) -> Result<Option<NumberFor<Self>>, Self::Error>;
pub fn block_id_to_hash(
        &self,
        at: &BlockId<Self::Block>
    ) -> Result<Option<<Self::Block as BlockT>::Hash>, Self::Error>;
pub fn hash_and_length(
        &self,
        uxt: &ExtrinsicFor<Self>
    ) -> (ExtrinsicHash<Self>, usize);
pub fn block_body(&self, at: &BlockId<Self::Block>) -> Self::BodyFuture; }

Concrete extrinsic validation and query logic.

Associated Types

type Block: BlockT[src]

Block type.

type Error: From<Error> + IntoPoolError[src]

Error type.

type ValidationFuture: Future<Output = Result<TransactionValidity, Self::Error>> + Send + Unpin[src]

Validate transaction future.

type BodyFuture: Future<Output = Result<Option<Vec<<Self::Block as Block>::Extrinsic>>, Self::Error>> + Unpin + Send + 'static[src]

Body future (since block body might be remote)

Loading content...

Required methods

pub fn validate_transaction(
    &self,
    at: &BlockId<Self::Block>,
    source: TransactionSource,
    uxt: ExtrinsicFor<Self>
) -> Self::ValidationFuture
[src]

Verify extrinsic at given block.

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

Returns a block number given the block id.

pub fn block_id_to_hash(
    &self,
    at: &BlockId<Self::Block>
) -> Result<Option<<Self::Block as BlockT>::Hash>, Self::Error>
[src]

Returns a block hash given the block id.

pub fn hash_and_length(
    &self,
    uxt: &ExtrinsicFor<Self>
) -> (ExtrinsicHash<Self>, usize)
[src]

Returns hash and encoding length of the extrinsic.

pub fn block_body(&self, at: &BlockId<Self::Block>) -> Self::BodyFuture[src]

Returns a block body given the block id.

Loading content...

Implementors

Loading content...