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

fix: anvil mine #1784

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

fix: anvil mine #1784

wants to merge 3 commits into from

Conversation

dudesahn
Copy link

@dudesahn dudesahn commented Jun 26, 2024

What I did

small refactor so chain.mine() works as expected w/ anvil

Currently, chain.mine() or chain.mine(x) both revert with error brownie.exceptions.RPCRequestError: Timestamp error: 1 is lower than or equal to previous block's timestamp

Related issue: #

How I did it

set the mine function to only use evm_mine and to pass blocks instead of defaulting to hardcoded 1

How to verify it

  • chain.mine() mines 1 block
  • chain.mine(x) mines x blocks

Checklist

  • I have confirmed that my PR passes all linting checks
  • I have included test cases
  • I have updated the documentation
  • I have added an entry to the changelog

small refactor so `chain.mine()` works as expected w/ anvil
- `chain.mine()` mines 1 block
- `chain.mine(x)` mines x blocks
clarify in docs what chain.mine() does
@@ -2184,13 +2184,11 @@ Chain Methods
>>> chain.time()
1550189143

.. py:method:: Chain.mine(blocks=1, timestamp=None, timedelta=None)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timestamp and timedelta should still work when using ganache / hardhat so removing the documentation around it feels wrong.

Copy link
Member

@iamdefinitelyahuman iamdefinitelyahuman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is good, please adjust the docs edit and then happy to merge and release it.

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

Successfully merging this pull request may close these issues.

2 participants