Skip to content

Commit 7bfec3b

Browse files
authored
Merge pull request #13430 from ethereum/fix-gnosis-test-inconsistent-dependency
Fix inconsistent nested dependency in safe-contracts
2 parents f802eaf + 71c3c26 commit 7bfec3b

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

test/externalTests/gnosis.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ BINARY_TYPE="$1"
3131
BINARY_PATH="$(realpath "$2")"
3232
SELECTED_PRESETS="$3"
3333

34-
function compile_fn { npm run build; }
35-
function test_fn { npm test; }
34+
function compile_fn { npx npm run build; }
35+
function test_fn { npx npm test; }
3636

3737
function gnosis_safe_test
3838
{
@@ -87,33 +87,44 @@ function gnosis_safe_test
8787
sed -i "s|it\(('can only be called from Safe itself'\)|it.skip\1|g" test/libraries/Migration.spec.ts
8888
sed -i "s|it\(('should enforce delegatecall to MultiSend'\)|it.skip\1|g" test/libraries/MultiSend.spec.ts
8989

90+
# Force nested abstract-provider dependencies to be at version 5.6.0. Version 5.7.0 of @ethersproject/abstract-provider
91+
# introduced a new field in FeeData, which causes clashes unless all dependency packages of abstract-provider are pegged
92+
# to the same version. As we've already had to peg @ethersproject/contracts to 5.6.0 earlier, we are doing so now with
93+
# @ethersproject/abstract-provider as well.
94+
jq '.overrides."@ethersproject/abstract-provider"="5.6.0" |
95+
.overrides."@ethersproject/[email protected]"
96+
."@ethersproject/abstract-provider"="5.6.0"' package.json > package.json.tmp
97+
mv package.json.tmp package.json
98+
9099
neutralize_package_lock
91100
neutralize_package_json_hooks
92101
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"
93102
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var"
94-
npm install
95-
npm install hardhat-gas-reporter
103+
# [email protected]+ is required for `overrides` support
104+
npm install npm@>8.3.0
105+
npx npm install
106+
npx npm install hardhat-gas-reporter
96107

97108
# Typescript compilation fails with typescript >= 4.7:
98109
# Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`
99-
npm install "typescript@<4.7.0"
110+
npx npm install "typescript@<4.7.0"
100111

101112
# With ethers.js 5.6.2 many tests for revert messages fail.
102113
# TODO: Remove when https://github.com/ethers-io/ethers.js/discussions/2849 is resolved.
103-
npm install [email protected]
114+
npx npm install [email protected]
104115

105116
# Note that [email protected] depends on @ethersproject/[email protected] while the dependency on hardhat-deploy
106117
# pulls @ethersproject/[email protected] (latest). Force 5.6.0 to avoid errors due to having two copies.
107-
npm install @ethersproject/[email protected]
118+
npx npm install @ethersproject/[email protected]
108119

109120
# 2.1.1 started causing failures in safe-contracts external tests after a contract address check was introduced
110121
# in https://github.com/NomicFoundation/hardhat/pull/2916, and so to avoid errors, the package is now pegged.
111122
# TODO: Remove when https://github.com/safe-global/safe-contracts/issues/436 is resolved.
112-
npm install @nomiclabs/[email protected]
123+
npx npm install @nomiclabs/[email protected]
113124

114125
# Hardhat 2.9.5 introduced a bug with handling padded arguments to getStorageAt().
115126
# TODO: Remove when https://github.com/NomicFoundation/hardhat/issues/2709 is fixed.
116-
npm install [email protected]
127+
npx npm install [email protected]
117128

118129
replace_version_pragmas
119130
[[ $BINARY_TYPE == solcjs ]] && force_solc_modules "${DIR}/solc/dist"

0 commit comments

Comments
 (0)