@@ -3404,7 +3404,7 @@ fn tx_replay_rejected_when_forking_across_reward_cycle() {
3404
3404
let sender_addr = tests::to_addr(&sender_sk);
3405
3405
let send_amt = 100;
3406
3406
let send_fee = 180;
3407
- let mut signer_test: SignerTest<SpawnedSigner> = SignerTest::new_with_config_modifications(
3407
+ let signer_test: SignerTest<SpawnedSigner> = SignerTest::new_with_config_modifications(
3408
3408
num_signers,
3409
3409
vec![(sender_addr, (send_amt + send_fee) * 10)],
3410
3410
|_| {},
@@ -3416,10 +3416,9 @@ fn tx_replay_rejected_when_forking_across_reward_cycle() {
3416
3416
);
3417
3417
let conf = signer_test.running_nodes.conf.clone();
3418
3418
let http_origin = format!("http://{}", &conf.node.rpc_bind);
3419
- let burn_chain = signer_test
3420
- .running_nodes
3421
- .btc_regtest_controller
3422
- .get_burnchain();
3419
+ let btc_controller = &signer_test.running_nodes.btc_regtest_controller;
3420
+ let burn_chain = btc_controller.get_burnchain();
3421
+ let counters = &signer_test.running_nodes.counters;
3423
3422
3424
3423
signer_test.boot_to_epoch_3();
3425
3424
info!("------------------------- Reached Epoch 3.0 -------------------------");
@@ -3465,7 +3464,6 @@ fn tx_replay_rejected_when_forking_across_reward_cycle() {
3465
3464
3466
3465
info!("----- Trigger Bitcoin fork -----");
3467
3466
//Fork on the third-to-last tenure of prev reward cycle
3468
- let btc_controller = &signer_test.running_nodes.btc_regtest_controller;
3469
3467
let burn_block_hash_to_fork = btc_controller.get_block_hash(new_burn_block_height - 2);
3470
3468
btc_controller.invalidate_block(&burn_block_hash_to_fork);
3471
3469
btc_controller.build_next_block(3);
@@ -3475,27 +3473,19 @@ fn tx_replay_rejected_when_forking_across_reward_cycle() {
3475
3473
3476
3474
//mine throught the fork (just check commits because of naka block mining stalled)
3477
3475
TEST_MINE_STALL.set(true);
3478
- let submitted_commits = signer_test
3479
- .running_nodes
3480
- .counters
3481
- .naka_submitted_commits
3482
- .clone();
3483
3476
3477
+ let submitted_commits = counters.naka_submitted_commits.clone();
3484
3478
for i in 0..3 {
3485
3479
let current_burn_height = get_chain_info(&signer_test.running_nodes.conf).burn_block_height;
3486
3480
info!(
3487
3481
"Mining block #{i} to be considered a frequent miner";
3488
3482
"current_burn_height" => current_burn_height,
3489
3483
);
3490
3484
let commits_count = submitted_commits.load(Ordering::SeqCst);
3491
- next_block_and(
3492
- &mut signer_test.running_nodes.btc_regtest_controller,
3493
- 60,
3494
- || {
3495
- let commits_submitted = submitted_commits.load(Ordering::SeqCst);
3496
- Ok(commits_submitted > commits_count)
3497
- },
3498
- )
3485
+ next_block_and(btc_controller, 60, || {
3486
+ let commits_submitted = submitted_commits.load(Ordering::SeqCst);
3487
+ Ok(commits_submitted > commits_count)
3488
+ })
3499
3489
.unwrap();
3500
3490
}
3501
3491
0 commit comments