Skip to content

Commit

Permalink
f - use bool instead of test case number
Browse files Browse the repository at this point in the history
  • Loading branch information
alecchendev committed Jul 12, 2024
1 parent ec37b47 commit 3340a73
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lightning/src/ln/async_signer_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ fn test_async_commitment_signature_for_funding_signed() {

#[test]
fn test_async_commitment_signature_for_commitment_signed() {
do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(0);
do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(1);
do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(true);
do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(false);
}

fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(test_case: u8) {
fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(enable_sign_counterparty_commit_first: bool) {
let chanmon_cfgs = create_chanmon_cfgs(2);
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
Expand Down Expand Up @@ -164,7 +164,7 @@ fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(test_
dst.node.handle_commitment_signed(&src.node.get_our_node_id(), &payment_event.commitment_msg);
check_added_monitors(dst, 1);

if test_case == 0 {
if enable_sign_counterparty_commit_first {
// Unblock CS -> no messages should be sent, since we must send RAA first.
dst.enable_channel_signer_op(&src.node.get_our_node_id(), &chan_id, SignerOp::SignCounterpartyCommitment);
dst.node.signer_unblocked(Some((src.node.get_our_node_id(), chan_id)));
Expand All @@ -175,7 +175,7 @@ fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(test_
dst.enable_channel_signer_op(&src.node.get_our_node_id(), &chan_id, SignerOp::GetPerCommitmentPoint);
dst.node.signer_unblocked(Some((src.node.get_our_node_id(), chan_id)));
get_revoke_commit_msgs(&dst, &src.node.get_our_node_id());
} else if test_case == 1 {
} else {
// Unblock revoke_and_ack -> we should send just RAA.
dst.enable_channel_signer_op(&src.node.get_our_node_id(), &chan_id, SignerOp::GetPerCommitmentPoint);
dst.node.signer_unblocked(Some((src.node.get_our_node_id(), chan_id)));
Expand Down

0 comments on commit 3340a73

Please sign in to comment.