Trait sc_transaction_pool::test_helpers::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(
&self,
at: &BlockId<Self::Block>,
source: TransactionSource,
uxt: ExtrinsicFor<Self>
) -> Self::ValidationFuture; 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<<Self::Block as BlockT>::Hash>, Self::Error>; fn hash_and_length(
&self,
uxt: &ExtrinsicFor<Self>
) -> (<<Self as ChainApi>::Block as Block>::Hash, usize); fn block_body(&self, at: &BlockId<Self::Block>) -> Self::BodyFuture; fn block_header(
&self,
at: &BlockId<Self::Block>
) -> Result<Option<<Self::Block as BlockT>::Header>, Self::Error>; }
Expand description
Concrete extrinsic validation and query logic.
Associated Types
type Error: From<Error> + IntoPoolError
type Error: From<Error> + IntoPoolError
Error type.
type ValidationFuture: Future<Output = Result<TransactionValidity, Self::Error>> + Send + Unpin
type ValidationFuture: Future<Output = Result<TransactionValidity, Self::Error>> + Send + Unpin
Validate transaction future.
Required methods
fn validate_transaction(
&self,
at: &BlockId<Self::Block>,
source: TransactionSource,
uxt: ExtrinsicFor<Self>
) -> Self::ValidationFuture
fn validate_transaction(
&self,
at: &BlockId<Self::Block>,
source: TransactionSource,
uxt: ExtrinsicFor<Self>
) -> Self::ValidationFuture
Verify extrinsic at given block.
Returns a block number given the block id.
Returns a block hash given the block id.
fn hash_and_length(
&self,
uxt: &ExtrinsicFor<Self>
) -> (<<Self as ChainApi>::Block as Block>::Hash, usize)
fn hash_and_length(
&self,
uxt: &ExtrinsicFor<Self>
) -> (<<Self as ChainApi>::Block as Block>::Hash, usize)
Returns hash and encoding length of the extrinsic.
fn block_body(&self, at: &BlockId<Self::Block>) -> Self::BodyFuture
fn block_body(&self, at: &BlockId<Self::Block>) -> Self::BodyFuture
Returns a block body given the block id.
Implementors
impl<Client, Block> ChainApi for FullChainApi<Client, Block> where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + BlockIdTo<Block> + HeaderBackend<Block>,
Client: Send + Sync + 'static,
Client::Api: TaggedTransactionQueue<Block>,
impl<Client, F, Block> ChainApi for LightChainApi<Client, F, Block> where
Block: BlockT,
Client: HeaderBackend<Block> + 'static,
F: Fetcher<Block> + 'static,