Skip to content

Commit 49d5c0a

Browse files
cameelchriseth
authored andcommitted
Disable external test cases where Hardhat's heuristics break after relaxing inlining
1 parent f0e4392 commit 49d5c0a

File tree

7 files changed

+66
-0
lines changed

7 files changed

+66
-0
lines changed

test/externalTests/ens.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ function ens_test
7575
# In some cases Hardhat does not detect revert reasons properly via IR.
7676
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2115 gets fixed.
7777
sed -i "s|it\(('Does not allow wrapping a name you do not own',\)|it.skip\1|g" test/wrapper/NameWrapper.js
78+
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2453 gets fixed.
79+
sed -i "s|it\(('can set fuses and then burn ability to burn fuses',\)|it.skip\1|g" test/wrapper/NameWrapper.js
80+
sed -i "s|it\(('can set fuses and burn canSetResolver and canSetTTL',\)|it.skip\1|g" test/wrapper/NameWrapper.js
81+
sed -i "s|it\(('Cannot be called if CANNOT_TRANSFER is burned\.',\)|it.skip\1|g" test/wrapper/NameWrapper.js
82+
sed -i "s|it\(('Cannot be called if CANNOT_SET_RESOLVER is burned\.\?',\)|it.skip\1|g" test/wrapper/NameWrapper.js
83+
sed -i "s|it\(('Cannot be called if CANNOT_SET_TTL is burned\.\?',\)|it.skip\1|g" test/wrapper/NameWrapper.js
84+
sed -i "s|it\(('Cannot be called if CREATE_SUBDOMAIN is burned and is a new subdomain',\)|it.skip\1|g" test/wrapper/NameWrapper.js
85+
sed -i "s|it\(('Cannot be called if REPLACE_SUBDOMAIN is burned and is an existing subdomain',\)|it.skip\1|g" test/wrapper/NameWrapper.js
86+
sed -i "s|it\(('Cannot be called if CANNOT_CREATE_SUBDOMAIN is burned and is a new subdomain',\)|it.skip\1|g" test/wrapper/NameWrapper.js
87+
sed -i "s|it\(('Cannot be called if PARENT_CANNOT_CONTROL is burned and is an existing subdomain',\)|it.skip\1|g" test/wrapper/NameWrapper.js
7888

7989
find . -name "*.sol" -exec sed -i -e 's/^\(\s*\)\(assembly\)/\1\/\/\/ @solidity memory-safe-assembly\n\1\2/' '{}' \;
8090

test/externalTests/euler.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ function euler_test
6565
# them for other presets but that's fine - we want same code run for benchmarks to be comparable.
6666
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2453 gets fixed.
6767
sed -i "/expectError: 'JUNK_UPGRADE_TEST_FAILURE'/d" test/moduleUpgrade.js
68+
sed -i "/et\.expect(errMsg)\.to\.contain('e\/collateral-violation');/d" test/flashLoanNative.js
6869

6970
# One of the tests is currently broken in the upstream, due to changed behavior of chainid in @ethereumjs/vm.
7071
# TODO: Remove this when https://github.com/euler-xyz/euler-contracts/issues/119 gets fixed.

test/externalTests/gnosis.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ function gnosis_safe_test
8282
# TODO: Remove this when Gnosis merges https://github.com/gnosis/safe-contracts/pull/394
8383
sed -i "s|\(function isValidSignature(bytes \)calldata\( _data, bytes \)calldata\( _signature)\)|\1memory\2memory\3|g" contracts/handler/CompatibilityFallbackHandler.sol
8484

85+
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2453 gets fixed.
86+
sed -i "s|it\(('should enforce delegatecall'\)|it.skip\1|g" test/accessors/SimulateTxAccessor.spec.ts
87+
sed -i "s|it\(('can only be called from Safe itself'\)|it.skip\1|g" test/libraries/Migration.spec.ts
88+
sed -i "s|it\(('should enforce delegatecall to MultiSend'\)|it.skip\1|g" test/libraries/MultiSend.spec.ts
89+
8590
neutralize_package_lock
8691
neutralize_package_json_hooks
8792
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"

test/externalTests/pool-together.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ function pool_together_test
5959
setup_solc "$DIR" "$BINARY_TYPE" "$BINARY_PATH"
6060
download_project "$repo" "$ref_type" "$ref" "$DIR"
6161

62+
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2453 gets fixed.
63+
sed -i "s|it\(('should fail to return value if value passed does not fit in [0-9]\+ bits'\)|it.skip\1|g" test/libraries/ExtendedSafeCast.test.ts
64+
sed -i "s|it\(('should require an rng to be requested'\)|it.skip\1|g" test/DrawBeacon.test.ts
65+
6266
neutralize_package_lock
6367
neutralize_package_json_hooks
6468
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"

test/externalTests/trident.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ function trident_test
8989
sed -i 's|IStrategy(0)|IStrategy(address(0))|g' contracts/flat/BentoBoxV1Flat.sol
9090
find contracts -name "*.sol" -exec sed -i -e 's/^\(\s*\)\(assembly\)/\1\/\/\/ @solidity memory-safe-assembly\n\1\2/' '{}' \;
9191

92+
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2453 gets fixed.
93+
sed -i 's|it\(("Reverts on direct deployment via factory"\)|it.skip\1|g' test/MasterDeployer.test.ts
94+
9295
# @sushiswap/core package contains contracts that get built with 0.6.12 and fail our compiler
9396
# version check. It's not used by tests so we can remove it.
9497
rm -r node_modules/@sushiswap/core/

test/externalTests/uniswap.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ function uniswap_test
5959
setup_solc "$DIR" "$BINARY_TYPE" "$BINARY_PATH"
6060
download_project "$repo" "$ref_type" "$ref" "$DIR"
6161

62+
# Disable tests that won't pass on the ir presets due to Hardhat heuristics. Note that this also disables
63+
# them for other presets but that's fine - we want same code run for benchmarks to be comparable.
64+
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2115 gets fixed.
65+
sed -i "s|it\(('underpay zero for one and exact in',\)|it.skip\1|g" test/UniswapV3Pool.spec.ts
66+
sed -i "s|it\(('pay in the wrong token zero for one and exact in',\)|it.skip\1|g" test/UniswapV3Pool.spec.ts
67+
sed -i "s|it\(('underpay zero for one and exact out',\)|it.skip\1|g" test/UniswapV3Pool.spec.ts
68+
sed -i "s|it\(('pay in the wrong token zero for one and exact out',\)|it.skip\1|g" test/UniswapV3Pool.spec.ts
69+
sed -i "s|it\(('underpay one for zero and exact in',\)|it.skip\1|g" test/UniswapV3Pool.spec.ts
70+
sed -i "s|it\(('pay in the wrong token one for zero and exact in',\)|it.skip\1|g" test/UniswapV3Pool.spec.ts
71+
sed -i "s|it\(('underpay one for zero and exact out',\)|it.skip\1|g" test/UniswapV3Pool.spec.ts
72+
sed -i "s|it\(('pay in the wrong token one for zero and exact out',\)|it.skip\1|g" test/UniswapV3Pool.spec.ts
73+
6274
neutralize_package_json_hooks
6375
name_hardhat_default_export "$config_file" "$config_var"
6476
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"

test/externalTests/zeppelin.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
# (c) 2019 solidity contributors.
2020
#------------------------------------------------------------------------------
2121

22+
# Disable shellcheck errors on quoted special chars like backticks. Too many false-positives.
23+
# shellcheck disable=SC2016
24+
2225
set -e
2326

2427
source scripts/common.sh
@@ -70,6 +73,34 @@ function zeppelin_test
7073
# In some cases Hardhat does not detect revert reasons properly via IR.
7174
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2453 gets fixed.
7275
sed -i "s|it(\('reverts if the current value is 0'\)|it.skip(\1|g" test/utils/Counters.test.js
76+
sed -i "s|it(\('prevent unauthorized maintenance'\)|it.skip(\1|g" test/governance/TimelockController.test.js
77+
sed -i "s|it(\('cannot cancel invalid operation'\)|it.skip(\1|g" test/governance/TimelockController.test.js
78+
sed -i "s|it(\('reverts if block number >= current block'\)|it.skip(\1|g" test/governance/utils/Votes.test.js
79+
sed -i "s|it(\('reverts if block number >= current block'\)|it.skip(\1|g" test/governance/utils/Votes.behavior.js
80+
sed -i "s|it(\('cannot call onlyInitializable function outside the scope of an initializable function'\)|it.skip(\1|g" test/proxy/utils/Initializable.test.js
81+
sed -i "s|it(\('other accounts cannot unpause'\)|it.skip(\1|g" test/token/ERC20/presets/ERC20PresetMinterPauser.test.js
82+
sed -i "s|it(\('other accounts cannot unpause'\)|it.skip(\1|g" test/token/ERC1155/presets/ERC1155PresetMinterPauser.test.js
83+
sed -i "s|it(\('other accounts cannot pause'\)|it.skip(\1|g" test/token/ERC20/presets/ERC20PresetMinterPauser.test.js
84+
sed -i "s|it(\('other accounts cannot pause'\)|it.skip(\1|g" test/token/ERC1155/presets/ERC1155PresetMinterPauser.test.js
85+
sed -i "s|it(\('reverts when decreasing the allowance'\)|it.skip(\1|g" test/token/ERC20/utils/SafeERC20.test.js
86+
sed -i "s|it(\('reverts when decreasing the allowance to a negative value'\)|it.skip(\1|g" test/token/ERC20/utils/SafeERC20.test.js
87+
sed -i "s|it(\('cannot be released before time limit'\)|it.skip(\1|g" test/token/ERC20/utils/TokenTimelock.test.js
88+
sed -i "s|it(\('cannot be released just before time limit'\)|it.skip(\1|g" test/token/ERC20/utils/TokenTimelock.test.js
89+
sed -i "s|it(\('reverts when sending non-zero amounts'\)|it.skip(\1|g" test/utils/Address.test.js
90+
sed -i "s|it(\('reverts when sending more than the balance'\)|it.skip(\1|g" test/utils/Address.test.js
91+
sed -i "s|it(\('reverts if block number >= current block'\)|it.skip(\1|g" test/utils/Checkpoints.test.js
92+
sed -i "s|it(\('fails deploying a contract if the bytecode length is zero'\)|it.skip(\1|g" test/utils/Create2.test.js
93+
sed -i "s|it(\('fails deploying a contract if factory contract does not have sufficient balance'\)|it.skip(\1|g" test/utils/Create2.test.js
94+
sed -i "s|it(\('reverts on withdrawals'\)|it.skip(\1|g" test/utils/escrow/ConditionalEscrow.test.js
95+
sed -i "s|it(\('does not allow beneficiary withdrawal'\)|it.skip(\1|g" test/utils/escrow/RefundEscrow.test.js
96+
sed -i "s|it(\('rejects deposits'\)|it.skip(\1|g" test/utils/escrow/RefundEscrow.test.js
97+
sed -i "s|it(\('does not allow 0xffffffff'\)|it.skip(\1|g" test/utils/introspection/ERC165Storage.test.js
98+
sed -i "s|it(\('reverts when casting -1'\)|it.skip(\1|g" test/utils/math/SafeCast.test.js
99+
sed -i 's|it(\(`reverts when downcasting 2^\${bits} (\${maxValue.addn(1)})`\)|it.skip(\1|g' test/utils/math/SafeCast.test.js
100+
sed -i 's|it(\(`reverts when downcasting 2^\${bits} + 1 (\${maxValue.addn(2)})`\)|it.skip(\1|g' test/utils/math/SafeCast.test.js
101+
sed -i 's|it(\(`reverts when casting [^`]\+`\)|it.skip(\1|g' test/utils/math/SafeCast.test.js
102+
sed -i "s|it(\('missing value'\)|it.skip(\1|g" test/utils/structs/EnumerableMap.behavior.js
103+
73104
# TODO: Remove this when https://github.com/NomicFoundation/hardhat/issues/2115 gets fixed.
74105
sed -i "s|describe\(('Polygon-Child'\)|describe.skip\1|g" test/crosschain/CrossChainEnabled.test.js
75106

0 commit comments

Comments
 (0)