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.
When
hardhat_reset
is used, the counter forevm_snapshot
is reset This can cause issue forevm_revert
to be reverted to unexpected state (if newevm_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.