Skip to content

Commit

Permalink
Merge pull request fedimint#5606 from tvolk131/fix_fmt
Browse files Browse the repository at this point in the history
chore: fix clippy warnings
  • Loading branch information
dpc authored Jul 12, 2024
2 parents 2bcd381 + 1eb456c commit 88b474a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
8 changes: 3 additions & 5 deletions fedimint-testing/src/fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl Fixtures {
Arc::new(FakeLightningBuilder);

// Module tests do not use the webserver, so any port is ok
let listen: SocketAddr = format!("127.0.0.1:9000").parse().unwrap();
let listen: SocketAddr = "127.0.0.1:9000".parse().unwrap();
let address: SafeUrl = format!("http://{listen}").parse().unwrap();

let ln_client: Arc<dyn ILnRpcClient> = lightning_builder.build().await.into();
Expand All @@ -183,7 +183,7 @@ impl Fixtures {
lightning_network,
};

let gateway = Gateway::new_with_custom_registry(
Gateway::new_with_custom_registry(
lightning_builder,
client_builder,
listen,
Expand All @@ -202,9 +202,7 @@ impl Fixtures {
ln_gateway::GatewayState::Running { lightning_context },
)
.await
.expect("Failed to create gateway");

gateway
.expect("Failed to create gateway")
}

/// Get a server bitcoin RPC config
Expand Down
7 changes: 4 additions & 3 deletions gateway/ln-gateway/src/lightning/lnd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl GatewayLndClient {

if contains_payment_hash
&& invoice.r_preimage.is_empty()
&& invoice.state().clone() == InvoiceState::Open
&& invoice.state() == InvoiceState::Open
{
info!(
"Monitoring new LNv2 invoice with {}",
Expand Down Expand Up @@ -980,9 +980,10 @@ impl ILnRpcClient for GatewayLndClient {
Some(Action::Settle(Settle { preimage })) => {
(ResolveHoldForwardAction::Settle, preimage)
}
Some(Action::Cancel(Cancel { reason: _ })) => (ResolveHoldForwardAction::Fail, vec![]),
Some(Action::Forward(Forward {})) => (ResolveHoldForwardAction::Resume, vec![]),
None => (ResolveHoldForwardAction::Fail, vec![]),
Some(Action::Cancel(Cancel { reason: _ })) | None => {
(ResolveHoldForwardAction::Fail, vec![])
}
};

// First check if this completion request corresponds to a HOLD LNv2 invoice
Expand Down
15 changes: 4 additions & 11 deletions modules/fedimint-lnv2-tests/src/bin/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,13 @@ async fn test_lightning_payment(dev_fed: &DevJitFed) -> anyhow::Result<()> {

async fn fetch_invoice(
client: &Client,
gw_address: &String,
gw_address: &str,
amount: u64,
) -> anyhow::Result<(Bolt11Invoice, OperationId)> {
Ok(serde_json::from_value::<(Bolt11Invoice, OperationId)>(
cmd!(
client,
"module",
"lnv2",
"receive",
gw_address.clone(),
amount,
)
.out_json()
.await?,
cmd!(client, "module", "lnv2", "receive", gw_address, amount,)
.out_json()
.await?,
)?)
}

Expand Down

0 comments on commit 88b474a

Please sign in to comment.