Fix issues with optimizer (#1499)

* Fix issues with optimizer

* Fix solidity contract test
pull/1501/head
Nikhil Parasaram 3 years ago committed by GitHub
parent d1e31485d7
commit 05a1b5bb7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      mythril/ethereum/util.py
  2. 2
      tests/solidity_contract_test.py

@ -43,11 +43,12 @@ def get_solc_json(file, solc_binary="solc", solc_settings_json=None):
:param solc_settings_json:
:return:
"""
cmd = [solc_binary, "--optimize", "--standard-json", "--allow-paths", "."]
cmd = [solc_binary, "--standard-json", "--allow-paths", "."]
settings = json.loads(solc_settings_json) if solc_settings_json else {}
settings.update(
{
"optimizer": {"enabled": True},
"outputSelection": {
"*": {
"": ["ast"],
@ -58,7 +59,7 @@ def get_solc_json(file, solc_binary="solc", solc_settings_json=None):
"evm.methodIdentifiers",
],
}
}
},
}
)
input_json = json.dumps(

@ -36,7 +36,7 @@ class SolidityContractTest(BaseTestCase):
str(input_file), name="AssertFail", solc_binary=solc_binary
)
code_info = contract.get_source_info(75, constructor=True)
code_info = contract.get_source_info(58, constructor=True)
self.assertEqual(code_info.filename, str(input_file))
self.assertEqual(code_info.lineno, 6)

Loading…
Cancel
Save