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

There is no way to undo evm_increaseTime #7

@hodlbank

Description

@hodlbank

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions