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

Local network not restarting for every run #6

Open
ohaponiuk opened this issue Dec 20, 2021 · 5 comments
Open

Local network not restarting for every run #6

ohaponiuk opened this issue Dec 20, 2021 · 5 comments

Comments

@ohaponiuk
Copy link

I noticed that when I run tests with hardhat-watcher on local hardhat network if I spam tests, signers' balances don't reset and I get weird bugs where they don't have enough funds because they used them in the previous run of the same test.

@alexandrethsilva
Copy link

@xanderdeseyn Is there any update on this? I'm having the same issue.

@arodundef
Copy link

Same here. I have issues when using evm_increaseTime and the test restart sometime and local hardhat is not restarted

@sahilrajput03
Copy link
Contributor

@ohaponiuk , are you resetting it via await hre.network.provider.send("hardhat_reset") ?

Source

@arodundef
Copy link

arodundef commented Oct 21, 2022

It doesn't work properly. Using only in the function that I need to reset causes this:

@nomicfoundation/hardhat-chai-matchers/src/internal/reverted/reverted.ts:31
          receipt.status === 0,
                  ^
TypeError: Cannot read properties of null (reading 'status')

The idea of using loadFixture from hardhat is already to have a clean and reset node in each test, without the necessity to use beforeEach and afterEach (which will break if you try to reset the node state again). It works when running tests without test watcher, even if you use many time travel functions.

@sahilrajput03
Copy link
Contributor

can you provide a MRE please?

Repository owner deleted a comment from redtree0 Feb 20, 2024
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

No branches or pull requests

4 participants