Open
Description
Component
Forge
Describe the feature you would like
Thanks again for adding vm.sort()
and vm.shuffle()
!
One use case that’s come up frequently: I often work with two corresponding arrays (like strategies[i]
and balances[i]
) and need to shuffle them in sync to maintain their index alignment. Currently, there’s no built-in way to ensure two shuffles apply the same permutation.
It would be incredibly useful if vm.shuffle()
accepted an optional salt
parameter for deterministic shuffling. That way, we could do something like:
uint256 salt = vm.randomUint();
vm.shuffle(strategies, salt);
vm.shuffle(balances, salt);
This would make it much easier to preserve relationships across parallel arrays during randomized testing.
Additional context
Metadata
Metadata
Assignees
Type
Projects
Status
Backlog