NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7k stars 1.35k forks source link

`snapshot.restore` cannot be used when `loadFixture` is used #5435

Open ChristopherDedominici opened 1 week ago

ChristopherDedominici commented 1 week ago

Version of Hardhat

2.22.5

What happened?

See this issue to better understand the problem.

PROBLEM snapshot.restore cannot be used (e.g. in a afterEach) when loadFixture is used, because loadFixture already reset the snapshot. We should better understand if we should allow the users to run snapshot.restore also when loadFixture is used

Minimal reproduction steps

Run the code mentioned in the original issue

Search terms

No response