diff --git a/src/PoolManager.sol b/src/PoolManager.sol index 52e6969ab..643843432 100644 --- a/src/PoolManager.sol +++ b/src/PoolManager.sol @@ -21,7 +21,6 @@ import {BeforeSwapDelta} from "./types/BeforeSwapDelta.sol"; import {Lock} from "./libraries/Lock.sol"; import {CurrencyDelta} from "./libraries/CurrencyDelta.sol"; import {NonZeroDeltaCount} from "./libraries/NonZeroDeltaCount.sol"; -import {PoolGetters} from "./libraries/PoolGetters.sol"; import {Reserves} from "./libraries/Reserves.sol"; import {Extsload} from "./Extsload.sol"; import {Exttload} from "./Exttload.sol"; @@ -84,7 +83,6 @@ contract PoolManager is IPoolManager, ProtocolFees, NoDelegateCall, ERC6909Claim using CurrencyLibrary for Currency; using CurrencyDelta for Currency; using LPFeeLibrary for uint24; - using PoolGetters for Pool.State; using Reserves for Currency; /// @inheritdoc IPoolManager diff --git a/src/libraries/PoolGetters.sol b/src/libraries/PoolGetters.sol deleted file mode 100644 index a05761b34..000000000 --- a/src/libraries/PoolGetters.sol +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.20; - -import {Pool} from "./Pool.sol"; - -library PoolGetters { - function getPoolTickInfo(Pool.State storage pool, int24 tick) internal view returns (Pool.TickInfo memory) { - return pool.ticks[tick]; - } - - function getPoolBitmapInfo(Pool.State storage pool, int16 word) internal view returns (uint256 tickBitmap) { - return pool.tickBitmap[word]; - } - - function getFeeGrowthGlobals(Pool.State storage pool) - internal - view - returns (uint256 feeGrowthGlobal0x128, uint256 feeGrowthGlobal1x128) - { - return (pool.feeGrowthGlobal0X128, pool.feeGrowthGlobal1X128); - } -} diff --git a/test/Tick.t.sol b/test/Tick.t.sol index 451781cba..50b54ac41 100644 --- a/test/Tick.t.sol +++ b/test/Tick.t.sol @@ -7,7 +7,6 @@ import {GasSnapshot} from "../lib/forge-gas-snapshot/src/GasSnapshot.sol"; import {Constants} from "./utils/Constants.sol"; import {Pool} from "../src/libraries/Pool.sol"; import {TickMath} from "../src/libraries/TickMath.sol"; -import {PoolGetters} from "../src/libraries/PoolGetters.sol"; contract LiquidityMathRef { function addDelta(uint128 x, int128 y) external pure returns (uint128) { @@ -24,7 +23,6 @@ contract LiquidityMathRef { } contract TickTest is Test, GasSnapshot { - using PoolGetters for Pool.State; using Pool for Pool.State; int24 constant LOW_TICK_SPACING = 10; @@ -43,6 +41,10 @@ contract TickTest is Test, GasSnapshot { return pool.ticks[tick]; } + function tickBitmap(int16 word) internal view returns (uint256) { + return pool.tickBitmap[word]; + } + function tickSpacingToMaxLiquidityPerTick(int24 tickSpacing) internal pure returns (uint128) { return Pool.tickSpacingToMaxLiquidityPerTick(tickSpacing); } @@ -522,7 +524,7 @@ contract TickTest is Test, GasSnapshot { function test_getPoolTickInfo(int24 tick, Pool.TickInfo memory info) public { setTick(tick, info); - Pool.TickInfo memory actualInfo = pool.getPoolTickInfo(tick); + Pool.TickInfo memory actualInfo = ticks(tick); assertEq(actualInfo.liquidityGross, info.liquidityGross); assertEq(actualInfo.liquidityNet, info.liquidityNet); assertEq(actualInfo.feeGrowthOutside0X128, info.feeGrowthOutside0X128); @@ -531,7 +533,7 @@ contract TickTest is Test, GasSnapshot { function test_getPoolBitmapInfo(int16 word, uint256 bitmap) public { setTickBitmap(word, bitmap); - assertEq(pool.getPoolBitmapInfo(word), bitmap); + assertEq(tickBitmap(word), bitmap); } function testTick_tickSpacingToParametersInvariants_fuzz(int24 tickSpacing) public pure {