pub trait LoadTransaction:
SpawnBlocking
+ FullEthApiTypes
+ RpcNodeCoreExt {
// Provided methods
fn recover_raw_transaction<T>(
&self,
tx: &[u8],
) -> Result<Recovered<T>, EthApiError>
where T: SignedTransaction { ... }
fn recover_raw_transactions<T>(
&self,
txs: impl IntoIterator<Item = impl AsRef<[u8]>>,
) -> Result<Vec<Recovered<T>>, EthApiError>
where T: SignedTransaction { ... }
fn recover_raw_pooled_transaction(
&self,
tx: &[u8],
) -> Result<Recovered<<<Self::Pool as TransactionPool>::Transaction as PoolTransaction>::Pooled>, EthApiError> { ... }
fn recover_raw_pooled_transactions(
&self,
txs: impl IntoIterator<Item = impl AsRef<[u8]>>,
) -> Result<Vec<Recovered<<<Self::Pool as TransactionPool>::Transaction as PoolTransaction>::Pooled>>, EthApiError> { ... }
fn recover_mined_transaction<T>(
&self,
tx: T,
) -> Result<Recovered<T>, EthApiError>
where T: SignedTransaction { ... }
fn mined_transaction_by_hash_with_meta(
&self,
hash: FixedBytes<32>,
) -> Result<Option<(Recovered<<Self::Provider as TransactionsProvider>::Transaction>, TransactionMeta)>, Self::Error> { ... }
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§
Sourcefn recover_raw_transaction<T>(
&self,
tx: &[u8],
) -> Result<Recovered<T>, EthApiError>where
T: SignedTransaction,
fn recover_raw_transaction<T>(
&self,
tx: &[u8],
) -> Result<Recovered<T>, EthApiError>where
T: SignedTransaction,
Decodes and recovers a raw transaction, sharing sender recovery when configured.
Sourcefn recover_raw_transactions<T>(
&self,
txs: impl IntoIterator<Item = impl AsRef<[u8]>>,
) -> Result<Vec<Recovered<T>>, EthApiError>where
T: SignedTransaction,
fn recover_raw_transactions<T>(
&self,
txs: impl IntoIterator<Item = impl AsRef<[u8]>>,
) -> Result<Vec<Recovered<T>>, EthApiError>where
T: SignedTransaction,
Decodes and recovers raw transactions in order, stopping at the first error.
Uses Self::recover_raw_transaction to share sender recovery when configured.
Sourcefn recover_raw_pooled_transaction(
&self,
tx: &[u8],
) -> Result<Recovered<<<Self::Pool as TransactionPool>::Transaction as PoolTransaction>::Pooled>, EthApiError>
fn recover_raw_pooled_transaction( &self, tx: &[u8], ) -> Result<Recovered<<<Self::Pool as TransactionPool>::Transaction as PoolTransaction>::Pooled>, EthApiError>
Decodes and recovers a raw transaction in the pool’s pooled format.
Used by RPC methods that execute raw transactions a client could also submit to the pool,
such as eth_callBundle, mev_simBundle and trace_rawTransaction. The default delegates
to Self::recover_raw_transaction; implementations can override it to customize decoding
or recovery for their pooled transaction type.
Sourcefn recover_raw_pooled_transactions(
&self,
txs: impl IntoIterator<Item = impl AsRef<[u8]>>,
) -> Result<Vec<Recovered<<<Self::Pool as TransactionPool>::Transaction as PoolTransaction>::Pooled>>, EthApiError>
fn recover_raw_pooled_transactions( &self, txs: impl IntoIterator<Item = impl AsRef<[u8]>>, ) -> Result<Vec<Recovered<<<Self::Pool as TransactionPool>::Transaction as PoolTransaction>::Pooled>>, EthApiError>
Decodes and recovers raw pooled transactions in order, stopping at the first error.
Uses Self::recover_raw_pooled_transaction for each transaction.
Sourcefn recover_mined_transaction<T>(
&self,
tx: T,
) -> Result<Recovered<T>, EthApiError>where
T: SignedTransaction,
fn recover_mined_transaction<T>(
&self,
tx: T,
) -> Result<Recovered<T>, EthApiError>where
T: SignedTransaction,
Recovers the sender of a mined transaction, reusing a cached sender when configured.
Mined transactions can predate EIP-2, so recovery does not reject high-s signatures. A sender recovered on a cache miss is not cached: lookups of mined transactions rarely repeat, and caching them would evict senders that ingress and payload execution still need.
Sourcefn mined_transaction_by_hash_with_meta(
&self,
hash: FixedBytes<32>,
) -> Result<Option<(Recovered<<Self::Provider as TransactionsProvider>::Transaction>, TransactionMeta)>, Self::Error>
fn mined_transaction_by_hash_with_meta( &self, hash: FixedBytes<32>, ) -> Result<Option<(Recovered<<Self::Provider as TransactionsProvider>::Transaction>, TransactionMeta)>, Self::Error>
Returns the mined transaction with the given hash and the metadata of its block.
Uses the stored sender, and falls back to Self::recover_mined_transaction if senders are
pruned. Reads from the provider, so this must run on a blocking task.
Returns Ok(None) if the transaction was not found.
Sourcefn 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( &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.
Sourcefn 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_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
Sourcefn 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( &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
Sourcefn 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
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".