Skip to content

Commit

Permalink
change to 10 eligible identities and add warning if there are 0
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldelucia committed May 20, 2024
1 parent fc5c7b8 commit f15725b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/strategy-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,24 +569,31 @@ impl Strategy {
document_type,
contract,
}) => {
// Get the first 3 identities who are eligible to submit documents for this contract
let first_3_eligible_identities: Vec<Identity> = current_identities
// Get the first 10 identities who are eligible to submit documents for this contract
let first_10_eligible_identities: Vec<Identity> = current_identities
.iter()
.filter(|identity| {
mempool_document_counter
.get(&(identity.id(), contract.id()))
.unwrap_or(&0)
< &24u64
})
.take(3)
.take(10)
.cloned()
.collect();

if first_10_eligible_identities.len() == 0 {
tracing::warn!(
"No eligible identities to submit a document to contract {}",
contract.id().to_string(Encoding::Base64)
);
}

// TO-DO: these documents should be created according to the data contract's validation rules
let documents = document_type
.random_documents_with_params(
count as u32,
&first_3_eligible_identities,
&first_10_eligible_identities,
Some(block_info.time_ms),
Some(block_info.height),
Some(block_info.core_height),
Expand Down

0 comments on commit f15725b

Please sign in to comment.