defi-wonderland / smock

The Solidity mocking library
MIT License
319 stars 40 forks source link

EVM Reset bug #55

Closed alejoamiras closed 3 years ago

alejoamiras commented 3 years ago

Describe the bug Calling evm.reset() blocks the creation of a new fake.

Reproduction steps

const fake1 = await smock.fake('MyContract');
await fake1.callStatic.something(); // will be fine

await network.provider.request({
    method: 'hardhat_reset',
    params: [],
});

const fake2 = await smock.fake('MyOtherContract');
await fake2.callStatic.somethingElse(); // will revert

Expected behavior fake2 should be mocked, and behave as such. N items should be able to be mocked.

System Specs:

Additional context Showed with @0xGorilla how to reproduce.