From 1233feb3589c365838b18dfccabd2208697034f1 Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 2 Nov 2018 17:12:41 +0100 Subject: [PATCH] style: fix imports --- trezorctl | 1 - trezorlib/btc.py | 2 +- trezorlib/debuglink.py | 2 +- trezorlib/tests/device_tests/common.py | 3 +-- trezorlib/tests/device_tests/test_msg_signtx.py | 5 ++--- trezorlib/tests/device_tests/test_msg_signtx_bcash.py | 2 +- trezorlib/tests/device_tests/test_msg_signtx_bgold.py | 2 +- trezorlib/tests/device_tests/test_msg_signtx_capricoin.py | 2 +- trezorlib/tests/device_tests/test_msg_signtx_decred.py | 2 +- trezorlib/tests/device_tests/test_msg_signtx_zcash.py | 4 ++-- trezorlib/tests/device_tests/test_op_return.py | 3 +-- trezorlib/tests/device_tests/test_zerosig.py | 3 +-- trezorlib/tx_api.py | 4 +--- 13 files changed, 14 insertions(+), 21 deletions(-) diff --git a/trezorctl b/trezorctl index 6e8a39a47..e3f859aa4 100755 --- a/trezorctl +++ b/trezorctl @@ -21,7 +21,6 @@ # along with this library. If not, see . import base64 -import decimal import json import os import sys diff --git a/trezorlib/btc.py b/trezorlib/btc.py index df4840d5d..8186c164f 100644 --- a/trezorlib/btc.py +++ b/trezorlib/btc.py @@ -1,4 +1,4 @@ -from . import messages, tools +from . import messages from .tools import CallException, expect, normalize_nfc, session diff --git a/trezorlib/debuglink.py b/trezorlib/debuglink.py index 3cea074be..3c2bad847 100644 --- a/trezorlib/debuglink.py +++ b/trezorlib/debuglink.py @@ -17,7 +17,7 @@ from copy import deepcopy from mnemonic import Mnemonic -from . import messages as proto, tools, protobuf +from . import messages as proto, protobuf, tools from .client import TrezorClient from .tools import expect diff --git a/trezorlib/tests/device_tests/common.py b/trezorlib/tests/device_tests/common.py index 4be44aebf..7a8981b06 100644 --- a/trezorlib/tests/device_tests/common.py +++ b/trezorlib/tests/device_tests/common.py @@ -14,9 +14,8 @@ # You should have received a copy of the License along with this library. # If not, see . -import os -from trezorlib import coins, debuglink, device +from trezorlib import debuglink, device from trezorlib.debuglink import TrezorClientDebugLink from trezorlib.messages.PassphraseSourceType import HOST as PASSPHRASE_ON_HOST diff --git a/trezorlib/tests/device_tests/test_msg_signtx.py b/trezorlib/tests/device_tests/test_msg_signtx.py index 95f0b0cc8..5b6fb5fa8 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx.py +++ b/trezorlib/tests/device_tests/test_msg_signtx.py @@ -17,12 +17,11 @@ import pytest from trezorlib import btc, messages as proto -from trezorlib.coins import tx_api -from trezorlib.tools import H_, CallException, parse_path, btc_hash +from trezorlib.tools import H_, CallException, btc_hash, parse_path +from ..support.tx_cache import tx_cache from .common import TrezorTest from .conftest import TREZOR_VERSION -from ..support.tx_cache import tx_cache TXHASH_157041 = bytes.fromhex( "1570416eb4302cf52979afd5e6909e37d8fdd874301f7cc87e547e509cb1caa6" diff --git a/trezorlib/tests/device_tests/test_msg_signtx_bcash.py b/trezorlib/tests/device_tests/test_msg_signtx_bcash.py index a25d53c2d..ab4bb9f24 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx_bcash.py +++ b/trezorlib/tests/device_tests/test_msg_signtx_bcash.py @@ -16,7 +16,7 @@ import pytest -from trezorlib import btc, coins, messages as proto +from trezorlib import btc, messages as proto from trezorlib.tools import H_, CallException, parse_path from ..support.ckd_public import deserialize diff --git a/trezorlib/tests/device_tests/test_msg_signtx_bgold.py b/trezorlib/tests/device_tests/test_msg_signtx_bgold.py index 0bc6b77e8..c8a4926a6 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx_bgold.py +++ b/trezorlib/tests/device_tests/test_msg_signtx_bgold.py @@ -16,7 +16,7 @@ import pytest -from trezorlib import btc, coins, messages as proto +from trezorlib import btc, messages as proto from trezorlib.tools import H_, CallException, parse_path from ..support.ckd_public import deserialize diff --git a/trezorlib/tests/device_tests/test_msg_signtx_capricoin.py b/trezorlib/tests/device_tests/test_msg_signtx_capricoin.py index f703e9b53..2a8e58ed4 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx_capricoin.py +++ b/trezorlib/tests/device_tests/test_msg_signtx_capricoin.py @@ -19,8 +19,8 @@ import pytest from trezorlib import btc, messages from trezorlib.tools import parse_path -from .conftest import setup_client from ..support.tx_cache import tx_cache +from .conftest import setup_client TXHASH_3bf506 = bytes.fromhex( "3bf506c81ce84eda891679ddc797d162c17c60b15d6c0ac23be5e31369e7235f" diff --git a/trezorlib/tests/device_tests/test_msg_signtx_decred.py b/trezorlib/tests/device_tests/test_msg_signtx_decred.py index f70e58263..ceb1116db 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx_decred.py +++ b/trezorlib/tests/device_tests/test_msg_signtx_decred.py @@ -19,8 +19,8 @@ import pytest from trezorlib import btc, messages as proto from trezorlib.tools import parse_path -from .common import TrezorTest from ..support.tx_cache import tx_cache +from .common import TrezorTest TX_API = tx_cache("Decred Testnet") diff --git a/trezorlib/tests/device_tests/test_msg_signtx_zcash.py b/trezorlib/tests/device_tests/test_msg_signtx_zcash.py index 228c3bdf1..a78dc7fde 100644 --- a/trezorlib/tests/device_tests/test_msg_signtx_zcash.py +++ b/trezorlib/tests/device_tests/test_msg_signtx_zcash.py @@ -16,11 +16,11 @@ import pytest -from trezorlib import btc, coins, messages as proto +from trezorlib import btc, messages as proto from trezorlib.tools import parse_path -from .common import TrezorTest from ..support.tx_cache import tx_cache +from .common import TrezorTest TX_API = tx_cache("Zcash Testnet") diff --git a/trezorlib/tests/device_tests/test_op_return.py b/trezorlib/tests/device_tests/test_op_return.py index 7905e8866..4727409e6 100644 --- a/trezorlib/tests/device_tests/test_op_return.py +++ b/trezorlib/tests/device_tests/test_op_return.py @@ -19,11 +19,10 @@ import pytest from trezorlib import btc, messages as proto from trezorlib.tools import CallException +from ..support.tx_cache import tx_cache from .common import TrezorTest from .conftest import TREZOR_VERSION -from ..support.tx_cache import tx_cache - TX_API = tx_cache("Bitcoin") TXHASH_d5f65e = bytes.fromhex( diff --git a/trezorlib/tests/device_tests/test_zerosig.py b/trezorlib/tests/device_tests/test_zerosig.py index 78c053693..61d0f0890 100644 --- a/trezorlib/tests/device_tests/test_zerosig.py +++ b/trezorlib/tests/device_tests/test_zerosig.py @@ -16,9 +16,8 @@ from trezorlib import btc, messages as proto -from .common import TrezorTest - from ..support.tx_cache import tx_cache +from .common import TrezorTest TXHASH_d5f65e = bytes.fromhex( "d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882" diff --git a/trezorlib/tx_api.py b/trezorlib/tx_api.py index 68d4f62c6..8e26a0268 100644 --- a/trezorlib/tx_api.py +++ b/trezorlib/tx_api.py @@ -14,10 +14,8 @@ # You should have received a copy of the License along with this library. # If not, see . -import json -from decimal import Decimal import random -from typing import Mapping, Any +from decimal import Decimal import requests