There is no way to undo evm_increaseTime
hodlbank opened this issue · 3 comments
hodlbank commented
Expected Behavior
There is no way to undo evm_increaseTime. See "Current Behavior".
Current Behavior
- evm_increaseTime does not accept negative values, treats them as 0.
- evm_snapshot does not capture current BlockchainDouble.timeAdjustment , so...
- ... evm_revert does not undo effects of evm_increaseTime
Possible Solution
Either:
- add evm_setTime geth API.
- make evm_increaseTime to accept negative values.
- make evm_snapshot capture current BlockchainDouble.timeAdjustment and evm_revert to restore snapshot including time.
Steps to Reproduce (for bugs)
- Start testrpc
- Note current time
- issue evm_snapshot
- issue evm_increaseTime(365 * 86400)
- issue evm_revert
- observe current testrpc time, which is still 365 days from now in future.
Context
We make snapshots and do some test pieces inside these snapshots.
Calls to evm_increaseTime alters times outside of snapshots, affecting other tests.
Your Environment
- Version used: EthereumJS TestRPC v4.0.1 (ganache-core: 1.0.1)
- Environment name and version: NodeJS v6.11.0
- Server type and version: Truffle v3.4.3 (core: 3.4.1)
- Operating System and version: Linux 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
jaddison commented
This is addressed in PR #2. trufflesuite/ganache-cli-archive#390 is the testrpc related issue. This is a fairly debilitating bug.
chris-shyft commented
here's the fix <3 w tests!!