Skip to content

Commit 9065a0a

Browse files
authored
Merge pull request ethereum#14932 from ethereum/add-hardhat-networks-settings-ext-tests
Add hardhat networks settings external tests
2 parents cc79c91 + 6b3ca24 commit 9065a0a

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

.circleci/config.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -1919,11 +1919,13 @@ workflows:
19191919
- t_ext: *job_native_test_ext_elementfi
19201920
- t_ext: *job_native_test_ext_brink
19211921
- t_ext: *job_native_compile_ext_gp2
1922-
- t_ext: *job_native_compile_ext_trident
19231922
- t_ext: *job_native_compile_ext_euler
1924-
- t_ext: *job_native_compile_ext_bleeps
19251923
- t_ext: *job_native_compile_ext_pool_together
1926-
- t_ext: *job_native_compile_ext_chainlink
1924+
# TODO: Dropping the external tests below since they are based on old forks and
1925+
# fail after update the default evm version to cancun.
1926+
#- t_ext: *job_native_compile_ext_trident
1927+
#- t_ext: *job_native_compile_ext_chainlink
1928+
#- t_ext: *job_native_compile_ext_bleeps
19271929

19281930
- c_ext_benchmarks:
19291931
<<: *requires_nothing
@@ -1941,11 +1943,13 @@ workflows:
19411943
# TODO: Dropping prb-math from the benchmarks since it is not implemented yet
19421944
# in the new Foundry external testing infrastructure.
19431945
# - t_native_test_ext_prb_math
1944-
- t_native_compile_ext_trident
19451946
- t_native_compile_ext_euler
1946-
- t_native_compile_ext_bleeps
19471947
- t_native_compile_ext_pool_together
1948-
- t_native_compile_ext_chainlink
1948+
# TODO: Dropping the external tests below since they are based on old forks and
1949+
# fail after update the default evm version to cancun.
1950+
#- t_native_compile_ext_trident
1951+
#- t_native_compile_ext_chainlink
1952+
#- t_native_compile_ext_bleeps
19491953

19501954
# Windows build and tests
19511955
- b_win: *requires_nothing

scripts/externalTests/common.sh

+4
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,16 @@ function force_hardhat_compiler_settings
332332
echo "require('hardhat-gas-reporter');"
333333
echo "module.exports.gasReporter = ${gas_reporter_settings};"
334334
echo "module.exports.solidity = ${compiler_settings};"
335+
echo "module.exports.networks.hardhat = module.exports.networks.hardhat || { hardfork: '${evm_version}' }"
336+
echo "module.exports.networks.hardhat.hardfork = '${evm_version}'"
335337
else
336338
[[ $config_file == *\.ts ]] || assertFail
337339
[[ $config_var_name != "" ]] || assertFail
338340
echo 'import "hardhat-gas-reporter";'
339341
echo "${config_var_name}.gasReporter = ${gas_reporter_settings};"
340342
echo "${config_var_name}.solidity = {compilers: [${compiler_settings}]};"
343+
echo "${config_var_name}.networks!.hardhat = ${config_var_name}.networks!.hardhat ?? { hardfork: '${evm_version}' };"
344+
echo "${config_var_name}.networks!.hardhat!.hardfork = '${evm_version}'"
341345
fi >> "$config_file"
342346
}
343347

test/externalTests/brink.sh

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ function brink_test
6464
# TODO: Remove this when Brink merges https://github.com/brinktrade/brink-core/pull/52
6565
sed -i "s|\(function isValidSignature(bytes \)calldata\( _data, bytes \)calldata\( _signature)\)|\1memory\2memory\3|g" src/Test/MockEIP1271Validator.sol
6666

67+
neutralize_package_lock
6768
neutralize_package_json_hooks
6869
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"
6970
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var" "$CURRENT_EVM_VERSION" "$extra_settings" "$extra_optimizer_settings"

test/externalTests/elementfi.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ function elementfi_test
9999
# "ProviderError: Too Many Requests error received from eth-mainnet.alchemyapi.io"
100100
rm test/mockERC20YearnVaultTest.ts
101101

102-
# Several tests fail unless we use the exact versions hard-coded in package-lock.json
103-
#neutralize_package_lock
104-
102+
neutralize_package_lock
105103
neutralize_package_json_hooks
106104
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"
107105
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var"

test/externalTests/gnosis.sh

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ function gnosis_safe_test
7676
sed -i "s|\(it\)\((\"can be used only via DELEGATECALL opcode\"\)|\1.skip\2|g" test/libraries/SignMessageLib.spec.ts
7777
sed -i "s|it\((\"can only be called from Safe itself\"\)|it.skip\1|g" test/libraries/Migration.spec.ts
7878

79+
neutralize_package_lock
7980
neutralize_package_json_hooks
8081
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"
8182
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var"

test/externalTests/pool-together.sh

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ function pool_together_test
6666
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"
6767
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var"
6868
yarn install
69+
# Hardhat 2.20.0 is the last version that works. Newer versions throw this error:
70+
# Unexpected config HardhatConfig.networks.hardhat.initialBaseFeePerGas found - This field is only valid for networks with EIP-1559. Try a newer hardfork or remove it.
71+
yarn add hardhat@2.20.0
6972

7073
# These come with already compiled artifacts. We want them recompiled with latest compiler.
7174
rm -r node_modules/@pooltogether/yield-source-interface/artifacts/

0 commit comments

Comments
 (0)