Skip to content

Commit

Permalink
Fix typehints for latest mypy release (Consensys#1221)
Browse files Browse the repository at this point in the history
  • Loading branch information
norhh authored Sep 26, 2019
1 parent 028fae6 commit 90f2de8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions mythril/analysis/modules/unchecked_retval.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,9 @@ def _analyze_state(self, state: GlobalState) -> list:
assert state.environment.code.instruction_list[state.mstate.pc - 1][
"opcode"
] in ["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"]
retval = state.mstate.stack[-1]
# Use Typed Dict after release of mypy 0.670 and remove type ignore
return_value = state.mstate.stack[-1]
retvals.append(
{ # type: ignore
"address": state.instruction["address"] - 1,
"retval": retval,
}
{"address": state.instruction["address"] - 1, "retval": return_value}
)

return []
Expand Down
2 changes: 1 addition & 1 deletion mythril/laser/ethereum/state/calldata.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __getitem__(self, item: Union[int, slice, BitVec]) -> Any:
try:
current_index = (
start
if isinstance(start, Expression)
if isinstance(start, BitVec)
else symbol_factory.BitVecVal(start, 256)
)
parts = []
Expand Down

0 comments on commit 90f2de8

Please sign in to comment.