@@ -1394,7 +1394,7 @@ impl SendEvent {
1394
1394
/// Don't use this, use the identically-named function instead.
1395
1395
macro_rules! expect_pending_htlcs_forwardable_conditions {
1396
1396
( $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) ;
1398
1398
}
1399
1399
}
1400
1400
@@ -1413,11 +1413,10 @@ macro_rules! expect_htlc_handling_failed_destinations {
1413
1413
} }
1414
1414
}
1415
1415
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
1418
1418
/// `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 ] ) {
1421
1420
match events[ 0 ] {
1422
1421
Event :: PendingHTLCsForwardable { .. } => { } ,
1423
1422
_ => panic ! ( "Unexpected event {:?}" , events) ,
@@ -1438,7 +1437,7 @@ pub fn expect_pending_htlcs_forwardable_conditions(node: &Node, expected_failure
1438
1437
/// instead.
1439
1438
macro_rules! expect_pending_htlcs_forwardable_ignore {
1440
1439
( $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 ( ) , & [ ] ) ;
1442
1441
}
1443
1442
}
1444
1443
@@ -1448,15 +1447,15 @@ macro_rules! expect_pending_htlcs_forwardable_ignore {
1448
1447
/// Don't use this, call [`expect_pending_htlcs_forwardable_conditions`] instead.
1449
1448
macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore {
1450
1449
( $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) ;
1452
1451
}
1453
1452
}
1454
1453
1455
1454
#[ macro_export]
1456
1455
/// Handles a PendingHTLCsForwardable event
1457
1456
macro_rules! expect_pending_htlcs_forwardable {
1458
1457
( $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 ( ) , & [ ] ) ;
1460
1459
$node. node. process_pending_htlc_forwards( ) ;
1461
1460
1462
1461
// Ensure process_pending_htlc_forwards is idempotent.
@@ -1468,7 +1467,7 @@ macro_rules! expect_pending_htlcs_forwardable {
1468
1467
/// Handles a PendingHTLCsForwardable and HTLCHandlingFailed event
1469
1468
macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed {
1470
1469
( $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) ;
1472
1471
$node. node. process_pending_htlc_forwards( ) ;
1473
1472
1474
1473
// Ensure process_pending_htlc_forwards is idempotent.
0 commit comments