MockPayload

Type Alias MockPayload 

Source
pub type MockPayload = TestBlockPayload;

Aliased Type§

pub struct MockPayload {
    pub transactions: Vec<TestTransaction>,
}

Fields§

§transactions: Vec<TestTransaction>

List of transactions.

Trait Implementations§

Source§

impl QueryablePayload<MockTypes> for MockPayload

Source§

type Iter<'a> = <Vec<TransactionIndex<MockTypes>> as IntoIterator>::IntoIter

Enumerate the transactions in this block.
Source§

type InclusionProof = MockInclusionProof

A proof that a certain transaction exists in the block.
Source§

fn len(&self, _meta: &Self::Metadata) -> usize

The number of transactions in the block.
Source§

fn iter(&self, meta: &Self::Metadata) -> Self::Iter<'_>

List the transaction indices in the block.
Source§

fn transaction( &self, _meta: &Self::Metadata, index: &TransactionIndex<MockTypes>, ) -> Option<Self::Transaction>

Get a transaction by its block-specific index.
Source§

fn transaction_proof( &self, _meta: &Self::Metadata, _vid: &VidCommonQueryData<MockTypes>, _index: &TransactionIndex<MockTypes>, ) -> Option<Self::InclusionProof>

Get an inclusion proof for the given transaction. Read more
Source§

fn is_empty(&self, meta: &Self::Metadata) -> bool

Whether this block is empty of transactions.
Source§

fn enumerate<'a>( &'a self, meta: &'a Self::Metadata, ) -> Box<dyn Iterator<Item = (TransactionIndex<Types>, Self::Transaction)> + 'a>

Enumerate the transactions in the block with their indices.
Source§

fn nth( &self, meta: &Self::Metadata, n: usize, ) -> Option<TransactionIndex<Types>>

Get the index of the nth transaction.
Source§

fn nth_transaction( &self, meta: &Self::Metadata, n: usize, ) -> Option<Self::Transaction>

Get the nth transaction.
Source§

fn by_hash( &self, meta: &Self::Metadata, hash: Commitment<Self::Transaction>, ) -> Option<TransactionIndex<Types>>

Get the index of the transaction with a given hash, if it is in the block.
Source§

fn transaction_by_hash( &self, meta: &Self::Metadata, hash: Commitment<Self::Transaction>, ) -> Option<Self::Transaction>

Get the transaction with a given hash, if it is in the block.