Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add gas snaps for swaps with 1155 as input/output #383

Merged
merged 4 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add snaps for 1155 swaps
  • Loading branch information
zhongeric committed Nov 1, 2023
commit c2e9341b6ae85190426a5f04e47177a6b646cd6f
1 change: 1 addition & 0 deletions .forge-snapshots/swap mint 1155 as output.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
169555
1 change: 1 addition & 0 deletions .forge-snapshots/swap with 1155 as input.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
155963
1 change: 1 addition & 0 deletions lib/erc-6909
Submodule erc-6909 added at 16bb14
4 changes: 4 additions & 0 deletions test/foundry-tests/PoolManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,9 @@ contract PoolManagerTest is Test, Deployers, TokenFixture, GasSnapshot, IERC1155

vm.expectEmit(true, true, true, true);
emit TransferSingle(address(swapRouter), address(0), address(this), CurrencyLibrary.toId(currency1), 98);
snapStart("swap mint 1155 as output");
swapRouter.swap(key, params, testSettings, ZERO_BYTES);
snapEnd();

uint256 erc1155Balance = manager.balanceOf(address(this), CurrencyLibrary.toId(currency1));
assertEq(erc1155Balance, 98);
Expand Down Expand Up @@ -858,7 +860,9 @@ contract PoolManagerTest is Test, Deployers, TokenFixture, GasSnapshot, IERC1155

vm.expectEmit(true, true, true, true);
emit TransferSingle(address(manager), address(manager), address(0), CurrencyLibrary.toId(currency1), 27);
snapStart("swap with 1155 as input");
swapRouter.swap(key, params, testSettings, ZERO_BYTES);
snapEnd();

erc1155Balance = manager.balanceOf(address(this), CurrencyLibrary.toId(currency1));
assertEq(erc1155Balance, 71);
Expand Down