Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chain time is inconsistent #1492

Open
theref opened this issue Mar 30, 2022 · 0 comments
Open

Chain time is inconsistent #1492

theref opened this issue Mar 30, 2022 · 0 comments

Comments

@theref
Copy link
Contributor

theref commented Mar 30, 2022

Environment information

  • brownie Version: 1.18.1
  • ganache-cli Version: 6.12.2 (ganache-core: 2.13.2)
  • solc Version: 1.1.1
  • Python Version: 3.9.10
  • OS: osx

What was wrong?

When interacting with the chain.time() (eg, sleep, mine etc) the timings are inconsistent.
This can be easily demonstrated with:

from brownie import chain


def test_chain_time():
    for _ in range(100):
        now = chain.time()
        chain.sleep(100)
        chain.mine()
        then = chain.time()
        assert now + 100 == then

Running the above test in a fresh brownie project will fail, but only sporadically.

This is probably related to #709

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

No branches or pull requests

1 participant