@@ -1394,7 +1394,7 @@ impl SendEvent {
13941394/// Don't use this, use the identically-named function instead.
13951395macro_rules! expect_pending_htlcs_forwardable_conditions {
13961396 ( $node: expr, $expected_failures: expr) => {
1397- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & $expected_failures) ;
1397+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & $expected_failures) ;
13981398 }
13991399}
14001400
@@ -1413,11 +1413,10 @@ macro_rules! expect_htlc_handling_failed_destinations {
14131413 } }
14141414}
14151415
1416- /// Checks that an [`Event::PendingHTLCsForwardable`] is available on the given node and, if there
1417- /// are any [`Event::HTLCHandlingFailed`] events their [`HTLCDestination`] is included in the
1416+ /// Checks that an [`Event::PendingHTLCsForwardable`] is available in the given events and, if
1417+ /// there are any [`Event::HTLCHandlingFailed`] events their [`HTLCDestination`] is included in the
14181418/// `expected_failures` set.
1419- pub fn expect_pending_htlcs_forwardable_conditions ( node : & Node , expected_failures : & [ HTLCDestination ] ) {
1420- let events = node. node . get_and_clear_pending_events ( ) ;
1419+ pub fn expect_pending_htlcs_forwardable_conditions ( events : Vec < Event > , expected_failures : & [ HTLCDestination ] ) {
14211420 match events[ 0 ] {
14221421 Event :: PendingHTLCsForwardable { .. } => { } ,
14231422 _ => panic ! ( "Unexpected event {:?}" , events) ,
@@ -1438,7 +1437,7 @@ pub fn expect_pending_htlcs_forwardable_conditions(node: &Node, expected_failure
14381437/// instead.
14391438macro_rules! expect_pending_htlcs_forwardable_ignore {
14401439 ( $node: expr) => {
1441- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & [ ] ) ;
1440+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & [ ] ) ;
14421441 }
14431442}
14441443
@@ -1448,15 +1447,15 @@ macro_rules! expect_pending_htlcs_forwardable_ignore {
14481447/// Don't use this, call [`expect_pending_htlcs_forwardable_conditions`] instead.
14491448macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore {
14501449 ( $node: expr, $expected_failures: expr) => {
1451- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & $expected_failures) ;
1450+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & $expected_failures) ;
14521451 }
14531452}
14541453
14551454#[ macro_export]
14561455/// Handles a PendingHTLCsForwardable event
14571456macro_rules! expect_pending_htlcs_forwardable {
14581457 ( $node: expr) => { {
1459- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & [ ] ) ;
1458+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & [ ] ) ;
14601459 $node. node. process_pending_htlc_forwards( ) ;
14611460
14621461 // Ensure process_pending_htlc_forwards is idempotent.
@@ -1468,7 +1467,7 @@ macro_rules! expect_pending_htlcs_forwardable {
14681467/// Handles a PendingHTLCsForwardable and HTLCHandlingFailed event
14691468macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed {
14701469 ( $node: expr, $expected_failures: expr) => { {
1471- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & $expected_failures) ;
1470+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & $expected_failures) ;
14721471 $node. node. process_pending_htlc_forwards( ) ;
14731472
14741473 // Ensure process_pending_htlc_forwards is idempotent.
0 commit comments