Skip to content
Merged
Changes from all 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
13 changes: 10 additions & 3 deletions pkgs/id/tests/tag_claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,16 @@ fn history(seed: u64, steps: usize, count: usize) -> History {
continue;
}
let named_count = 1 + rng.below(3);
let named: Vec<Hash> = (0..named_count)
.map(|_| sets[rng.below(sets.len())].id())
.collect();
// A clear naming a claim twice is invalid input since #4765 (the store
// refuses it in check_op), so the generator must not produce one: pick
// without replacement.
let mut named: Vec<Hash> = Vec::new();
for _ in 0..named_count {
let id = sets[rng.below(sets.len())].id();
if !named.contains(&id) {
named.push(id);
}
}
let seen: HashSet<Hash> = known[w].values().map(Sent::id).collect();
let after = frontier(&known[w], count);
let sent = writers[w].send(&clear(&named), after, w);
Expand Down
Loading