Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

There is no way to undo evm_increaseTime #7

Closed
hodlbank opened this issue Aug 11, 2017 · 3 comments
Closed

There is no way to undo evm_increaseTime #7

hodlbank opened this issue Aug 11, 2017 · 3 comments

Comments

@hodlbank
Copy link

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)

  1. Start testrpc
  2. Note current time
  3. issue evm_snapshot
  4. issue evm_increaseTime(365 * 86400)
  5. issue evm_revert
  6. 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 Fix getTransactionCount leading zeros in hex string #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
@jaddison
Copy link

This is addressed in PR #2. trufflesuite/ganache-cli-archive#390 is the testrpc related issue. This is a fairly debilitating bug.

@chris-shyft
Copy link

#81

here's the fix <3 w tests!!

@mikeseese
Copy link
Contributor

Closed by #2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants