-
Notifications
You must be signed in to change notification settings - Fork 968
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
rename Snaps #535
Open
nishim3
wants to merge
8
commits into
Uniswap:main
Choose a base branch
from
nishim3:rename-snaps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
rename Snaps #535
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
278c3b7
rename Snaps
nishim3 b5b6939
implement changes
nishim3 79b9865
add suggestions
nishim3 86a167b
add suggestions
nishim3 06bb849
add suggestions
nishim3 08e3181
merge main/add snaps
nishim3 fb5be28
Merge main
nishim3 a9287fd
update snaps
nishim3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
76727 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -66,7 +66,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
} | ||||||
|
||||||
function test_bytecodeSize() public { | ||||||
snapSize("poolManager bytecode size", address(manager)); | ||||||
snapSize("PoolManager.bytecodeSize", address(manager)); | ||||||
} | ||||||
|
||||||
function test_feeControllerSet() public { | ||||||
|
@@ -366,25 +366,25 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
} | ||||||
|
||||||
function test_addLiquidity_gas() public { | ||||||
snapStart("addLiquidity"); | ||||||
snapStart("PoolManager.addLiquidity"); | ||||||
modifyLiquidityRouter.modifyLiquidity(key, LIQ_PARAMS, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
||||||
function test_removeLiquidity_gas() public { | ||||||
snapStart("removeLiquidity"); | ||||||
snapStart("PoolManager.removeLiquidity"); | ||||||
modifyLiquidityRouter.modifyLiquidity(key, REMOVE_LIQ_PARAMS, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
||||||
function test_addLiquidity_withNative_gas() public { | ||||||
snapStart("addLiquidity with native token"); | ||||||
snapStart("PoolManager.addLiquidityWithNativeToken"); | ||||||
modifyLiquidityRouter.modifyLiquidity{value: 1 ether}(nativeKey, LIQ_PARAMS, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
||||||
function test_removeLiquidity_withNative_gas() public { | ||||||
snapStart("removeLiquidity with native token"); | ||||||
snapStart("PoolManager.removeLiquidityWithNativeToken"); | ||||||
modifyLiquidityRouter.modifyLiquidity{value: 1 ether}(nativeKey, REMOVE_LIQ_PARAMS, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
@@ -397,7 +397,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
|
||||||
(key,) = initPool(currency0, currency1, mockHooks, 3000, SQRT_RATIO_1_1, ZERO_BYTES); | ||||||
|
||||||
snapStart("addLiquidity with empty hook"); | ||||||
snapStart("PoolManager.addLiquidityWithEmptyHook"); | ||||||
modifyLiquidityRouter.modifyLiquidity(key, LIQ_PARAMS, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
@@ -411,7 +411,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
(key,) = initPool(currency0, currency1, mockHooks, 3000, SQRT_RATIO_1_1, ZERO_BYTES); | ||||||
modifyLiquidityRouter.modifyLiquidity(key, LIQ_PARAMS, ZERO_BYTES); | ||||||
|
||||||
snapStart("removeLiquidity with empty hook"); | ||||||
snapStart("PoolManager.removeLiquidityWithEmptyHook"); | ||||||
modifyLiquidityRouter.modifyLiquidity(key, REMOVE_LIQ_PARAMS, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
@@ -566,7 +566,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
PoolSwapTest.TestSettings memory testSettings = | ||||||
PoolSwapTest.TestSettings({withdrawTokens: true, settleUsingTransfer: true, currencyAlreadySent: false}); | ||||||
|
||||||
snapStart("simple swap"); | ||||||
snapStart("PoolManager.simpleSwap"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
swapRouter.swap(key, swapParams, testSettings, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
@@ -578,7 +578,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
PoolSwapTest.TestSettings memory testSettings = | ||||||
PoolSwapTest.TestSettings({withdrawTokens: true, settleUsingTransfer: true, currencyAlreadySent: false}); | ||||||
|
||||||
snapStart("simple swap with native"); | ||||||
snapStart("PoolManager.simpleSwapWithNative"); | ||||||
swapRouter.swap{value: 100}(nativeKey, swapParams, testSettings, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
@@ -605,7 +605,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
testSettings = | ||||||
PoolSwapTest.TestSettings({withdrawTokens: true, settleUsingTransfer: true, currencyAlreadySent: false}); | ||||||
|
||||||
snapStart("swap with hooks"); | ||||||
snapStart("PoolManager.swapWithHooks"); | ||||||
swapRouter.swap(key, swapParams, testSettings, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
@@ -619,7 +619,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
|
||||||
vm.expectEmit(); | ||||||
emit Transfer(address(swapRouter), address(0), address(this), CurrencyLibrary.toId(currency1), 98); | ||||||
snapStart("swap mint output as 6909"); | ||||||
snapStart("PoolManager.swapMintOutputAs6909"); | ||||||
swapRouter.swap(key, params, testSettings, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
|
||||||
|
@@ -636,7 +636,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
|
||||||
vm.expectEmit(); | ||||||
emit Transfer(address(swapRouter), address(0), address(this), CurrencyLibrary.toId(CurrencyLibrary.NATIVE), 98); | ||||||
snapStart("swap mint native output as 6909"); | ||||||
snapStart("PoolManager.swapMintNativeOutputAs6909"); | ||||||
swapRouter.swap(nativeKey, params, testSettings, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
|
||||||
|
@@ -668,7 +668,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
|
||||||
vm.expectEmit(); | ||||||
emit Transfer(address(swapRouter), address(this), address(0), CurrencyLibrary.toId(currency1), 27); | ||||||
snapStart("swap burn 6909 for input"); | ||||||
snapStart("PoolManager.swapBurn6909ForInput"); | ||||||
swapRouter.swap(key, params, testSettings, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
|
||||||
|
@@ -700,7 +700,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
|
||||||
vm.expectEmit(); | ||||||
emit Transfer(address(swapRouter), address(this), address(0), CurrencyLibrary.toId(CurrencyLibrary.NATIVE), 27); | ||||||
snapStart("swap burn native 6909 for input"); | ||||||
snapStart("PoolManager.swapBurnNative6909ForInput"); | ||||||
// don't have to send in native currency since burning 6909 for input | ||||||
swapRouter.swap(nativeKey, params, testSettings, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
|
@@ -720,7 +720,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
|
||||||
params = IPoolManager.SwapParams({zeroForOne: true, amountSpecified: -100, sqrtPriceLimitX96: SQRT_RATIO_1_4}); | ||||||
|
||||||
snapStart("swap against liquidity"); | ||||||
snapStart("PoolManager.swapAgainstLiquidity"); | ||||||
swapRouter.swap(key, params, testSettings, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
@@ -736,7 +736,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
|
||||||
params = IPoolManager.SwapParams({zeroForOne: true, amountSpecified: -100, sqrtPriceLimitX96: SQRT_RATIO_1_4}); | ||||||
|
||||||
snapStart("swap against liquidity with native token"); | ||||||
snapStart("PoolManager.swapAgainstLiquidityWithNativeToken"); | ||||||
swapRouter.swap{value: 1 ether}(nativeKey, params, testSettings, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
@@ -805,7 +805,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
assertEq(feeGrowthGlobal0X128, 0); | ||||||
assertEq(feeGrowthGlobal1X128, 0); | ||||||
|
||||||
snapStart("donate gas with 2 tokens"); | ||||||
snapStart("PoolManager.donateGasWith2Tokens"); | ||||||
donateRouter.donate(key, 100, 200, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
|
||||||
|
@@ -864,7 +864,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
} | ||||||
|
||||||
function test_donate_OneToken_gas() public { | ||||||
snapStart("donate gas with 1 token"); | ||||||
snapStart("PoolManager.donateGasWith1Token"); | ||||||
donateRouter.donate(key, 100, 0, ZERO_BYTES); | ||||||
snapEnd(); | ||||||
} | ||||||
|
@@ -1009,7 +1009,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
assertEq(manager.protocolFeesAccrued(currency1), 0); | ||||||
assertEq(currency0.balanceOf(address(1)), 0); | ||||||
vm.prank(address(feeController)); | ||||||
snapStart("erc20 collect protocol fees"); | ||||||
snapStart("PoolManager.erc20CollectProtocolFees"); | ||||||
manager.collectProtocolFees(address(1), currency0, expectedFees); | ||||||
snapEnd(); | ||||||
assertEq(currency0.balanceOf(address(1)), expectedFees); | ||||||
|
@@ -1065,7 +1065,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { | |||||
assertEq(manager.protocolFeesAccrued(currency1), 0); | ||||||
assertEq(nativeCurrency.balanceOf(address(1)), 0); | ||||||
vm.prank(address(feeController)); | ||||||
snapStart("native collect protocol fees"); | ||||||
snapStart("PoolManager.nativeCollectProtocolFees"); | ||||||
manager.collectProtocolFees(address(1), nativeCurrency, expectedFees); | ||||||
snapEnd(); | ||||||
assertEq(nativeCurrency.balanceOf(address(1)), expectedFees); | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to go
ContractName.functionName_extraNotes
e.g.
PoolManager.removeLiquidity_withNative
PoolManager.swap_simple
PoolManager.collectProtocolFees_withNative