mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(rpc): add super trait RpcNodeCoreExt to LoadReceipt (#12149)
This commit is contained in:
@ -145,7 +145,8 @@ pub trait EthBlocks: LoadBlock {
|
||||
if let Some(block_hash) =
|
||||
self.provider().block_hash_for_id(block_id).map_err(Self::Error::from_eth_err)?
|
||||
{
|
||||
return LoadReceipt::cache(self)
|
||||
return self
|
||||
.cache()
|
||||
.get_block_and_receipts(block_hash)
|
||||
.await
|
||||
.map_err(Self::Error::from_eth_err)
|
||||
|
||||
@ -3,19 +3,13 @@
|
||||
|
||||
use futures::Future;
|
||||
use reth_primitives::{Receipt, TransactionMeta, TransactionSigned};
|
||||
use reth_rpc_eth_types::EthStateCache;
|
||||
|
||||
use crate::{EthApiTypes, RpcReceipt};
|
||||
use crate::{EthApiTypes, RpcNodeCoreExt, RpcReceipt};
|
||||
|
||||
/// 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;
|
||||
|
||||
pub trait LoadReceipt: EthApiTypes + RpcNodeCoreExt + Send + Sync {
|
||||
/// Helper method for `eth_getBlockReceipts` and `eth_getTransactionReceipt`.
|
||||
fn build_transaction_receipt(
|
||||
&self,
|
||||
|
||||
@ -2,20 +2,15 @@
|
||||
|
||||
use alloy_serde::WithOtherFields;
|
||||
use reth_primitives::{Receipt, TransactionMeta, TransactionSigned};
|
||||
use reth_rpc_eth_api::{helpers::LoadReceipt, FromEthApiError, RpcReceipt};
|
||||
use reth_rpc_eth_types::{EthApiError, EthStateCache, ReceiptBuilder};
|
||||
use reth_rpc_eth_api::{helpers::LoadReceipt, FromEthApiError, RpcNodeCoreExt, RpcReceipt};
|
||||
use reth_rpc_eth_types::{EthApiError, ReceiptBuilder};
|
||||
|
||||
use crate::EthApi;
|
||||
|
||||
impl<Provider, Pool, Network, EvmConfig> LoadReceipt for EthApi<Provider, Pool, Network, EvmConfig>
|
||||
where
|
||||
Self: Send + Sync,
|
||||
Self: RpcNodeCoreExt,
|
||||
{
|
||||
#[inline]
|
||||
fn cache(&self) -> &EthStateCache {
|
||||
self.inner.cache()
|
||||
}
|
||||
|
||||
async fn build_transaction_receipt(
|
||||
&self,
|
||||
tx: TransactionSigned,
|
||||
|
||||
Reference in New Issue
Block a user