Skip to content

Commit

Permalink
Merge pull request #5689 from stacks-network/fix/get-latest-block-pro…
Browse files Browse the repository at this point in the history
…posal-tests

Fix get_latest_block_proposal function to return an err if no block proposals in list
  • Loading branch information
jferrant authored Jan 15, 2025
2 parents 6621956 + bdbebdc commit c4ef003
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion testnet/stacks-node/src/tests/nakamoto_integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,9 @@ pub fn get_latest_block_proposal(
info!("Consider block"; "signer_sighash" => %b.header.signer_signature_hash(), "is_latest_sortition" => is_latest, "chain_height" => b.header.chain_length);
}

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

let pubkey = StacksPublicKey::recover_to_pubkey(
proposed_block.header.miner_signature_hash().as_bytes(),
Expand Down

0 comments on commit c4ef003

Please sign in to comment.