From fa4280286208b973467243c67be501657d6a44ff Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 14 Jun 2024 21:21:28 -0500 Subject: [PATCH] Add more logs to federation client --- mutiny-core/src/federation.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mutiny-core/src/federation.rs b/mutiny-core/src/federation.rs index b07974afe..7c0e63296 100644 --- a/mutiny-core/src/federation.rs +++ b/mutiny-core/src/federation.rs @@ -492,12 +492,19 @@ impl FederationClient { amount: u64, labels: Vec, ) -> Result { + log_trace!(self.logger, "calling federation.get_invoice"); let inbound = true; let lightning_module = self .fedimint_client .get_first_module::(); + log_debug!( + self.logger, + "getting invoice from federation: {}", + self.fedimint_client.federation_id() + ); + let desc = Description::new(String::new()).expect("empty string is valid"); let gateway = self.gateway.read().await; let (id, invoice, _) = lightning_module @@ -511,6 +518,8 @@ impl FederationClient { .await?; let invoice = convert_from_fedimint_invoice(&invoice); + log_debug!(self.logger, "got invoice from federation: {invoice}"); + // persist the invoice let mut stored_payment: MutinyInvoice = invoice.clone().into(); stored_payment.inbound = inbound; @@ -546,6 +555,7 @@ impl FederationClient { ); }); + log_trace!(self.logger, "finished calling get_invoice"); Ok(invoice.into()) } @@ -553,14 +563,23 @@ impl FederationClient { &self, labels: Vec, ) -> Result { + log_trace!(self.logger, "calling federation.get_new_address"); let wallet_module = self .fedimint_client .get_first_module::(); + log_debug!( + self.logger, + "getting new address from federation: {}", + self.fedimint_client.federation_id() + ); + let (op_id, address) = wallet_module .get_deposit_address(fedimint_core::time::now() + PEG_IN_TIMEOUT_YEAR, ()) .await?; + log_debug!(self.logger, "got new address from federation: {address}"); + let address = Address::from_str(&address.to_string()) .expect("should convert") .assume_checked(); @@ -578,6 +597,8 @@ impl FederationClient { .expect("just created it"); self.subscribe_operation(operation, op_id); + log_trace!(self.logger, "finished calling get_new_address"); + Ok(address) }