Merge pull request #13027 from ethereum/ethersproject-contracts-update-workaround

Workaround for problems caused by forcing ethers@5.6.1 in external tests
This commit is contained in:
chriseth 2022-05-17 12:59:50 +02:00 committed by GitHub
commit bef348aa6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -36,7 +36,7 @@ function test_fn { npm test; }
function gnosis_safe_test
{
local repo="https://github.com/gnosis/safe-contracts.git"
local repo="https://github.com/safe-global/safe-contracts.git"
local ref_type=branch
local ref=main
local config_file="hardhat.config.ts"
@ -73,6 +73,11 @@ function gnosis_safe_test
# them for other presets but that's fine - we want same code run for benchmarks to be comparable.
# TODO: Remove this when Hardhat adjusts heuristics for IR (https://github.com/nomiclabs/hardhat/issues/2115).
sed -i "s|\(it\)\(('should not allow to call setup on singleton'\)|\1.skip\2|g" test/core/GnosisSafe.Setup.spec.ts
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2453 gets fixed.
sed -i 's|\(it\)\(("changes the expected storage slot without touching the most important ones"\)|\1.skip\2|g' test/libraries/SignMessageLib.spec.ts
sed -i "s|\(it\)\(('can be used only via DELEGATECALL opcode'\)|\1.skip\2|g" test/libraries/SignMessageLib.spec.ts
sed -i 's|\(describe\)\(("Upgrade from Safe 1.1.1"\)|\1.skip\2|g' test/migration/UpgradeFromSafe111.spec.ts
sed -i 's|\(describe\)\(("Upgrade from Safe 1.2.0"\)|\1.skip\2|g' test/migration/UpgradeFromSafe120.spec.ts
neutralize_package_lock
neutralize_package_json_hooks
@ -85,6 +90,10 @@ function gnosis_safe_test
# TODO: Remove when https://github.com/ethers-io/ethers.js/discussions/2849 is resolved.
npm install ethers@5.6.1
# Note that ethers@5.6.1 depends on @ethersproject/contracts@5.6.0 while the dependency on hardhat-deploy
# pulls @ethersproject/contracts@5.6.1 (latest). Force 5.6.0 to avoid errors due to having two copies.
npm install @ethersproject/contracts@5.6.0
# Hardhat 2.9.5 introduced a bug with handling padded arguments to getStorageAt().
# TODO: Remove when https://github.com/NomicFoundation/hardhat/issues/2709 is fixed.
npm install hardhat@2.9.4

View File

@ -66,10 +66,6 @@ function perpetual_pools_test
force_hardhat_unlimited_contract_size "$config_file" "$config_var"
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
for preset in $SELECTED_PRESETS; do