Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit b4cf1bf

Browse files
authored
Merge pull request #1222 from MutinyWallet/log-fed
2 parents dc03da6 + fa42802 commit b4cf1bf

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

mutiny-core/src/federation.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,19 @@ impl<S: MutinyStorage> FederationClient<S> {
492492
amount: u64,
493493
labels: Vec<String>,
494494
) -> Result<MutinyInvoice, MutinyError> {
495+
log_trace!(self.logger, "calling federation.get_invoice");
495496
let inbound = true;
496497

497498
let lightning_module = self
498499
.fedimint_client
499500
.get_first_module::<LightningClientModule>();
500501

502+
log_debug!(
503+
self.logger,
504+
"getting invoice from federation: {}",
505+
self.fedimint_client.federation_id()
506+
);
507+
501508
let desc = Description::new(String::new()).expect("empty string is valid");
502509
let gateway = self.gateway.read().await;
503510
let (id, invoice, _) = lightning_module
@@ -511,6 +518,8 @@ impl<S: MutinyStorage> FederationClient<S> {
511518
.await?;
512519
let invoice = convert_from_fedimint_invoice(&invoice);
513520

521+
log_debug!(self.logger, "got invoice from federation: {invoice}");
522+
514523
// persist the invoice
515524
let mut stored_payment: MutinyInvoice = invoice.clone().into();
516525
stored_payment.inbound = inbound;
@@ -546,21 +555,31 @@ impl<S: MutinyStorage> FederationClient<S> {
546555
);
547556
});
548557

558+
log_trace!(self.logger, "finished calling get_invoice");
549559
Ok(invoice.into())
550560
}
551561

552562
pub(crate) async fn get_new_address(
553563
&self,
554564
labels: Vec<String>,
555565
) -> Result<Address, MutinyError> {
566+
log_trace!(self.logger, "calling federation.get_new_address");
556567
let wallet_module = self
557568
.fedimint_client
558569
.get_first_module::<WalletClientModule>();
559570

571+
log_debug!(
572+
self.logger,
573+
"getting new address from federation: {}",
574+
self.fedimint_client.federation_id()
575+
);
576+
560577
let (op_id, address) = wallet_module
561578
.get_deposit_address(fedimint_core::time::now() + PEG_IN_TIMEOUT_YEAR, ())
562579
.await?;
563580

581+
log_debug!(self.logger, "got new address from federation: {address}");
582+
564583
let address = Address::from_str(&address.to_string())
565584
.expect("should convert")
566585
.assume_checked();
@@ -578,6 +597,8 @@ impl<S: MutinyStorage> FederationClient<S> {
578597
.expect("just created it");
579598
self.subscribe_operation(operation, op_id);
580599

600+
log_trace!(self.logger, "finished calling get_new_address");
601+
581602
Ok(address)
582603
}
583604

0 commit comments

Comments
 (0)