@@ -1397,7 +1397,7 @@ impl SendEvent {
1397
1397
/// Don't use this, use the identically-named function instead.
1398
1398
macro_rules! expect_pending_htlcs_forwardable_conditions {
1399
1399
( $node: expr, $expected_failures: expr) => {
1400
- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & $expected_failures) ;
1400
+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & $expected_failures) ;
1401
1401
}
1402
1402
}
1403
1403
@@ -1416,11 +1416,10 @@ macro_rules! expect_htlc_handling_failed_destinations {
1416
1416
} }
1417
1417
}
1418
1418
1419
- /// Checks that an [`Event::PendingHTLCsForwardable`] is available on the given node and, if there
1420
- /// are any [`Event::HTLCHandlingFailed`] events their [`HTLCDestination`] is included in the
1419
+ /// Checks that an [`Event::PendingHTLCsForwardable`] is available in the given events and, if
1420
+ /// there are any [`Event::HTLCHandlingFailed`] events their [`HTLCDestination`] is included in the
1421
1421
/// `expected_failures` set.
1422
- pub fn expect_pending_htlcs_forwardable_conditions ( node : & Node , expected_failures : & [ HTLCDestination ] ) {
1423
- let events = node. node . get_and_clear_pending_events ( ) ;
1422
+ pub fn expect_pending_htlcs_forwardable_conditions ( events : Vec < Event > , expected_failures : & [ HTLCDestination ] ) {
1424
1423
match events[ 0 ] {
1425
1424
Event :: PendingHTLCsForwardable { .. } => { } ,
1426
1425
_ => panic ! ( "Unexpected event {:?}" , events) ,
@@ -1441,7 +1440,7 @@ pub fn expect_pending_htlcs_forwardable_conditions(node: &Node, expected_failure
1441
1440
/// instead.
1442
1441
macro_rules! expect_pending_htlcs_forwardable_ignore {
1443
1442
( $node: expr) => {
1444
- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & [ ] ) ;
1443
+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & [ ] ) ;
1445
1444
}
1446
1445
}
1447
1446
@@ -1451,15 +1450,15 @@ macro_rules! expect_pending_htlcs_forwardable_ignore {
1451
1450
/// Don't use this, call [`expect_pending_htlcs_forwardable_conditions`] instead.
1452
1451
macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore {
1453
1452
( $node: expr, $expected_failures: expr) => {
1454
- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & $expected_failures) ;
1453
+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & $expected_failures) ;
1455
1454
}
1456
1455
}
1457
1456
1458
1457
#[ macro_export]
1459
1458
/// Handles a PendingHTLCsForwardable event
1460
1459
macro_rules! expect_pending_htlcs_forwardable {
1461
1460
( $node: expr) => { {
1462
- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & [ ] ) ;
1461
+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & [ ] ) ;
1463
1462
$node. node. process_pending_htlc_forwards( ) ;
1464
1463
1465
1464
// Ensure process_pending_htlc_forwards is idempotent.
@@ -1471,7 +1470,7 @@ macro_rules! expect_pending_htlcs_forwardable {
1471
1470
/// Handles a PendingHTLCsForwardable and HTLCHandlingFailed event
1472
1471
macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed {
1473
1472
( $node: expr, $expected_failures: expr) => { {
1474
- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & $expected_failures) ;
1473
+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & $expected_failures) ;
1475
1474
$node. node. process_pending_htlc_forwards( ) ;
1476
1475
1477
1476
// Ensure process_pending_htlc_forwards is idempotent.
0 commit comments