[][src]Trait substrate_service::ChainApi

pub trait ChainApi: Send + Sync {
    type Block: Block;
    type Hash: Eq + Hash + Serialize + Member;
    type Error: IntoPoolError + From<Error>;
    fn validate_transaction(
        &self,
        at: &BlockId<Self::Block>,
        uxt: <Self::Block as Block>::Extrinsic
    ) -> Result<Result<ValidTransaction, TransactionValidityError>, Self::Error>;
fn block_id_to_number(
        &self,
        at: &BlockId<Self::Block>
    ) -> Result<Option<<<Self::Block as Block>::Header as Header>::Number>, Self::Error>;
fn block_id_to_hash(
        &self,
        at: &BlockId<Self::Block>
    ) -> Result<Option<<Self::Block as Block>::Hash>, Self::Error>;
fn hash_and_length(
        &self,
        uxt: &<Self::Block as Block>::Extrinsic
    ) -> (Self::Hash, usize); }

Concrete extrinsic validation and query logic.

Associated Types

type Block: Block

Block type.

type Hash: Eq + Hash + Serialize + Member

Transaction Hash type

type Error: IntoPoolError + From<Error>

Error type.

Loading content...

Required methods

fn validate_transaction(
    &self,
    at: &BlockId<Self::Block>,
    uxt: <Self::Block as Block>::Extrinsic
) -> Result<Result<ValidTransaction, TransactionValidityError>, Self::Error>

Verify extrinsic at given block.

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

Returns a block number given the block id.

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

Returns a block hash given the block id.

fn hash_and_length(
    &self,
    uxt: &<Self::Block as Block>::Extrinsic
) -> (Self::Hash, usize)

Returns hash and encoding length of the extrinsic.

Loading content...

Implementations on Foreign Types

impl<T, Block> ChainApi for ChainApi<T, Block> where
    Block: Block<Hash = H256>,
    T: ProvideRuntimeApi + HeaderBackend<Block>,
    <T as ProvideRuntimeApi>::Api: TaggedTransactionQueue<Block>, 
[src]

type Block = Block

type Hash = H256

type Error = Error

Loading content...

Implementors

Loading content...