@@ -127,11 +127,11 @@ fn test_async_commitment_signature_for_funding_signed() {
127
127
128
128
#[ test]
129
129
fn test_async_commitment_signature_for_commitment_signed ( ) {
130
- do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack ( 0 ) ;
131
- do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack ( 1 ) ;
130
+ do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack ( true ) ;
131
+ do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack ( false ) ;
132
132
}
133
133
134
- fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack ( test_case : u8 ) {
134
+ fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack ( enable_sign_counterparty_commit_first : bool ) {
135
135
let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
136
136
let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
137
137
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
@@ -164,7 +164,7 @@ fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(test_
164
164
dst. node . handle_commitment_signed ( & src. node . get_our_node_id ( ) , & payment_event. commitment_msg ) ;
165
165
check_added_monitors ( dst, 1 ) ;
166
166
167
- if test_case == 0 {
167
+ if enable_sign_counterparty_commit_first {
168
168
// Unblock CS -> no messages should be sent, since we must send RAA first.
169
169
dst. enable_channel_signer_op ( & src. node . get_our_node_id ( ) , & chan_id, SignerOp :: SignCounterpartyCommitment ) ;
170
170
dst. node . signer_unblocked ( Some ( ( src. node . get_our_node_id ( ) , chan_id) ) ) ;
@@ -175,7 +175,7 @@ fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(test_
175
175
dst. enable_channel_signer_op ( & src. node . get_our_node_id ( ) , & chan_id, SignerOp :: GetPerCommitmentPoint ) ;
176
176
dst. node . signer_unblocked ( Some ( ( src. node . get_our_node_id ( ) , chan_id) ) ) ;
177
177
get_revoke_commit_msgs ( & dst, & src. node . get_our_node_id ( ) ) ;
178
- } else if test_case == 1 {
178
+ } else {
179
179
// Unblock revoke_and_ack -> we should send just RAA.
180
180
dst. enable_channel_signer_op ( & src. node . get_our_node_id ( ) , & chan_id, SignerOp :: GetPerCommitmentPoint ) ;
181
181
dst. node . signer_unblocked ( Some ( ( src. node . get_our_node_id ( ) , chan_id) ) ) ;
0 commit comments