Open robercano opened 9 months ago
I'm curious what dependency you have between viem and smock. My assumption is there is no dependency that you would be able to use smock to mock/ fake contracts and still query them with viem.
Hi @coreyar,
As far as I understood Smock uses Ethers.js Contract type for instantiating the mocks/fakes. I couldn't manage to use viem Contracts with Smock, but perhaps I was doing it wrong. Have you tried this combination of Hardhat Toolbox for viem and Smock?
I haven't but I played around with it but I dug in a bit today and I was able to get it to work here - https://github.com/coreyar/smock-viem-example/blob/main/test/SmockLock.ts#L152
I need to learn more about how smock works but it is at the evm layer hence the dependency on hardhat but not viem or ethers.
Is your feature request related to a problem? Please describe. We've decided to switch to viem for our project, and we were previously using Smock for our tests. Unfortunately Smock does not support viem so we will need to drop it for now.
Describe the solution you'd like Having viem support in Smock
Describe alternatives you've considered There are no other libraries out there with the same functionality, so there aren't really any alternatives
Additional context If you'd be open to collaboration I could have a look to understand how much work it would involve, or at least help with the effort. I'm really interested in having this :)