Skip to content

Commit 9b4afdb

Browse files
committed
add gas measurement to tests and refactor some test structures
1 parent 08ea3f2 commit 9b4afdb

33 files changed

+716
-367
lines changed

.gitmodules

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[submodule "lib/openzeppelin-contracts"]
22
path = lib/openzeppelin-contracts
33
url = https://github.com/OpenZeppelin/openzeppelin-contracts
4-
branch = v5.0.2
54
[submodule "lib/forge-std"]
65
path = lib/forge-std
76
url = https://github.com/foundry-rs/forge-std
8-
branch = v1.3.0

snapshots/AdminManagement.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"approveTokens(): testApproveTokens": "136967",
3+
"rescueTokens(): testRescueTokens": "86851"
4+
}

snapshots/AllowanceTarget.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"pause(): testSpendFromUserToAfterUnpause": "27667",
3+
"spendFromUserTo(): testSpendFromUserTo": "63533",
4+
"spendFromUserTo(): testSpendFromUserToAfterUnpause": "63533",
5+
"spendFromUserTo(): testSpendFromUserToWithDeflationaryToken": "91576",
6+
"spendFromUserTo(): testSpendFromUserToWithNoReturnValueToken": "68943",
7+
"unpause(): testSpendFromUserToAfterUnpause": "27645"
8+
}

snapshots/Asset.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"getBalance(): testGetBalance": "6107",
3+
"getBalance(): testGetBalance(ETH_ADDRESS)": "764",
4+
"getBalance(): testGetBalance(ZERO_ADDRESS)": "781",
5+
"isETH(): testIsETH(ETH_ADDRESS)": "441",
6+
"isETH(): testIsETH2(ZERO_ADDRESS)": "458",
7+
"transferTo(): testDoNothingIfTransferToSelf": "22431",
8+
"transferTo(): testDoNothingIfTransferWithZeroAmount": "22419",
9+
"transferTo(): testTransferETH": "57012",
10+
"transferTo(): testTransferToken": "51501"
11+
}

snapshots/CoordinatedTaker.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"approveTokens(): testApproveTokens": "54307",
3+
"setCoordinator(): testSetCoordinator": "30043",
4+
"submitLimitOrderFill(): testFillWithETH": "192971",
5+
"submitLimitOrderFill(): testFillWithPermission": "256473"
6+
}

snapshots/EIP712.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"EIP712_DOMAIN_SEPARATOR(): testDomainSeparatorOnChain": "276",
3+
"EIP712_DOMAIN_SEPARATOR(): testDomainSeparatorOnDifferentChain": "626",
4+
"getEIP712Hash(): testGetEIP712Hash": "828"
5+
}

snapshots/GenericSwap.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"executeSwap(): testGenericSwapWithUniswap": "251909",
3+
"executeSwap(): testLeaveOneWeiWithMultipleUsers(the first deposit)": "251909",
4+
"executeSwap(): testLeaveOneWeiWithMultipleUsers(the second deposit)": "208263",
5+
"executeSwap(): testSwapWithETHInput": "100382",
6+
"executeSwap(): testSwapWithETHOutput": "130241",
7+
"executeSwap(): testSwapWithLessOutputButWithinTolerance": "160688",
8+
"executeSwapWithSig(): testGenericSwapRelayed": "283756"
9+
}

snapshots/LimitOrderSwap.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"cancelOrder(): testCancelOrder": "52753",
3+
"fillLimitOrder(): testFillLimitOrderWithETH": "158029",
4+
"fillLimitOrder(): testFillWithBetterTakingAmount": "215471",
5+
"fillLimitOrder(): testFillWithBetterTakingAmountButGetAdjusted": "215705",
6+
"fillLimitOrder(): testFillWithETHRefund": "165308",
7+
"fillLimitOrder(): testFillWithLargerVolumeAndSettleAsManyAsPossible": "215693",
8+
"fillLimitOrder(): testFillWithoutMakerSigForVerifiedOrder": "215471",
9+
"fillLimitOrder(): testFillWithoutMakerSigForVerifiedOrder(without makerSig)": "120983",
10+
"fillLimitOrder(): testFullyFillLimitOrder": "215471",
11+
"fillLimitOrder(): testFullyFillLimitOrderUsingAMM": "235046",
12+
"fillLimitOrder(): testPartiallyFillLimitOrder": "215471",
13+
"fillLimitOrderFullOrKill(): testFillWithFOK": "215449",
14+
"fillLimitOrderGroup(): testGroupFillRingTrade": "291749",
15+
"fillLimitOrderGroup(): testGroupFillWithPartialWETHUnwrap": "277818",
16+
"fillLimitOrderGroup(): testGroupFillWithTakerPrefundETH": "198117",
17+
"fillLimitOrderGroup(): testGroupFillWithWETHUnwrap": "198117",
18+
"fillLimitOrderGroup(): testPartialFillLargeOrderWithSmallOrders": "265910",
19+
"testGroupFillWithProfit: fillLimitOrderGroup()": "225225"
20+
}

snapshots/Ownable.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"acceptOwnership(): testAcceptOwnership": "28390",
3+
"nominateNewOwner(): testNominateNewOwner": "47132",
4+
"renounceOwnership(): testRenounceOwnership": "25351"
5+
}

0 commit comments

Comments
 (0)