mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
externalTests: Helper for neutralizing package locks
This commit is contained in:
parent
b57c0a0b81
commit
7b7cc081db
@ -96,6 +96,14 @@ function replace_version_pragmas
|
|||||||
find . test -name '*.sol' -type f -print0 | xargs -0 sed -i -E -e 's/pragma solidity [^;]+;/pragma solidity >=0.0;/'
|
find . test -name '*.sol' -type f -print0 | xargs -0 sed -i -E -e 's/pragma solidity [^;]+;/pragma solidity >=0.0;/'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function neutralize_package_lock
|
||||||
|
{
|
||||||
|
# Remove lock files (if they exist) to prevent them from overriding our changes in package.json
|
||||||
|
printLog "Removing package lock files..."
|
||||||
|
rm --force --verbose yarn.lock
|
||||||
|
rm --force --verbose package-lock.json
|
||||||
|
}
|
||||||
|
|
||||||
function force_truffle_solc_modules
|
function force_truffle_solc_modules
|
||||||
{
|
{
|
||||||
local soljson="$1"
|
local soljson="$1"
|
||||||
|
@ -44,9 +44,7 @@ function ens_test
|
|||||||
# Use latest Truffle. Older versions crash on the output from 0.8.0.
|
# Use latest Truffle. Older versions crash on the output from 0.8.0.
|
||||||
force_truffle_version ^5.1.55
|
force_truffle_version ^5.1.55
|
||||||
|
|
||||||
# Remove the lock file (if it exists) to prevent it from overriding our changes in package.json
|
neutralize_package_lock
|
||||||
rm -f package-lock.json
|
|
||||||
|
|
||||||
replace_version_pragmas
|
replace_version_pragmas
|
||||||
force_truffle_solc_modules "$SOLJSON"
|
force_truffle_solc_modules "$SOLJSON"
|
||||||
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
||||||
|
@ -45,9 +45,7 @@ function gnosis_safe_test
|
|||||||
sed -i 's|github:gnosis/mock-contract#sol_0_5_0|github:solidity-external-tests/mock-contract#master_080|g' package.json
|
sed -i 's|github:gnosis/mock-contract#sol_0_5_0|github:solidity-external-tests/mock-contract#master_080|g' package.json
|
||||||
sed -i -E 's|"@gnosis.pm/util-contracts": "[^"]+"|"@gnosis.pm/util-contracts": "github:solidity-external-tests/util-contracts#solc-7_080"|g' package.json
|
sed -i -E 's|"@gnosis.pm/util-contracts": "[^"]+"|"@gnosis.pm/util-contracts": "github:solidity-external-tests/util-contracts#solc-7_080"|g' package.json
|
||||||
|
|
||||||
# Remove the lock file (if it exists) to prevent it from overriding our changes in package.json
|
neutralize_package_lock
|
||||||
rm -f package-lock.json
|
|
||||||
|
|
||||||
replace_version_pragmas
|
replace_version_pragmas
|
||||||
force_truffle_solc_modules "$SOLJSON"
|
force_truffle_solc_modules "$SOLJSON"
|
||||||
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
||||||
|
@ -43,9 +43,7 @@ function gnosis_safe_test
|
|||||||
|
|
||||||
sed -i 's|github:gnosis/mock-contract#sol_0_5_0|github:solidity-external-tests/mock-contract#master_080|g' package.json
|
sed -i 's|github:gnosis/mock-contract#sol_0_5_0|github:solidity-external-tests/mock-contract#master_080|g' package.json
|
||||||
|
|
||||||
# Remove the lock file (if it exists) to prevent it from overriding our changes in package.json
|
neutralize_package_lock
|
||||||
rm -f package-lock.json
|
|
||||||
|
|
||||||
replace_version_pragmas
|
replace_version_pragmas
|
||||||
force_truffle_solc_modules "$SOLJSON"
|
force_truffle_solc_modules "$SOLJSON"
|
||||||
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
force_truffle_compiler_settings "$config_file" "${DIR}/solc" "$min_optimizer_level"
|
||||||
|
Loading…
Reference in New Issue
Block a user