Skip to content

Commit 7a73f92

Browse files
committed
Wait for a new block commit and don't use mine_commit fn
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 54777d3 commit 7a73f92

File tree

1 file changed

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

1 file changed

+8
-10
lines changed

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ 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, 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,
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,
6968
};
7069
use crate::tests::neon_integrations::{
7170
get_account, get_chain_info, next_block_and_wait, run_until_burnchain_height, submit_tx,
@@ -278,15 +277,14 @@ impl SignerTest<SpawnedSigner> {
278277

279278
self.run_until_epoch_3_boundary();
280279

280+
let commits_submitted = self.running_nodes.commits_submitted.clone();
281+
let commits_before = commits_submitted.load(Ordering::SeqCst);
281282
info!("Waiting 1 burnchain block for miner VRF key confirmation");
282283
// Wait one block to confirm the VRF register, wait until a block commit is submitted
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-
)
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 > commits_before)
287+
})
290288
.unwrap();
291289
info!("Ready to mine Nakamoto blocks!");
292290
}

0 commit comments

Comments
 (0)