Skip to content

Commit 407c98a

Browse files
committed
Use submit_commit_miner_* fns and get_peer_info sans outer unwrap
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent e98c39c commit 407c98a

File tree

2 files changed

+297
-863
lines changed

2 files changed

+297
-863
lines changed

testnet/stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10776,16 +10776,6 @@ fn test_tenure_extend_from_flashblocks() {
1077610776
let btc_regtest_controller = &mut signer_test.running_nodes.btc_regtest_controller;
1077710777
let coord_channel = signer_test.running_nodes.coord_channel.clone();
1077810778
let counters = signer_test.running_nodes.counters.clone();
10779-
let nakamoto_test_skip_commit_op = signer_test
10780-
.running_nodes
10781-
.counters
10782-
.naka_skip_commit_op
10783-
.clone();
10784-
let nakamoto_miner_directives = signer_test
10785-
.running_nodes
10786-
.counters
10787-
.naka_miner_directives
10788-
.clone();
1078910779

1079010780
let tx_fee = 1_000;
1079110781

@@ -10839,7 +10829,7 @@ fn test_tenure_extend_from_flashblocks() {
1083910829
next_block_and_mine_commit(btc_regtest_controller, 60, &naka_conf, &counters).unwrap();
1084010830

1084110831
// prevent the miner from sending another block-commit
10842-
nakamoto_test_skip_commit_op.set(true);
10832+
counters.naka_skip_commit_op.set(true);
1084310833

1084410834
let info_before = get_chain_info(&naka_conf);
1084510835

@@ -10872,7 +10862,7 @@ fn test_tenure_extend_from_flashblocks() {
1087210862
// mine another Bitcoin block right away, and force it to be a flash block
1087310863
btc_regtest_controller.bootstrap_chain(1);
1087410864

10875-
let miner_directives_before = nakamoto_miner_directives.load(Ordering::SeqCst);
10865+
let miner_directives_before = counters.naka_miner_directives.load(Ordering::SeqCst);
1087610866

1087710867
// unblock the relayer so it can process the flash block sortition.
1087810868
// Given the above, this will be an `Extend` tenure.
@@ -10931,13 +10921,12 @@ fn test_tenure_extend_from_flashblocks() {
1093110921
}
1093210922

1093310923
// unstall miner thread and allow block-commits again
10934-
nakamoto_test_skip_commit_op.set(false);
10924+
counters.naka_skip_commit_op.set(false);
1093510925
TEST_MINE_STALL.set(false);
1093610926

1093710927
// wait for the miner directive to be processed
1093810928
wait_for(60, || {
10939-
let directives_cnt = nakamoto_miner_directives.load(Ordering::SeqCst);
10940-
Ok(directives_cnt > miner_directives_before)
10929+
Ok(counters.naka_miner_directives.load(Ordering::SeqCst) > miner_directives_before)
1094110930
})
1094210931
.unwrap();
1094310932

0 commit comments

Comments
 (0)