From baee4ea03f4c3fc55aa5f09c037a74cda98ec76e Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Tue, 8 Oct 2024 13:00:08 +0200 Subject: [PATCH] fix: itest kill script --- crates/cdk-integration-tests/src/lib.rs | 2 +- crates/cdk-mintd/src/main.rs | 4 ++-- crates/cdk-mintd/src/setup.rs | 8 ++++---- misc/itests.sh | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/cdk-integration-tests/src/lib.rs b/crates/cdk-integration-tests/src/lib.rs index a64a11f9..7a727d7b 100644 --- a/crates/cdk-integration-tests/src/lib.rs +++ b/crates/cdk-integration-tests/src/lib.rs @@ -39,7 +39,7 @@ pub fn create_backends_fake_wallet( let ln_key = LnKey::new(CurrencyUnit::Sat, PaymentMethod::Bolt11); let wallet = Arc::new(FakeWallet::new( - fee_reserve.clone(), + fee_reserve, HashMap::default(), HashSet::default(), 0, diff --git a/crates/cdk-mintd/src/main.rs b/crates/cdk-mintd/src/main.rs index e5786c6f..03537140 100644 --- a/crates/cdk-mintd/src/main.rs +++ b/crates/cdk-mintd/src/main.rs @@ -209,8 +209,8 @@ async fn main() -> anyhow::Result<()> { .collect(); let nut_05_methods: Vec = ln_backends - .iter() - .map(|(key, _ln)| MeltMethodSettings { + .keys() + .map(|key| MeltMethodSettings { method: key.method, unit: key.unit, min_amount: Some(settings.ln.min_melt), diff --git a/crates/cdk-mintd/src/setup.rs b/crates/cdk-mintd/src/setup.rs index a3247dd5..9403ad16 100644 --- a/crates/cdk-mintd/src/setup.rs +++ b/crates/cdk-mintd/src/setup.rs @@ -106,7 +106,7 @@ impl LnBackendSetup for config::Strike { let strike = cdk_strike::Strike::new( api_key.clone(), - unit.clone(), + unit, Arc::new(Mutex::new(Some(receiver))), webhook_url.to_string(), ) @@ -117,12 +117,12 @@ impl LnBackendSetup for config::Strike { .await?; routers.push(router); - let ln_key = LnKey::new(unit.clone(), PaymentMethod::Bolt11); + let ln_key = LnKey::new(unit, PaymentMethod::Bolt11); ln_backends.insert(ln_key, Arc::new(strike)); let input_fee_ppk = settings.info.input_fee_ppk.unwrap_or(0); - supported_units.insert(unit.clone(), (input_fee_ppk, 64)); + supported_units.insert(unit, (input_fee_ppk, 64)); } Ok(()) @@ -342,7 +342,7 @@ impl LnBackendSetup for config::FakeWallet { let ln_key = LnKey::new(CurrencyUnit::Sat, PaymentMethod::Bolt12); let wallet = Arc::new(cdk_fake_wallet::FakeWallet::new( - fee_reserve.clone(), + fee_reserve, HashMap::default(), HashSet::default(), 0, diff --git a/misc/itests.sh b/misc/itests.sh index b8d599c2..50eb7f7f 100755 --- a/misc/itests.sh +++ b/misc/itests.sh @@ -6,7 +6,7 @@ cleanup() { # Kill the Rust binary process echo "Killing the Rust binary with PID $RUST_BIN_PID" - # kill $CDK_ITEST_MINT_BIN_PID + kill $CDK_ITEST_MINT_BIN_PID # Wait for the Rust binary to terminate wait $CDK_ITEST_MINT_BIN_PID @@ -15,11 +15,11 @@ cleanup() { # Kill processes lncli --lnddir="$cdk_itests/lnd" --network=regtest stop - # lightning-cli --regtest --lightning-dir="$cdk_itests/cln/" stop - # bitcoin-cli --datadir="$cdk_itests/bitcoin" -rpcuser=testuser -rpcpassword=testpass -rpcport=18443 stop + lightning-cli --regtest --lightning-dir="$cdk_itests/cln/" stop + bitcoin-cli --datadir="$cdk_itests/bitcoin" -rpcuser=testuser -rpcpassword=testpass -rpcport=18443 stop # Remove the temporary directory - # rm -rf "$cdk_itests" + rm -rf "$cdk_itests" echo "Temp directory removed: $cdk_itests" unset cdk_itests unset cdk_itests_mint_addr