diff --git a/test/libraries/Pool.t.sol b/test/libraries/Pool.t.sol index e5832a44e..e93e9f1df 100644 --- a/test/libraries/Pool.t.sol +++ b/test/libraries/Pool.t.sol @@ -119,9 +119,12 @@ contract PoolTest is Test { assertEq(slot0.protocolFee(), 0); slot0 = slot0.setProtocolFee(protocolFee); assertEq(slot0.protocolFee(), protocolFee); + state.slot0 = slot0; + + uint16 expectedProtocolFee = params.zeroForOne ? protocolFee0 : protocolFee1; uint24 _lpFee = params.lpFeeOverride.isOverride() ? params.lpFeeOverride.removeOverrideFlag() : lpFee; - uint24 swapFee = protocolFee == 0 ? _lpFee : uint16(protocolFee).calculateSwapFee(_lpFee); + uint24 swapFee = expectedProtocolFee == 0 ? _lpFee : expectedProtocolFee.calculateSwapFee(_lpFee); if (params.amountSpecified >= 0 && swapFee == MAX_LP_FEE) { vm.expectRevert(Pool.InvalidFeeForExactOut.selector);