Skip to content

Commit f7a075b

Browse files
committed
externalTests: Add force_hardhat_unlimited_contract_size
1 parent f6ca413 commit f7a075b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/externalTests/common.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,26 @@ function force_hardhat_compiler_binary
227227
hardhat_solc_build_subtask "$SOLCVERSION_SHORT" "$SOLCVERSION" "$binary_type" "$solc_path" "$language" >> "$config_file"
228228
}
229229

230+
function force_hardhat_unlimited_contract_size
231+
{
232+
local config_file="$1"
233+
local config_var_name="$2"
234+
235+
printLog "Configuring Hardhat..."
236+
echo "-------------------------------------"
237+
echo "Allow unlimited contract size: true"
238+
echo "-------------------------------------"
239+
240+
if [[ $config_file == *\.js ]]; then
241+
[[ $config_var_name == "" ]] || assertFail
242+
echo "module.exports.networks.hardhat.allowUnlimitedContractSize = true" >> "$config_file"
243+
else
244+
[[ $config_file == *\.ts ]] || assertFail
245+
[[ $config_var_name != "" ]] || assertFail
246+
echo "${config_var_name}.networks!.hardhat!.allowUnlimitedContractSize = true" >> "$config_file"
247+
fi
248+
}
249+
230250
function force_hardhat_compiler_settings
231251
{
232252
local config_file="$1"

0 commit comments

Comments
 (0)