wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.17k stars 283 forks source link

Does external deployments config work with `hh node --no-deploy`? #408

Closed jack-wombat closed 1 year ago

jack-wombat commented 1 year ago

Does hardhat-deploy skips loading existing and external deployments when --no-deploy is present? I was looking for a way to have local hardhat simulate mainnet as much as possible. I came across to the external deployments config in https://github.com/wighawag/hardhat-deploy/issues/56.

However, when I run hh node with the --no-deploy flag, the await deployments.all() is empty. But await deployments.getArtifact() still seem to work. Most of my code is using deployments.get() which relies on deployments.all().

jack-wombat commented 1 year ago

Ping @wighawag

wighawag commented 1 year ago

hmm, it should work. DO you have reproduction repo I could look at ?

jack-wombat commented 1 year ago

I figured this out. I need to add also localhost to the external deployments config.

Example:

config.external = {
    deployments: { 
      hardhat: ['deployments/mainnet'], 
      localhost:['deployments/mainnet'] 
    },
  }