From 73ac5c7c8f8c13cdaacaca5faddc4b548c504574 Mon Sep 17 00:00:00 2001 From: 0xAustrian Date: Thu, 16 May 2024 10:25:20 -0300 Subject: [PATCH] test: improve weights in assumes --- test/unit/BPool.t.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/unit/BPool.t.sol b/test/unit/BPool.t.sol index 60674fba..f1509961 100644 --- a/test/unit/BPool.t.sol +++ b/test/unit/BPool.t.sol @@ -610,8 +610,8 @@ contract BPool_Unit_SwapExactAmountIn is BasePoolTest { function _assumeHappyPath(SwapExactAmountIn_FuzzScenario memory _fuzz) internal pure { // safe bound assumptions - _fuzz.tokenInDenorm = bound(_fuzz.tokenInDenorm, MIN_WEIGHT, MAX_WEIGHT); - _fuzz.tokenOutDenorm = bound(_fuzz.tokenOutDenorm, MIN_WEIGHT, MAX_WEIGHT); + _fuzz.tokenInDenorm = bound(_fuzz.tokenInDenorm, MIN_WEIGHT, MAX_WEIGHT / 2); + _fuzz.tokenOutDenorm = bound(_fuzz.tokenOutDenorm, MIN_WEIGHT, MAX_WEIGHT / 2); _fuzz.swapFee = bound(_fuzz.swapFee, MIN_FEE, MAX_FEE); // min @@ -748,8 +748,8 @@ contract BPool_Unit_SwapExactAmountOut is BasePoolTest { function _assumeHappyPath(SwapExactAmountOut_FuzzScenario memory _fuzz) internal pure { // safe bound assumptions - _fuzz.tokenInDenorm = bound(_fuzz.tokenInDenorm, MIN_WEIGHT, MAX_WEIGHT); - _fuzz.tokenOutDenorm = bound(_fuzz.tokenOutDenorm, MIN_WEIGHT, MAX_WEIGHT); + _fuzz.tokenInDenorm = bound(_fuzz.tokenInDenorm, MIN_WEIGHT, MAX_WEIGHT / 2); + _fuzz.tokenOutDenorm = bound(_fuzz.tokenOutDenorm, MIN_WEIGHT, MAX_WEIGHT / 2); _fuzz.swapFee = bound(_fuzz.swapFee, MIN_FEE, MAX_FEE); // min @@ -898,9 +898,9 @@ contract BPool_Unit_JoinswapExternAmountIn is BasePoolTest { function _assumeHappyPath(JoinswapExternAmountIn_FuzzScenario memory _fuzz) internal pure { // safe bound assumptions - _fuzz.tokenInDenorm = bound(_fuzz.tokenInDenorm, MIN_WEIGHT, MAX_WEIGHT); + _fuzz.tokenInDenorm = bound(_fuzz.tokenInDenorm, MIN_WEIGHT, MAX_WEIGHT / 2); _fuzz.swapFee = bound(_fuzz.swapFee, MIN_FEE, MAX_FEE); - _fuzz.totalWeight = bound(_fuzz.totalWeight, MIN_WEIGHT * MAX_BOUND_TOKENS, MAX_WEIGHT * MAX_BOUND_TOKENS); + _fuzz.totalWeight = bound(_fuzz.totalWeight, MIN_WEIGHT * MAX_BOUND_TOKENS, MAX_TOTAL_WEIGHT); vm.assume(_fuzz.totalSupply >= INIT_POOL_SUPPLY);