smock
smock copied to clipboard
Using smock on a forked mainnet
Describe the bug Throws and error when running a local hardhat node with forked mainnet
Reproduction steps
npx hardhat node npm run test --network localhost
Error: Smock is only compatible with the "hardhat" network, got: localhost. Follow this issue for more info:
https://github.com/defi-wonderland/smock/issues/29
at Function.create (node_modules/@defi-wonderland/smock/src/sandbox.ts:58:13)
at init (node_modules/@defi-wonderland/smock/src/index.ts:27:27)
at Object.mock (node_modules/@defi-wonderland/smock/src/index.ts:21:23)
Have u tried with 'hardhat' pal?
yes this works, but this will spin up a new empty/or forked network and close it after the test is finished.
What I want to do is a 2step process: 1)testing against "new" network hardhat (working) 2) testing against a running local node