From 4d32385b2057ade18cfa61d5c40ab931ac7b643f Mon Sep 17 00:00:00 2001 From: djordon Date: Thu, 26 Sep 2024 11:59:33 -0400 Subject: [PATCH] Remove the inner context --- signer/src/context/mod.rs | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/signer/src/context/mod.rs b/signer/src/context/mod.rs index 5140634b..a05fb5dc 100644 --- a/signer/src/context/mod.rs +++ b/signer/src/context/mod.rs @@ -39,20 +39,6 @@ pub trait Context: Clone + Sync + Send { /// signer binary. #[derive(Debug, Clone)] pub struct SignerContext { - inner: InnerSignerContext, -} - -impl std::ops::Deref for SignerContext { - type Target = InnerSignerContext; - - fn deref(&self) -> &Self::Target { - &self.inner - } -} - -/// Inner signer context which holds the configuration and signalling channels. -#[derive(Debug, Clone)] -pub struct InnerSignerContext { config: Settings, // Handle to the app signalling channel. This keeps the channel alive // for the duration of the program and is used both to send messages @@ -106,13 +92,11 @@ where let (term_tx, _) = tokio::sync::watch::channel(false); Self { - inner: InnerSignerContext { - config, - signal_tx, - term_tx, - storage: db, - bitcoin_client, - }, + config, + signal_tx, + term_tx, + storage: db, + bitcoin_client, } } } @@ -131,7 +115,7 @@ where } fn get_signal_sender(&self) -> tokio::sync::broadcast::Sender { - self.inner.signal_tx.clone() + self.signal_tx.clone() } /// Send a signal to the application signalling channel.