diff --git a/test/Collateral.t.sol b/test/Collateral.t.sol index ceeb1993..6a2de040 100644 --- a/test/Collateral.t.sol +++ b/test/Collateral.t.sol @@ -254,8 +254,8 @@ contract DepositCollateral is CollateralTest { } function test_depositCollateral_ETH_Fuzz(uint256 amount) public { - /// @dev amount must be less than max MarketCollateralAmount - vm.assume(amount < 1_000_000_000_000_000_000_000); + /// @dev amount must be less than max MarketCollateralAmount - currentDepositedCollateral + vm.assume(amount < MAX_WRAPPABLE_AMOUNT); vm.assume(amount > SMALLEST_AMOUNT); vm.deal(ACTOR, amount); @@ -520,7 +520,7 @@ contract WithdrawCollateral is CollateralTest { uint256 preBalance = ACTOR.balance; /// @dev amount must be less than max MarketCollateralAmount - vm.assume(amount < 1_000_000_000_000_000_000_000); + vm.assume(amount < MAX_WRAPPABLE_AMOUNT); vm.assume(amount > SMALLEST_AMOUNT); vm.deal(ACTOR, amount); diff --git a/test/utils/Constants.sol b/test/utils/Constants.sol index 96001427..72525084 100644 --- a/test/utils/Constants.sol +++ b/test/utils/Constants.sol @@ -62,6 +62,8 @@ contract Constants { uint256 internal constant SMALLEST_AMOUNT = 100 wei; + uint256 internal constant MAX_WRAPPABLE_AMOUNT = 900_000_000_000_000_000_000; + address internal constant MARKET_CONFIGURATION_MODULE = address(0xC0FE); uint256 internal constant ZERO_CO_FEE = 0;