From 0929672f07823c6c9b4beb6e407db4eb3bc5a7c3 Mon Sep 17 00:00:00 2001 From: 0xAustrian Date: Wed, 8 May 2024 16:40:26 -0300 Subject: [PATCH] test: improve happyPath --- foundry.toml | 2 +- test/unit/BPool.t.sol | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/foundry.toml b/foundry.toml index 71cfb5de..8599d1c0 100644 --- a/foundry.toml +++ b/foundry.toml @@ -26,7 +26,7 @@ src = 'src/interfaces/' [fuzz] runs = 1000 -max_test_rejects = 10000000 +max_test_rejects = 400000 [rpc_endpoints] mainnet = "${MAINNET_RPC}" diff --git a/test/unit/BPool.t.sol b/test/unit/BPool.t.sol index 9e99ed7b..544964c0 100644 --- a/test/unit/BPool.t.sol +++ b/test/unit/BPool.t.sol @@ -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; @@ -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++) {