From c2396a50faa3e9cb0b536756e8e1a31d88661c05 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Sun, 14 Oct 2018 00:13:00 +0200 Subject: [PATCH] Move blockchain interfacing code to ethereum.interface --- mythril/{leveldb => ethereum}/__init__.py | 0 mythril/{rpc => ethereum/interface}/__init__.py | 0 mythril/ethereum/interface/leveldb/__init__.py | 0 .../{ => ethereum/interface}/leveldb/accountindexing.py | 0 mythril/{ => ethereum/interface}/leveldb/client.py | 8 ++++---- mythril/{ => ethereum/interface}/leveldb/eth_db.py | 0 mythril/{ => ethereum/interface}/leveldb/state.py | 0 mythril/ethereum/interface/rpc/__init__.py | 0 mythril/{ => ethereum/interface}/rpc/base_client.py | 0 mythril/{ => ethereum/interface}/rpc/client.py | 0 mythril/{ => ethereum/interface}/rpc/constants.py | 0 mythril/{ => ethereum/interface}/rpc/exceptions.py | 0 mythril/{ => ethereum/interface}/rpc/utils.py | 0 mythril/mythril.py | 6 +++--- tests/rpc_test.py | 2 +- 15 files changed, 8 insertions(+), 8 deletions(-) rename mythril/{leveldb => ethereum}/__init__.py (100%) rename mythril/{rpc => ethereum/interface}/__init__.py (100%) create mode 100644 mythril/ethereum/interface/leveldb/__init__.py rename mythril/{ => ethereum/interface}/leveldb/accountindexing.py (100%) rename mythril/{ => ethereum/interface}/leveldb/client.py (96%) rename mythril/{ => ethereum/interface}/leveldb/eth_db.py (100%) rename mythril/{ => ethereum/interface}/leveldb/state.py (100%) create mode 100644 mythril/ethereum/interface/rpc/__init__.py rename mythril/{ => ethereum/interface}/rpc/base_client.py (100%) rename mythril/{ => ethereum/interface}/rpc/client.py (100%) rename mythril/{ => ethereum/interface}/rpc/constants.py (100%) rename mythril/{ => ethereum/interface}/rpc/exceptions.py (100%) rename mythril/{ => ethereum/interface}/rpc/utils.py (100%) diff --git a/mythril/leveldb/__init__.py b/mythril/ethereum/__init__.py similarity index 100% rename from mythril/leveldb/__init__.py rename to mythril/ethereum/__init__.py diff --git a/mythril/rpc/__init__.py b/mythril/ethereum/interface/__init__.py similarity index 100% rename from mythril/rpc/__init__.py rename to mythril/ethereum/interface/__init__.py diff --git a/mythril/ethereum/interface/leveldb/__init__.py b/mythril/ethereum/interface/leveldb/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/mythril/leveldb/accountindexing.py b/mythril/ethereum/interface/leveldb/accountindexing.py similarity index 100% rename from mythril/leveldb/accountindexing.py rename to mythril/ethereum/interface/leveldb/accountindexing.py diff --git a/mythril/leveldb/client.py b/mythril/ethereum/interface/leveldb/client.py similarity index 96% rename from mythril/leveldb/client.py rename to mythril/ethereum/interface/leveldb/client.py index 81c3f9e4..164185de 100644 --- a/mythril/leveldb/client.py +++ b/mythril/ethereum/interface/leveldb/client.py @@ -1,12 +1,12 @@ import binascii import rlp -from mythril.leveldb.accountindexing import CountableList -from mythril.leveldb.accountindexing import ReceiptForStorage, AccountIndexer +from mythril.ethereum.interface.leveldb.accountindexing import CountableList +from mythril.ethereum.interface.leveldb.accountindexing import ReceiptForStorage, AccountIndexer import logging from ethereum import utils from ethereum.block import BlockHeader, Block -from mythril.leveldb.state import State -from mythril.leveldb.eth_db import ETH_DB +from mythril.ethereum.interface.leveldb import State +from mythril.ethereum.interface.leveldb.eth_db import ETH_DB from mythril.ether.ethcontract import ETHContract from mythril.exceptions import AddressNotFoundError diff --git a/mythril/leveldb/eth_db.py b/mythril/ethereum/interface/leveldb/eth_db.py similarity index 100% rename from mythril/leveldb/eth_db.py rename to mythril/ethereum/interface/leveldb/eth_db.py diff --git a/mythril/leveldb/state.py b/mythril/ethereum/interface/leveldb/state.py similarity index 100% rename from mythril/leveldb/state.py rename to mythril/ethereum/interface/leveldb/state.py diff --git a/mythril/ethereum/interface/rpc/__init__.py b/mythril/ethereum/interface/rpc/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/mythril/rpc/base_client.py b/mythril/ethereum/interface/rpc/base_client.py similarity index 100% rename from mythril/rpc/base_client.py rename to mythril/ethereum/interface/rpc/base_client.py diff --git a/mythril/rpc/client.py b/mythril/ethereum/interface/rpc/client.py similarity index 100% rename from mythril/rpc/client.py rename to mythril/ethereum/interface/rpc/client.py diff --git a/mythril/rpc/constants.py b/mythril/ethereum/interface/rpc/constants.py similarity index 100% rename from mythril/rpc/constants.py rename to mythril/ethereum/interface/rpc/constants.py diff --git a/mythril/rpc/exceptions.py b/mythril/ethereum/interface/rpc/exceptions.py similarity index 100% rename from mythril/rpc/exceptions.py rename to mythril/ethereum/interface/rpc/exceptions.py diff --git a/mythril/rpc/utils.py b/mythril/ethereum/interface/rpc/utils.py similarity index 100% rename from mythril/rpc/utils.py rename to mythril/ethereum/interface/rpc/utils.py diff --git a/mythril/mythril.py b/mythril/mythril.py index 9cdeb0fd..027e1211 100644 --- a/mythril/mythril.py +++ b/mythril/mythril.py @@ -20,8 +20,8 @@ import platform from mythril.ether import util from mythril.ether.ethcontract import ETHContract from mythril.ether.soliditycontract import SolidityContract, get_contracts_from_file -from mythril.rpc.client import EthJsonRpc -from mythril.rpc.exceptions import ConnectionError +from mythril.ethereum.interface.rpc.client import EthJsonRpc +from mythril.ethereum.interface.rpc.exceptions import ConnectionError from mythril.support import signatures from mythril.support.truffle import analyze_truffle_project from mythril.support.loader import DynLoader @@ -31,7 +31,7 @@ from mythril.analysis.callgraph import generate_graph from mythril.analysis.traceexplore import get_serializable_statespace from mythril.analysis.security import fire_lasers from mythril.analysis.report import Report -from mythril.leveldb.client import EthLevelDB +from mythril.ethereum.interface.leveldb.client import EthLevelDB # logging.basicConfig(level=logging.DEBUG) diff --git a/tests/rpc_test.py b/tests/rpc_test.py index 89621b64..564c7da8 100644 --- a/tests/rpc_test.py +++ b/tests/rpc_test.py @@ -1,6 +1,6 @@ from unittest import TestCase -from mythril.rpc.client import EthJsonRpc +from mythril.ethereum.interface.rpc.client import EthJsonRpc class RpcTest(TestCase): client = None