Skip to content

Commit

Permalink
fix: incorrect test token balances (#165)
Browse files Browse the repository at this point in the history
This commit fixes the batchTransferMultiToken test to check the token1
balances correctly where before it was doublechecking token0 balances

Closes: #164
  • Loading branch information
marktoda authored Jan 4, 2023
1 parent 2141eef commit ca6b6ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .forge-snapshots/batchTransferFromMultiToken.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
83786
81786
2 changes: 1 addition & 1 deletion .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AllowanceTransferInvariants:invariant_spendNeverExceedsPermit() (runs: 256, call
AllowanceTransferTest:testApprove() (gas: 47561)
AllowanceTransferTest:testBatchTransferFrom() (gas: 159268)
AllowanceTransferTest:testBatchTransferFromDifferentOwners() (gas: 235508)
AllowanceTransferTest:testBatchTransferFromMultiToken() (gas: 231810)
AllowanceTransferTest:testBatchTransferFromMultiToken() (gas: 231828)
AllowanceTransferTest:testBatchTransferFromWithGasSnapshot() (gas: 159818)
AllowanceTransferTest:testExcessiveInvalidation() (gas: 64136)
AllowanceTransferTest:testInvalidateMultipleNonces() (gas: 83139)
Expand Down
4 changes: 2 additions & 2 deletions test/AllowanceTransferTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ contract AllowanceTransferTest is Test, TokenProvider, PermitSignature, GasSnaps
uint256 startBalanceFrom0 = token0.balanceOf(from);
uint256 startBalanceFrom1 = token1.balanceOf(from);
uint256 startBalanceTo0 = token0.balanceOf(address0);
uint256 startBalanceTo1 = token0.balanceOf(address0);
uint256 startBalanceTo1 = token1.balanceOf(address0);

permit2.permit(from, permitBatch, sig);

Expand All @@ -578,7 +578,7 @@ contract AllowanceTransferTest is Test, TokenProvider, PermitSignature, GasSnaps
assertEq(token0.balanceOf(from), startBalanceFrom0 - 1 ** 18);
assertEq(token1.balanceOf(from), startBalanceFrom1 - 1 ** 18);
assertEq(token0.balanceOf(address0), startBalanceTo0 + 1 ** 18);
assertEq(token0.balanceOf(address0), startBalanceTo1 + 1 ** 18);
assertEq(token1.balanceOf(address0), startBalanceTo1 + 1 ** 18);
(amount,,) = permit2.allowance(from, address(token0), address(this));
assertEq(amount, defaultAmount - 1 ** 18);
(amount,,) = permit2.allowance(from, address(token1), address(this));
Expand Down

0 comments on commit ca6b6ff

Please sign in to comment.