Skip to content

Commit 6165853

Browse files
committed
f - use bool instead of test case number
1 parent 3d93a32 commit 6165853

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lightning/src/ln/async_signer_tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ fn test_async_commitment_signature_for_funding_signed() {
127127

128128
#[test]
129129
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);
132132
}
133133

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) {
135135
let chanmon_cfgs = create_chanmon_cfgs(2);
136136
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
137137
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_
164164
dst.node.handle_commitment_signed(&src.node.get_our_node_id(), &payment_event.commitment_msg);
165165
check_added_monitors(dst, 1);
166166

167-
if test_case == 0 {
167+
if enable_sign_counterparty_commit_first {
168168
// Unblock CS -> no messages should be sent, since we must send RAA first.
169169
dst.enable_channel_signer_op(&src.node.get_our_node_id(), &chan_id, SignerOp::SignCounterpartyCommitment);
170170
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_
175175
dst.enable_channel_signer_op(&src.node.get_our_node_id(), &chan_id, SignerOp::GetPerCommitmentPoint);
176176
dst.node.signer_unblocked(Some((src.node.get_our_node_id(), chan_id)));
177177
get_revoke_commit_msgs(&dst, &src.node.get_our_node_id());
178-
} else if test_case == 1 {
178+
} else {
179179
// Unblock revoke_and_ack -> we should send just RAA.
180180
dst.enable_channel_signer_op(&src.node.get_our_node_id(), &chan_id, SignerOp::GetPerCommitmentPoint);
181181
dst.node.signer_unblocked(Some((src.node.get_our_node_id(), chan_id)));

0 commit comments

Comments
 (0)