Skip to content

Commit

Permalink
Add some logging to bitcoind test
Browse files Browse the repository at this point in the history
Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
  • Loading branch information
jferrant committed Sep 30, 2024
1 parent 065a89b commit fdcfcdf
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions testnet/stacks-node/src/tests/signer/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,8 +1227,9 @@ fn bitcoind_forking_test() {
let pre_epoch_3_nonce = get_account(&http_origin, &miner_address).nonce;
let pre_fork_tenures = 10;

for _i in 0..pre_fork_tenures {
let _mined_block = signer_test.mine_nakamoto_block(Duration::from_secs(30));
for i in 0..pre_fork_tenures {
debug!("Mining pre-fork tenure {} of {pre_fork_tenures}", i + 1);
signer_test.mine_nakamoto_block(Duration::from_secs(30));
}

let pre_fork_1_nonce = get_account(&http_origin, &miner_address).nonce;
Expand All @@ -1255,7 +1256,11 @@ fn bitcoind_forking_test() {
thread::sleep(Duration::from_secs(15));

// we need to mine some blocks to get back to being considered a frequent miner
for _i in 0..3 {
for i in 0..3 {
debug!(
"Mining block {} of 3 to be considered a frequent miner",
i + 1
);
let commits_count = signer_test
.running_nodes
.commits_submitted
Expand All @@ -1278,7 +1283,8 @@ fn bitcoind_forking_test() {

assert_eq!(post_fork_1_nonce, pre_fork_1_nonce - 1 * 2);

for _i in 0..5 {
for i in 0..5 {
debug!("Mining post-fork tenure {} of 5", i + 1);
signer_test.mine_nakamoto_block(Duration::from_secs(30));
}

Expand Down Expand Up @@ -1310,7 +1316,11 @@ fn bitcoind_forking_test() {
thread::sleep(Duration::from_secs(15));

// we need to mine some blocks to get back to being considered a frequent miner
for _i in 0..3 {
for i in 0..3 {
debug!(
"Mining block {} of 3 to be considered a frequent miner",
i + 1
);
let commits_count = signer_test
.running_nodes
.commits_submitted
Expand All @@ -1333,7 +1343,8 @@ fn bitcoind_forking_test() {

assert_eq!(post_fork_2_nonce, pre_fork_2_nonce - 4 * 2);

for _i in 0..5 {
for i in 0..5 {
debug!("Mining post-fork tenure {} of 5", i + 1);
signer_test.mine_nakamoto_block(Duration::from_secs(30));
}

Expand Down

0 comments on commit fdcfcdf

Please sign in to comment.