+ };
+ if $expect_paths {
+ for i in 1..events.len() {
+ match events[i] {
+ $crate::util::events::Event::PaymentPathSuccessful { payment_id, payment_hash, .. } => {
+ assert_eq!(payment_id, expected_payment_id);
+ assert_eq!(payment_hash, Some(expected_payment_hash));
+ },
+ _ => panic!("Unexpected event"),
+ }
+ }
+ }
+ } }
+}
+
+#[cfg(test)]
+#[macro_export]
+macro_rules! expect_payment_path_successful {
+ ($node: expr) => {
+ let events = $node.node.get_and_clear_pending_events();
+ assert_eq!(events.len(), 1);
+ match events[0] {
+ $crate::util::events::Event::PaymentPathSuccessful { .. } => {},
+ _ => panic!("Unexpected event"),