Skip to content

Commit 6046807

Browse files
committed
Update tests/signer/commands for logging with info!
1 parent 7ddadb4 commit 6046807

File tree

9 files changed

+32
-32
lines changed

9 files changed

+32
-32
lines changed

testnet/stacks-node/src/tests/signer/commands/block_commit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ impl SubmitBlockCommitSecondaryMinerCommand {
1616

1717
impl Command<SignerTestState, SignerTestContext> for SubmitBlockCommitSecondaryMinerCommand {
1818
fn check(&self, state: &SignerTestState) -> bool {
19-
println!(
19+
info!(
2020
"Checking: Submitting block commit miner 2. Result: {:?}",
2121
state.is_secondary_miner_skip_commit_op
2222
);
2323
state.is_secondary_miner_skip_commit_op
2424
}
2525

2626
fn apply(&self, _state: &mut SignerTestState) {
27-
println!("Applying: Submitting block commit miner 2");
27+
info!("Applying: Submitting block commit miner 2");
2828

2929
let (conf_1, _) = self.miners.lock().unwrap().get_node_configs();
3030
let burnchain = conf_1.get_burnchain();
@@ -58,15 +58,15 @@ impl SubmitBlockCommitPrimaryMinerCommand {
5858

5959
impl Command<SignerTestState, SignerTestContext> for SubmitBlockCommitPrimaryMinerCommand {
6060
fn check(&self, state: &SignerTestState) -> bool {
61-
println!(
61+
info!(
6262
"Checking: Submitting block commit miner 1. Result: {:?}",
6363
state.is_primary_miner_skip_commit_op
6464
);
6565
state.is_primary_miner_skip_commit_op
6666
}
6767

6868
fn apply(&self, _state: &mut SignerTestState) {
69-
println!("Applying: Submitting block commit miner 1");
69+
info!("Applying: Submitting block commit miner 1");
7070

7171
let (conf_1, _) = self.miners.lock().unwrap().get_node_configs();
7272
let burnchain = conf_1.get_burnchain();

testnet/stacks-node/src/tests/signer/commands/block_wait.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ impl WaitForBlockFromMiner1Command {
1616

1717
impl Command<SignerTestState, SignerTestContext> for WaitForBlockFromMiner1Command {
1818
fn check(&self, state: &SignerTestState) -> bool {
19-
println!(
19+
info!(
2020
"Checking: Waiting for Nakamoto block from miner 1. Result: {:?}",
2121
!state.mining_stalled
2222
);
2323
!state.mining_stalled
2424
}
2525

2626
fn apply(&self, _state: &mut SignerTestState) {
27-
println!("Applying: Waiting for Nakamoto block from miner 1");
27+
info!("Applying: Waiting for Nakamoto block from miner 1");
2828

2929
let miners_arc = self.miners.clone();
3030

@@ -40,7 +40,7 @@ impl Command<SignerTestState, SignerTestContext> for WaitForBlockFromMiner1Comma
4040
.load(Ordering::SeqCst);
4141
let expected_height = last_confirmed_height + 1;
4242

43-
println!(
43+
info!(
4444
"Waiting for Nakamoto block {} pushed by miner 1",
4545
expected_height
4646
);
@@ -74,15 +74,15 @@ impl WaitForBlockFromMiner2Command {
7474

7575
impl Command<SignerTestState, SignerTestContext> for WaitForBlockFromMiner2Command {
7676
fn check(&self, state: &SignerTestState) -> bool {
77-
println!(
77+
info!(
7878
"Checking: Waiting for Nakamoto block from miner 2. Result: {:?}",
7979
!state.mining_stalled
8080
);
8181
!state.mining_stalled
8282
}
8383

8484
fn apply(&self, _state: &mut SignerTestState) {
85-
println!("Applying: Waiting for Nakamoto block from miner 2");
85+
info!("Applying: Waiting for Nakamoto block from miner 2");
8686

8787
let miners_arc = self.miners.clone();
8888

@@ -98,7 +98,7 @@ impl Command<SignerTestState, SignerTestContext> for WaitForBlockFromMiner2Comma
9898
.load(Ordering::SeqCst);
9999
let expected_stacks_height = last_confirmed_height + 1;
100100

101-
println!(
101+
info!(
102102
"Waiting for Nakamoto block {} pushed by miner 2",
103103
expected_stacks_height
104104
);

testnet/stacks-node/src/tests/signer/commands/boot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ impl BootToEpoch3 {
1616

1717
impl Command<SignerTestState, SignerTestContext> for BootToEpoch3 {
1818
fn check(&self, state: &SignerTestState) -> bool {
19-
println!(
19+
info!(
2020
"Checking: Booting miners to Nakamoto. Result: {:?}",
2121
!state.is_booted_to_nakamoto
2222
);
2323
!state.is_booted_to_nakamoto
2424
}
2525

2626
fn apply(&self, state: &mut SignerTestState) {
27-
println!("Applying: Booting miners to Nakamoto");
27+
info!("Applying: Booting miners to Nakamoto");
2828

2929
self.miners.lock().unwrap().boot_to_epoch_3();
3030

testnet/stacks-node/src/tests/signer/commands/commit_ops.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ impl SkipCommitOpPrimaryMiner {
1818

1919
impl Command<SignerTestState, SignerTestContext> for SkipCommitOpPrimaryMiner {
2020
fn check(&self, state: &SignerTestState) -> bool {
21-
println!(
21+
info!(
2222
"Checking: Skipping commit operations for miner 1. Result: {:?}",
2323
!state.is_primary_miner_skip_commit_op
2424
);
2525
!state.is_primary_miner_skip_commit_op
2626
}
2727

2828
fn apply(&self, state: &mut SignerTestState) {
29-
println!("Applying: Skipping commit operations for miner 1");
29+
info!("Applying: Skipping commit operations for miner 1");
3030

3131
self.miner_1_skip_commit_flag.set(true);
3232

@@ -60,15 +60,15 @@ impl SkipCommitOpSecondaryMiner {
6060

6161
impl Command<SignerTestState, SignerTestContext> for SkipCommitOpSecondaryMiner {
6262
fn check(&self, state: &SignerTestState) -> bool {
63-
println!(
63+
info!(
6464
"Checking: Skipping commit operations for miner 2. Result: {:?}",
6565
!state.is_secondary_miner_skip_commit_op
6666
);
6767
!state.is_secondary_miner_skip_commit_op
6868
}
6969

7070
fn apply(&self, state: &mut SignerTestState) {
71-
println!("Applying: Skipping commit operations for miner 2");
71+
info!("Applying: Skipping commit operations for miner 2");
7272

7373
self.miner_2_skip_commit_flag.set(true);
7474

testnet/stacks-node/src/tests/signer/commands/mining.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ impl Command<SignerTestState, SignerTestContext>
2222
for MineBitcoinBlockTenureChangePrimaryMinerCommand
2323
{
2424
fn check(&self, state: &SignerTestState) -> bool {
25-
println!(
25+
info!(
2626
"Checking: Miner 1 mining Bitcoin block and tenure change tx. Result: {:?}",
2727
state.is_booted_to_nakamoto
2828
);
2929
state.is_booted_to_nakamoto
3030
}
3131

3232
fn apply(&self, _state: &mut SignerTestState) {
33-
println!("Applying: Miner 1 mining Bitcoin block and tenure change tx");
33+
info!("Applying: Miner 1 mining Bitcoin block and tenure change tx");
3434

3535
let (stacks_height_before, conf_1, miner_pk_1) = {
3636
let mut miners = self.miners.lock().unwrap();
@@ -48,7 +48,7 @@ impl Command<SignerTestState, SignerTestContext>
4848
(stacks_height_before, conf_1, miner_pk_1)
4949
};
5050

51-
println!(
51+
info!(
5252
"Waiting for Nakamoto block {} pushed by miner 1",
5353
stacks_height_before + 1
5454
);
@@ -96,15 +96,15 @@ impl Command<SignerTestState, SignerTestContext>
9696
for MineBitcoinBlockTenureChangeSecondaryMinerCommand
9797
{
9898
fn check(&self, state: &SignerTestState) -> bool {
99-
println!(
99+
info!(
100100
"Checking: Miner 2 mining Bitcoin block and tenure change tx. Result: {:?}",
101101
state.is_booted_to_nakamoto
102102
);
103103
state.is_booted_to_nakamoto
104104
}
105105

106106
fn apply(&self, _state: &mut SignerTestState) {
107-
println!("Applying: Miner 2 mining Bitcoin block and tenure change tx");
107+
info!("Applying: Miner 2 mining Bitcoin block and tenure change tx");
108108

109109
let stacks_height_before = self.miners.lock().unwrap().get_peer_stacks_tip_height();
110110

@@ -119,7 +119,7 @@ impl Command<SignerTestState, SignerTestContext>
119119

120120
let (_, miner_pk_2) = self.miners.lock().unwrap().get_miner_public_keys();
121121

122-
println!(
122+
info!(
123123
"Waiting for Nakamoto block {} pushed by miner 2",
124124
stacks_height_before + 1
125125
);

testnet/stacks-node/src/tests/signer/commands/shutdown.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ impl ShutdownMinersCommand {
1616

1717
impl Command<SignerTestState, SignerTestContext> for ShutdownMinersCommand {
1818
fn check(&self, _state: &SignerTestState) -> bool {
19-
println!("Checking: Shutting down miners. Result: {:?}", true);
19+
info!("Checking: Shutting down miners. Result: {:?}", true);
2020
true
2121
}
2222

2323
fn apply(&self, _state: &mut SignerTestState) {
24-
println!("Applying: Shutting down miners");
24+
info!("Applying: Shutting down miners");
2525

2626
if let Ok(miners_arc) = Arc::try_unwrap(self.miners.clone()) {
2727
if let Ok(miners) = miners_arc.into_inner() {

testnet/stacks-node/src/tests/signer/commands/stalling.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ pub struct StallMiningCommand;
77

88
impl Command<SignerTestState, SignerTestContext> for StallMiningCommand {
99
fn check(&self, state: &SignerTestState) -> bool {
10-
println!(
10+
info!(
1111
"Checking: Stalling mining. Result: {:?}",
1212
!state.mining_stalled
1313
);
1414
!state.mining_stalled
1515
}
1616

1717
fn apply(&self, state: &mut SignerTestState) {
18-
println!("Applying: Stalling mining");
18+
info!("Applying: Stalling mining");
1919
crate::tests::signer::v0::test_mine_stall_set(true);
2020
state.mining_stalled = true;
2121
}
@@ -35,15 +35,15 @@ pub struct RecoverFromStallCommand;
3535

3636
impl Command<SignerTestState, SignerTestContext> for RecoverFromStallCommand {
3737
fn check(&self, state: &SignerTestState) -> bool {
38-
println!(
38+
info!(
3939
"Checking: Recovering from mining stall. Result: {:?}",
4040
state.mining_stalled
4141
);
4242
state.mining_stalled
4343
}
4444

4545
fn apply(&self, state: &mut SignerTestState) {
46-
println!("Applying: Recovering from mining stall");
46+
info!("Applying: Recovering from mining stall");
4747
crate::tests::signer::v0::test_mine_stall_set(false);
4848
state.mining_stalled = false;
4949
}

testnet/stacks-node/src/tests/signer/commands/tenure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ impl MineTenureCommand {
2020

2121
impl Command<SignerTestState, SignerTestContext> for MineTenureCommand {
2222
fn check(&self, _state: &SignerTestState) -> bool {
23-
println!("Checking: Mining tenure. Result: {:?}", true);
23+
info!("Checking: Mining tenure. Result: {:?}", true);
2424
true
2525
}
2626

2727
fn apply(&self, _state: &mut SignerTestState) {
28-
println!(
28+
info!(
2929
"Applying: Mining tenure and waiting for it for {:?} seconds",
3030
self.timeout_secs
3131
);

testnet/stacks-node/src/tests/signer/commands/transfer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ impl SendTransferTxCommand {
1616

1717
impl Command<SignerTestState, SignerTestContext> for SendTransferTxCommand {
1818
fn check(&self, _state: &SignerTestState) -> bool {
19-
println!("Checking: Sending transfer tx. Result: {:?}", true);
19+
info!("Checking: Sending transfer tx. Result: {:?}", true);
2020
true
2121
}
2222

2323
fn apply(&self, _state: &mut SignerTestState) {
24-
println!("Applying: Sending transfer tx");
24+
info!("Applying: Sending transfer tx");
2525

2626
self.miners.lock().unwrap().send_transfer_tx();
2727
}

0 commit comments

Comments
 (0)