mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
28 lines
1018 B
Rust
28 lines
1018 B
Rust
//! Loads a receipt from database. Helper trait for `eth_` block and transaction RPC methods, that
|
|
//! loads receipt data w.r.t. network.
|
|
|
|
use futures::Future;
|
|
use reth_primitives::{Receipt, TransactionMeta, TransactionSigned};
|
|
use reth_rpc_eth_types::EthStateCache;
|
|
use reth_rpc_types::AnyTransactionReceipt;
|
|
|
|
use crate::EthApiTypes;
|
|
|
|
/// Assembles transaction receipt data w.r.t to network.
|
|
///
|
|
/// Behaviour shared by several `eth_` RPC methods, not exclusive to `eth_` receipts RPC methods.
|
|
pub trait LoadReceipt: EthApiTypes + Send + Sync {
|
|
/// Returns a handle for reading data from memory.
|
|
///
|
|
/// Data access in default (L1) trait method implementations.
|
|
fn cache(&self) -> &EthStateCache;
|
|
|
|
/// Helper method for `eth_getBlockReceipts` and `eth_getTransactionReceipt`.
|
|
fn build_transaction_receipt(
|
|
&self,
|
|
tx: TransactionSigned,
|
|
meta: TransactionMeta,
|
|
receipt: Receipt,
|
|
) -> impl Future<Output = Result<AnyTransactionReceipt, Self::Error>> + Send;
|
|
}
|