Trait reth_storage_api::TransactionsProvider

source ·
pub trait TransactionsProvider:
    BlockNumReader
    + Send
    + Sync {
    // Required methods
    fn transaction_id(
        &self,
        tx_hash: TxHash,
    ) -> ProviderResult<Option<TxNumber>>;
    fn transaction_by_id(
        &self,
        id: TxNumber,
    ) -> ProviderResult<Option<TransactionSigned>>;
    fn transaction_by_id_no_hash(
        &self,
        id: TxNumber,
    ) -> ProviderResult<Option<TransactionSignedNoHash>>;
    fn transaction_by_hash(
        &self,
        hash: TxHash,
    ) -> ProviderResult<Option<TransactionSigned>>;
    fn transaction_by_hash_with_meta(
        &self,
        hash: TxHash,
    ) -> ProviderResult<Option<(TransactionSigned, TransactionMeta)>>;
    fn transaction_block(
        &self,
        id: TxNumber,
    ) -> ProviderResult<Option<BlockNumber>>;
    fn transactions_by_block(
        &self,
        block: BlockHashOrNumber,
    ) -> ProviderResult<Option<Vec<TransactionSigned>>>;
    fn transactions_by_block_range(
        &self,
        range: impl RangeBounds<BlockNumber>,
    ) -> ProviderResult<Vec<Vec<TransactionSigned>>>;
    fn transactions_by_tx_range(
        &self,
        range: impl RangeBounds<TxNumber>,
    ) -> ProviderResult<Vec<TransactionSignedNoHash>>;
    fn senders_by_tx_range(
        &self,
        range: impl RangeBounds<TxNumber>,
    ) -> ProviderResult<Vec<Address>>;
    fn transaction_sender(
        &self,
        id: TxNumber,
    ) -> ProviderResult<Option<Address>>;
}
Expand description

Client trait for fetching [TransactionSigned] related data.

Required Methods§

source

fn transaction_id(&self, tx_hash: TxHash) -> ProviderResult<Option<TxNumber>>

Get internal transaction identifier by transaction hash.

This is the inverse of TransactionsProvider::transaction_by_id. Returns None if the transaction is not found.

source

fn transaction_by_id( &self, id: TxNumber, ) -> ProviderResult<Option<TransactionSigned>>

Get transaction by id, computes hash every time so more expensive.

source

fn transaction_by_id_no_hash( &self, id: TxNumber, ) -> ProviderResult<Option<TransactionSignedNoHash>>

Get transaction by id without computing the hash.

source

fn transaction_by_hash( &self, hash: TxHash, ) -> ProviderResult<Option<TransactionSigned>>

Get transaction by transaction hash.

source

fn transaction_by_hash_with_meta( &self, hash: TxHash, ) -> ProviderResult<Option<(TransactionSigned, TransactionMeta)>>

Get transaction by transaction hash and additional metadata of the block the transaction was mined in

source

fn transaction_block(&self, id: TxNumber) -> ProviderResult<Option<BlockNumber>>

Get transaction block number

source

fn transactions_by_block( &self, block: BlockHashOrNumber, ) -> ProviderResult<Option<Vec<TransactionSigned>>>

Get transactions by block id.

source

fn transactions_by_block_range( &self, range: impl RangeBounds<BlockNumber>, ) -> ProviderResult<Vec<Vec<TransactionSigned>>>

Get transactions by block range.

source

fn transactions_by_tx_range( &self, range: impl RangeBounds<TxNumber>, ) -> ProviderResult<Vec<TransactionSignedNoHash>>

Get transactions by tx range.

source

fn senders_by_tx_range( &self, range: impl RangeBounds<TxNumber>, ) -> ProviderResult<Vec<Address>>

Get Senders from a tx range.

source

fn transaction_sender(&self, id: TxNumber) -> ProviderResult<Option<Address>>

Get transaction sender.

Returns None if the transaction is not found.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, T: 'a + TransactionsProvider + ?Sized> TransactionsProvider for &'a T

source§

fn transaction_id(&self, tx_hash: TxHash) -> ProviderResult<Option<TxNumber>>

source§

fn transaction_by_id( &self, id: TxNumber, ) -> ProviderResult<Option<TransactionSigned>>

source§

fn transaction_by_id_no_hash( &self, id: TxNumber, ) -> ProviderResult<Option<TransactionSignedNoHash>>

source§

fn transaction_by_hash( &self, hash: TxHash, ) -> ProviderResult<Option<TransactionSigned>>

source§

fn transaction_by_hash_with_meta( &self, hash: TxHash, ) -> ProviderResult<Option<(TransactionSigned, TransactionMeta)>>

source§

fn transaction_block(&self, id: TxNumber) -> ProviderResult<Option<BlockNumber>>

source§

fn transactions_by_block( &self, block: BlockHashOrNumber, ) -> ProviderResult<Option<Vec<TransactionSigned>>>

source§

fn transactions_by_block_range( &self, range: impl RangeBounds<BlockNumber>, ) -> ProviderResult<Vec<Vec<TransactionSigned>>>

source§

fn transactions_by_tx_range( &self, range: impl RangeBounds<TxNumber>, ) -> ProviderResult<Vec<TransactionSignedNoHash>>

source§

fn senders_by_tx_range( &self, range: impl RangeBounds<TxNumber>, ) -> ProviderResult<Vec<Address>>

source§

fn transaction_sender(&self, id: TxNumber) -> ProviderResult<Option<Address>>

source§

impl<T: TransactionsProvider + ?Sized> TransactionsProvider for Arc<T>
where Arc<T>: BlockNumReader + Send + Sync,

source§

fn transaction_id(&self, tx_hash: TxHash) -> ProviderResult<Option<TxNumber>>

source§

fn transaction_by_id( &self, id: TxNumber, ) -> ProviderResult<Option<TransactionSigned>>

source§

fn transaction_by_id_no_hash( &self, id: TxNumber, ) -> ProviderResult<Option<TransactionSignedNoHash>>

source§

fn transaction_by_hash( &self, hash: TxHash, ) -> ProviderResult<Option<TransactionSigned>>

source§

fn transaction_by_hash_with_meta( &self, hash: TxHash, ) -> ProviderResult<Option<(TransactionSigned, TransactionMeta)>>

source§

fn transaction_block(&self, id: TxNumber) -> ProviderResult<Option<BlockNumber>>

source§

fn transactions_by_block( &self, block: BlockHashOrNumber, ) -> ProviderResult<Option<Vec<TransactionSigned>>>

source§

fn transactions_by_block_range( &self, range: impl RangeBounds<BlockNumber>, ) -> ProviderResult<Vec<Vec<TransactionSigned>>>

source§

fn transactions_by_tx_range( &self, range: impl RangeBounds<TxNumber>, ) -> ProviderResult<Vec<TransactionSignedNoHash>>

source§

fn senders_by_tx_range( &self, range: impl RangeBounds<TxNumber>, ) -> ProviderResult<Vec<Address>>

source§

fn transaction_sender(&self, id: TxNumber) -> ProviderResult<Option<Address>>

Implementors§