diff --git a/test/FullRange.t.sol b/test/FullRange.t.sol index 5edec106..ffa36afb 100644 --- a/test/FullRange.t.sol +++ b/test/FullRange.t.sol @@ -128,9 +128,8 @@ contract TestFullRange is Test, Deployers, GasSnapshot { vm.expectEmit(true, true, true, true); emit Initialize(id, testKey.currency0, testKey.currency1, testKey.fee, testKey.tickSpacing, testKey.hooks); - snapStart("FullRangeInitialize"); manager.initialize(testKey, SQRT_PRICE_1_1, ZERO_BYTES); - snapEnd(); + snapLastCall("FullRangeInitialize"); (, address liquidityToken) = fullRange.poolInfo(id); @@ -154,9 +153,8 @@ contract TestFullRange is Test, Deployers, GasSnapshot { key.currency0, key.currency1, 3000, 10 ether, 10 ether, 9 ether, 9 ether, address(this), MAX_DEADLINE ); - snapStart("FullRangeAddInitialLiquidity"); fullRange.addLiquidity(addLiquidityParams); - snapEnd(); + snapLastCall("FullRangeAddInitialLiquidity"); (bool hasAccruedFees, address liquidityToken) = fullRange.poolInfo(id); uint256 liquidityTokenBal = UniswapV4ERC20(liquidityToken).balanceOf(address(this)); @@ -220,9 +218,8 @@ contract TestFullRange is Test, Deployers, GasSnapshot { MAX_DEADLINE ); - snapStart("FullRangeAddLiquidity"); fullRange.addLiquidity(addLiquidityParams); - snapEnd(); + snapLastCall("FullRangeAddLiquidity"); (bool hasAccruedFees,) = fullRange.poolInfo(idWithLiq); uint256 liquidityTokenBal = UniswapV4ERC20(liquidityToken).balanceOf(address(this)); @@ -275,9 +272,8 @@ contract TestFullRange is Test, Deployers, GasSnapshot { HookEnabledSwapRouter.TestSettings memory settings = HookEnabledSwapRouter.TestSettings({takeClaims: false, settleUsingBurn: false}); - snapStart("FullRangeSwap"); router.swap(key, params, settings, ZERO_BYTES); - snapEnd(); + snapLastCall("FullRangeSwap"); (bool hasAccruedFees,) = fullRange.poolInfo(id); @@ -338,16 +334,14 @@ contract TestFullRange is Test, Deployers, GasSnapshot { HookEnabledSwapRouter.TestSettings memory settings = HookEnabledSwapRouter.TestSettings({takeClaims: false, settleUsingBurn: false}); - snapStart("FullRangeFirstSwap"); router.swap(testKey, params, settings, ZERO_BYTES); - snapEnd(); + snapLastCall("FullRangeFirstSwap"); (bool hasAccruedFees,) = fullRange.poolInfo(id); assertEq(hasAccruedFees, true); - snapStart("FullRangeSecondSwap"); router.swap(testKey, params, settings, ZERO_BYTES); - snapEnd(); + snapLastCall("FullRangeSecondSwap"); (hasAccruedFees,) = fullRange.poolInfo(id); assertEq(hasAccruedFees, true); @@ -395,9 +389,8 @@ contract TestFullRange is Test, Deployers, GasSnapshot { FullRange.RemoveLiquidityParams memory removeLiquidityParams = FullRange.RemoveLiquidityParams(keyWithLiq.currency0, keyWithLiq.currency1, 3000, 1 ether, MAX_DEADLINE); - snapStart("FullRangeRemoveLiquidity"); fullRange.removeLiquidity(removeLiquidityParams); - snapEnd(); + snapLastCall("FullRangeRemoveLiquidity"); (bool hasAccruedFees,) = fullRange.poolInfo(idWithLiq); uint256 liquidityTokenBal = UniswapV4ERC20(liquidityToken).balanceOf(address(this)); @@ -564,9 +557,8 @@ contract TestFullRange is Test, Deployers, GasSnapshot { FullRange.RemoveLiquidityParams memory removeLiquidityParams = FullRange.RemoveLiquidityParams(keyWithLiq.currency0, keyWithLiq.currency1, 3000, 5 ether, MAX_DEADLINE); - snapStart("FullRangeRemoveLiquidityAndRebalance"); fullRange.removeLiquidity(removeLiquidityParams); - snapEnd(); + snapLastCall("FullRangeRemoveLiquidityAndRebalance"); (bool hasAccruedFees,) = fullRange.poolInfo(idWithLiq); assertEq(hasAccruedFees, false); diff --git a/test/Oracle.t.sol b/test/Oracle.t.sol index 04157e16..cc465a02 100644 --- a/test/Oracle.t.sol +++ b/test/Oracle.t.sol @@ -17,9 +17,8 @@ contract TestOracle is Test, GasSnapshot { } function testInitialize() public { - snapStart("OracleInitialize"); oracle.initialize(OracleImplementation.InitializeParams({time: 1, tick: 1, liquidity: 1})); - snapEnd(); + snapLastCall("OracleInitialize"); assertEq(oracle.index(), 0); assertEq(oracle.cardinality(), 1); diff --git a/test/TWAMM.t.sol b/test/TWAMM.t.sol index 0f2f82e0..9525025c 100644 --- a/test/TWAMM.t.sol +++ b/test/TWAMM.t.sol @@ -110,9 +110,8 @@ contract TWAMMTest is Test, Deployers, GasSnapshot { vm.warp(10000); token0.approve(address(twamm), 100 ether); - snapStart("TWAMMSubmitOrder"); twamm.submitOrder(poolKey, orderKey, 1 ether); - snapEnd(); + snapLastCall("TWAMMSubmitOrder"); ITWAMM.Order memory submittedOrder = twamm.getOrder(poolKey, orderKey); (uint256 sellRateCurrent0For1, uint256 earningsFactorCurrent0For1) = twamm.getOrderPool(poolKey, true);