Skip to content

Commit 021d503

Browse files
committed
Use commitment_signed_dance_through_cp_raa instead of macro
Replace calls to `commitment_signed_dance` macro to instead call `commitment_signed_dance_through_cp_raa`.
1 parent b675324 commit 021d503

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

lightning/src/ln/blinded_payment_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
10271027
check_added_monitors!(nodes[2], 1);
10281028

10291029
nodes[2].node.handle_shutdown(nodes[1].node.get_our_node_id(), &node_1_shutdown);
1030-
commitment_signed_dance!(nodes[2], nodes[1], (), false, true, false, false);
1030+
assert!(commitment_signed_dance_through_cp_raa(&nodes[2], &nodes[1], false, false).is_none());
10311031
expect_and_process_pending_htlcs(&nodes[2], false);
10321032
expect_htlc_handling_failed_destinations!(nodes[2].node.get_and_clear_pending_events(), &[HTLCHandlingFailureType::Receive { payment_hash }]);
10331033
check_added_monitors(&nodes[2], 1);

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2826,8 +2826,7 @@ fn do_channel_holding_cell_serialize(disconnect: bool, reload_a: bool) {
28262826
expect_payment_claimable!(nodes[1], payment_hash_1, payment_secret_1, 100000);
28272827
check_added_monitors!(nodes[1], 1);
28282828

2829-
commitment_signed_dance!(nodes[1], nodes[0], (), false, true, false, false);
2830-
2829+
assert!(commitment_signed_dance_through_cp_raa(&nodes[1], &nodes[0], false, false).is_none());
28312830
let events = nodes[1].node.get_and_clear_pending_events();
28322831
assert_eq!(events.len(), 1);
28332832
match events[0] {

lightning/src/ln/functional_test_utils.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,15 +2661,6 @@ macro_rules! commitment_signed_dance {
26612661
assert!(extra_msg_option.is_none());
26622662
bs_revoke_and_ack
26632663
}};
2664-
($node_a: expr, $node_b: expr, (), $fail_backwards: expr, true /* skip last step */, false /* no extra message */, $incl_claim: expr) => {
2665-
assert!($crate::ln::functional_test_utils::commitment_signed_dance_through_cp_raa(
2666-
&$node_a,
2667-
&$node_b,
2668-
$fail_backwards,
2669-
$incl_claim
2670-
)
2671-
.is_none());
2672-
};
26732664
}
26742665

26752666
/// Runs the commitment_signed dance after the initial commitment_signed is delivered through to
@@ -2755,7 +2746,9 @@ pub fn do_commitment_signed_dance(
27552746
if fail_backwards {
27562747
assert!(!got_claim);
27572748
}
2758-
commitment_signed_dance!(node_a, node_b, (), fail_backwards, true, false, got_claim);
2749+
assert!(
2750+
commitment_signed_dance_through_cp_raa(node_a, node_b, fail_backwards, got_claim).is_none()
2751+
);
27592752

27602753
if skip_last_step {
27612754
return;

lightning/src/ln/shutdown_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ fn do_htlc_fail_async_shutdown(blinded_recipient: bool) {
566566
nodes[1].node.handle_commitment_signed_batch_test(node_a_id, &updates.commitment_signed);
567567
check_added_monitors!(nodes[1], 1);
568568
nodes[1].node.handle_shutdown(node_a_id, &node_0_shutdown);
569-
commitment_signed_dance!(nodes[1], nodes[0], (), false, true, false, false);
569+
assert!(commitment_signed_dance_through_cp_raa(&nodes[1], &nodes[0], false, false).is_none());
570570
expect_and_process_pending_htlcs(&nodes[1], false);
571571
expect_htlc_handling_failed_destinations!(
572572
nodes[1].node.get_and_clear_pending_events(),

0 commit comments

Comments
 (0)