You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Hardhat Network config has a chains property, which is a Map. But if you use deepmerge with a map, it gets converted to an object (and you lose its contents):
> deepmerge({}, {a: new Map([[1, 1]])})
{ a: {} }
I don't know what's the right solution here. There is an open issue about this in the deepmerge repo and the author created an alternative that seems to support maps and sets, maybe that helps?
Steps to reproduce
Try this piece of code with the most recent (2.9.3) hardhat version and this config referencing our clone of hardhat-local-networks-config-plugin.
You will see the test failing with TypeError: config.chains.has is not a function when trying to hardhat_reset.
1) Forking test
"before all" hook for "should work":
TypeError: config.chains.has is not a function
at Function.create (node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:199:25)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async HardhatNetworkProvider._init (node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:250:28)
at async HardhatNetworkProvider._send (node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:191:5)
at async HardhatNetworkProvider.request (node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:117:18)
at async resetFork (test/system/staking.test.js:5:5)
at async Context.<anonymous> (test/system/staking.test.js:19:5)
The text was updated successfully, but these errors were encountered:
See: NomicFoundation/hardhat#2630
It is no longer possible to use
hardhat-local-networks-config
and run tests on a forked mainnet chain.Quoting @fvictorio:
Steps to reproduce
Try this piece of code with the most recent (2.9.3) hardhat version and this config referencing our clone of
hardhat-local-networks-config-plugin
.You will see the test failing with
TypeError: config.chains.has is not a function
when trying tohardhat_reset
.The text was updated successfully, but these errors were encountered: