Skip to content

Commit

Permalink
fix(test): replace failing test assume boundaries with bound
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeckers committed May 29, 2024
1 parent b4a47f1 commit 5927baa
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions contracts/test/foundry/marketplace/BatchMakerOrders.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ contract BatchMakerOrdersTest is ProtocolBase {
}

function testTakerBidMultipleOrdersSignedERC721(uint256 numberOrders, uint256 orderIndex) public {
_assertMerkleTreeAssumptions(numberOrders, orderIndex);
numberOrders = bound(numberOrders, 1, 2 ** MAX_CALLDATA_PROOF_LENGTH);
orderIndex = bound(orderIndex, 0, numberOrders - 1);

mockERC721.batchMint(makerUser, numberOrders);

Expand Down Expand Up @@ -75,7 +76,8 @@ contract BatchMakerOrdersTest is ProtocolBase {
}

function testTakerAskMultipleOrdersSignedERC721(uint256 numberOrders, uint256 orderIndex) public {
_assertMerkleTreeAssumptions(numberOrders, orderIndex);
numberOrders = bound(numberOrders, 1, 2 ** MAX_CALLDATA_PROOF_LENGTH);
orderIndex = bound(orderIndex, 0, numberOrders - 1);

mockERC721.batchMint(takerUser, numberOrders);

Expand Down Expand Up @@ -111,7 +113,8 @@ contract BatchMakerOrdersTest is ProtocolBase {
function testTakerBidMultipleOrdersSignedERC721MerkleProofInvalid(uint256 numberOrders, uint256 orderIndex)
public
{
_assertMerkleTreeAssumptions(numberOrders, orderIndex);
numberOrders = bound(numberOrders, 1, 2 ** MAX_CALLDATA_PROOF_LENGTH);
orderIndex = bound(orderIndex, 0, numberOrders - 1);

mockERC721.batchMint(makerUser, numberOrders);

Expand All @@ -138,7 +141,8 @@ contract BatchMakerOrdersTest is ProtocolBase {
function testTakerAskMultipleOrdersSignedERC721MerkleProofInvalid(uint256 numberOrders, uint256 orderIndex)
public
{
_assertMerkleTreeAssumptions(numberOrders, orderIndex);
numberOrders = bound(numberOrders, 1, 2 ** MAX_CALLDATA_PROOF_LENGTH);
orderIndex = bound(orderIndex, 0, numberOrders - 1);

mockERC721.batchMint(takerUser, numberOrders);

Expand All @@ -165,7 +169,8 @@ contract BatchMakerOrdersTest is ProtocolBase {
function testTakerBidMultipleOrdersSignedERC721MerkleProofWrongPosition(uint256 numberOrders, uint256 orderIndex)
public
{
_assertMerkleTreeAssumptions(numberOrders, orderIndex);
numberOrders = bound(numberOrders, 1, 2 ** MAX_CALLDATA_PROOF_LENGTH);
orderIndex = bound(orderIndex, 0, numberOrders - 1);

mockERC721.batchMint(makerUser, numberOrders);

Expand Down Expand Up @@ -199,7 +204,8 @@ contract BatchMakerOrdersTest is ProtocolBase {
function testTakerAskMultipleOrdersSignedERC721MerkleProofWrongPosition(uint256 numberOrders, uint256 orderIndex)
public
{
_assertMerkleTreeAssumptions(numberOrders, orderIndex);
numberOrders = bound(numberOrders, 1, 2 ** MAX_CALLDATA_PROOF_LENGTH);
orderIndex = bound(orderIndex, 0, numberOrders - 1);

mockERC721.batchMint(takerUser, numberOrders);

Expand Down

0 comments on commit 5927baa

Please sign in to comment.