chore(rpc): remove redundant LoadTransaction::cache (#12148)

This commit is contained in:
Emilia Hane
2024-10-29 02:10:18 +08:00
committed by GitHub
parent 3d62bfde14
commit 28f8c47dc0
3 changed files with 7 additions and 18 deletions

View File

@@ -12,7 +12,7 @@ use reth_rpc_eth_api::{
helpers::{EthSigner, EthTransactions, LoadTransaction, SpawnBlocking},
FromEthApiError, FullEthApiTypes, RpcNodeCore, TransactionCompat,
};
use reth_rpc_eth_types::{utils::recover_raw_transaction, EthStateCache};
use reth_rpc_eth_types::utils::recover_raw_transaction;
use reth_transaction_pool::{PoolTransaction, TransactionOrigin, TransactionPool};
use crate::{OpEthApi, SequencerClient};
@@ -59,10 +59,6 @@ where
Self: SpawnBlocking + FullEthApiTypes,
N: RpcNodeCore<Provider: TransactionsProvider, Pool: TransactionPool>,
{
#[inline]
fn cache(&self) -> &EthStateCache {
self.inner.cache()
}
}
impl<N> OpEthApi<N>

View File

@@ -15,14 +15,15 @@ use reth_primitives::{
use reth_provider::{BlockNumReader, BlockReaderIdExt, ReceiptProvider, TransactionsProvider};
use reth_rpc_eth_types::{
utils::{binary_search, recover_raw_transaction},
EthApiError, EthStateCache, SignError, TransactionSource,
EthApiError, SignError, TransactionSource,
};
use reth_rpc_types_compat::transaction::{from_recovered, from_recovered_with_block_context};
use reth_transaction_pool::{PoolTransaction, TransactionOrigin, TransactionPool};
use std::sync::Arc;
use crate::{
FromEthApiError, FullEthApiTypes, IntoEthApiError, RpcNodeCore, RpcReceipt, RpcTransaction,
FromEthApiError, FullEthApiTypes, IntoEthApiError, RpcNodeCore, RpcNodeCoreExt, RpcReceipt,
RpcTransaction,
};
use super::{
@@ -461,13 +462,10 @@ pub trait EthTransactions: LoadTransaction<Provider: BlockReaderIdExt> {
/// Behaviour shared by several `eth_` RPC methods, not exclusive to `eth_` transactions RPC
/// methods.
pub trait LoadTransaction:
SpawnBlocking + FullEthApiTypes + RpcNodeCore<Provider: TransactionsProvider, Pool: TransactionPool>
SpawnBlocking
+ FullEthApiTypes
+ RpcNodeCoreExt<Provider: TransactionsProvider, Pool: TransactionPool>
{
/// Returns a handle for reading data from memory.
///
/// Data access in default (L1) trait method implementations.
fn cache(&self) -> &EthStateCache;
/// Returns the transaction by hash.
///
/// Checks the pool and state.

View File

@@ -5,7 +5,6 @@ use reth_rpc_eth_api::{
helpers::{EthSigner, EthTransactions, LoadTransaction, SpawnBlocking},
FullEthApiTypes, RpcNodeCore,
};
use reth_rpc_eth_types::EthStateCache;
use reth_transaction_pool::TransactionPool;
use crate::EthApi;
@@ -28,10 +27,6 @@ where
+ FullEthApiTypes
+ RpcNodeCore<Provider: TransactionsProvider, Pool: TransactionPool>,
{
#[inline]
fn cache(&self) -> &EthStateCache {
self.inner.cache()
}
}
#[cfg(test)]