Skip to content

Commit c0c7afb

Browse files
committed
f retain non-Node Node compat
1 parent 4b941ea commit c0c7afb

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ impl SendEvent {
13971397
/// Don't use this, use the identically-named function instead.
13981398
macro_rules! expect_pending_htlcs_forwardable_conditions {
13991399
($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);
14011401
}
14021402
}
14031403

@@ -1416,11 +1416,10 @@ macro_rules! expect_htlc_handling_failed_destinations {
14161416
}}
14171417
}
14181418

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
14211421
/// `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]) {
14241423
match events[0] {
14251424
Event::PendingHTLCsForwardable { .. } => { },
14261425
_ => panic!("Unexpected event {:?}", events),
@@ -1441,7 +1440,7 @@ pub fn expect_pending_htlcs_forwardable_conditions(node: &Node, expected_failure
14411440
/// instead.
14421441
macro_rules! expect_pending_htlcs_forwardable_ignore {
14431442
($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(), &[]);
14451444
}
14461445
}
14471446

@@ -1451,15 +1450,15 @@ macro_rules! expect_pending_htlcs_forwardable_ignore {
14511450
/// Don't use this, call [`expect_pending_htlcs_forwardable_conditions`] instead.
14521451
macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore {
14531452
($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);
14551454
}
14561455
}
14571456

14581457
#[macro_export]
14591458
/// Handles a PendingHTLCsForwardable event
14601459
macro_rules! expect_pending_htlcs_forwardable {
14611460
($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(), &[]);
14631462
$node.node.process_pending_htlc_forwards();
14641463

14651464
// Ensure process_pending_htlc_forwards is idempotent.
@@ -1471,7 +1470,7 @@ macro_rules! expect_pending_htlcs_forwardable {
14711470
/// Handles a PendingHTLCsForwardable and HTLCHandlingFailed event
14721471
macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed {
14731472
($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);
14751474
$node.node.process_pending_htlc_forwards();
14761475

14771476
// Ensure process_pending_htlc_forwards is idempotent.

0 commit comments

Comments
 (0)