[][src]Trait substrate_service::ChainApi

pub trait ChainApi: Send + Sync where
    <Self::ValidationFuture as Future>::Output == Result<Result<ValidTransaction, TransactionValidityError>, Self::Error>, 
{ type Block: Block; type Hash: Eq + Hash + Serialize + Member; type Error: IntoPoolError + From<Error>; type ValidationFuture: Send + Unpin + Future; fn validate_transaction(
        &self,
        at: &BlockId<Self::Block>,
        uxt: <Self::Block as Block>::Extrinsic
    ) -> Self::ValidationFuture;
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.

type ValidationFuture: Send + Unpin + Future

Validate transaction future.

Loading content...

Required methods

fn validate_transaction(
    &self,
    at: &BlockId<Self::Block>,
    uxt: <Self::Block as Block>::Extrinsic
) -> Self::ValidationFuture

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 FullChainApi<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

type ValidationFuture = Ready<Result<Result<ValidTransaction, TransactionValidityError>, Error>>

Loading content...

Implementors

Loading content...