Add typehints and docs

pull/971/head
Nikhil Parasaram 6 years ago
parent 342f5df0f7
commit 03d73e18b2
  1. 1
      mythril/analysis/report.py
  2. 7
      mythril/support/source_support.py
  3. 2
      mythril/support/support_utils.py

@ -3,7 +3,6 @@ import logging
import json
import operator
from jinja2 import PackageLoader, Environment
from typing import Dict, List
import hashlib

@ -48,5 +48,10 @@ class Source:
else:
assert False # Fail hard
def get_source_index(self, bytecode_hash):
def get_source_index(self, bytecode_hash: str) -> int:
"""
Find the contract index in the list
:param bytecode_hash: The contract hash
:return: The index of the contract in the _source_hash list
"""
return self._source_hash.index(bytecode_hash)

@ -26,7 +26,7 @@ class Singleton(type):
return cls._instances[cls]
def get_code_hash(code):
def get_code_hash(code: str) -> str:
"""
:param code: bytecode
:return: Returns hash of the given bytecode

Loading…
Cancel
Save