Skip to content

Commit df44274

Browse files
added a million Node<CL> thingies everywhere
1 parent 1a186fb commit df44274

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ use std::rc::Rc;
3535
use std::sync::{Arc, Mutex};
3636
use std::mem;
3737
use std::ops::Deref;
38-
use std::marker::Sized;
3938

4039
pub const CHAN_CONFIRM_DEPTH: u32 = 100;
41-
pub fn confirm_transaction(notifier: &chaininterface::BlockNotifier, chain: &chaininterface::ChainWatchInterfaceUtil, tx: &Transaction, chan_id: u32) {
40+
pub fn confirm_transaction<CL: Deref<Target = chaininterface::ChainListener> + Clone>(notifier: &chaininterface::BlockNotifier<CL>, chain: &chaininterface::ChainWatchInterfaceUtil, tx: &Transaction, chan_id: u32) {
4241
assert!(chain.does_match_tx(tx));
4342
let mut header = BlockHeader { version: 0x20000000, prev_blockhash: Default::default(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
4443
notifier.block_connected_checked(&header, 1, &[tx; 1], &[chan_id; 1]);
@@ -48,7 +47,7 @@ pub fn confirm_transaction(notifier: &chaininterface::BlockNotifier, chain: &cha
4847
}
4948
}
5049

51-
pub fn connect_blocks(notifier: &chaininterface::BlockNotifier, depth: u32, height: u32, parent: bool, prev_blockhash: Sha256d) -> Sha256d {
50+
pub fn connect_blocks<CL: Deref<Target = chaininterface::ChainListener> + Clone>(notifier: &chaininterface::BlockNotifier<CL>, depth: u32, height: u32, parent: bool, prev_blockhash: Sha256d) -> Sha256d {
5251
let mut header = BlockHeader { version: 0x2000000, prev_blockhash: if parent { prev_blockhash } else { Default::default() }, merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
5352
notifier.block_connected_checked(&header, height + 1, &Vec::new(), &Vec::new());
5453
for i in 2..depth + 1 {
@@ -71,7 +70,8 @@ pub struct Node {
7170
pub network_chan_count: Rc<RefCell<u32>>,
7271
pub logger: Arc<test_utils::TestLogger>
7372
}
74-
impl Drop for Node {
73+
74+
impl<CL: Deref<Target = chaininterface::ChainListener> + Clone> Drop for Node<CL> {
7575
fn drop(&mut self) {
7676
if !::std::thread::panicking() {
7777
// Check that we processed all pending events
@@ -82,11 +82,11 @@ impl Drop for Node {
8282
}
8383
}
8484

85-
pub fn create_chan_between_nodes(node_a: &Node, node_b: &Node, a_flags: LocalFeatures, b_flags: LocalFeatures) -> (msgs::ChannelAnnouncement, msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction) {
85+
pub fn create_chan_between_nodes<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node_a: &Node<CL>, node_b: &Node<CL>, a_flags: LocalFeatures, b_flags: LocalFeatures) -> (msgs::ChannelAnnouncement, msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction) {
8686
create_chan_between_nodes_with_value(node_a, node_b, 100000, 10001, a_flags, b_flags)
8787
}
8888

89-
pub fn create_chan_between_nodes_with_value(node_a: &Node, node_b: &Node, channel_value: u64, push_msat: u64, a_flags: LocalFeatures, b_flags: LocalFeatures) -> (msgs::ChannelAnnouncement, msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction) {
89+
pub fn create_chan_between_nodes_with_value<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node_a: &Node<CL>, node_b: &Node<CL>, channel_value: u64, push_msat: u64, a_flags: LocalFeatures, b_flags: LocalFeatures) -> (msgs::ChannelAnnouncement, msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction) {
9090
let (funding_locked, channel_id, tx) = create_chan_between_nodes_with_value_a(node_a, node_b, channel_value, push_msat, a_flags, b_flags);
9191
let (announcement, as_update, bs_update) = create_chan_between_nodes_with_value_b(node_a, node_b, &funding_locked);
9292
(announcement, as_update, bs_update, channel_id, tx)
@@ -161,7 +161,7 @@ macro_rules! get_feerate {
161161
}
162162
}
163163

164-
pub fn create_funding_transaction(node: &Node, expected_chan_value: u64, expected_user_chan_id: u64) -> ([u8; 32], Transaction, OutPoint) {
164+
pub fn create_funding_transaction<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node: &Node<CL>, expected_chan_value: u64, expected_user_chan_id: u64) -> ([u8; 32], Transaction, OutPoint) {
165165
let chan_id = *node.network_chan_count.borrow();
166166

167167
let events = node.node.get_and_clear_pending_events();
@@ -181,7 +181,7 @@ pub fn create_funding_transaction(node: &Node, expected_chan_value: u64, expecte
181181
}
182182
}
183183

184-
pub fn create_chan_between_nodes_with_value_init(node_a: &Node, node_b: &Node, channel_value: u64, push_msat: u64, a_flags: LocalFeatures, b_flags: LocalFeatures) -> Transaction {
184+
pub fn create_chan_between_nodes_with_value_init<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node_a: &Node<CL>, node_b: &Node<CL>, channel_value: u64, push_msat: u64, a_flags: LocalFeatures, b_flags: LocalFeatures) -> Transaction {
185185
node_a.node.create_channel(node_b.node.get_our_node_id(), channel_value, push_msat, 42).unwrap();
186186
node_b.node.handle_open_channel(&node_a.node.get_our_node_id(), a_flags, &get_event_msg!(node_a, MessageSendEvent::SendOpenChannel, node_b.node.get_our_node_id()));
187187
node_a.node.handle_accept_channel(&node_b.node.get_our_node_id(), b_flags, &get_event_msg!(node_b, MessageSendEvent::SendAcceptChannel, node_a.node.get_our_node_id()));
@@ -225,12 +225,12 @@ pub fn create_chan_between_nodes_with_value_init(node_a: &Node, node_b: &Node, c
225225
tx
226226
}
227227

228-
pub fn create_chan_between_nodes_with_value_confirm_first(node_recv: &Node, node_conf: &Node, tx: &Transaction) {
228+
pub fn create_chan_between_nodes_with_value_confirm_first<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node_recv: &Node<CL>, node_conf: &Node<CL>, tx: &Transaction) {
229229
confirm_transaction(&node_conf.block_notifier, &node_conf.chain_monitor, &tx, tx.version);
230230
node_recv.node.handle_funding_locked(&node_conf.node.get_our_node_id(), &get_event_msg!(node_conf, MessageSendEvent::SendFundingLocked, node_recv.node.get_our_node_id()));
231231
}
232232

233-
pub fn create_chan_between_nodes_with_value_confirm_second(node_recv: &Node, node_conf: &Node) -> ((msgs::FundingLocked, msgs::AnnouncementSignatures), [u8; 32]) {
233+
pub fn create_chan_between_nodes_with_value_confirm_second<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node_recv: &Node<CL>, node_conf: &Node<CL>) -> ((msgs::FundingLocked, msgs::AnnouncementSignatures), [u8; 32]) {
234234
let channel_id;
235235
let events_6 = node_conf.node.get_and_clear_pending_msg_events();
236236
assert_eq!(events_6.len(), 2);
@@ -250,19 +250,19 @@ pub fn create_chan_between_nodes_with_value_confirm_second(node_recv: &Node, nod
250250
}), channel_id)
251251
}
252252

253-
pub fn create_chan_between_nodes_with_value_confirm(node_a: &Node, node_b: &Node, tx: &Transaction) -> ((msgs::FundingLocked, msgs::AnnouncementSignatures), [u8; 32]) {
253+
pub fn create_chan_between_nodes_with_value_confirm<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node_a: &Node<CL>, node_b: &Node<CL>, tx: &Transaction) -> ((msgs::FundingLocked, msgs::AnnouncementSignatures), [u8; 32]) {
254254
create_chan_between_nodes_with_value_confirm_first(node_a, node_b, tx);
255255
confirm_transaction(&node_a.block_notifier, &node_a.chain_monitor, &tx, tx.version);
256256
create_chan_between_nodes_with_value_confirm_second(node_b, node_a)
257257
}
258258

259-
pub fn create_chan_between_nodes_with_value_a(node_a: &Node, node_b: &Node, channel_value: u64, push_msat: u64, a_flags: LocalFeatures, b_flags: LocalFeatures) -> ((msgs::FundingLocked, msgs::AnnouncementSignatures), [u8; 32], Transaction) {
259+
pub fn create_chan_between_nodes_with_value_a<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node_a: &Node<CL>, node_b: &Node<CL>, channel_value: u64, push_msat: u64, a_flags: LocalFeatures, b_flags: LocalFeatures) -> ((msgs::FundingLocked, msgs::AnnouncementSignatures), [u8; 32], Transaction) {
260260
let tx = create_chan_between_nodes_with_value_init(node_a, node_b, channel_value, push_msat, a_flags, b_flags);
261261
let (msgs, chan_id) = create_chan_between_nodes_with_value_confirm(node_a, node_b, &tx);
262262
(msgs, chan_id, tx)
263263
}
264264

265-
pub fn create_chan_between_nodes_with_value_b(node_a: &Node, node_b: &Node, as_funding_msgs: &(msgs::FundingLocked, msgs::AnnouncementSignatures)) -> (msgs::ChannelAnnouncement, msgs::ChannelUpdate, msgs::ChannelUpdate) {
265+
pub fn create_chan_between_nodes_with_value_b<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node_a: &Node<CL>, node_b: &Node<CL>, as_funding_msgs: &(msgs::FundingLocked, msgs::AnnouncementSignatures)) -> (msgs::ChannelAnnouncement, msgs::ChannelUpdate, msgs::ChannelUpdate) {
266266
node_b.node.handle_funding_locked(&node_a.node.get_our_node_id(), &as_funding_msgs.0);
267267
let bs_announcement_sigs = get_event_msg!(node_b, MessageSendEvent::SendAnnouncementSignatures, node_a.node.get_our_node_id());
268268
node_b.node.handle_announcement_signatures(&node_a.node.get_our_node_id(), &as_funding_msgs.1);
@@ -294,11 +294,11 @@ pub fn create_chan_between_nodes_with_value_b(node_a: &Node, node_b: &Node, as_f
294294
((*announcement).clone(), (*as_update).clone(), (*bs_update).clone())
295295
}
296296

297-
pub fn create_announced_chan_between_nodes(nodes: &Vec<Node>, a: usize, b: usize, a_flags: LocalFeatures, b_flags: LocalFeatures) -> (msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction) {
297+
pub fn create_announced_chan_between_nodes<CL: Deref<Target = chaininterface::ChainListener> + Clone>(nodes: &Vec<Node<CL>>, a: usize, b: usize, a_flags: LocalFeatures, b_flags: LocalFeatures) -> (msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction) {
298298
create_announced_chan_between_nodes_with_value(nodes, a, b, 100000, 10001, a_flags, b_flags)
299299
}
300300

301-
pub fn create_announced_chan_between_nodes_with_value(nodes: &Vec<Node>, a: usize, b: usize, channel_value: u64, push_msat: u64, a_flags: LocalFeatures, b_flags: LocalFeatures) -> (msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction) {
301+
pub fn create_announced_chan_between_nodes_with_value<CL: Deref<Target = chaininterface::ChainListener> + Clone>(nodes: &Vec<Node<CL>>, a: usize, b: usize, channel_value: u64, push_msat: u64, a_flags: LocalFeatures, b_flags: LocalFeatures) -> (msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction) {
302302
let chan_announcement = create_chan_between_nodes_with_value(&nodes[a], &nodes[b], channel_value, push_msat, a_flags, b_flags);
303303
for node in nodes {
304304
assert!(node.router.handle_channel_announcement(&chan_announcement.0).unwrap());
@@ -368,7 +368,7 @@ macro_rules! check_closed_broadcast {
368368
}}
369369
}
370370

371-
pub fn close_channel(outbound_node: &Node, inbound_node: &Node, channel_id: &[u8; 32], funding_tx: Transaction, close_inbound_first: bool) -> (msgs::ChannelUpdate, msgs::ChannelUpdate, Transaction) {
371+
pub fn close_channel<CL: Deref<Target = chaininterface::ChainListener> + Clone>(outbound_node: &Node<CL>, inbound_node: &Node<CL>, channel_id: &[u8; 32], funding_tx: Transaction, close_inbound_first: bool) -> (msgs::ChannelUpdate, msgs::ChannelUpdate, Transaction) {
372372
let (node_a, broadcaster_a, struct_a) = if close_inbound_first { (&inbound_node.node, &inbound_node.tx_broadcaster, inbound_node) } else { (&outbound_node.node, &outbound_node.tx_broadcaster, outbound_node) };
373373
let (node_b, broadcaster_b) = if close_inbound_first { (&outbound_node.node, &outbound_node.tx_broadcaster) } else { (&inbound_node.node, &inbound_node.tx_broadcaster) };
374374
let (tx_a, tx_b);
@@ -455,7 +455,7 @@ impl SendEvent {
455455
}
456456
}
457457

458-
pub fn from_node(node: &Node) -> SendEvent {
458+
pub fn from_node<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node: &Node<CL>) -> SendEvent {
459459
let mut events = node.node.get_and_clear_pending_msg_events();
460460
assert_eq!(events.len(), 1);
461461
SendEvent::from_event(events.pop().unwrap())
@@ -603,7 +603,7 @@ macro_rules! expect_payment_sent {
603603
}
604604
}
605605

606-
pub fn send_along_route_with_hash(origin_node: &Node, route: Route, expected_route: &[&Node], recv_value: u64, our_payment_hash: PaymentHash) {
606+
pub fn send_along_route_with_hash<CL: Deref<Target = chaininterface::ChainListener> + Clone>(origin_node: &Node<CL>, route: Route, expected_route: &[&Node<CL>], recv_value: u64, our_payment_hash: PaymentHash) {
607607
let mut payment_event = {
608608
origin_node.node.send_payment(route, our_payment_hash).unwrap();
609609
check_added_monitors!(origin_node, 1);
@@ -645,13 +645,13 @@ pub fn send_along_route_with_hash(origin_node: &Node, route: Route, expected_rou
645645
}
646646
}
647647

648-
pub fn send_along_route(origin_node: &Node, route: Route, expected_route: &[&Node], recv_value: u64) -> (PaymentPreimage, PaymentHash) {
648+
pub fn send_along_route<CL: Deref<Target = chaininterface::ChainListener> + Clone>(origin_node: &Node<CL>, route: Route, expected_route: &[&Node<CL>], recv_value: u64) -> (PaymentPreimage, PaymentHash) {
649649
let (our_payment_preimage, our_payment_hash) = get_payment_preimage_hash!(origin_node);
650650
send_along_route_with_hash(origin_node, route, expected_route, recv_value, our_payment_hash);
651651
(our_payment_preimage, our_payment_hash)
652652
}
653653

654-
pub fn claim_payment_along_route(origin_node: &Node, expected_route: &[&Node], skip_last: bool, our_payment_preimage: PaymentPreimage, expected_amount: u64) {
654+
pub fn claim_payment_along_route<CL: Deref<Target = chaininterface::ChainListener> + Clone>(origin_node: &Node<CL>, expected_route: &[&Node<CL>], skip_last: bool, our_payment_preimage: PaymentPreimage, expected_amount: u64) {
655655
assert!(expected_route.last().unwrap().node.claim_funds(our_payment_preimage, expected_amount));
656656
check_added_monitors!(expected_route.last().unwrap(), 1);
657657

@@ -729,13 +729,13 @@ pub fn claim_payment_along_route(origin_node: &Node, expected_route: &[&Node], s
729729
}
730730
}
731731

732-
pub fn claim_payment(origin_node: &Node, expected_route: &[&Node], our_payment_preimage: PaymentPreimage, expected_amount: u64) {
732+
pub fn claim_payment<CL: Deref<Target = chaininterface::ChainListener> + Clone>(origin_node: &Node<CL>, expected_route: &[&Node<CL>], our_payment_preimage: PaymentPreimage, expected_amount: u64) {
733733
claim_payment_along_route(origin_node, expected_route, false, our_payment_preimage, expected_amount);
734734
}
735735

736736
pub const TEST_FINAL_CLTV: u32 = 32;
737737

738-
pub fn route_payment(origin_node: &Node, expected_route: &[&Node], recv_value: u64) -> (PaymentPreimage, PaymentHash) {
738+
pub fn route_payment<CL: Deref<Target = chaininterface::ChainListener> + Clone>(origin_node: &Node<CL>, expected_route: &[&Node<CL>], recv_value: u64) -> (PaymentPreimage, PaymentHash) {
739739
let route = origin_node.router.get_route(&expected_route.last().unwrap().node.get_our_node_id(), None, &Vec::new(), recv_value, TEST_FINAL_CLTV).unwrap();
740740
assert_eq!(route.hops.len(), expected_route.len());
741741
for (node, hop) in expected_route.iter().zip(route.hops.iter()) {
@@ -745,7 +745,7 @@ pub fn route_payment(origin_node: &Node, expected_route: &[&Node], recv_value: u
745745
send_along_route(origin_node, route, expected_route, recv_value)
746746
}
747747

748-
pub fn route_over_limit(origin_node: &Node, expected_route: &[&Node], recv_value: u64) {
748+
pub fn route_over_limit<CL: Deref<Target = chaininterface::ChainListener> + Clone>(origin_node: &Node<CL>, expected_route: &[&Node<CL>], recv_value: u64) {
749749
let route = origin_node.router.get_route(&expected_route.last().unwrap().node.get_our_node_id(), None, &Vec::new(), recv_value, TEST_FINAL_CLTV).unwrap();
750750
assert_eq!(route.hops.len(), expected_route.len());
751751
for (node, hop) in expected_route.iter().zip(route.hops.iter()) {
@@ -761,12 +761,12 @@ pub fn route_over_limit(origin_node: &Node, expected_route: &[&Node], recv_value
761761
};
762762
}
763763

764-
pub fn send_payment(origin: &Node, expected_route: &[&Node], recv_value: u64, expected_value: u64) {
764+
pub fn send_payment<CL: Deref<Target = chaininterface::ChainListener> + Clone>(origin: &Node<CL>, expected_route: &[&Node<CL>], recv_value: u64, expected_value: u64) {
765765
let our_payment_preimage = route_payment(&origin, expected_route, recv_value).0;
766766
claim_payment(&origin, expected_route, our_payment_preimage, expected_value);
767767
}
768768

769-
pub fn fail_payment_along_route(origin_node: &Node, expected_route: &[&Node], skip_last: bool, our_payment_hash: PaymentHash) {
769+
pub fn fail_payment_along_route<CL: Deref<Target = chaininterface::ChainListener> + Clone>(origin_node: &Node<CL>, expected_route: &[&Node<CL>], skip_last: bool, our_payment_hash: PaymentHash) {
770770
assert!(expected_route.last().unwrap().node.fail_htlc_backwards(&our_payment_hash));
771771
expect_pending_htlcs_forwardable!(expected_route.last().unwrap());
772772
check_added_monitors!(expected_route.last().unwrap(), 1);
@@ -835,11 +835,11 @@ pub fn fail_payment_along_route(origin_node: &Node, expected_route: &[&Node], sk
835835
}
836836
}
837837

838-
pub fn fail_payment(origin_node: &Node, expected_route: &[&Node], our_payment_hash: PaymentHash) {
838+
pub fn fail_payment<CL: Deref<Target = chaininterface::ChainListener> + Clone>(origin_node: &Node<CL>, expected_route: &[&Node<CL>], our_payment_hash: PaymentHash) {
839839
fail_payment_along_route(origin_node, expected_route, false, our_payment_hash);
840840
}
841841

842-
pub fn create_network(node_count: usize, node_config: &[Option<UserConfig>]) -> Vec<Node> {
842+
pub fn create_network<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node_count: usize, node_config: &[Option<UserConfig>]) -> Vec<Node<CL>> {
843843
let mut nodes = Vec::new();
844844
let mut rng = thread_rng();
845845
let secp_ctx = Secp256k1::new();
@@ -891,7 +891,7 @@ pub enum HTLCType { NONE, TIMEOUT, SUCCESS }
891891
///
892892
/// All broadcast transactions must be accounted for in one of the above three types of we'll
893893
/// also fail.
894-
pub fn test_txn_broadcast(node: &Node, chan: &(msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction), commitment_tx: Option<Transaction>, has_htlc_tx: HTLCType) -> Vec<Transaction> {
894+
pub fn test_txn_broadcast<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node: &Node<CL>, chan: &(msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction), commitment_tx: Option<Transaction>, has_htlc_tx: HTLCType) -> Vec<Transaction> {
895895
let mut node_txn = node.tx_broadcaster.txn_broadcasted.lock().unwrap();
896896
assert!(node_txn.len() >= if commitment_tx.is_some() { 0 } else { 1 } + if has_htlc_tx == HTLCType::NONE { 0 } else { 1 });
897897

@@ -936,7 +936,7 @@ pub fn test_txn_broadcast(node: &Node, chan: &(msgs::ChannelUpdate, msgs::Channe
936936

937937
/// Tests that the given node has broadcast a claim transaction against the provided revoked
938938
/// HTLC transaction.
939-
pub fn test_revoked_htlc_claim_txn_broadcast(node: &Node, revoked_tx: Transaction, commitment_revoked_tx: Transaction) {
939+
pub fn test_revoked_htlc_claim_txn_broadcast<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node: &Node<CL>, revoked_tx: Transaction, commitment_revoked_tx: Transaction) {
940940
let mut node_txn = node.tx_broadcaster.txn_broadcasted.lock().unwrap();
941941
// We should issue a 2nd transaction if one htlc is dropped from initial claiming tx
942942
// but sometimes not as feerate is too-low
@@ -954,7 +954,7 @@ pub fn test_revoked_htlc_claim_txn_broadcast(node: &Node, revoked_tx: Transactio
954954
assert!(node_txn.is_empty());
955955
}
956956

957-
pub fn check_preimage_claim(node: &Node, prev_txn: &Vec<Transaction>) -> Vec<Transaction> {
957+
pub fn check_preimage_claim<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node: &Node<CL>, prev_txn: &Vec<Transaction>) -> Vec<Transaction> {
958958
let mut node_txn = node.tx_broadcaster.txn_broadcasted.lock().unwrap();
959959

960960
assert!(node_txn.len() >= 1);
@@ -978,7 +978,7 @@ pub fn check_preimage_claim(node: &Node, prev_txn: &Vec<Transaction>) -> Vec<Tra
978978
res
979979
}
980980

981-
pub fn get_announce_close_broadcast_events(nodes: &Vec<Node>, a: usize, b: usize) {
981+
pub fn get_announce_close_broadcast_events<CL: Deref<Target = chaininterface::ChainListener> + Clone>(nodes: &Vec<Node<CL>>, a: usize, b: usize) {
982982
let events_1 = nodes[a].node.get_and_clear_pending_msg_events();
983983
assert_eq!(events_1.len(), 1);
984984
let as_update = match events_1[0] {
@@ -1085,7 +1085,7 @@ macro_rules! handle_chan_reestablish_msgs {
10851085

10861086
/// pending_htlc_adds includes both the holding cell and in-flight update_add_htlcs, whereas
10871087
/// for claims/fails they are separated out.
1088-
pub fn reconnect_nodes(node_a: &Node, node_b: &Node, send_funding_locked: (bool, bool), pending_htlc_adds: (i64, i64), pending_htlc_claims: (usize, usize), pending_cell_htlc_claims: (usize, usize), pending_cell_htlc_fails: (usize, usize), pending_raa: (bool, bool)) {
1088+
pub fn reconnect_nodes<CL: Deref<Target = chaininterface::ChainListener> + Clone>(node_a: &Node<CL>, node_b: &Node<CL>, send_funding_locked: (bool, bool), pending_htlc_adds: (i64, i64), pending_htlc_claims: (usize, usize), pending_cell_htlc_claims: (usize, usize), pending_cell_htlc_fails: (usize, usize), pending_raa: (bool, bool)) {
10891089
node_a.node.peer_connected(&node_b.node.get_our_node_id());
10901090
let reestablish_1 = get_chan_reestablish_msgs!(node_a, node_b);
10911091
node_b.node.peer_connected(&node_a.node.get_our_node_id());

0 commit comments

Comments
 (0)