Raise error as exception and reformat code with black

pull/646/head
Nikhil Parasaram 6 years ago
parent 1835bcd6c8
commit ea0b155c6b
  1. 2
      mythril/laser/ethereum/call.py
  2. 4
      mythril/laser/ethereum/state.py
  3. 4
      mythril/laser/ethereum/util.py

@ -124,7 +124,7 @@ def get_callee_account(global_state, callee_address, dynamic_loader):
code = dynamic_loader.dynld(environment.active_account.address, callee_address) code = dynamic_loader.dynld(environment.active_account.address, callee_address)
except ValueError as error: except ValueError as error:
logging.debug("Unable to execute dynamic loader because: {}".format(str(error))) logging.debug("Unable to execute dynamic loader because: {}".format(str(error)))
raise ValueError(str(error)) raise error
if code is None: if code is None:
logging.debug("No code returned, not a contract account?") logging.debug("No code returned, not a contract account?")
raise ValueError() raise ValueError()

@ -100,9 +100,7 @@ class Calldata:
if stop is None: if stop is None:
stop = self.calldatasize stop = self.calldatasize
current_index = ( current_index = (
start start if isinstance(start, BitVecRef) else BitVecVal(start, 256)
if isinstance(start, BitVecRef)
else BitVecVal(start, 256)
) )
dataparts = [] dataparts = []
while simplify(current_index != stop): while simplify(current_index != stop):

@ -89,7 +89,9 @@ def get_concrete_int(item):
def concrete_int_from_bytes(_bytes, start_index): def concrete_int_from_bytes(_bytes, start_index):
_bytes = [_byte.as_long() if type(_byte) == BitVecNumRef else _byte for _byte in _bytes] _bytes = [
_byte.as_long() if type(_byte) == BitVecNumRef else _byte for _byte in _bytes
]
b = _bytes[start_index : start_index + 32] b = _bytes[start_index : start_index + 32]
val = int.from_bytes(b, byteorder="big") val = int.from_bytes(b, byteorder="big")

Loading…
Cancel
Save