Skip to content

Commit 54777d3

Browse files
committed
Wait for a new block commit. Not just 1 commit
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent b8e17c8 commit 54777d3

File tree

1 file changed

+10
-8
lines changed
  • testnet/stacks-node/src/tests/signer

1 file changed

+10
-8
lines changed

testnet/stacks-node/src/tests/signer/v0.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ use crate::nakamoto_node::sign_coordinator::TEST_IGNORE_SIGNERS;
6363
use crate::neon::Counters;
6464
use crate::run_loop::boot_nakamoto;
6565
use crate::tests::nakamoto_integrations::{
66-
boot_to_epoch_25, boot_to_epoch_3_reward_set, next_block_and, setup_epoch_3_reward_set,
67-
wait_for, POX_4_DEFAULT_STACKER_BALANCE, POX_4_DEFAULT_STACKER_STX_AMT,
66+
boot_to_epoch_25, boot_to_epoch_3_reward_set, next_block_and, next_block_and_mine_commit,
67+
setup_epoch_3_reward_set, wait_for, POX_4_DEFAULT_STACKER_BALANCE,
68+
POX_4_DEFAULT_STACKER_STX_AMT,
6869
};
6970
use crate::tests::neon_integrations::{
7071
get_account, get_chain_info, next_block_and_wait, run_until_burnchain_height, submit_tx,
@@ -277,14 +278,15 @@ impl SignerTest<SpawnedSigner> {
277278

278279
self.run_until_epoch_3_boundary();
279280

280-
let commits_submitted = self.running_nodes.commits_submitted.clone();
281-
282281
info!("Waiting 1 burnchain block for miner VRF key confirmation");
283282
// Wait one block to confirm the VRF register, wait until a block commit is submitted
284-
next_block_and(&mut self.running_nodes.btc_regtest_controller, 60, || {
285-
let commits_count = commits_submitted.load(Ordering::SeqCst);
286-
Ok(commits_count >= 1)
287-
})
283+
let commits_submitted = self.running_nodes.commits_submitted.clone();
284+
next_block_and_mine_commit(
285+
&mut self.running_nodes.btc_regtest_controller,
286+
30,
287+
&self.running_nodes.coord_channel,
288+
&commits_submitted,
289+
)
288290
.unwrap();
289291
info!("Ready to mine Nakamoto blocks!");
290292
}

0 commit comments

Comments
 (0)