Merge pull request #12868 from ethereum/ext-tests-workaround-for-ethers-5.6.2-breaking-revert-string-testing

Workarounds for ext test breakage (ethers.js downgrade, disabled polygon test in zeppelin, switch to compiler-only in elementfi)
This commit is contained in:
Leo 2022-04-04 11:05:15 +02:00 committed by GitHub
commit 37a4e9e3db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 7 deletions

View File

@ -42,9 +42,9 @@ function elementfi_test
local config_file="hardhat.config.ts"
local config_var=config
local compile_only_presets=()
local settings_presets=(
"${compile_only_presets[@]}"
local compile_only_presets=(
# ElementFi's test suite is hard-coded for mainnet forked via alchemy.io.
# Locally we can only compile.
#ir-no-optimize # Compilation fails with "YulException: Variable var_amount_9311 is 10 slot(s) too deep inside the stack."
#ir-optimize-evm-only # Compilation fails with "YulException: Variable var_amount_9311 is 10 slot(s) too deep inside the stack."
ir-optimize-evm+yul
@ -52,6 +52,9 @@ function elementfi_test
legacy-optimize-evm-only
legacy-optimize-evm+yul
)
local settings_presets=(
"${compile_only_presets[@]}"
)
[[ $SELECTED_PRESETS != "" ]] || SELECTED_PRESETS=$(circleci_select_steps_multiarg "${settings_presets[@]}")
print_presets_or_exit "$SELECTED_PRESETS"

View File

@ -65,6 +65,10 @@ function ens_test
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")"
yarn install
# With ethers.js 5.6.2 many tests for revert messages fail.
# TODO: Remove when https://github.com/ethers-io/ethers.js/discussions/2849 is resolved.
yarn add ethers@5.6.1
replace_version_pragmas
neutralize_packaged_contracts

View File

@ -68,6 +68,10 @@ function euler_test
force_hardhat_unlimited_contract_size "$config_file"
npm install
# With ethers.js 5.6.2 many tests for revert messages fail.
# TODO: Remove when https://github.com/ethers-io/ethers.js/discussions/2849 is resolved.
npm install ethers@5.6.1
replace_version_pragmas
neutralize_packaged_contracts

View File

@ -81,6 +81,10 @@ function gnosis_safe_test
npm install
npm install hardhat-gas-reporter
# With ethers.js 5.6.2 many tests for revert messages fail.
# TODO: Remove when https://github.com/ethers-io/ethers.js/discussions/2849 is resolved.
npm install ethers@5.6.1
replace_version_pragmas
[[ $BINARY_TYPE == solcjs ]] && force_solc_modules "${DIR}/solc/dist"

View File

@ -66,10 +66,9 @@ function perpetual_pools_test
force_hardhat_unlimited_contract_size "$config_file" "$config_var"
yarn install
# The project depends on @openzeppelin/hardhat-upgrades, which is currently not prepared
# for the parallel compilation introduced in Hardhat 2.9.0.
# TODO: Remove when https://github.com/OpenZeppelin/openzeppelin-upgrades/issues/528 is fixed.
yarn add hardhat@2.8.4
# With ethers.js 5.6.2 many tests for revert messages fail.
# TODO: Remove when https://github.com/ethers-io/ethers.js/discussions/2849 is resolved.
yarn add ethers@5.6.1
replace_version_pragmas

View File

@ -77,6 +77,10 @@ function uniswap_test
yarn install
yarn add hardhat-gas-reporter
# With ethers.js 5.6.2 many tests for revert messages fail.
# TODO: Remove when https://github.com/ethers-io/ethers.js/discussions/2849 is resolved.
yarn add ethers@5.6.1
replace_version_pragmas
for preset in $SELECTED_PRESETS; do

View File

@ -70,6 +70,8 @@ function zeppelin_test
# In some cases Hardhat does not detect revert reasons properly via IR.
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2453 gets fixed.
sed -i "s|it(\('reverts if the current value is 0'\)|it.skip(\1|g" test/utils/Counters.test.js
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2115 gets fixed.
sed -i "s|describe\(('Polygon-Child'\)|describe.skip\1|g" test/crosschain/CrossChainEnabled.test.js
neutralize_package_json_hooks
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"