-
Notifications
You must be signed in to change notification settings - Fork 553
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
Support for Hardhat Network #1043
Conversation
Looks great! I think this covers everything I ran into. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [hardhat] Incorrect transaction gas limit #1024 Fixed
--network hardhat-fork
doesn't work yet, all transactions fail withValueError: Transaction gas limit is 12475600 and exceeds block gas limit of 9500000
. Fixed by overriding the limit when creating a hardhat config. - [hardhat] unlocked account is missing #1025 Tested, impersonation works well.
- [hardhat] network config adds incompatible flags #1026 Tested, one caveat. Spawning hardhat fails because it seems to go into an interactive prompt suggesting creating a project. Brownie should create
hardhat.config.js
prior to spawning hardhat. Fixed in suggestion. - [hardhat] brownie reverts context manager does not catch reverts #1027 Fixed
brownie.reverts
doesn't work properly, gettingValueError: Transaction reverted without a reason
instead. Fixed from Brownie side. The issue also mentions a fix via hardhat config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed all mentioned issues in suggestions. Looks good after that.
There are still problems, cont'd in #1044 |
Need to expose https://hardhat.org/guides/mainnet-forking.html#pinning-a-block and think about some sensible defaults for it |
Also lots of potentially interesting stuff here: https://hardhat.org/hardhat-network/#mining-modes |
Seems like one quality of life improvement would be an ability to inject Hardhat config via RPC. |
Pls cherry pick this too a06a35f |
0903fba
to
89e366c
Compare
This is beautiful. Just ran a few tests.... they are so FAST! I did have to add the network though: Might be good to have that in the docs too. |
Some weird inconsistencies between ganache and hardhat with how time is handled. Implementing #709 alongside this could help |
A fix could look like this, but ideally we need to use error codes to not depend on parsing error messages. message = result["error"]["message"].replace('Error: ', '') # fix for [email protected] |
Bump, what does this need to move forward? |
was waiting for hardhat official release - we got that a few days ago, now i guess the blocker is probably me? really just needs another round of testing and rechecking that everything works as expected, updates to docs... i'm on vacation at the moment tho so moving slowly. |
Have an awesome vacation! Let me know how I can help here. Going to update most of the packages I worked on with hardhat support. |
How can I help? |
af6ecaa
to
9709ecd
Compare
9709ecd
to
6eb8b40
Compare
This is mostly working. The test suite fails from 3 broad issues:
I think this is far enough along to launch it as a sort-of beta integration. As we use it in prod we'll find issues and shortcomings and I'm sure in a month or 2 it will look better than it does today. But for now.. lfgggggg |
Docs updates will come in another PR, I need to do some updates around the EIP1559 functionality as well prior to pushing out a |
by global hardhat install, do you mean |
What I did
Add preliminary support for Hardhat Network as a testing environment.
To test this, you must currently install the
hardhat@dtt
package. The required features for this integration will not merge to the main hardhat repo until after the Berlin fork, in the mean time this PR should also be considered a WIP.To test, create a Brownie project and then install hardhat inside it:
You can now use hardhat as a dev environment with
--network hardhat
or hardhat fork mode using--network hardhat-fork
.How I did it
Most of the groundwork for this was laid in previous PRs (#997, #998). The integration is made possible via a new backend module and a hardhat-specific middleware.
How to verify it
Try it! And please report any issues you encounter.
TODO
Before this merges, the test suite should be modified to target both hardhat and ganache. We also need to start use this in our daily lives and smoke out any weird edge cases or other oddities.
Closes #1024
Closes #1025
Closes #1026
Closes #1027