reth::rpc::api::servers::eth::helpers

Trait LoadTransaction

pub trait LoadTransaction:
    SpawnBlocking
    + FullEthApiTypes
    + RpcNodeCoreExt{
    // Provided methods
    fn transaction_by_hash(
        &self,
        hash: FixedBytes<32>,
    ) -> impl Future<Output = Result<Option<TransactionSource>, Self::Error>> + Send { ... }
    fn transaction_by_hash_at(
        &self,
        transaction_hash: FixedBytes<32>,
    ) -> impl Future<Output = Result<Option<(TransactionSource, BlockId)>, Self::Error>> + Send { ... }
    fn transaction_and_block(
        &self,
        hash: FixedBytes<32>,
    ) -> impl Future<Output = Result<Option<(TransactionSource, Arc<SealedBlockWithSenders>)>, Self::Error>> + Send { ... }
}
Expand description

Loads a transaction from database.

Behaviour shared by several eth_ RPC methods, not exclusive to eth_ transactions RPC methods.

Provided Methods§

fn transaction_by_hash( &self, hash: FixedBytes<32>, ) -> impl Future<Output = Result<Option<TransactionSource>, Self::Error>> + Send

Returns the transaction by hash.

Checks the pool and state.

Returns Ok(None) if no matching transaction was found.

fn transaction_by_hash_at( &self, transaction_hash: FixedBytes<32>, ) -> impl Future<Output = Result<Option<(TransactionSource, BlockId)>, Self::Error>> + Send

Returns the transaction by including its corresponding BlockId.

Note: this supports pending transactions

fn transaction_and_block( &self, hash: FixedBytes<32>, ) -> impl Future<Output = Result<Option<(TransactionSource, Arc<SealedBlockWithSenders>)>, Self::Error>> + Send

Fetches the transaction and the transaction’s block

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Provider, Pool, Network, EvmConfig> LoadTransaction for EthApi<Provider, Pool, Network, EvmConfig>
where EthApi<Provider, Pool, Network, EvmConfig>: SpawnBlocking + FullEthApiTypes + RpcNodeCore, <EthApi<Provider, Pool, Network, EvmConfig> as RpcNodeCore>::Provider: TransactionsProvider, <EthApi<Provider, Pool, Network, EvmConfig> as RpcNodeCore>::Pool: TransactionPool,