Skip to content

Commit 9968684

Browse files
committed
Account for check_closed_event being moved on LDK main
In rust-lightning#4220 the `check_closed_event` macros was replaced with a method and is now also only re-exported via `fuctional_test_utils`.
1 parent 37045f4 commit 9968684

File tree

2 files changed

+33
-20
lines changed

2 files changed

+33
-20
lines changed

Cargo.toml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,29 @@ panic = 'abort' # Abort on panic
2929
default = []
3030

3131
[dependencies]
32-
lightning = { version = "0.2.0-rc1", features = ["std"] }
33-
lightning-types = { version = "0.3.0-rc1" }
34-
lightning-invoice = { version = "0.34.0-rc1", features = ["std"] }
35-
lightning-net-tokio = { version = "0.2.0-rc1" }
36-
lightning-persister = { version = "0.2.0-rc1", features = ["tokio"] }
37-
lightning-background-processor = { version = "0.2.0-rc1" }
38-
lightning-rapid-gossip-sync = { version = "0.2.0-rc1" }
39-
lightning-block-sync = { version = "0.2.0-rc1", features = ["rest-client", "rpc-client", "tokio"] }
40-
lightning-transaction-sync = { version = "0.2.0-rc1", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
41-
lightning-liquidity = { version = "0.2.0-rc1", features = ["std"] }
42-
lightning-macros = { version = "0.2.0-rc1" }
32+
#lightning = { version = "0.2.0-rc1", features = ["std"] }
33+
#lightning-types = { version = "0.3.0-rc1" }
34+
#lightning-invoice = { version = "0.34.0-rc1", features = ["std"] }
35+
#lightning-net-tokio = { version = "0.2.0-rc1" }
36+
#lightning-persister = { version = "0.2.0-rc1", features = ["tokio"] }
37+
#lightning-background-processor = { version = "0.2.0-rc1" }
38+
#lightning-rapid-gossip-sync = { version = "0.2.0-rc1" }
39+
#lightning-block-sync = { version = "0.2.0-rc1", features = ["rest-client", "rpc-client", "tokio"] }
40+
#lightning-transaction-sync = { version = "0.2.0-rc1", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
41+
#lightning-liquidity = { version = "0.2.0-rc1", features = ["std"] }
42+
#lightning-macros = { version = "0.2.0-rc1" }
43+
44+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370", features = ["std"] }
45+
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370" }
46+
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370", features = ["std"] }
47+
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370" }
48+
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370", features = ["tokio"] }
49+
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370" }
50+
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370" }
51+
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370", features = ["rest-client", "rpc-client", "tokio"] }
52+
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
53+
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370", features = ["std"] }
54+
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370" }
4355

4456
bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] }
4557
bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]}
@@ -72,7 +84,7 @@ prost = { version = "0.11.6", default-features = false}
7284
winapi = { version = "0.3", features = ["winbase"] }
7385

7486
[dev-dependencies]
75-
lightning = { version = "0.2.0-rc1", features = ["std", "_test_utils"] }
87+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "bb5504ec62d4b7e9d5626d8b1a6de60d71e8d370", features = ["std", "_test_utils"] }
7688
proptest = "1.0.0"
7789
regex = "1.5.6"
7890
criterion = { version = "0.7.0", features = ["async_tokio"] }

src/io/test_utils.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ use std::sync::Mutex;
1515

1616
use lightning::events::ClosureReason;
1717
use lightning::ln::functional_test_utils::{
18-
connect_block, create_announced_chan_between_nodes, create_chanmon_cfgs, create_dummy_block,
19-
create_network, create_node_cfgs, create_node_chanmgrs, send_payment, TestChanMonCfg,
18+
check_closed_event, connect_block, create_announced_chan_between_nodes, create_chanmon_cfgs,
19+
create_dummy_block, create_network, create_node_cfgs, create_node_chanmgrs, send_payment,
20+
TestChanMonCfg,
2021
};
2122
use lightning::util::persist::{
2223
KVStore, KVStoreSync, MonitorUpdatingPersister, KVSTORE_NAMESPACE_KEY_MAX_LEN,
2324
};
2425
use lightning::util::test_utils;
25-
use lightning::{check_added_monitors, check_closed_broadcast, check_closed_event, io};
26+
use lightning::{check_added_monitors, check_closed_broadcast, io};
2627
use rand::distr::Alphanumeric;
2728
use rand::{rng, Rng};
2829

@@ -326,12 +327,12 @@ pub(crate) fn do_test_store<K: KVStoreSync + Sync>(store_0: &K, store_1: &K) {
326327
message.clone(),
327328
)
328329
.unwrap();
329-
check_closed_event!(
330-
nodes[0],
330+
check_closed_event(
331+
&nodes[0],
331332
1,
332333
ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(true), message },
333-
[nodes[1].node.get_our_node_id()],
334-
100000
334+
&[nodes[1].node.get_our_node_id()],
335+
100000,
335336
);
336337
check_closed_broadcast!(nodes[0], true);
337338
check_added_monitors!(nodes[0], 1);
@@ -345,7 +346,7 @@ pub(crate) fn do_test_store<K: KVStoreSync + Sync>(store_0: &K, store_1: &K) {
345346
check_closed_broadcast!(nodes[1], true);
346347
let reason = ClosureReason::CommitmentTxConfirmed;
347348
let node_id_0 = nodes[0].node.get_our_node_id();
348-
check_closed_event!(nodes[1], 1, reason, false, [node_id_0], 100000);
349+
check_closed_event(&nodes[1], 1, reason, &[node_id_0], 100000);
349350
check_added_monitors!(nodes[1], 1);
350351

351352
// Make sure everything is persisted as expected after close.

0 commit comments

Comments
 (0)