external test scripts: Replace global $FORCE_ABIv2 variable with a parameter

This commit is contained in:
Kamil Śliwak 2020-12-01 20:38:15 +01:00
parent a6921bc39b
commit fcf0538224
5 changed files with 8 additions and 6 deletions

View File

@ -31,7 +31,6 @@ function test_fn { yarn run test:contracts; }
function colony_test
{
OPTIMIZER_LEVEL=3
FORCE_ABIv2=false
CONFIG="truffle.js"
truffle_setup https://github.com/solidity-external-tests/colonyNetwork.git develop_070
@ -42,7 +41,7 @@ function colony_test
git clone https://github.com/solidity-external-tests/dappsys-monolithic.git -b master_060 dappsys
cd ..
truffle_run_test compile_fn test_fn
truffle_run_test compile_fn test_fn "NO-FORCE-ABI-V2"
}
external_test ColonyNetworks colony_test

View File

@ -234,6 +234,9 @@ function truffle_run_test
{
local compile_fn="$1"
local test_fn="$2"
local force_abi_v2_flag="$3"
test "$force_abi_v2_flag" = "FORCE-ABI-V2" || test "$force_abi_v2_flag" = "NO-FORCE-ABI-V2"
replace_version_pragmas
force_solc "$CONFIG" "$DIR" "$SOLJSON"
@ -258,7 +261,7 @@ function truffle_run_test
clean
force_solc_settings "$CONFIG" "$optimize" "istanbul"
# Force abi coder v2 in the last step. Has to be the last because code is modified.
if [ "$FORCE_ABIv2" = true ]; then
if [ "$force_abi_v2_flag" = "FORCE-ABI-V2" ]; then
[[ "$optimize" =~ yul ]] && force_abi_v2
fi

View File

@ -42,7 +42,7 @@ function ens_test
run_install install_fn
truffle_run_test compile_fn test_fn
truffle_run_test compile_fn test_fn "NO-FORCE-ABI-V2"
}
external_test Ens ens_test

View File

@ -43,7 +43,7 @@ function gnosis_safe_test
run_install install_fn
replace_libsolc_call
truffle_run_test compile_fn test_fn
truffle_run_test compile_fn test_fn "NO-FORCE-ABI-V2"
}
external_test Gnosis-Safe gnosis_safe_test

View File

@ -36,7 +36,7 @@ function zeppelin_test
truffle_setup https://github.com/solidity-external-tests/openzeppelin-contracts.git upgrade-0.7.0
run_install install_fn
truffle_run_test compile_fn test_fn
truffle_run_test compile_fn test_fn "NO-FORCE-ABI-V2"
}
external_test Zeppelin zeppelin_test