From 8b3522ef2321b6ccfac22573a32c91f0a95a1d82 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 23 Jan 2019 21:26:58 +0530 Subject: [PATCH] Fix the tests --- mythril/laser/ethereum/state/calldata.py | 7 ++----- mythril/laser/smt/bitvec.py | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mythril/laser/ethereum/state/calldata.py b/mythril/laser/ethereum/state/calldata.py index 26780a4f..7f016be2 100644 --- a/mythril/laser/ethereum/state/calldata.py +++ b/mythril/laser/ethereum/state/calldata.py @@ -41,7 +41,7 @@ class BaseCalldata: """ result = self.size if isinstance(result, int): - return BitVec(symbol_factory.BitVecVal(result, 256)) + return symbol_factory.BitVecVal(result, 256) return result def get_word_at(self, offset: int) -> Expression: @@ -138,10 +138,7 @@ class ConcreteCalldata(BaseCalldata): :param item: :return: """ - item = cast( - BitVec, - symbol_factory.BitVecVal(item, 256) if isinstance(item, int) else item, - ) + item = symbol_factory.BitVecVal(item, 256) if isinstance(item, int) else item return simplify(self._calldata[item]) def concrete(self, model: Model) -> list: diff --git a/mythril/laser/smt/bitvec.py b/mythril/laser/smt/bitvec.py index cfad231d..8347352c 100644 --- a/mythril/laser/smt/bitvec.py +++ b/mythril/laser/smt/bitvec.py @@ -11,6 +11,7 @@ Annotations = List[Any] # fmt: off + class BitVec(Expression[z3.BitVecRef]): """A bit vector symbol."""