brownie icon indicating copy to clipboard operation
brownie copied to clipboard

chain.mine with timedelta not working on Hardhat

Open EdNoepel opened this issue 2 years ago • 1 comments

Environment information

  • brownie Version: 1.18.1
  • ganache-cli Version: 0.1.5
  • solc Version: 0.8.0
  • Python Version: 3.8.10
  • OS: linux

What was wrong?

Calls to chain.mine which specify a timedelta do not work when using hardhat as network. Specifically, upon submitting a subsequent transaction, a RPCRequestError is raised stating the next block timestamp is lower than the previous block timestamp.

How can it be fixed?

I have not delved into the eth-brownie source, but I put together a sample project to consistently reproduce the behavior: https://github.com/EdNoepel/brownie-test-issues/blob/master/tests/test_mining.py

EdNoepel avatar Apr 19 '22 16:04 EdNoepel

Possibly relevant: https://github.com/eth-brownie/brownie/issues/709

EdNoepel avatar Apr 19 '22 16:04 EdNoepel