mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(op): Clone impl for OpEthApi (#10611)
This commit is contained in:
@ -57,9 +57,10 @@ pub type EthApiNodeBackend<N> = EthApiInner<
|
||||
///
|
||||
/// This type implements the [`FullEthApi`](reth_rpc_eth_api::helpers::FullEthApi) by implemented
|
||||
/// all the `Eth` helper traits and prerequisite traits.
|
||||
#[derive(Clone)]
|
||||
pub struct OpEthApi<N: FullNodeComponents> {
|
||||
inner: Arc<EthApiNodeBackend<N>>,
|
||||
sequencer_client: parking_lot::RwLock<Option<SequencerClient>>,
|
||||
sequencer_client: Arc<parking_lot::RwLock<Option<SequencerClient>>>,
|
||||
}
|
||||
|
||||
impl<N: FullNodeComponents> OpEthApi<N> {
|
||||
@ -84,20 +85,7 @@ impl<N: FullNodeComponents> OpEthApi<N> {
|
||||
ctx.config.proof_permits,
|
||||
);
|
||||
|
||||
Self { inner: Arc::new(inner), sequencer_client: parking_lot::RwLock::new(None) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<N> Clone for OpEthApi<N>
|
||||
where
|
||||
N: FullNodeComponents,
|
||||
Self: Send + Sync,
|
||||
{
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
inner: self.inner.clone(),
|
||||
sequencer_client: parking_lot::RwLock::new(self.sequencer_client.read().clone()),
|
||||
}
|
||||
Self { inner: Arc::new(inner), sequencer_client: Arc::new(parking_lot::RwLock::new(None)) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user