Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: not all identities were being used to broadcast documents in strategy tests #1852

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/strategy-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use dpp::state_transition::data_contract_update_transition::methods::DataContrac
use operations::{DataContractUpdateAction, DataContractUpdateOp};
use platform_version::TryFromPlatformVersioned;
use rand::prelude::StdRng;
use rand::seq::SliceRandom;
use rand::seq::{IteratorRandom, SliceRandom};
use rand::Rng;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use bincode::{Decode, Encode};
Expand Down Expand Up @@ -569,7 +569,8 @@ impl Strategy {
document_type,
contract,
}) => {
// Get the first 10 identities who are eligible to submit documents for this contract
// Filter and collect eligible identities
// Eligible identities have less than 24 documents in the mempool for this contract
let first_10_eligible_identities: Vec<Identity> = current_identities
.iter()
.filter(|identity| {
Expand All @@ -578,9 +579,8 @@ impl Strategy {
.unwrap_or(&0)
< &24u64
})
.take(10)
.cloned()
shumkov marked this conversation as resolved.
Show resolved Hide resolved
.collect();
.choose_multiple(rng, 10);

if first_10_eligible_identities.len() == 0 {
tracing::warn!(
Expand Down
Loading