Skip to content

Commit ff6e78f

Browse files
committed
remove fuzz tests for now
1 parent 0c5d796 commit ff6e78f

File tree

2 files changed

+0
-58
lines changed

2 files changed

+0
-58
lines changed

.gas-snapshot

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
OrdersFuzzTest:testFuzz_initiate((address,uint256)[],(address,uint256,address,uint32)[]) (runs: 256, μ: 492290, ~: 496012)
21
OrdersTest:test_initiate_ERC20() (gas: 81255)
32
OrdersTest:test_initiate_ETH() (gas: 44801)
43
OrdersTest:test_initiate_both() (gas: 118573)

test/Orders.t.sol

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -177,60 +177,3 @@ contract OrdersTest is Test {
177177
target.sweep(recipient, token);
178178
}
179179
}
180-
181-
contract OrdersFuzzTest is Test {
182-
RollupOrders public target;
183-
mapping(address => bool) isToken;
184-
185-
uint256 deadline = block.timestamp + 100;
186-
187-
event OutputFilled(uint256 indexed originChainId, address indexed recipient, address indexed token, uint256 amount);
188-
189-
event Order(uint256 deadline, Input[] inputs, Output[] outputs);
190-
191-
event Sweep(address indexed recipient, address indexed token, uint256 amount);
192-
193-
function setUp() public {
194-
target = new RollupOrders();
195-
196-
// deploy ERC20 tokens
197-
for (uint256 i; i < 15; i++) {
198-
address token = address(new TestERC20("hi", "HI"));
199-
isToken[token] = true;
200-
}
201-
}
202-
203-
function testFuzz_initiate(Input[] memory fuzzInputs, Output[] memory fuzzOutputs) public {
204-
// can only use vm.assume 256 * 256 times, and we do 256 fuzz runs
205-
vm.assume(fuzzInputs.length < 256);
206-
// setup the fuzz test by ensuring ETH and ERC20 amounts are available
207-
uint256 totalETH;
208-
for (uint256 i; i < fuzzInputs.length; i++) {
209-
if (fuzzInputs[i].token == address(0)) {
210-
// tally up total ETH amount in the inputs
211-
totalETH += fuzzInputs[i].amount;
212-
continue;
213-
}
214-
215-
// ERC20 inputs must be one of the tokens we've deployed
216-
vm.assume(isToken[fuzzInputs[i].token]);
217-
// mint the token amount to ensure the address has it
218-
TestERC20(fuzzInputs[i].token).mint(address(this), fuzzInputs[i].amount);
219-
// approve the target to spend the total token amount
220-
TestERC20(fuzzInputs[i].token).approve(address(target), type(uint256).max);
221-
// expect the token amount to be transferred
222-
vm.expectCall(
223-
fuzzInputs[i].token,
224-
abi.encodeWithSelector(
225-
ERC20.transferFrom.selector, address(this), address(target), fuzzInputs[i].amount
226-
)
227-
);
228-
}
229-
// deal the total ETH amount to ensure the address has it
230-
vm.deal(address(this), address(this).balance + totalETH);
231-
232-
vm.expectEmit();
233-
emit Order(deadline, fuzzInputs, fuzzOutputs);
234-
target.initiate{value: totalETH}(deadline, fuzzInputs, fuzzOutputs);
235-
}
236-
}

0 commit comments

Comments
 (0)