Skip to content

Commit

Permalink
fix: review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-manuel committed Jul 8, 2024
1 parent 00aea79 commit 52571e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions test/unit/SwapExactIn.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ contract PSMSwapExactInFuzzTests is PSMTestBase {
assetIn.approve(address(psm), amountIn);
psm.swapExactIn(address(assetIn), address(assetOut), amountIn, 0, swapper, 0);

// Rounding is always in favour of the users
// Rounding is always in favour of the LPs
assertGe(psm.convertToAssetValue(psm.shares(lp0)), vars.lp0CachedValue);
assertGe(psm.convertToAssetValue(psm.shares(lp1)), vars.lp1CachedValue);
assertGe(psm.convertToAssetValue(psm.shares(lp2)), vars.lp2CachedValue);
Expand All @@ -437,10 +437,10 @@ contract PSMSwapExactInFuzzTests is PSMTestBase {
assertApproxEqAbs(psm.convertToAssetValue(psm.shares(lp0)), vars.lp0CachedValue, 2e12);
assertApproxEqAbs(psm.convertToAssetValue(psm.shares(lp1)), vars.lp1CachedValue, 2e12);
assertApproxEqAbs(psm.convertToAssetValue(psm.shares(lp2)), vars.lp2CachedValue, 2e12);
assertApproxEqAbs(psm.totalAssets(), vars.psmCachedValue, 2e12);
assertApproxEqAbs(psm.totalAssets(), vars.psmCachedValue, 2e12);
}

// Rounding is always in favour of the users
// Rounding is always in favour of the LPs
assertGe(psm.convertToAssetValue(psm.shares(lp0)), vars.lp0StartingValue);
assertGe(psm.convertToAssetValue(psm.shares(lp1)), vars.lp1StartingValue);
assertGe(psm.convertToAssetValue(psm.shares(lp2)), vars.lp2StartingValue);
Expand Down
4 changes: 2 additions & 2 deletions test/unit/SwapExactOut.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ contract PSMSwapExactOutFuzzTests is PSMTestBase {
assetIn.approve(address(psm), amountIn);
psm.swapExactOut(address(assetIn), address(assetOut), amountOut, amountIn, swapper, 0);

// Rounding is always in favour of the users
// Rounding is always in favour of the LPs
assertGe(psm.convertToAssetValue(psm.shares(lp0)), vars.lp0CachedValue);
assertGe(psm.convertToAssetValue(psm.shares(lp1)), vars.lp1CachedValue);
assertGe(psm.convertToAssetValue(psm.shares(lp2)), vars.lp2CachedValue);
Expand All @@ -486,7 +486,7 @@ contract PSMSwapExactOutFuzzTests is PSMTestBase {
assertApproxEqAbs(psm.totalAssets(), vars.psmCachedValue, 2e12);
}

// Rounding is always in favour of the users
// Rounding is always in favour of the LPs
assertGe(psm.convertToAssetValue(psm.shares(lp0)), vars.lp0StartingValue);
assertGe(psm.convertToAssetValue(psm.shares(lp1)), vars.lp1StartingValue);
assertGe(psm.convertToAssetValue(psm.shares(lp2)), vars.lp2StartingValue);
Expand Down

0 comments on commit 52571e9

Please sign in to comment.