defi-wonderland / smock

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

feat request: return hardhat errors on failed factories #110

Closed jcmonte closed 2 years ago

jcmonte commented 2 years ago

Is your feature request related to a problem? Please describe. We were getting an unable to generate smock spec from string error when trying to construct a fake from an interface contract. It wasn't directly clear from smock what the issue was. In our case, we found the root cause to be that there were two different IERC20 artifacts in the repo -- which breaks getContractFactory. See hardhat error: multiple artifacts for a contract issue

Describe the solution you'd like We should probably surface errors when parsing the spec string

Additional context https://github.com/defi-wonderland/smock/blob/d6397b7ed3b414395f43a97f697ef22fb46054a2/src/factories/ethers-interface.ts#L6-L19

wei3erHase commented 2 years ago

hi @JChiaramonte7, thanks for pointing this out, we've created a task to the roadmap to address this issue, hope this is fixed soon :)

wei3erHase commented 2 years ago

closed with #127