Skip to content

Commit 6217f2c

Browse files
f stronger assertions in test util
1 parent c292b48 commit 6217f2c

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

lightning/src/ln/functional_test_utils.rs

+17-16
Original file line numberDiff line numberDiff line change
@@ -1068,22 +1068,23 @@ macro_rules! unwrap_send_err {
10681068
assert!($res.is_ok());
10691069
let events = $node.node.get_and_clear_pending_events();
10701070
assert!(events.len() == 2);
1071-
for ev in events {
1072-
match ev {
1073-
crate::events::Event::PaymentPathFailed { failure, .. } => {
1074-
match failure {
1075-
crate::events::PathFailure::InitialSend { err } => {
1076-
match err {
1077-
$type => { $check },
1078-
_ => panic!()
1079-
}
1080-
},
1081-
_ => panic!()
1082-
}
1083-
},
1084-
crate::events::Event::PaymentFailed { .. } => {},
1085-
_ => panic!()
1086-
}
1071+
match &events[0] {
1072+
crate::events::Event::PaymentPathFailed { failure, .. } => {
1073+
match failure {
1074+
crate::events::PathFailure::InitialSend { err } => {
1075+
match err {
1076+
$type => { $check },
1077+
_ => panic!()
1078+
}
1079+
},
1080+
_ => panic!()
1081+
}
1082+
},
1083+
_ => panic!()
1084+
}
1085+
match &events[1] {
1086+
crate::events::Event::PaymentFailed { .. } => {},
1087+
_ => panic!()
10871088
}
10881089
}
10891090
}

0 commit comments

Comments
 (0)