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

test: auto mine functionality to eth-tester #1972

Merged
merged 4 commits into from
Mar 28, 2024

Conversation

antazoey
Copy link
Member

What I did

fixes: #1968

How I did it

does the same as https://github.com/ApeWorX/ape-foundry/pull/59/files but for ape-test

thought: maybe need to squeeze this into the api class to keep things uniform, but i implemented the same as ape-foundry's just in case.

How to verify it

connect to ape-test provider which uses eth-tester, and then you can do this

from ape import chain

chain.provider.automine = True
...
chain.provider.automine = False

by default, it is on.

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

assert not eth_tester_provider.auto_mine

# Ensure can still manually mine.
block = eth_tester_provider.get_block("latest").number
Copy link
Member Author

Choose a reason for hiding this comment

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

attempted to repro #1969 but mining still seems to work, at least at the provider level.

Copy link
Member

Choose a reason for hiding this comment

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

Is this a blocker?

Copy link
Member Author

Choose a reason for hiding this comment

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

not for this feature particularly. if we can get them to upgrade we can see if that helps them else will have to look for more info.

@antazoey antazoey requested a review from fubuloubu March 27, 2024 20:28
src/ape_test/provider.py Outdated Show resolved Hide resolved
assert not eth_tester_provider.auto_mine

# Ensure can still manually mine.
block = eth_tester_provider.get_block("latest").number
Copy link
Member

Choose a reason for hiding this comment

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

Is this a blocker?

@antazoey antazoey merged commit a4753da into ApeWorX:main Mar 28, 2024
15 checks passed
@antazoey antazoey deleted the fix/automine-ethtester branch March 28, 2024 20:50
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.

Expose automining via TestProviderAPI
2 participants