force_hardhat_unlimited_contract_size: Initialize 'hardhat' network if is not explicitly configured

This commit is contained in:
Kamil Śliwak 2022-01-19 17:05:00 +01:00
parent e79a25ed7f
commit 8f804333fe

View File

@ -239,12 +239,14 @@ function force_hardhat_unlimited_contract_size
if [[ $config_file == *\.js ]]; then if [[ $config_file == *\.js ]]; then
[[ $config_var_name == "" ]] || assertFail [[ $config_var_name == "" ]] || assertFail
echo "module.exports.networks.hardhat.allowUnlimitedContractSize = true" >> "$config_file" echo "module.exports.networks.hardhat = module.exports.networks.hardhat || {allowUnlimitedContractSize: undefined}"
echo "module.exports.networks.hardhat.allowUnlimitedContractSize = true"
else else
[[ $config_file == *\.ts ]] || assertFail [[ $config_file == *\.ts ]] || assertFail
[[ $config_var_name != "" ]] || assertFail [[ $config_var_name != "" ]] || assertFail
echo "${config_var_name}.networks!.hardhat!.allowUnlimitedContractSize = true" >> "$config_file" echo "${config_var_name}.networks!.hardhat ??= {allowUnlimitedContractSize: undefined};"
fi echo "${config_var_name}.networks!.hardhat!.allowUnlimitedContractSize = true"
fi >> "$config_file"
} }
function force_hardhat_compiler_settings function force_hardhat_compiler_settings