Skip to content

Commit

Permalink
test: improve happyPath
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAustrian committed May 8, 2024
1 parent 92cdff7 commit 0929672
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ src = 'src/interfaces/'

[fuzz]
runs = 1000
max_test_rejects = 10000000
max_test_rejects = 400000

[rpc_endpoints]
mainnet = "${MAINNET_RPC}"
Expand Down
5 changes: 2 additions & 3 deletions test/unit/BPool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {LibString} from 'solmate/utils/LibString.sol';
abstract contract Base is Test, BConst {
using LibString for *;

uint256 public constant TOKENS_AMOUNT = 5;
uint256 public constant TOKENS_AMOUNT = 3;

BPool public bPool;
address[TOKENS_AMOUNT] public tokens;
Expand Down Expand Up @@ -352,8 +352,7 @@ contract BPool_Unit_JoinPool is Base {
vm.assume(_fuzz.poolAmountOut >= _fuzz.initPoolSupply);
vm.assume(_fuzz.poolAmountOut < type(uint256).max / BONE);

uint256 _poolAmountOutTimesBONE = _fuzz.poolAmountOut * BONE; // bdiv uses '* BONE'
uint256 _ratio = _poolAmountOutTimesBONE / _fuzz.initPoolSupply;
uint256 _ratio = (_fuzz.poolAmountOut * BONE) / _fuzz.initPoolSupply; // bdiv uses '* BONE'
uint256 _maxTokenAmountIn = type(uint256).max / _ratio;

for (uint256 i = 0; i < _fuzz.balance.length; i++) {
Expand Down

0 comments on commit 0929672

Please sign in to comment.