Skip to content

Commit

Permalink
fix test assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
kantai committed Sep 26, 2024
1 parent 419ce43 commit 6a3746c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions testnet/stacks-node/src/tests/signer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
) -> Result<(), String> {
wait_for(timeout_secs, || {
let stackerdb_events = test_observer::get_stackerdb_chunks();
let block_rejections = stackerdb_events
let block_rejections: HashSet<_> = stackerdb_events
.into_iter()
.flat_map(|chunk| chunk.modified_slots)
.filter_map(|chunk| {
Expand All @@ -739,16 +739,17 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
.recover_public_key()
.expect("Failed to recover public key from rejection");
if expected_signers.contains(&rejected_pubkey) {
Some(rejection)
Some(rejected_pubkey)
} else {
None
}
}
_ => None,
}
})
.collect::<Vec<_>>();
Ok(block_rejections.len() == expected_signers.len())
.collect();
info!("Checking block rejections"; "rejected_len" => block_rejections.len(), "expected_len" => expected_signers.len());
Ok(block_rejections.len() >= expected_signers.len())
})
}
}
Expand Down

0 comments on commit 6a3746c

Please sign in to comment.