Skip to content

Commit 37ebcda

Browse files
committed
Update fuzzers for ChannelPending event
1 parent 658678d commit 37ebcda

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,18 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
526526
msg.clone()
527527
} else { panic!("Wrong event type"); }
528528
};
529+
let events = $dest.get_and_clear_pending_events();
530+
assert_eq!(events.len(), 1);
531+
if let events::Event::ChannelPending{ ref counterparty_node_id, .. } = events[0] {
532+
assert_eq!(counterparty_node_id, &$source.get_our_node_id());
533+
} else { panic!("Wrong event type"); }
534+
529535
$source.handle_funding_signed(&$dest.get_our_node_id(), &funding_signed);
536+
let events = $source.get_and_clear_pending_events();
537+
assert_eq!(events.len(), 1);
538+
if let events::Event::ChannelPending{ ref counterparty_node_id, .. } = events[0] {
539+
assert_eq!(counterparty_node_id, &$dest.get_our_node_id());
540+
} else { panic!("Wrong event type"); }
530541

531542
funding_output
532543
} }

0 commit comments

Comments
 (0)