Merge pull request #6428 from ethereum/external-tests-optimizer

Fixes forced optimizer settings in external tests
This commit is contained in:
chriseth 2019-04-01 15:35:36 +02:00 committed by GitHub
commit 8e07a2396f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,11 +150,15 @@ function force_solc_settings
local evmVersion="$3"
printLog "Forcing solc settings..."
echo "-------------------------------------"
echo "Config file: $config_file"
echo "Optimizer settings: $settings"
echo "EVM version: $evmVersion"
echo ""
echo "-------------------------------------"
# Forcing the settings should always work by just overwriting the solc object. Forcing them by using a
# dedicated settings objects should only be the fallback.
echo "module.exports['solc'] = { optimizer: $settings, evmVersion: \"$evmVersion\" };" >> "$config_file"
echo "module.exports['compilers']['solc']['settings'] = { optimizer: $settings, evmVersion: \"$evmVersion\" };" >> "$config_file"
}