Skip to content

Commit

Permalink
fix: swapExactOut test
Browse files Browse the repository at this point in the history
  • Loading branch information
wei3erHase committed May 16, 2024
1 parent 27cb3f3 commit 90c0dc8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/contracts/BPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ contract BPool is BBronze, BToken, BMath {
calcInGivenOut(tokenInBalance, inRecord.denorm, tokenOutBalance, outRecord.denorm, tokenAmountOut, _swapFee);
require(tokenAmountIn <= maxAmountIn, 'ERR_LIMIT_IN');

tokenOutBalance = badd(tokenOutBalance, tokenAmountIn);
tokenInBalance = badd(tokenInBalance, tokenAmountIn);
tokenOutBalance = bsub(tokenOutBalance, tokenAmountOut);

spotPriceAfter = calcSpotPrice(tokenInBalance, inRecord.denorm, tokenOutBalance, outRecord.denorm, _swapFee);
Expand Down
2 changes: 0 additions & 2 deletions test/unit/BPool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,7 @@ contract BPool_Unit_SwapExactAmountOut is BasePoolTest {
_;
}

// TODO: fix this test
function test_HappyPath(SwapExactAmountOut_FuzzScenario memory _fuzz) public happyPath(_fuzz) {
vm.skip(true);
uint256 _maxPrice = type(uint256).max;
uint256 _maxAmountIn = type(uint256).max;
bPool.swapExactAmountOut(tokenIn, _maxAmountIn, tokenOut, _fuzz.tokenAmountOut, _maxPrice);
Expand Down

0 comments on commit 90c0dc8

Please sign in to comment.