Skip to content

Commit b0ffccc

Browse files
authored
Use specific hardhat version on openzeppelin and gp2 external tests (#14938)
1 parent 759f5a7 commit b0ffccc

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

Diff for: .circleci/config.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -1913,17 +1913,15 @@ workflows:
19131913
- t_ext: *job_ems_compile_ext_colony
19141914

19151915
- t_ext: *job_native_compile_ext_gnosis
1916-
# TODO: Re-enable once bumped to use Cancun supported hardhat version
1917-
# - t_ext: *job_native_test_ext_zeppelin
1916+
- t_ext: *job_native_test_ext_zeppelin
19181917
- t_ext: *job_native_test_ext_ens
19191918
- t_ext: *job_native_test_ext_yield_liquidator
19201919
- t_ext: *job_native_test_ext_perpetual_pools
19211920
- t_ext: *job_native_test_ext_uniswap
19221921
- t_ext: *job_native_test_ext_prb_math
19231922
- t_ext: *job_native_test_ext_elementfi
19241923
- t_ext: *job_native_test_ext_brink
1925-
# TODO: Re-enable once bumped to use Cancun supported hardhat version
1926-
# - t_ext: *job_native_compile_ext_gp2
1924+
- t_ext: *job_native_compile_ext_gp2
19271925
- t_ext: *job_native_compile_ext_euler
19281926
- t_ext: *job_native_compile_ext_pool_together
19291927
# TODO: Dropping the external tests below since they are based on old forks and
@@ -1937,16 +1935,14 @@ workflows:
19371935
requires:
19381936
- t_ems_compile_ext_colony
19391937
- t_native_compile_ext_gnosis
1940-
# TODO: Re-enable once bumped to use Cancun supported hardhat version
1941-
# - t_native_test_ext_zeppelin
1938+
- t_native_test_ext_zeppelin
19421939
- t_native_test_ext_ens
19431940
- t_native_test_ext_yield_liquidator
19441941
- t_native_test_ext_perpetual_pools
19451942
- t_native_test_ext_uniswap
19461943
- t_native_test_ext_elementfi
19471944
- t_native_test_ext_brink
1948-
# TODO: Re-enable once bumped to use Cancun supported hardhat version
1949-
# - t_native_compile_ext_gp2
1945+
- t_native_compile_ext_gp2
19501946
# TODO: Dropping prb-math from the benchmarks since it is not implemented yet
19511947
# in the new Foundry external testing infrastructure.
19521948
# - t_native_test_ext_prb_math

Diff for: test/externalTests/gp2.sh

+9
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ function gp2_test
6666
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var"
6767
force_hardhat_unlimited_contract_size "$config_file" "$config_var"
6868
yarn
69+
# We require to install hardhat 2.20.0 due to support for evm version cancun, otherwise we get the following error:
70+
# Invalid value {"blockGasLimit":12500000,"hardfork":"cancun","allowUnlimitedContractSize":true} for HardhatConfig.networks.hardhat - Expected a value of type HardhatNetworkConfig.
71+
# See: https://github.com/NomicFoundation/hardhat/issues/4176
72+
73+
74+
# Ignore bench directory which fails to compile with current hardhat and ethers versions.
75+
# bench/trace/gas.ts:123:19 - error TS2339: Property 'equals' does not exist on type 'Uint8Array'.
76+
jq '. + {"exclude": ["bench"]}' tsconfig.json > temp.json
77+
mv temp.json tsconfig.json
6978

7079
# Remove the config section that requires an Etherscan key. We don't need it just to run tests.
7180
sed -i '/^ etherscan: {$/,/^ },$/d' hardhat.config.ts

Diff for: test/externalTests/zeppelin.sh

+6
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ function zeppelin_test
9595
sed -i "s|it(\('calling upgradeToAndCall on the implementation reverts'\)|it.skip(\1|g" test/proxy/utils/UUPSUpgradeable.test.js
9696
sed -i "s|it(\('calling upgradeTo from a contract that is not an ERC1967 proxy\)|it.skip(\1|g" test/proxy/utils/UUPSUpgradeable.test.js
9797
sed -i "s|it(\('calling upgradeToAndCall from a contract that is not an ERC1967 proxy\)|it.skip(\1|g" test/proxy/utils/UUPSUpgradeable.test.js
98+
sed -i "s|it(\('rejects overflow'\)|it.skip(\1|g" test/token/ERC20/ERC20.test.js
99+
sed -i "s|it(\('decimals overflow'\)|it.skip(\1|g" test/token/ERC20/extensions/ERC4626.test.js
98100

99101
# Here only the testToInt(248) and testToInt(256) cases fail so change the loop range to skip them
100102
sed -i "s|range(8, 256, 8)\(.forEach(bits => testToInt(bits));\)|range(8, 240, 8)\1|" test/utils/math/SafeCast.test.js
@@ -103,6 +105,10 @@ function zeppelin_test
103105
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"
104106
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")"
105107
npm install
108+
# We require to install hardhat 2.20.0 due to support for evm version cancun, otherwise we get the following error:
109+
# Invalid value {"blockGasLimit":10000000,"allowUnlimitedContractSize":true,"hardfork":"cancun"} for HardhatConfig.networks.hardhat - Expected a value of type HardhatNetworkConfig.
110+
# See: https://github.com/NomicFoundation/hardhat/issues/4176
111+
npm install [email protected]
106112

107113
replace_version_pragmas
108114
for preset in $SELECTED_PRESETS; do

0 commit comments

Comments
 (0)