@@ -1384,7 +1384,7 @@ impl SendEvent {
1384
1384
/// Don't use this, use the identically-named function instead.
1385
1385
macro_rules! expect_pending_htlcs_forwardable_conditions {
1386
1386
( $node: expr, $expected_failures: expr) => {
1387
- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & $expected_failures) ;
1387
+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & $expected_failures) ;
1388
1388
}
1389
1389
}
1390
1390
@@ -1403,11 +1403,10 @@ macro_rules! expect_htlc_handling_failed_destinations {
1403
1403
} }
1404
1404
}
1405
1405
1406
- /// Checks that an [`Event::PendingHTLCsForwardable`] is available on the given node and, if there
1407
- /// are any [`Event::HTLCHandlingFailed`] events their [`HTLCDestination`] is included in the
1406
+ /// Checks that an [`Event::PendingHTLCsForwardable`] is available in the given events and, if
1407
+ /// there are any [`Event::HTLCHandlingFailed`] events their [`HTLCDestination`] is included in the
1408
1408
/// `expected_failures` set.
1409
- pub fn expect_pending_htlcs_forwardable_conditions ( node : & Node , expected_failures : & [ HTLCDestination ] ) {
1410
- let events = node. node . get_and_clear_pending_events ( ) ;
1409
+ pub fn expect_pending_htlcs_forwardable_conditions ( events : Vec < Event > , expected_failures : & [ HTLCDestination ] ) {
1411
1410
match events[ 0 ] {
1412
1411
Event :: PendingHTLCsForwardable { .. } => { } ,
1413
1412
_ => panic ! ( "Unexpected event {:?}" , events) ,
@@ -1428,7 +1427,7 @@ pub fn expect_pending_htlcs_forwardable_conditions(node: &Node, expected_failure
1428
1427
/// instead.
1429
1428
macro_rules! expect_pending_htlcs_forwardable_ignore {
1430
1429
( $node: expr) => {
1431
- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & [ ] ) ;
1430
+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & [ ] ) ;
1432
1431
}
1433
1432
}
1434
1433
@@ -1438,15 +1437,15 @@ macro_rules! expect_pending_htlcs_forwardable_ignore {
1438
1437
/// Don't use this, call [`expect_pending_htlcs_forwardable_conditions`] instead.
1439
1438
macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore {
1440
1439
( $node: expr, $expected_failures: expr) => {
1441
- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & $expected_failures) ;
1440
+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & $expected_failures) ;
1442
1441
}
1443
1442
}
1444
1443
1445
1444
#[ macro_export]
1446
1445
/// Handles a PendingHTLCsForwardable event
1447
1446
macro_rules! expect_pending_htlcs_forwardable {
1448
1447
( $node: expr) => { {
1449
- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & [ ] ) ;
1448
+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & [ ] ) ;
1450
1449
$node. node. process_pending_htlc_forwards( ) ;
1451
1450
1452
1451
// Ensure process_pending_htlc_forwards is idempotent.
@@ -1458,7 +1457,7 @@ macro_rules! expect_pending_htlcs_forwardable {
1458
1457
/// Handles a PendingHTLCsForwardable and HTLCHandlingFailed event
1459
1458
macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed {
1460
1459
( $node: expr, $expected_failures: expr) => { {
1461
- $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( & $node, & $expected_failures) ;
1460
+ $crate:: ln:: functional_test_utils:: expect_pending_htlcs_forwardable_conditions( $node. node . get_and_clear_pending_events ( ) , & $expected_failures) ;
1462
1461
$node. node. process_pending_htlc_forwards( ) ;
1463
1462
1464
1463
// Ensure process_pending_htlc_forwards is idempotent.
0 commit comments