Skip to content

Commit

Permalink
chore(rpc): rm dup getters EthApi (#9283)
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane authored Jul 4, 2024
1 parent 5ccff2a commit f74b8ce
Showing 1 changed file with 12 additions and 49 deletions.
61 changes: 12 additions & 49 deletions crates/rpc/rpc/src/eth/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,55 +112,6 @@ where
}
}

impl<Provider, Pool, Network, EvmConfig> EthApi<Provider, Pool, Network, EvmConfig> {
/// Sets a forwarder for `eth_sendRawTransaction`
///
/// Note: this might be removed in the future in favor of a more generic approach.
pub fn set_eth_raw_transaction_forwarder(&self, forwarder: Arc<dyn RawTransactionForwarder>) {
self.inner.raw_transaction_forwarder.write().replace(forwarder);
}

/// Returns the state cache frontend
pub fn cache(&self) -> &EthStateCache {
&self.inner.eth_cache
}

/// Returns the gas oracle frontend
pub fn gas_oracle(&self) -> &GasPriceOracle<Provider> {
&self.inner.gas_oracle
}

/// Returns the configured gas limit cap for `eth_call` and tracing related calls
pub fn gas_cap(&self) -> u64 {
self.inner.gas_cap
}

/// The maximum number of blocks into the past for generating state proofs.
pub fn eth_proof_window(&self) -> u64 {
self.inner.eth_proof_window
}

/// Returns the inner `Provider`
pub fn provider(&self) -> &Provider {
&self.inner.provider
}

/// Returns the inner `Network`
pub fn network(&self) -> &Network {
&self.inner.network
}

/// Returns the inner `Pool`
pub fn pool(&self) -> &Pool {
&self.inner.pool
}

/// Returns fee history cache
pub fn fee_history_cache(&self) -> &FeeHistoryCache {
&self.inner.fee_history_cache
}
}

impl<Provider, Pool, Network, EvmConfig> std::fmt::Debug
for EthApi<Provider, Pool, Network, EvmConfig>
{
Expand Down Expand Up @@ -313,6 +264,18 @@ impl<Provider, Pool, Network, EvmConfig> EthApiInner<Provider, Pool, Network, Ev
pub const fn starting_block(&self) -> U256 {
self.starting_block
}

/// Returns the inner `Network`
#[inline]
pub const fn network(&self) -> &Network {
&self.network
}

/// The maximum number of blocks into the past for generating state proofs.
#[inline]
pub const fn eth_proof_window(&self) -> u64 {
self.eth_proof_window
}
}

impl<Provider, Pool, Network, EvmConfig> UpdateRawTxForwarder
Expand Down

0 comments on commit f74b8ce

Please sign in to comment.