mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: add missing getters (#13444)
This commit is contained in:
@ -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()
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user