Skip to content

Commit

Permalink
chore: add missing getters
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Dec 19, 2024
1 parent ef033ab commit 4b331b3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions crates/optimism/rpc/src/eth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ where
+ 'static,
>,
{
/// Returns a reference to the [`EthApiNodeBackend`].
pub fn eth_api(&self) -> &EthApiNodeBackend<N> {
self.inner.eth_api()
}

/// Returns the configured sequencer client, if any.
pub fn sequencer_client(&self) -> Option<&SequencerClient> {
self.inner.sequencer_client()
}

/// Build a [`OpEthApi`] using [`OpEthApiBuilder`].
pub const fn builder() -> OpEthApiBuilder {
OpEthApiBuilder::new()
Expand Down Expand Up @@ -273,6 +283,18 @@ struct OpEthApiInner<N: OpNodeCore> {
sequencer_client: Option<SequencerClient>,
}

impl<N: OpNodeCore> OpEthApiInner<N> {
/// Returns a reference to the [`EthApiNodeBackend`].
const fn eth_api(&self) -> &EthApiNodeBackend<N> {
&self.eth_api
}

/// Returns the configured sequencer client, if any.
const fn sequencer_client(&self) -> Option<&SequencerClient> {
self.sequencer_client.as_ref()
}
}

/// A type that knows how to build a [`OpEthApi`].
#[derive(Debug, Default)]
pub struct OpEthApiBuilder {
Expand Down

0 comments on commit 4b331b3

Please sign in to comment.