From 6db0bc0823a7edd6f5516416527f25d71337e684 Mon Sep 17 00:00:00 2001 From: Ana Julia Date: Sun, 25 Aug 2024 18:08:25 -0300 Subject: [PATCH] fix testForkFuzz_MultipleDepositorsStakAmountDifferentTimestamp --- test/DelegateStaking.integration.t.sol | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/DelegateStaking.integration.t.sol b/test/DelegateStaking.integration.t.sol index 881aea6..83be4be 100644 --- a/test/DelegateStaking.integration.t.sol +++ b/test/DelegateStaking.integration.t.sol @@ -3,6 +3,7 @@ pragma solidity 0.8.26; import "@forge-std/Test.sol"; +import {console} from "@forge-std/console.sol"; import {FixedPointMathLib} from "@solmate/utils/FixedPointMathLib.sol"; import {TransparentUpgradeableProxy, ITransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; @@ -175,8 +176,10 @@ contract DelegateStakingIntegrationTest is Test { address participant = address(uint160(i)); uint256 expectedTimestamp = timeStaked[i - 1] + 365 days; - // jump the diferrence between expected and actual time - _jumpAhead(expectedTimestamp - vm.getBlockTimestamp()); + if (vm.getBlockTimestamp() < expectedTimestamp) { + // jump the diferrence between expected and actual time + _jumpAhead(expectedTimestamp - vm.getBlockTimestamp()); + } vm.startPrank(participant); uint256 rewardsReceived = delegate.claimRewards(0);