mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(rpc): remove redundant LoadState::cache (#12147)
This commit is contained in:
@ -215,17 +215,12 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<N> LoadState for OpEthApi<N>
|
||||
where
|
||||
impl<N> LoadState for OpEthApi<N> where
|
||||
N: RpcNodeCore<
|
||||
Provider: StateProviderFactory + ChainSpecProvider<ChainSpec: EthereumHardforks>,
|
||||
Pool: TransactionPool,
|
||||
>,
|
||||
>
|
||||
{
|
||||
#[inline]
|
||||
fn cache(&self) -> &EthStateCache {
|
||||
self.inner.cache()
|
||||
}
|
||||
}
|
||||
|
||||
impl<N> EthState for OpEthApi<N>
|
||||
|
||||
@ -13,12 +13,12 @@ use reth_provider::{
|
||||
BlockIdReader, BlockNumReader, ChainSpecProvider, StateProvider, StateProviderBox,
|
||||
StateProviderFactory,
|
||||
};
|
||||
use reth_rpc_eth_types::{EthApiError, EthStateCache, PendingBlockEnv, RpcInvalidTransactionError};
|
||||
use reth_rpc_eth_types::{EthApiError, PendingBlockEnv, RpcInvalidTransactionError};
|
||||
use reth_rpc_types_compat::proof::from_primitive_account_proof;
|
||||
use reth_transaction_pool::TransactionPool;
|
||||
use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, SpecId};
|
||||
|
||||
use crate::{EthApiTypes, FromEthApiError, RpcNodeCore};
|
||||
use crate::{EthApiTypes, FromEthApiError, RpcNodeCore, RpcNodeCoreExt};
|
||||
|
||||
use super::{EthApiSpec, LoadPendingBlock, SpawnBlocking};
|
||||
|
||||
@ -170,17 +170,12 @@ pub trait EthState: LoadState + SpawnBlocking {
|
||||
/// Behaviour shared by several `eth_` RPC methods, not exclusive to `eth_` state RPC methods.
|
||||
pub trait LoadState:
|
||||
EthApiTypes
|
||||
+ RpcNodeCore<
|
||||
+ RpcNodeCoreExt<
|
||||
Provider: StateProviderFactory
|
||||
+ ChainSpecProvider<ChainSpec: EthChainSpec + EthereumHardforks>,
|
||||
Pool: TransactionPool,
|
||||
>
|
||||
{
|
||||
/// Returns a handle for reading data from memory.
|
||||
///
|
||||
/// Data access in default (L1) trait method implementations.
|
||||
fn cache(&self) -> &EthStateCache;
|
||||
|
||||
/// Returns the state at the given block number
|
||||
fn state_at_hash(&self, block_hash: B256) -> Result<StateProviderBox, Self::Error> {
|
||||
self.provider().history_by_block_hash(block_hash).map_err(Self::Error::from_eth_err)
|
||||
|
||||
@ -8,7 +8,6 @@ use reth_rpc_eth_api::{
|
||||
helpers::{EthState, LoadState, SpawnBlocking},
|
||||
RpcNodeCore,
|
||||
};
|
||||
use reth_rpc_eth_types::EthStateCache;
|
||||
|
||||
use crate::EthApi;
|
||||
|
||||
@ -21,17 +20,12 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<Provider, Pool, Network, EvmConfig> LoadState for EthApi<Provider, Pool, Network, EvmConfig>
|
||||
where
|
||||
impl<Provider, Pool, Network, EvmConfig> LoadState for EthApi<Provider, Pool, Network, EvmConfig> where
|
||||
Self: RpcNodeCore<
|
||||
Provider: StateProviderFactory + ChainSpecProvider<ChainSpec: EthereumHardforks>,
|
||||
Pool: TransactionPool,
|
||||
>,
|
||||
>
|
||||
{
|
||||
#[inline]
|
||||
fn cache(&self) -> &EthStateCache {
|
||||
self.inner.cache()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user