Skip to content

Commit 6def325

Browse files
committed
f retain non-Node Node compat
1 parent a5c3342 commit 6def325

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
@@ -1384,7 +1384,7 @@ impl SendEvent {
13841384
/// Don't use this, use the identically-named function instead.
13851385
macro_rules! expect_pending_htlcs_forwardable_conditions {
13861386
($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);
13881388
}
13891389
}
13901390

@@ -1403,11 +1403,10 @@ macro_rules! expect_htlc_handling_failed_destinations {
14031403
}}
14041404
}
14051405

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
14081408
/// `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]) {
14111410
match events[0] {
14121411
Event::PendingHTLCsForwardable { .. } => { },
14131412
_ => panic!("Unexpected event {:?}", events),
@@ -1428,7 +1427,7 @@ pub fn expect_pending_htlcs_forwardable_conditions(node: &Node, expected_failure
14281427
/// instead.
14291428
macro_rules! expect_pending_htlcs_forwardable_ignore {
14301429
($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(), &[]);
14321431
}
14331432
}
14341433

@@ -1438,15 +1437,15 @@ macro_rules! expect_pending_htlcs_forwardable_ignore {
14381437
/// Don't use this, call [`expect_pending_htlcs_forwardable_conditions`] instead.
14391438
macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore {
14401439
($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);
14421441
}
14431442
}
14441443

14451444
#[macro_export]
14461445
/// Handles a PendingHTLCsForwardable event
14471446
macro_rules! expect_pending_htlcs_forwardable {
14481447
($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(), &[]);
14501449
$node.node.process_pending_htlc_forwards();
14511450

14521451
// Ensure process_pending_htlc_forwards is idempotent.
@@ -1458,7 +1457,7 @@ macro_rules! expect_pending_htlcs_forwardable {
14581457
/// Handles a PendingHTLCsForwardable and HTLCHandlingFailed event
14591458
macro_rules! expect_pending_htlcs_forwardable_and_htlc_handling_failed {
14601459
($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);
14621461
$node.node.process_pending_htlc_forwards();
14631462

14641463
// Ensure process_pending_htlc_forwards is idempotent.

0 commit comments

Comments
 (0)