-
Why do we construct a new file "helper-hardhat-config.js" ?? why not use this const networkConfig = { in the file "hardhat-config.js" ??? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It would lead to a circular dependency, and also as it is irrelevant in We intend on keeping the contents inside Hardhat does not need to know of our networkConfig, we are using it for our own logic. Put simply, networkConfig does not belong there and only used for OUR purposes, so we make a helper config. You definitely could do that, but it would go against following the Modularity principle of Software Engineering - of keeping modules' content relevant to itself. It is also easier to debug this way, when everything has its own attribute. Put simply, keeping things specific to themselves. Hope this helps! |
Beta Was this translation helpful? Give feedback.
It would lead to a circular dependency, and also as it is irrelevant in
hardhat-config.js
We intend on keeping the contents inside
hardhat-config.js
solely for importing packages which Hardhat requires, and further configurations for Hardhat. So, it's relevance is solely for Hardhat and should be kept that way. Or, put simply, contents only which Hardhat needs.Hardhat does not need to know of our networkConfig, we are using it for our own logic.
Put simply, networkConfig does not belong there and only used for OUR purposes, so we make a helper config.
You definitely could do that, but it would go against following the Modularity principle of Software Engineering - of keeping modules' con…