@@ -2640,29 +2640,6 @@ pub fn expect_htlc_forwarding_fails(
26402640 expect_htlc_failure_conditions ( events, expected_failure) ;
26412641}
26422642
2643- #[ macro_export]
2644- /// Performs the "commitment signed dance" - the series of message exchanges which occur after a
2645- /// commitment update.
2646- macro_rules! commitment_signed_dance {
2647- ( $node_a: expr, $node_b: expr, $commitment_signed: expr, $fail_backwards: expr, true /* skip last step */ , false /* return extra message */ , true /* return last RAA */ ) => { {
2648- $crate:: ln:: functional_test_utils:: check_added_monitors( & $node_a, 0 ) ;
2649- assert!( $node_a. node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
2650- $node_a. node. handle_commitment_signed_batch_test(
2651- $node_b. node. get_our_node_id( ) ,
2652- & $commitment_signed,
2653- ) ;
2654- check_added_monitors( & $node_a, 1 ) ;
2655- let ( extra_msg_option, bs_revoke_and_ack) =
2656- $crate:: ln:: functional_test_utils:: do_main_commitment_signed_dance(
2657- & $node_a,
2658- & $node_b,
2659- $fail_backwards,
2660- ) ;
2661- assert!( extra_msg_option. is_none( ) ) ;
2662- bs_revoke_and_ack
2663- } } ;
2664- }
2665-
26662643/// Runs the commitment_signed dance after the initial commitment_signed is delivered through to
26672644/// the initiator's `revoke_and_ack` response. i.e. [`do_main_commitment_signed_dance`] plus the
26682645/// `revoke_and_ack` response to it.
@@ -2724,6 +2701,22 @@ pub fn do_main_commitment_signed_dance(
27242701 ( extra_msg_option, bs_revoke_and_ack)
27252702}
27262703
2704+ pub fn commitment_signed_dance_return_raa (
2705+ node_a : & Node < ' _ , ' _ , ' _ > , node_b : & Node < ' _ , ' _ , ' _ > ,
2706+ commitment_signed : & Vec < msgs:: CommitmentSigned > , fail_backwards : bool ,
2707+ ) -> msgs:: RevokeAndACK {
2708+ check_added_monitors ( & node_a, 0 ) ;
2709+ assert ! ( node_a. node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
2710+ node_a
2711+ . node
2712+ . handle_commitment_signed_batch_test ( node_b. node . get_our_node_id ( ) , commitment_signed) ;
2713+ check_added_monitors ( & node_a, 1 ) ;
2714+ let ( extra_msg_option, bs_revoke_and_ack) =
2715+ do_main_commitment_signed_dance ( & node_a, & node_b, fail_backwards) ;
2716+ assert ! ( extra_msg_option. is_none( ) ) ;
2717+ bs_revoke_and_ack
2718+ }
2719+
27272720/// Runs a full commitment_signed dance, delivering a commitment_signed, the responding
27282721/// `revoke_and_ack` and `commitment_signed`, and then the final `revoke_and_ack` response.
27292722///
0 commit comments