From 4ba6b238e151f528f90388c7d7feda76ec856201 Mon Sep 17 00:00:00 2001 From: ngutech21 Date: Sun, 31 Mar 2024 09:20:15 +0200 Subject: [PATCH] fix: use nutshell 0.15.2 in itests and adjust tests --- docker-compose.yml | 2 +- integrationtests/tests/tests_lnd.rs | 2 +- integrationtests/tests/tests_nutshell_compatibility.rs | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1f9c1dfd..2450e4da 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -122,7 +122,7 @@ services: - itest nutshell: - image: ngutech21/nutshell:latest + image: cashubtc/nutshell:0.15.2 container_name: nutshell ports: - "2228:3338" diff --git a/integrationtests/tests/tests_lnd.rs b/integrationtests/tests/tests_lnd.rs index d4dcda51..52467879 100644 --- a/integrationtests/tests/tests_lnd.rs +++ b/integrationtests/tests/tests_lnd.rs @@ -102,7 +102,7 @@ async fn test_btc_onchain_mint_melt() -> anyhow::Result<()> { let btc_address = btc_client.get_new_address()?; - let melt_amount = 3_000; + let melt_amount = 21_000; let melt_quotes = wallet .get_melt_quote_btconchain(btc_address.clone(), melt_amount) .await?; diff --git a/integrationtests/tests/tests_nutshell_compatibility.rs b/integrationtests/tests/tests_nutshell_compatibility.rs index 2cb2c920..a9bd7f60 100644 --- a/integrationtests/tests/tests_nutshell_compatibility.rs +++ b/integrationtests/tests/tests_nutshell_compatibility.rs @@ -50,17 +50,20 @@ pub async fn test_nutshell_compatibility() -> anyhow::Result<()> { let balance = wallet.get_balance().await?; assert_eq!(6_000, balance); - // pay ln-invoice + // pay ln-invoice (10_000 invoice + 10 sats fee_reserve / 9 sats get returned) let invoice_1000 = read_fixture("invoice_1000.txt")?; let quote = wallet .get_melt_quote_bolt11(invoice_1000.clone(), CurrencyUnit::Sat) .await?; + assert_eq!(10, quote.fee_reserve); let result_pay_invoice = wallet.pay_invoice("e, invoice_1000).await; + if result_pay_invoice.is_err() { println!("error in pay_invoice{:?}", result_pay_invoice); } assert!(result_pay_invoice.is_ok()); + assert_eq!(9, result_pay_invoice?.1); let balance = wallet.get_balance().await?; - assert_eq!(5_000, balance); + assert_eq!(4_999, balance); Ok(()) }