-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Reset ethers provider after a hardhat_reset #1024
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
Conversation
@@ -58,6 +58,10 @@ export class HttpProvider extends EventEmitter implements EIP1193Provider { | |||
throw error; | |||
} | |||
|
|||
if (args.method === "hardhat_reset") { | |||
this.emit("hardhat_reset"); |
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.
Not sure about the name of this event.
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.
maybe hardhatNetwokReset
? I'd create a constant.
} | ||
|
||
if (args.method === "hardhat_reset") { | ||
this.emit("hardhat_reset"); |
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.
Shouldn't we emit it in the node and just fwd it in the provider?
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.
As far as I understand, a new node is created on a reset, so that wouldn't be possible, would it?
Closes #1015
There are a lot of changes in the test file, but they are mostly whitespace because of an extra
describe
block around them.