Skip to content

Commit bee3e79

Browse files
committed
test: fix vm.assume too many rejections
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
1 parent a2abc90 commit bee3e79

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/horizon/test/unit/escrow/getters.t.sol

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ contract GraphEscrowGettersTest is GraphEscrowTest {
3535
uint256 amountThawing,
3636
uint256 amountCollected
3737
) public useGateway useDeposit(amountDeposit) {
38-
vm.assume(amountThawing > 0);
39-
vm.assume(amountDeposit > 0);
40-
vm.assume(amountDeposit >= amountThawing);
41-
vm.assume(amountDeposit >= amountCollected);
42-
vm.assume(amountDeposit - amountCollected < amountThawing);
38+
// amountCollected must be >= 1 for valid range, and <= amountDeposit
39+
amountCollected = bound(amountCollected, 1, amountDeposit);
40+
// amountThawing must be in (amountDeposit - amountCollected, amountDeposit]
41+
amountThawing = bound(amountThawing, amountDeposit - amountCollected + 1, amountDeposit);
4342

4443
// thaw some funds
4544
_thawEscrow(users.verifier, users.indexer, amountThawing);

0 commit comments

Comments
 (0)