From 92c03ed7158ca78ac202507e0c2698079ebb9ce4 Mon Sep 17 00:00:00 2001 From: Albert Llimos <53186777+albert-llimos@users.noreply.github.com> Date: Tue, 20 Sep 2022 09:42:08 +0200 Subject: [PATCH] Fix/fix test (#235) * fix: fix test with hardcoded values * test: fix chain time inconsistency --- tests/token_vesting/revoke/test_revoke_nostaking.py | 2 +- tests/token_vesting/revoke/test_revoke_staking.py | 2 +- tests/unit/vault/test_vault_govWithdraw.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/token_vesting/revoke/test_revoke_nostaking.py b/tests/token_vesting/revoke/test_revoke_nostaking.py index 91aaf035..b0068729 100644 --- a/tests/token_vesting/revoke/test_revoke_nostaking.py +++ b/tests/token_vesting/revoke/test_revoke_nostaking.py @@ -74,7 +74,7 @@ def test_revoke_rev_revoker(a, addrs, cf, tokenVestingNoStaking): def test_revoke_rev_revokable(addrs, cf, TokenVesting): - start = 1622400000 + start = getChainTime() cliff = start + QUARTER_YEAR end = start + QUARTER_YEAR + YEAR diff --git a/tests/token_vesting/revoke/test_revoke_staking.py b/tests/token_vesting/revoke/test_revoke_staking.py index 04604224..1cd25ebf 100644 --- a/tests/token_vesting/revoke/test_revoke_staking.py +++ b/tests/token_vesting/revoke/test_revoke_staking.py @@ -66,7 +66,7 @@ def test_revoke_rev_revoker(a, addrs, cf, tokenVestingStaking): def test_revoke_rev_revokable(addrs, cf, TokenVesting): - start = 1622400000 + start = getChainTime() end = start + QUARTER_YEAR + YEAR cliff = end diff --git a/tests/unit/vault/test_vault_govWithdraw.py b/tests/unit/vault/test_vault_govWithdraw.py index 72d0a816..d6bd9a35 100644 --- a/tests/unit/vault/test_vault_govWithdraw.py +++ b/tests/unit/vault/test_vault_govWithdraw.py @@ -63,6 +63,8 @@ def test_govWithdraw( chain.sleep(st_sleepTime) if getChainTime() - cf.keyManager.getLastValidateTime() < AGG_KEY_EMERGENCY_TIMEOUT: + # Add a sleep to ensure that it will revert (brownie is inconsistent with chain time) + chain.sleep(3) with reverts(REV_MSG_VAULT_DELAY): cf.vault.govWithdraw(tokenList, {"from": cf.GOVERNOR}) else: