Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAustrian committed May 14, 2024
1 parent f10f55b commit c706514
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions test/unit/BPool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ abstract contract BasePoolTest is Test, BConst, Utils, BMath {
_setPoolBalance(address(0), _totalSupply);
}

function _assumeCalcSpotPrice(uint _tokenInBalance, uint _tokenInDenorm, uint _tokenOutBalance, uint _tokenOutDenorm, uint _swapFee) internal view {
function _assumeCalcSpotPrice(
uint256 _tokenInBalance,
uint256 _tokenInDenorm,
uint256 _tokenOutBalance,
uint256 _tokenOutDenorm,
uint256 _swapFee
) internal view {
uint256 _numer = bdiv(_tokenInBalance, _tokenInDenorm);
uint256 _denom = bdiv(_tokenOutBalance, _tokenOutDenorm);
uint256 _ratio = bdiv(_numer, _denom);
Expand Down Expand Up @@ -721,7 +727,9 @@ contract BPool_Unit_SwapExactAmountOut is BasePoolTest {
vm.assume(_fuzz.tokenOutBalance + _fuzz.tokenAmountOut < type(uint256).max / _fuzz.tokenOutDenorm);

// internal calculation for calcSpotPrice (spotPriceBefore)
_assumeCalcSpotPrice(_fuzz.tokenInBalance, _fuzz.tokenInDenorm, _fuzz.tokenOutBalance, _fuzz.tokenOutDenorm, _fuzz.swapFee);
_assumeCalcSpotPrice(
_fuzz.tokenInBalance, _fuzz.tokenInDenorm, _fuzz.tokenOutBalance, _fuzz.tokenOutDenorm, _fuzz.swapFee
);

// MAX_OUT_RATIO
vm.assume(_fuzz.tokenAmountOut <= bmul(_fuzz.tokenOutBalance, MAX_OUT_RATIO));
Expand Down Expand Up @@ -755,7 +763,13 @@ contract BPool_Unit_SwapExactAmountOut is BasePoolTest {
vm.assume(_fuzz.tokenInBalance + _tokenAmountIn < type(uint256).max / _fuzz.tokenInDenorm);

// internal calculation for calcSpotPrice (spotPriceAfter)
_assumeCalcSpotPrice(_fuzz.tokenInBalance + _tokenAmountIn, _fuzz.tokenInDenorm, _fuzz.tokenOutBalance - _fuzz.tokenAmountOut, _fuzz.tokenOutDenorm, _fuzz.swapFee);
_assumeCalcSpotPrice(
_fuzz.tokenInBalance + _tokenAmountIn,
_fuzz.tokenInDenorm,
_fuzz.tokenOutBalance - _fuzz.tokenAmountOut,
_fuzz.tokenOutDenorm,
_fuzz.swapFee
);
}

modifier happyPath(SwapExactAmountOut_FuzzScenario memory _fuzz) {
Expand Down

0 comments on commit c706514

Please sign in to comment.