Skip to content

Commit c4ef003

Browse files
authored
Merge pull request #5689 from stacks-network/fix/get-latest-block-proposal-tests
Fix get_latest_block_proposal function to return an err if no block proposals in list
2 parents 6621956 + bdbebdc commit c4ef003

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,9 @@ pub fn get_latest_block_proposal(
457457
info!("Consider block"; "signer_sighash" => %b.header.signer_signature_hash(), "is_latest_sortition" => is_latest, "chain_height" => b.header.chain_length);
458458
}
459459

460-
let (proposed_block, miner_addr, _) = proposed_blocks.pop().unwrap();
460+
let Some((proposed_block, miner_addr, _)) = proposed_blocks.pop() else {
461+
return Err("No block proposals found".into());
462+
};
461463

462464
let pubkey = StacksPublicKey::recover_to_pubkey(
463465
proposed_block.header.miner_signature_hash().as_bytes(),

0 commit comments

Comments
 (0)