Skip to content

Commit

Permalink
feat: ensure new miner doesn't propose a block yet
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Oct 22, 2024
1 parent e8a5673 commit 09f3546
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions testnet/stacks-node/src/tests/signer/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,11 @@ fn miner_wait_for_proposal() {
})
.expect("Timed out waiting for block proposal");

let proposals_before = signer_test
.running_nodes
.nakamoto_blocks_proposed
.load(Ordering::SeqCst);

let mut block_proposal: Option<BlockProposal> = None;

wait_for(30, || {
Expand Down Expand Up @@ -737,6 +742,16 @@ fn miner_wait_for_proposal() {

TEST_IGNORE_ALL_BLOCK_PROPOSALS.lock().unwrap().take();

// Ensure that the new miner hasn't proposed any blocks yet
wait_for(10, || {
Ok(signer_test
.running_nodes
.nakamoto_blocks_proposed
.load(Ordering::SeqCst)
> proposals_before)
})
.expect_err("New miner proposed a block before we expected");

// Now, generate a block response for each signer
signer_test.spawned_signers.iter().for_each(|signer| {
let sk = signer.config.stacks_private_key;
Expand Down

0 comments on commit 09f3546

Please sign in to comment.