We encountered an issue where an error is thrown when working with a structure like this:
001_deploy:
Defines Diamond Root
Tag: root
002_deploy:
Defines Diamond A
Tag: a
Dependencies: ['root']
003_deploy:
Defines Diamond B
Tag b
Dependencies: ['root']
And two test files, which use either a or b.
test1:
await deployments.fixtures(['a'])
test2:
await deployments.fixtures(['b']).
In this case test2 fails with the following error message:
TypeError: diamondProxy.facets is not a function
at _deployViaDiamondProxy (node_modules/hardhat-deploy/src/helpers.ts:1929:38)
at async _deployViaDiamondProxy (node_modules/hardhat-deploy/src/helpers.ts:2444:11)
at async Object.func (deploy/001_deploy.ts:47:39)
at async DeploymentsManager.executeDeployScripts (node_modules/hardhat-deploy/src/DeploymentsManager.ts:1226:22)
at async DeploymentsManager.runDeploy (node_modules/hardhat-deploy/src/DeploymentsManager.ts:1059:5)
at async Object.fixture (node_modules/hardhat-deploy/src/DeploymentsManager.ts:316:9)
at async Context.<anonymous> (test/products/test2.ts:9:5)
at DeploymentsManager.executeDeployScripts (node_modules/hardhat-deploy/src/DeploymentsManager.ts:1229:19)
at async DeploymentsManager.runDeploy (node_modules/hardhat-deploy/src/DeploymentsManager.ts:1059:5)
at async Object.fixture (node_modules/hardhat-deploy/src/DeploymentsManager.ts:316:9)
at async Context.<anonymous> (test/products//003_deploy.ts:9:5)
When switching the tests around the same error, but in the other test file (e.g. a or b). So the second attempt, when deploying the other contract and looking up the dependency to root something goes off rail.
Workaround for now is to ALWAYS specify ALL tags in the dependencies.fixtures(['root', 'a', 'b']) call.
Describe the bug
We encountered an issue where an error is thrown when working with a structure like this:
001_deploy:
002_deploy:
003_deploy:
And two test files, which use either a or b.
test1:
await deployments.fixtures(['a'])
test2:
await deployments.fixtures(['b']).
In this case test2 fails with the following error message:
When switching the tests around the same error, but in the other test file (e.g. a or b). So the second attempt, when deploying the other contract and looking up the dependency to root something goes off rail.
Workaround for now is to ALWAYS specify ALL tags in the dependencies.fixtures(['root', 'a', 'b']) call.
To Reproduce
see above
Expected behavior
see above
versions