Skip to content

Commit

Permalink
Merge pull request #1152 from ProjectOpenSea/less-criteria-fuzzing
Browse files Browse the repository at this point in the history
fuzz on criteria items less frequently for performance
  • Loading branch information
0age authored Apr 14, 2023
2 parents e9f8a25 + 12de5fa commit 3caa72c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/foundry/new/helpers/FuzzGenerators.sol
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,12 @@ library TestStateGenerator {
OfferItemSpace[] memory offer = new OfferItemSpace[](len);
for (uint256 i; i < len; ++i) {
offer[i] = OfferItemSpace({
itemType: ItemType(context.randEnum(0, 5)),
tokenIndex: TokenIndex(context.randEnum(0, 1)),
itemType: ItemType(
context.randRange(0, 10) != 0
? context.randEnum(0, 3)
: context.randEnum(4, 5)
),
tokenIndex: TokenIndex(context.randEnum(0, 2)),
criteria: Criteria(context.randEnum(0, 1)),
amount: Amount(context.randEnum(0, 2))
});
Expand Down Expand Up @@ -294,7 +298,11 @@ library TestStateGenerator {
if (!isBasic) {
for (uint256 i; i < len; ++i) {
consideration[i] = ConsiderationItemSpace({
itemType: ItemType(context.randEnum(0, 5)),
itemType: ItemType(
context.randRange(0, 10) != 0
? context.randEnum(0, 3)
: context.randEnum(4, 5)
),
tokenIndex: TokenIndex(context.randEnum(0, 2)),
criteria: Criteria(context.randEnum(0, 1)),
amount: atLeastOne
Expand Down

0 comments on commit 3caa72c

Please sign in to comment.