Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(rpc): rm dup getters EthApi #9283

Merged
merged 3 commits into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading