NomicFoundation / hardhat

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

issues when using both hardhat_reset and evm_revert / evm_snapshot #991

Open wighawag opened 4 years ago

wighawag commented 4 years ago

When hardhat_reset is used, the counter for evm_snapshot is reset This can cause issue for evm_revert to be reverted to unexpected state (if new evm_snapshot call reach to the same snapshot id of a previously snapshot)

In general for library that use evm_revert/evm_snapshot it would be useful to have a way to detect a revert.

As mentioned on a separate channel with @alcuadrado It could be solved by a new api like hardhat_checkpoint / hardhat_revert_checkpoint that would consider a reset.

gitpusha commented 4 years ago

thanks for reporting @wighawag