Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using smock on a forked mainnet #169

Open
derawi opened this issue Oct 28, 2022 · 2 comments
Open

Using smock on a forked mainnet #169

derawi opened this issue Oct 28, 2022 · 2 comments

Comments

@derawi
Copy link

derawi commented Oct 28, 2022

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)
@wei3erHase
Copy link
Member

Have u tried with 'hardhat' pal?

@derawi
Copy link
Author

derawi commented Nov 1, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants