]> git.bitcoin.ninja Git - rust-lightning/commitdiff
f check every failure
authorMatt Corallo <git@bluematt.me>
Tue, 21 Sep 2021 06:10:23 +0000 (06:10 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 21 Sep 2021 06:10:23 +0000 (06:10 +0000)
lightning/src/ln/functional_test_utils.rs

index a8b91735c7a9d7fe28b0bd48f13fc865037b4681..5690c834e73860d37729934c38c507bb648b3299 100644 (file)
@@ -769,11 +769,14 @@ macro_rules! check_closed_event {
        ($node: expr, $events: expr, $reason: expr) => {{
                let events = $node.node.get_and_clear_pending_events();
                assert_eq!(events.len(), $events);
-               match events[0] {
-                       Event::ChannelClosed { ref reason, .. } => {
-                               assert_eq!(*reason, $reason);
-                       },
-                       _ => panic!("Unexpected event"),
+               let expected_reason = $reason;
+               for event in events {
+                       match event {
+                               Event::ChannelClosed { ref reason, .. } => {
+                                       assert_eq!(*reason, expected_reason);
+                               },
+                               _ => panic!("Unexpected event"),
+                       }
                }
        }}
 }