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

Remove PoolGetters #683

Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions src/PoolManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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
Expand Down
22 changes: 0 additions & 22 deletions src/libraries/PoolGetters.sol

This file was deleted.

10 changes: 6 additions & 4 deletions test/Tick.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
Expand All @@ -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 {
Expand Down
Loading