We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e2d60e commit 82313d3Copy full SHA for 82313d3
stackslib/src/chainstate/stacks/tests/mod.rs
@@ -521,18 +521,14 @@ impl TestStacksNode {
521
fork_tip: &BlockSnapshot,
522
miner: &TestMiner,
523
) -> Option<BlockSnapshot> {
524
- for commit_op in miner.block_commits.iter().rev() {
525
- if let Some(sn) = SortitionDB::get_block_snapshot_for_winning_stacks_block(
+ miner.block_commits.iter().rev().find_map(|commit_op| {
+ SortitionDB::get_block_snapshot_for_winning_stacks_block(
526
ic,
527
&fork_tip.sortition_id,
528
&commit_op.block_header_hash,
529
)
530
.unwrap()
531
- {
532
- return Some(sn);
533
- }
534
535
- return None;
+ })
536
}
537
538
pub fn get_miner_balance(clarity_tx: &mut ClarityTx, addr: &StacksAddress) -> u128 {
0 commit comments