From 6db1674f95c17388e8de7d014421cd422db8cc7a Mon Sep 17 00:00:00 2001 From: saucepoint Date: Sun, 30 Jun 2024 21:38:14 -0400 Subject: [PATCH] fix gas benchmark --- ...mpound_exactUnclaimedFees_exactCustodiedFees.snap | 2 +- test/position-managers/Gas.t.sol | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.forge-snapshots/autocompound_exactUnclaimedFees_exactCustodiedFees.snap b/.forge-snapshots/autocompound_exactUnclaimedFees_exactCustodiedFees.snap index f9df8100..6e4bf338 100644 --- a/.forge-snapshots/autocompound_exactUnclaimedFees_exactCustodiedFees.snap +++ b/.forge-snapshots/autocompound_exactUnclaimedFees_exactCustodiedFees.snap @@ -1 +1 @@ -239588 \ No newline at end of file +238844 \ No newline at end of file diff --git a/test/position-managers/Gas.t.sol b/test/position-managers/Gas.t.sol index de0f3fb4..ee47a857 100644 --- a/test/position-managers/Gas.t.sol +++ b/test/position-managers/Gas.t.sol @@ -197,8 +197,14 @@ contract GasTest is Test, Deployers, GasSnapshot { donateRouter.donate(key, 20e18, 20e18, ZERO_BYTES); // bob collects fees so some of alice's fees are now cached + bytes[] memory calls = new bytes[](1); + calls[0] = abi.encodeWithSelector(lpm.collect.selector, tokenIdBob, bob, ZERO_BYTES, false); + Currency[] memory currencies = new Currency[](2); + currencies[0] = currency0; + currencies[1] = currency1; + vm.prank(bob); - lpm.collect(tokenIdBob, bob, ZERO_BYTES, false); + lpm.unlockAndExecute(calls, currencies); // donate to create more fees donateRouter.donate(key, 20e18, 20e18, ZERO_BYTES); @@ -216,10 +222,10 @@ contract GasTest is Test, Deployers, GasSnapshot { newToken1Owed ); - bytes[] memory calls = new bytes[](1); + calls = new bytes[](1); calls[0] = abi.encodeWithSelector(lpm.increaseLiquidity.selector, tokenIdAlice, liquidityDelta, ZERO_BYTES, false); - Currency[] memory currencies = new Currency[](2); + currencies = new Currency[](2); currencies[0] = currency0; currencies[1] = currency1;