From a7cbb41bf946026510f5e4bf5d566bae4d0de94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 13 Jan 2022 23:08:01 +0100 Subject: [PATCH] externalTests: Add name_hardhat_default_export --- test/externalTests/common.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/externalTests/common.sh b/test/externalTests/common.sh index 4c0fed8d3..fe73dc67a 100644 --- a/test/externalTests/common.sh +++ b/test/externalTests/common.sh @@ -211,6 +211,17 @@ function force_truffle_compiler_settings echo "module.exports['compilers'] = $(truffle_compiler_settings "$solc_path" "$preset" "$evm_version");" >> "$config_file" } +function name_hardhat_default_export +{ + local config_file="$1" + local config_var_name="$2" + + local import="import {HardhatUserConfig} from 'hardhat/types';" + local config="const config: HardhatUserConfig = {" + sed -i "s|^\s*export\s*default\s*{|${import}\n${config}|g" "$config_file" + echo "export default config;" >> "$config_file" +} + function force_hardhat_compiler_binary { local config_file="$1"