From 4b331b31804aae55dcbdd8c87dcc1afc6bce4b25 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 19 Dec 2024 08:42:09 +0100 Subject: [PATCH] chore: add missing getters --- crates/optimism/rpc/src/eth/mod.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/crates/optimism/rpc/src/eth/mod.rs b/crates/optimism/rpc/src/eth/mod.rs index 4304a2a37411..f244d114ed93 100644 --- a/crates/optimism/rpc/src/eth/mod.rs +++ b/crates/optimism/rpc/src/eth/mod.rs @@ -79,6 +79,16 @@ where + 'static, >, { + /// Returns a reference to the [`EthApiNodeBackend`]. + pub fn eth_api(&self) -> &EthApiNodeBackend { + 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() @@ -273,6 +283,18 @@ struct OpEthApiInner { sequencer_client: Option, } +impl OpEthApiInner { + /// Returns a reference to the [`EthApiNodeBackend`]. + const fn eth_api(&self) -> &EthApiNodeBackend { + &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 {