Skip to content

Commit

Permalink
banking_stage: use iproduct! macro in test
Browse files Browse the repository at this point in the history
  • Loading branch information
AshwinSekar committed Oct 2, 2024
1 parent 9b5525d commit 8cc9c8c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/src/banking_stage/unprocessed_transaction_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ impl ThreadLocalUnprocessedPackets {
mod tests {
use {
super::*,
itertools::iproduct,
solana_ledger::genesis_utils::{create_genesis_config, GenesisConfigInfo},
solana_perf::packet::{Packet, PacketFlags},
solana_runtime::genesis_utils,
Expand Down Expand Up @@ -1273,10 +1274,10 @@ mod tests {
assert!(deserialized_packets.contains(&big_transfer));
}

for (vote_source, staked) in [VoteSource::Gossip, VoteSource::Tpu]
.into_iter()
.flat_map(|vs| [(vs, true), (vs, false)])
{
for (vote_source, staked) in iproduct!(
[VoteSource::Gossip, VoteSource::Tpu].into_iter(),
[true, false].into_iter()
) {
let latest_unprocessed_votes = LatestUnprocessedVotes::default();
if staked {
latest_unprocessed_votes.set_staked_nodes(&[keypair.pubkey()]);
Expand Down

0 comments on commit 8cc9c8c

Please sign in to comment.