Skip to content

Commit

Permalink
test: add identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
dyedm1 committed Nov 22, 2023
1 parent ef22399 commit 4b47122
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions test/foundry/core/PanopticPool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4988,14 +4988,16 @@ contract PanopticPoolTest is PositionUtils {
int256(uint256(type(uint104).max)) -
(exerciseFeeAmounts[0] < 0 ? -1 : int8(1)) *
int256(ct0.convertToShares(uint256(Math.abs(exerciseFeeAmounts[0])))),
10
10,
"Incorrect Exercise Fees 0 for Bob"
);
assertApproxEqAbs(
int256(ct1.balanceOf(Bob)),
int256(uint256(type(uint104).max)) -
(exerciseFeeAmounts[1] < 0 ? -1 : int8(1)) *
int256(ct1.convertToShares(uint256(Math.abs(exerciseFeeAmounts[1])))),
10
10,
"Incorrect Exercise Fees 1 for Bob"
);

assertEq(sfpm.balanceOf(address(pp), tokenId), 0);
Expand All @@ -5005,7 +5007,8 @@ contract PanopticPoolTest is PositionUtils {
assertApproxEqAbs(
inAMM,
uint128(longAmounts.rightSlot() + shortAmounts.rightSlot()) * 2,
10
10,
"Incorrect token0 inAMM amount"
);
}

Expand All @@ -5014,7 +5017,8 @@ contract PanopticPoolTest is PositionUtils {
assertApproxEqAbs(
inAMM,
uint128(longAmounts.leftSlot() + shortAmounts.leftSlot()) * 2,
10
10,
"Incorrect token1 inAMM amount"
);
}
{
Expand Down Expand Up @@ -5048,12 +5052,16 @@ contract PanopticPoolTest is PositionUtils {
uint256(int256(lastCollateralBalance0[Alice]) + $balanceDelta0),
uint256(
int256((longAmounts.rightSlot() + shortAmounts.rightSlot()) / 1_000_000 + 10)
)
),
"Incorrect Collateral 0 Balance for Alice"
);
assertApproxEqAbs(
ct1.convertToAssets(ct1.balanceOf(Alice)),
uint256(int256(lastCollateralBalance1[Alice]) + $balanceDelta1),
uint256(int256((longAmounts.leftSlot() + shortAmounts.leftSlot()) / 1_000_000 + 10))
uint256(
int256((longAmounts.leftSlot() + shortAmounts.leftSlot()) / 1_000_000 + 10)
),
"Incorrect Collateral 1 Balance for Alice"
);
}
}
Expand Down

0 comments on commit 4b47122

Please sign in to comment.