From be43848d2b3bc8984ee9f8ffb04e0cc1d9b11264 Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Mon, 13 May 2024 10:39:41 +0200 Subject: [PATCH] Bump LDK to v0.0.123, lightning-liquidity to v0.1.0-alpha.4 .. to account for the new release --- Cargo.toml | 20 +++++++++----------- src/event.rs | 7 ++++++- src/io/utils.rs | 11 ++++++++++- tests/integration_tests_cln.rs | 4 ++-- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e88826aee..4c4422461 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,16 +28,14 @@ panic = 'abort' # Abort on panic default = [] [dependencies] -lightning = { version = "0.0.123-beta", features = ["std"] } -lightning-invoice = { version = "0.31.0-beta" } -lightning-net-tokio = { version = "0.0.123-beta" } -lightning-persister = { version = "0.0.123-beta" } -lightning-background-processor = { version = "0.0.123-beta", features = ["futures"] } -lightning-rapid-gossip-sync = { version = "0.0.123-beta" } -lightning-transaction-sync = { version = "0.0.123-beta", features = ["esplora-async-https", "time"] } -#lightning-liquidity = { version = "0.1.0-alpha.1", features = ["std"] } - -lightning-liquidity = { git = "https://github.com/tnull/lightning-liquidity", rev = "abf7088c0e03221c0f122e797f34802c9e99a3d4", features = ["std"] } +lightning = { version = "0.0.123", features = ["std"] } +lightning-invoice = { version = "0.31.0" } +lightning-net-tokio = { version = "0.0.123" } +lightning-persister = { version = "0.0.123" } +lightning-background-processor = { version = "0.0.123", features = ["futures"] } +lightning-rapid-gossip-sync = { version = "0.0.123" } +lightning-transaction-sync = { version = "0.0.123", features = ["esplora-async-https", "time"] } +lightning-liquidity = { version = "0.1.0-alpha.4", features = ["std"] } #lightning = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main", features = ["std"] } #lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main" } @@ -79,7 +77,7 @@ prost = { version = "0.11.6", default-features = false} winapi = { version = "0.3", features = ["winbase"] } [dev-dependencies] -lightning = { version = "0.0.123-beta", features = ["std", "_test_utils"] } +lightning = { version = "0.0.123", features = ["std", "_test_utils"] } #lightning = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main", features = ["std", "_test_utils"] } electrum-client = { version = "0.15.1", default-features = true } bitcoincore-rpc = { version = "0.17.0", default-features = false } diff --git a/src/event.rs b/src/event.rs index cd11e41a8..acdf12e4c 100644 --- a/src/event.rs +++ b/src/event.rs @@ -706,7 +706,12 @@ where } }, LdkEvent::SpendableOutputs { outputs, channel_id } => { - self.output_sweeper.track_spendable_outputs(outputs, channel_id, true, None) + self.output_sweeper + .track_spendable_outputs(outputs, channel_id, true, None) + .unwrap_or_else(|_| { + log_error!(self.logger, "Failed to track spendable outputs"); + panic!("Failed to track spendable outputs"); + }); }, LdkEvent::OpenChannelRequest { temporary_channel_id, diff --git a/src/io/utils.rs b/src/io/utils.rs index 3a0429ed2..77cc56f55 100644 --- a/src/io/utils.rs +++ b/src/io/utils.rs @@ -263,7 +263,16 @@ where })?; let descriptors = vec![output.descriptor.clone()]; let spend_delay = Some(best_block.height + 2); - sweeper.track_spendable_outputs(descriptors, output.channel_id, true, spend_delay); + sweeper + .track_spendable_outputs(descriptors, output.channel_id, true, spend_delay) + .map_err(|_| { + log_error!(logger, "Failed to track spendable outputs. Aborting migration, will retry in the future."); + std::io::Error::new( + std::io::ErrorKind::InvalidData, + "Failed to track spendable outputs. Aborting migration, will retry in the future.", + ) + })?; + if let Some(tracked_spendable_output) = sweeper.tracked_spendable_outputs().iter().find(|o| o.descriptor == output.descriptor) { diff --git a/tests/integration_tests_cln.rs b/tests/integration_tests_cln.rs index a5c11ad1b..dd4fefb4f 100644 --- a/tests/integration_tests_cln.rs +++ b/tests/integration_tests_cln.rs @@ -94,7 +94,7 @@ fn test_cln() { let mut rng = thread_rng(); let rand_label: String = (0..7).map(|_| rng.sample(Alphanumeric) as char).collect(); let cln_invoice = - cln_client.invoice(Some(2_500_000), &rand_label, &rand_label, None, None, None).unwrap(); + cln_client.invoice(Some(10_000_000), &rand_label, &rand_label, None, None, None).unwrap(); let parsed_invoice = Bolt11Invoice::from_str(&cln_invoice.bolt11).unwrap(); node.send_payment(&parsed_invoice).unwrap(); @@ -106,7 +106,7 @@ fn test_cln() { // Send a payment to LDK let rand_label: String = (0..7).map(|_| rng.sample(Alphanumeric) as char).collect(); - let ldk_invoice = node.receive_payment(2_500_000, &rand_label, 3600).unwrap(); + let ldk_invoice = node.receive_payment(10_000_000, &rand_label, 3600).unwrap(); cln_client.pay(&ldk_invoice.to_string(), Default::default()).unwrap(); common::expect_event!(node, PaymentReceived);