Skip to main content

LoadTransaction

Trait LoadTransaction 

Source
pub trait LoadTransaction:
    SpawnBlocking
    + FullEthApiTypes
    + RpcNodeCoreExt {
    // Provided methods
    fn transaction_by_hash(
        &self,
        hash: FixedBytes<32>,
    ) -> impl Future<Output = Result<Option<TransactionSource<<Self::Provider as TransactionsProvider>::Transaction>>, Self::Error>> + Send { ... }
    fn transaction_by_hash_at(
        &self,
        transaction_hash: FixedBytes<32>,
    ) -> impl Future<Output = Result<Option<(TransactionSource<<Self::Provider as TransactionsProvider>::Transaction>, BlockId)>, Self::Error>> + Send { ... }
    fn transaction_and_block(
        &self,
        hash: FixedBytes<32>,
    ) -> impl Future<Output = Result<Option<(TransactionSource<<Self::Provider as TransactionsProvider>::Transaction>, Arc<RecoveredBlock<<Self::Provider as BlockReader>::Block>>)>, Self::Error>> + Send { ... }
    fn transaction_and_block_and_maybe_bal(
        &self,
        hash: FixedBytes<32>,
    ) -> impl Future<Output = Result<Option<(TransactionSource<<Self::Provider as TransactionsProvider>::Transaction>, Arc<RecoveredBlock<<Self::Provider as BlockReader>::Block>>, Option<Arc<DecodedBal<Arc<Bal>>>>)>, 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§

Source

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

Returns the transaction by hash.

Checks the pool and state.

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

Source

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

Returns the transaction by including its corresponding BlockId.

Note: this supports pending transactions

Source

fn transaction_and_block( &self, hash: FixedBytes<32>, ) -> impl Future<Output = Result<Option<(TransactionSource<<Self::Provider as TransactionsProvider>::Transaction>, Arc<RecoveredBlock<<Self::Provider as BlockReader>::Block>>)>, Self::Error>> + Send

Fetches the transaction and the transaction’s block

Source

fn transaction_and_block_and_maybe_bal( &self, hash: FixedBytes<32>, ) -> impl Future<Output = Result<Option<(TransactionSource<<Self::Provider as TransactionsProvider>::Transaction>, Arc<RecoveredBlock<<Self::Provider as BlockReader>::Block>>, Option<Arc<DecodedBal<Arc<Bal>>>>)>, Self::Error>> + Send

Fetches the transaction and the transaction’s block, together with the block’s cached block access list, if any.

The BAL is only returned if it is already cached, it is never fetched from the BAL store.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<N, Rpc> LoadTransaction for EthApi<N, Rpc>
where N: RpcNodeCore, EthApiError: FromEvmError<<N as RpcNodeCore>::Evm>, Rpc: RpcConvert<Primitives = <N as RpcNodeCore>::Primitives, Error = EthApiError>,