Skip to content

Commit

Permalink
Use specific hardhat version on openzeppelin and gp2 external tests (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
r0qs authored Mar 14, 2024
1 parent 759f5a7 commit b0ffccc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1913,17 +1913,15 @@ workflows:
- t_ext: *job_ems_compile_ext_colony

- t_ext: *job_native_compile_ext_gnosis
# TODO: Re-enable once bumped to use Cancun supported hardhat version
# - t_ext: *job_native_test_ext_zeppelin
- t_ext: *job_native_test_ext_zeppelin
- t_ext: *job_native_test_ext_ens
- t_ext: *job_native_test_ext_yield_liquidator
- t_ext: *job_native_test_ext_perpetual_pools
- t_ext: *job_native_test_ext_uniswap
- t_ext: *job_native_test_ext_prb_math
- t_ext: *job_native_test_ext_elementfi
- t_ext: *job_native_test_ext_brink
# TODO: Re-enable once bumped to use Cancun supported hardhat version
# - t_ext: *job_native_compile_ext_gp2
- t_ext: *job_native_compile_ext_gp2
- t_ext: *job_native_compile_ext_euler
- t_ext: *job_native_compile_ext_pool_together
# TODO: Dropping the external tests below since they are based on old forks and
Expand All @@ -1937,16 +1935,14 @@ workflows:
requires:
- t_ems_compile_ext_colony
- t_native_compile_ext_gnosis
# TODO: Re-enable once bumped to use Cancun supported hardhat version
# - t_native_test_ext_zeppelin
- t_native_test_ext_zeppelin
- t_native_test_ext_ens
- t_native_test_ext_yield_liquidator
- t_native_test_ext_perpetual_pools
- t_native_test_ext_uniswap
- t_native_test_ext_elementfi
- t_native_test_ext_brink
# TODO: Re-enable once bumped to use Cancun supported hardhat version
# - t_native_compile_ext_gp2
- t_native_compile_ext_gp2
# TODO: Dropping prb-math from the benchmarks since it is not implemented yet
# in the new Foundry external testing infrastructure.
# - t_native_test_ext_prb_math
Expand Down
9 changes: 9 additions & 0 deletions test/externalTests/gp2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ function gp2_test
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var"
force_hardhat_unlimited_contract_size "$config_file" "$config_var"
yarn
# We require to install hardhat 2.20.0 due to support for evm version cancun, otherwise we get the following error:
# Invalid value {"blockGasLimit":12500000,"hardfork":"cancun","allowUnlimitedContractSize":true} for HardhatConfig.networks.hardhat - Expected a value of type HardhatNetworkConfig.
# See: https://github.com/NomicFoundation/hardhat/issues/4176
yarn add [email protected]

# Ignore bench directory which fails to compile with current hardhat and ethers versions.
# bench/trace/gas.ts:123:19 - error TS2339: Property 'equals' does not exist on type 'Uint8Array'.
jq '. + {"exclude": ["bench"]}' tsconfig.json > temp.json
mv temp.json tsconfig.json

# Remove the config section that requires an Etherscan key. We don't need it just to run tests.
sed -i '/^ etherscan: {$/,/^ },$/d' hardhat.config.ts
Expand Down
6 changes: 6 additions & 0 deletions test/externalTests/zeppelin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ function zeppelin_test
sed -i "s|it(\('calling upgradeToAndCall on the implementation reverts'\)|it.skip(\1|g" test/proxy/utils/UUPSUpgradeable.test.js
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
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
sed -i "s|it(\('rejects overflow'\)|it.skip(\1|g" test/token/ERC20/ERC20.test.js
sed -i "s|it(\('decimals overflow'\)|it.skip(\1|g" test/token/ERC20/extensions/ERC4626.test.js

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

replace_version_pragmas
for preset in $SELECTED_PRESETS; do
Expand Down

0 comments on commit b0ffccc

Please sign in to comment.