diff --git a/packages/horizon/test/unit/escrow/getters.t.sol b/packages/horizon/test/unit/escrow/getters.t.sol index 2d348cab2..ded655b39 100644 --- a/packages/horizon/test/unit/escrow/getters.t.sol +++ b/packages/horizon/test/unit/escrow/getters.t.sol @@ -35,20 +35,17 @@ contract GraphEscrowGettersTest is GraphEscrowTest { uint256 amountThawing, uint256 amountCollected ) public useGateway { - amountThawing = bound(amountThawing, 1, MAX_STAKING_TOKENS); - amountCollected = bound(amountCollected, 1, MAX_STAKING_TOKENS); + // Limit thawing and collected to half of MAX_STAKING_TOKENS to ensure valid deposit range + amountThawing = bound(amountThawing, 1, MAX_STAKING_TOKENS / 2); + amountCollected = bound(amountCollected, 1, MAX_STAKING_TOKENS / 2); // amountDeposit must be: // - >= amountThawing (so we can thaw that amount) // - >= amountCollected (so we can collect that amount) // - < amountThawing + amountCollected (so that after collecting, balance < thawing) - // - <= MAX_STAKING_TOKENS (consistent with other tests) + // With the above bounds, this range is guaranteed to be valid uint256 minDeposit = amountThawing > amountCollected ? amountThawing : amountCollected; uint256 maxDeposit = amountThawing + amountCollected - 1; - if (maxDeposit > MAX_STAKING_TOKENS) { - maxDeposit = MAX_STAKING_TOKENS; - } - vm.assume(minDeposit <= maxDeposit); amountDeposit = bound(amountDeposit, minDeposit, maxDeposit); _depositTokens(users.verifier, users.indexer, amountDeposit);