+#[macro_export]
+macro_rules! expect_htlc_handling_failed_destinations {
+ ($events: expr, $expected_failures: expr) => {{
+ for event in $events {
+ match event {
+ $crate::util::events::Event::PendingHTLCsForwardable { .. } => { },
+ $crate::util::events::Event::HTLCHandlingFailed { ref failed_next_destination, .. } => {
+ assert!($expected_failures.contains(&failed_next_destination))
+ },
+ _ => panic!("Unexpected destination"),
+ }
+ }
+ }}
+}
+
+#[macro_export]
+/// Clears (and ignores) a PendingHTLCsForwardable event
+macro_rules! expect_pending_htlcs_forwardable_ignore {
+ ($node: expr) => {{
+ expect_pending_htlcs_forwardable_conditions!($node, vec![]);
+ }};
+}
+
+#[macro_export]
+/// Clears (and ignores) PendingHTLCsForwardable and HTLCHandlingFailed events
+macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore {
+ ($node: expr, $expected_failures: expr) => {{
+ expect_pending_htlcs_forwardable_conditions!($node, $expected_failures);
+ }};
+}
+