externalTests: Add force_hardhat_unlimited_contract_size

This commit is contained in:
Kamil Śliwak 2022-01-13 17:46:40 +01:00
parent f6ca4132b3
commit f7a075bd48

View File

@ -227,6 +227,26 @@ function force_hardhat_compiler_binary
hardhat_solc_build_subtask "$SOLCVERSION_SHORT" "$SOLCVERSION" "$binary_type" "$solc_path" "$language" >> "$config_file" hardhat_solc_build_subtask "$SOLCVERSION_SHORT" "$SOLCVERSION" "$binary_type" "$solc_path" "$language" >> "$config_file"
} }
function force_hardhat_unlimited_contract_size
{
local config_file="$1"
local config_var_name="$2"
printLog "Configuring Hardhat..."
echo "-------------------------------------"
echo "Allow unlimited contract size: true"
echo "-------------------------------------"
if [[ $config_file == *\.js ]]; then
[[ $config_var_name == "" ]] || assertFail
echo "module.exports.networks.hardhat.allowUnlimitedContractSize = true" >> "$config_file"
else
[[ $config_file == *\.ts ]] || assertFail
[[ $config_var_name != "" ]] || assertFail
echo "${config_var_name}.networks!.hardhat!.allowUnlimitedContractSize = true" >> "$config_file"
fi
}
function force_hardhat_compiler_settings function force_hardhat_compiler_settings
{ {
local config_file="$1" local config_file="$1"