diff --git a/tests/device_tests/recovery/__init__.py b/tests/device_tests/bitcoin/__init__.py similarity index 100% rename from tests/device_tests/recovery/__init__.py rename to tests/device_tests/bitcoin/__init__.py diff --git a/tests/device_tests/test_msg_authorize_coinjoin.py b/tests/device_tests/bitcoin/test_authorize_coinjoin.py similarity index 99% rename from tests/device_tests/test_msg_authorize_coinjoin.py rename to tests/device_tests/bitcoin/test_authorize_coinjoin.py index e080f76f1..d1885aa53 100644 --- a/tests/device_tests/test_msg_authorize_coinjoin.py +++ b/tests/device_tests/bitcoin/test_authorize_coinjoin.py @@ -20,8 +20,8 @@ from trezorlib import btc, device, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import parse_path -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType diff --git a/tests/device_tests/test_msg_signtx_bcash.py b/tests/device_tests/bitcoin/test_bcash.py similarity index 99% rename from tests/device_tests/test_msg_signtx_bcash.py rename to tests/device_tests/bitcoin/test_bcash.py index 9d2c40261..43815b45b 100644 --- a/tests/device_tests/test_msg_signtx_bcash.py +++ b/tests/device_tests/bitcoin/test_bcash.py @@ -20,8 +20,8 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import H_, parse_path -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType TX_API = TxCache("Bcash") diff --git a/tests/device_tests/test_msg_signtx_bgold.py b/tests/device_tests/bitcoin/test_bgold.py similarity index 99% rename from tests/device_tests/test_msg_signtx_bgold.py rename to tests/device_tests/bitcoin/test_bgold.py index 3be1b9e7a..6f3bb45a0 100644 --- a/tests/device_tests/test_msg_signtx_bgold.py +++ b/tests/device_tests/bitcoin/test_bgold.py @@ -20,8 +20,8 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import H_, btc_hash, parse_path -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType TX_API = TxCache("Bgold") diff --git a/tests/device_tests/test_msg_signtx_dash.py b/tests/device_tests/bitcoin/test_dash.py similarity index 98% rename from tests/device_tests/test_msg_signtx_dash.py rename to tests/device_tests/bitcoin/test_dash.py index 33b67ac38..ad2bf37e2 100644 --- a/tests/device_tests/test_msg_signtx_dash.py +++ b/tests/device_tests/bitcoin/test_dash.py @@ -19,8 +19,8 @@ import pytest from trezorlib import btc, messages from trezorlib.tools import parse_path -from ..tx_cache import TxCache -from .signtx import ( +from ...tx_cache import TxCache +from ..signtx import ( request_extra_data, request_finished, request_input, diff --git a/tests/device_tests/test_msg_signtx_decred.py b/tests/device_tests/bitcoin/test_decred.py similarity index 99% rename from tests/device_tests/test_msg_signtx_decred.py rename to tests/device_tests/bitcoin/test_decred.py index 0dfebac1a..c75d2cdbb 100644 --- a/tests/device_tests/test_msg_signtx_decred.py +++ b/tests/device_tests/bitcoin/test_decred.py @@ -19,8 +19,8 @@ import pytest from trezorlib import btc, messages from trezorlib.tools import parse_path -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType TX_API = TxCache("Decred Testnet") diff --git a/tests/device_tests/test_descriptors.py b/tests/device_tests/bitcoin/test_descriptors.py similarity index 100% rename from tests/device_tests/test_descriptors.py rename to tests/device_tests/bitcoin/test_descriptors.py diff --git a/tests/device_tests/test_msg_signtx_firo.py b/tests/device_tests/bitcoin/test_firo.py similarity index 98% rename from tests/device_tests/test_msg_signtx_firo.py rename to tests/device_tests/bitcoin/test_firo.py index e1e8ee610..8f16beb87 100644 --- a/tests/device_tests/test_msg_signtx_firo.py +++ b/tests/device_tests/bitcoin/test_firo.py @@ -19,7 +19,7 @@ import pytest from trezorlib import btc, messages from trezorlib.tools import btc_hash, parse_path -from ..tx_cache import TxCache +from ...tx_cache import TxCache TX_API = TxCache("Firo Testnet") TXHASH_8a34cc = bytes.fromhex( diff --git a/tests/device_tests/test_msg_getaddress.py b/tests/device_tests/bitcoin/test_getaddress.py similarity index 99% rename from tests/device_tests/test_msg_getaddress.py rename to tests/device_tests/bitcoin/test_getaddress.py index b86a76840..dc1b981ed 100644 --- a/tests/device_tests/test_msg_getaddress.py +++ b/tests/device_tests/bitcoin/test_getaddress.py @@ -21,7 +21,7 @@ from trezorlib.exceptions import TrezorFailure from trezorlib.messages import SafetyCheckLevel from trezorlib.tools import parse_path -from .. import bip32 +from ... import bip32 def getmultisig(chain, nr, xpubs): diff --git a/tests/device_tests/test_msg_getaddress_segwit.py b/tests/device_tests/bitcoin/test_getaddress_segwit.py similarity index 100% rename from tests/device_tests/test_msg_getaddress_segwit.py rename to tests/device_tests/bitcoin/test_getaddress_segwit.py diff --git a/tests/device_tests/test_msg_getaddress_segwit_native.py b/tests/device_tests/bitcoin/test_getaddress_segwit_native.py similarity index 96% rename from tests/device_tests/test_msg_getaddress_segwit_native.py rename to tests/device_tests/bitcoin/test_getaddress_segwit_native.py index 0a75e3da2..a2bc2a5f1 100644 --- a/tests/device_tests/test_msg_getaddress_segwit_native.py +++ b/tests/device_tests/bitcoin/test_getaddress_segwit_native.py @@ -48,25 +48,25 @@ VECTORS = ( # coin, path, script_type, address ( "Testnet", "86'/1'/0'/0/0", - proto.InputScriptType.SPENDTAPROOT, + messages.InputScriptType.SPENDTAPROOT, "tb1pswrqtykue8r89t9u4rprjs0gt4qzkdfuursfnvqaa3f2yql07zmq8s8a5u", ), ( "Testnet", "86'/1'/0'/1/0", - proto.InputScriptType.SPENDTAPROOT, + messages.InputScriptType.SPENDTAPROOT, "tb1pn2d0yjeedavnkd8z8lhm566p0f2utm3lgvxrsdehnl94y34txmts5s7t4c", ), ( "Bitcoin", "86'/0'/0'/0/0", - proto.InputScriptType.SPENDTAPROOT, + messages.InputScriptType.SPENDTAPROOT, "bc1ptxs597p3fnpd8gwut5p467ulsydae3rp9z75hd99w8k3ljr9g9rqx6ynaw", ), ( "Bitcoin", "86'/0'/0'/1/0", - proto.InputScriptType.SPENDTAPROOT, + messages.InputScriptType.SPENDTAPROOT, "bc1pgypgja2hmcx2l6s2ssq75k6ev68ved6nujcspt47dgvkp8euc70s6uegk6", ), pytest.param( @@ -122,7 +122,7 @@ def test_bip86(client, path, address): parse_path(path), False, None, - script_type=proto.InputScriptType.SPENDTAPROOT, + script_type=messages.InputScriptType.SPENDTAPROOT, ) == address ) diff --git a/tests/device_tests/test_msg_getaddress_show.py b/tests/device_tests/bitcoin/test_getaddress_show.py similarity index 100% rename from tests/device_tests/test_msg_getaddress_show.py rename to tests/device_tests/bitcoin/test_getaddress_show.py diff --git a/tests/device_tests/test_msg_getownershipproof.py b/tests/device_tests/bitcoin/test_getownershipproof.py similarity index 100% rename from tests/device_tests/test_msg_getownershipproof.py rename to tests/device_tests/bitcoin/test_getownershipproof.py diff --git a/tests/device_tests/test_msg_getpublickey.py b/tests/device_tests/bitcoin/test_getpublickey.py similarity index 99% rename from tests/device_tests/test_msg_getpublickey.py rename to tests/device_tests/bitcoin/test_getpublickey.py index 5d0b59dc9..83951fd66 100644 --- a/tests/device_tests/test_msg_getpublickey.py +++ b/tests/device_tests/bitcoin/test_getpublickey.py @@ -20,7 +20,7 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import parse_path -from .. import bip32 +from ... import bip32 VECTORS_BITCOIN = ( # coin_name, xpub_magic, path, xpub ( diff --git a/tests/device_tests/test_msg_getpublickey_curve.py b/tests/device_tests/bitcoin/test_getpublickey_curve.py similarity index 100% rename from tests/device_tests/test_msg_getpublickey_curve.py rename to tests/device_tests/bitcoin/test_getpublickey_curve.py diff --git a/tests/device_tests/test_msg_signtx_grs.py b/tests/device_tests/bitcoin/test_grs.py similarity index 99% rename from tests/device_tests/test_msg_signtx_grs.py rename to tests/device_tests/bitcoin/test_grs.py index 73c696afb..c00bd5b9c 100644 --- a/tests/device_tests/test_msg_signtx_grs.py +++ b/tests/device_tests/bitcoin/test_grs.py @@ -19,7 +19,7 @@ import pytest from trezorlib import btc, messages from trezorlib.tools import parse_path -from ..tx_cache import TxCache +from ...tx_cache import TxCache B = messages.ButtonRequestType TX_API = TxCache("Groestlcoin") diff --git a/tests/device_tests/test_msg_signtx_komodo.py b/tests/device_tests/bitcoin/test_komodo.py similarity index 99% rename from tests/device_tests/test_msg_signtx_komodo.py rename to tests/device_tests/bitcoin/test_komodo.py index 11a256940..7d41d21b3 100644 --- a/tests/device_tests/test_msg_signtx_komodo.py +++ b/tests/device_tests/bitcoin/test_komodo.py @@ -19,8 +19,8 @@ import pytest from trezorlib import btc, messages from trezorlib.tools import parse_path -from ..tx_cache import TxCache -from .signtx import ( +from ...tx_cache import TxCache +from ..signtx import ( request_extra_data, request_finished, request_input, diff --git a/tests/device_tests/test_multisig.py b/tests/device_tests/bitcoin/test_multisig.py similarity index 98% rename from tests/device_tests/test_multisig.py rename to tests/device_tests/bitcoin/test_multisig.py index 9e3b9debd..c77865778 100644 --- a/tests/device_tests/test_multisig.py +++ b/tests/device_tests/bitcoin/test_multisig.py @@ -20,9 +20,9 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import parse_path, tx_hash -from ..common import MNEMONIC12 -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...common import MNEMONIC12 +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType TX_API = TxCache("Bitcoin") diff --git a/tests/device_tests/test_multisig_change.py b/tests/device_tests/bitcoin/test_multisig_change.py similarity index 97% rename from tests/device_tests/test_multisig_change.py rename to tests/device_tests/bitcoin/test_multisig_change.py index 65aeef44e..143da7f07 100644 --- a/tests/device_tests/test_multisig_change.py +++ b/tests/device_tests/bitcoin/test_multisig_change.py @@ -19,10 +19,10 @@ import pytest from trezorlib import btc, messages from trezorlib.tools import H_, parse_path -from .. import bip32 -from ..common import MNEMONIC12 -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ... import bip32 +from ...common import MNEMONIC12 +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType TX_API = TxCache("Testnet") @@ -136,6 +136,7 @@ INP3 = messages.TxInputType( multisig=multisig_in3, ) + def _responses(INP1, INP2, change=0): resp = [ request_input(0), @@ -219,9 +220,7 @@ def test_external_internal(client): ) with client: - client.set_expected_responses( - _responses(INP1, INP2, change=2) - ) + client.set_expected_responses(_responses(INP1, INP2, change=2)) _, serialized_tx = btc.sign_tx( client, "Bitcoin", @@ -251,9 +250,7 @@ def test_internal_external(client): ) with client: - client.set_expected_responses( - _responses(INP1, INP2, change=1) - ) + client.set_expected_responses(_responses(INP1, INP2, change=1)) _, serialized_tx = btc.sign_tx( client, "Bitcoin", @@ -321,9 +318,7 @@ def test_multisig_change_match_first(client): ) with client: - client.set_expected_responses( - _responses(INP1, INP2, change=1) - ) + client.set_expected_responses(_responses(INP1, INP2, change=1)) _, serialized_tx = btc.sign_tx( client, "Bitcoin", @@ -361,9 +356,7 @@ def test_multisig_change_match_second(client): ) with client: - client.set_expected_responses( - _responses(INP1, INP2, change=2) - ) + client.set_expected_responses(_responses(INP1, INP2, change=2)) _, serialized_tx = btc.sign_tx( client, "Bitcoin", diff --git a/tests/device_tests/test_nonstandard_paths.py b/tests/device_tests/bitcoin/test_nonstandard_paths.py similarity index 99% rename from tests/device_tests/test_nonstandard_paths.py rename to tests/device_tests/bitcoin/test_nonstandard_paths.py index ff391483f..ea0ec9a3d 100644 --- a/tests/device_tests/test_nonstandard_paths.py +++ b/tests/device_tests/bitcoin/test_nonstandard_paths.py @@ -19,7 +19,7 @@ import pytest from trezorlib import btc, messages from trezorlib.tools import parse_path -from ..tx_cache import TxCache +from ...tx_cache import TxCache TX_CACHE_MAINNET = TxCache("Bitcoin") diff --git a/tests/device_tests/test_op_return.py b/tests/device_tests/bitcoin/test_op_return.py similarity index 97% rename from tests/device_tests/test_op_return.py rename to tests/device_tests/bitcoin/test_op_return.py index 0c37fd041..4a48bcc0c 100644 --- a/tests/device_tests/test_op_return.py +++ b/tests/device_tests/bitcoin/test_op_return.py @@ -20,8 +20,8 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import parse_path -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType TX_API = TxCache("Bitcoin") diff --git a/tests/device_tests/test_msg_signtx_peercoin.py b/tests/device_tests/bitcoin/test_peercoin.py similarity index 99% rename from tests/device_tests/test_msg_signtx_peercoin.py rename to tests/device_tests/bitcoin/test_peercoin.py index e13509e3b..458115c8e 100644 --- a/tests/device_tests/test_msg_signtx_peercoin.py +++ b/tests/device_tests/bitcoin/test_peercoin.py @@ -20,7 +20,7 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import parse_path -from ..tx_cache import TxCache +from ...tx_cache import TxCache TX_CACHE = TxCache("Peercoin") diff --git a/tests/device_tests/test_msg_signmessage.py b/tests/device_tests/bitcoin/test_signmessage.py similarity index 100% rename from tests/device_tests/test_msg_signmessage.py rename to tests/device_tests/bitcoin/test_signmessage.py diff --git a/tests/device_tests/test_msg_signtx.py b/tests/device_tests/bitcoin/test_signtx.py similarity index 99% rename from tests/device_tests/test_msg_signtx.py rename to tests/device_tests/bitcoin/test_signtx.py index 721e4349f..b01fbf59e 100644 --- a/tests/device_tests/test_msg_signtx.py +++ b/tests/device_tests/bitcoin/test_signtx.py @@ -22,9 +22,9 @@ from trezorlib import btc, device, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import H_, parse_path, tx_hash -from ..common import MNEMONIC12 -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...common import MNEMONIC12 +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType diff --git a/tests/device_tests/test_msg_signtx_amount_unit.py b/tests/device_tests/bitcoin/test_signtx_amount_unit.py similarity index 98% rename from tests/device_tests/test_msg_signtx_amount_unit.py rename to tests/device_tests/bitcoin/test_signtx_amount_unit.py index 33b29c428..ad96d2049 100644 --- a/tests/device_tests/test_msg_signtx_amount_unit.py +++ b/tests/device_tests/bitcoin/test_signtx_amount_unit.py @@ -19,7 +19,7 @@ import pytest from trezorlib import btc, messages from trezorlib.tools import parse_path -from ..tx_cache import TxCache +from ...tx_cache import TxCache TX_API = TxCache("Testnet") diff --git a/tests/device_tests/test_msg_signtx_external.py b/tests/device_tests/bitcoin/test_signtx_external.py similarity index 99% rename from tests/device_tests/test_msg_signtx_external.py rename to tests/device_tests/bitcoin/test_signtx_external.py index 6706e6af9..2574f523a 100644 --- a/tests/device_tests/test_msg_signtx_external.py +++ b/tests/device_tests/bitcoin/test_signtx_external.py @@ -20,8 +20,8 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import parse_path -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType diff --git a/tests/device_tests/test_msg_signtx_invalid_path.py b/tests/device_tests/bitcoin/test_signtx_invalid_path.py similarity index 99% rename from tests/device_tests/test_msg_signtx_invalid_path.py rename to tests/device_tests/bitcoin/test_signtx_invalid_path.py index 0762730a8..ef0f9f058 100644 --- a/tests/device_tests/test_msg_signtx_invalid_path.py +++ b/tests/device_tests/bitcoin/test_signtx_invalid_path.py @@ -20,7 +20,7 @@ from trezorlib import btc, device, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import parse_path -from ..tx_cache import TxCache +from ...tx_cache import TxCache TX_CACHE_MAINNET = TxCache("Bitcoin") TX_CACHE_BCASH = TxCache("Bcash") @@ -34,6 +34,7 @@ TXHASH_d5f65e = bytes.fromhex( pytestmark = pytest.mark.altcoin + # Adapted from TestMsgSigntx.test_one_one_fee, # only changed the coin from Bitcoin to Litecoin. # Litecoin does not have strong replay protection using SIGHASH_FORKID, diff --git a/tests/device_tests/test_msg_signtx_mixed_inputs.py b/tests/device_tests/bitcoin/test_signtx_mixed_inputs.py similarity index 99% rename from tests/device_tests/test_msg_signtx_mixed_inputs.py rename to tests/device_tests/bitcoin/test_signtx_mixed_inputs.py index e6c9e78f3..1933c0430 100644 --- a/tests/device_tests/test_msg_signtx_mixed_inputs.py +++ b/tests/device_tests/bitcoin/test_signtx_mixed_inputs.py @@ -17,7 +17,7 @@ from trezorlib import btc, messages from trezorlib.tools import parse_path -from ..tx_cache import TxCache +from ...tx_cache import TxCache TX_API = TxCache("Testnet") diff --git a/tests/device_tests/test_msg_signtx_prevhash.py b/tests/device_tests/bitcoin/test_signtx_prevhash.py similarity index 99% rename from tests/device_tests/test_msg_signtx_prevhash.py rename to tests/device_tests/bitcoin/test_signtx_prevhash.py index b0aeaa688..009875879 100644 --- a/tests/device_tests/test_msg_signtx_prevhash.py +++ b/tests/device_tests/bitcoin/test_signtx_prevhash.py @@ -6,7 +6,7 @@ import pytest from trezorlib import btc, messages, tools from trezorlib.exceptions import TrezorFailure -from ..tx_cache import TxCache +from ...tx_cache import TxCache TXHASH_157041 = bytes.fromhex( "1570416eb4302cf52979afd5e6909e37d8fdd874301f7cc87e547e509cb1caa6" diff --git a/tests/device_tests/test_msg_signtx_replacement.py b/tests/device_tests/bitcoin/test_signtx_replacement.py similarity index 99% rename from tests/device_tests/test_msg_signtx_replacement.py rename to tests/device_tests/bitcoin/test_signtx_replacement.py index a610ae80c..72227524d 100644 --- a/tests/device_tests/test_msg_signtx_replacement.py +++ b/tests/device_tests/bitcoin/test_signtx_replacement.py @@ -20,8 +20,8 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import parse_path -from ..tx_cache import TxCache -from .signtx import ( +from ...tx_cache import TxCache +from ..signtx import ( request_finished, request_input, request_meta, diff --git a/tests/device_tests/test_msg_signtx_segwit.py b/tests/device_tests/bitcoin/test_signtx_segwit.py similarity index 99% rename from tests/device_tests/test_msg_signtx_segwit.py rename to tests/device_tests/bitcoin/test_signtx_segwit.py index 852fe0f02..709790f4c 100644 --- a/tests/device_tests/test_msg_signtx_segwit.py +++ b/tests/device_tests/bitcoin/test_signtx_segwit.py @@ -20,8 +20,8 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import H_, parse_path -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType TX_API = TxCache("Testnet") diff --git a/tests/device_tests/test_msg_signtx_segwit_native.py b/tests/device_tests/bitcoin/test_signtx_segwit_native.py similarity index 99% rename from tests/device_tests/test_msg_signtx_segwit_native.py rename to tests/device_tests/bitcoin/test_signtx_segwit_native.py index a4620fdb4..fb1d27ca8 100644 --- a/tests/device_tests/test_msg_signtx_segwit_native.py +++ b/tests/device_tests/bitcoin/test_signtx_segwit_native.py @@ -19,9 +19,9 @@ import pytest from trezorlib import btc, messages from trezorlib.tools import H_, parse_path -from ..bip32 import deserialize -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...bip32 import deserialize +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType TX_API = TxCache("Testnet") diff --git a/tests/device_tests/test_msg_signtx_taproot.py b/tests/device_tests/bitcoin/test_signtx_taproot.py similarity index 99% rename from tests/device_tests/test_msg_signtx_taproot.py rename to tests/device_tests/bitcoin/test_signtx_taproot.py index 79ac239e1..01d16898b 100644 --- a/tests/device_tests/test_msg_signtx_taproot.py +++ b/tests/device_tests/bitcoin/test_signtx_taproot.py @@ -20,8 +20,8 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import H_, parse_path -from ..tx_cache import TxCache -from .signtx import request_finished, request_input, request_meta, request_output +from ...tx_cache import TxCache +from ..signtx import request_finished, request_input, request_meta, request_output B = messages.ButtonRequestType TX_API = TxCache("Testnet") diff --git a/tests/device_tests/test_msg_verifymessage.py b/tests/device_tests/bitcoin/test_verifymessage.py similarity index 100% rename from tests/device_tests/test_msg_verifymessage.py rename to tests/device_tests/bitcoin/test_verifymessage.py diff --git a/tests/device_tests/test_msg_verifymessage_segwit.py b/tests/device_tests/bitcoin/test_verifymessage_segwit.py similarity index 100% rename from tests/device_tests/test_msg_verifymessage_segwit.py rename to tests/device_tests/bitcoin/test_verifymessage_segwit.py diff --git a/tests/device_tests/test_msg_verifymessage_segwit_native.py b/tests/device_tests/bitcoin/test_verifymessage_segwit_native.py similarity index 100% rename from tests/device_tests/test_msg_verifymessage_segwit_native.py rename to tests/device_tests/bitcoin/test_verifymessage_segwit_native.py diff --git a/tests/device_tests/test_msg_signtx_zcash.py b/tests/device_tests/bitcoin/test_zcash.py similarity index 99% rename from tests/device_tests/test_msg_signtx_zcash.py rename to tests/device_tests/bitcoin/test_zcash.py index 03f382665..50f4e99a1 100644 --- a/tests/device_tests/test_msg_signtx_zcash.py +++ b/tests/device_tests/bitcoin/test_zcash.py @@ -20,8 +20,8 @@ from trezorlib import btc, messages from trezorlib.exceptions import TrezorFailure from trezorlib.tools import parse_path -from ..tx_cache import TxCache -from .signtx import ( +from ...tx_cache import TxCache +from ..signtx import ( request_extra_data, request_finished, request_input, diff --git a/tests/device_tests/reset/__init__.py b/tests/device_tests/misc/__init__.py similarity index 100% rename from tests/device_tests/reset/__init__.py rename to tests/device_tests/misc/__init__.py diff --git a/tests/device_tests/test_cosi.py b/tests/device_tests/misc/test_cosi.py similarity index 100% rename from tests/device_tests/test_cosi.py rename to tests/device_tests/misc/test_cosi.py diff --git a/tests/device_tests/test_msg_cipherkeyvalue.py b/tests/device_tests/misc/test_msg_cipherkeyvalue.py similarity index 99% rename from tests/device_tests/test_msg_cipherkeyvalue.py rename to tests/device_tests/misc/test_msg_cipherkeyvalue.py index 88723e92f..e267c48c3 100644 --- a/tests/device_tests/test_msg_cipherkeyvalue.py +++ b/tests/device_tests/misc/test_msg_cipherkeyvalue.py @@ -18,7 +18,7 @@ import pytest from trezorlib import misc -from ..common import MNEMONIC12 +from ...common import MNEMONIC12 @pytest.mark.setup_client(mnemonic=MNEMONIC12) diff --git a/tests/device_tests/test_msg_getecdhsessionkey.py b/tests/device_tests/misc/test_msg_getecdhsessionkey.py similarity index 98% rename from tests/device_tests/test_msg_getecdhsessionkey.py rename to tests/device_tests/misc/test_msg_getecdhsessionkey.py index d8ff6aec6..ae07f27f5 100644 --- a/tests/device_tests/test_msg_getecdhsessionkey.py +++ b/tests/device_tests/misc/test_msg_getecdhsessionkey.py @@ -18,7 +18,7 @@ import pytest from trezorlib import messages, misc -from ..common import MNEMONIC12 +from ...common import MNEMONIC12 @pytest.mark.setup_client(mnemonic=MNEMONIC12) diff --git a/tests/device_tests/test_msg_getentropy.py b/tests/device_tests/misc/test_msg_getentropy.py similarity index 100% rename from tests/device_tests/test_msg_getentropy.py rename to tests/device_tests/misc/test_msg_getentropy.py diff --git a/tests/device_tests/test_msg_signidentity.py b/tests/device_tests/misc/test_msg_signidentity.py similarity index 99% rename from tests/device_tests/test_msg_signidentity.py rename to tests/device_tests/misc/test_msg_signidentity.py index ebcf00945..584b08aa4 100644 --- a/tests/device_tests/test_msg_signidentity.py +++ b/tests/device_tests/misc/test_msg_signidentity.py @@ -18,7 +18,7 @@ import pytest from trezorlib import messages, misc -from ..common import MNEMONIC12 +from ...common import MNEMONIC12 @pytest.mark.setup_client(mnemonic=MNEMONIC12) diff --git a/tests/device_tests/nem/test_signtx_mosaics.py b/tests/device_tests/nem/test_signtx_mosaics_t1.py similarity index 100% rename from tests/device_tests/nem/test_signtx_mosaics.py rename to tests/device_tests/nem/test_signtx_mosaics_t1.py diff --git a/tests/device_tests/reset_recovery/__init__.py b/tests/device_tests/reset_recovery/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/device_tests/recovery/test_bip39_dryrun.py b/tests/device_tests/reset_recovery/test_recovery_bip39_dryrun.py similarity index 100% rename from tests/device_tests/recovery/test_bip39_dryrun.py rename to tests/device_tests/reset_recovery/test_recovery_bip39_dryrun.py diff --git a/tests/device_tests/recovery/test_bip39.py b/tests/device_tests/reset_recovery/test_recovery_bip39_t1.py similarity index 99% rename from tests/device_tests/recovery/test_bip39.py rename to tests/device_tests/reset_recovery/test_recovery_bip39_t1.py index adfdccde1..5912edd57 100644 --- a/tests/device_tests/recovery/test_bip39.py +++ b/tests/device_tests/reset_recovery/test_recovery_bip39_t1.py @@ -23,7 +23,7 @@ from ...common import MNEMONIC12 PIN4 = "1234" PIN6 = "789456" -pytestmark = [pytest.mark.skip_t2] +pytestmark = pytest.mark.skip_t2 @pytest.mark.setup_client(uninitialized=True) diff --git a/tests/device_tests/recovery/test_bip39_t2.py b/tests/device_tests/reset_recovery/test_recovery_bip39_t2.py similarity index 100% rename from tests/device_tests/recovery/test_bip39_t2.py rename to tests/device_tests/reset_recovery/test_recovery_bip39_t2.py diff --git a/tests/device_tests/recovery/test_slip39_advanced.py b/tests/device_tests/reset_recovery/test_recovery_slip39_advanced.py similarity index 100% rename from tests/device_tests/recovery/test_slip39_advanced.py rename to tests/device_tests/reset_recovery/test_recovery_slip39_advanced.py diff --git a/tests/device_tests/recovery/test_slip39_advanced_dryrun.py b/tests/device_tests/reset_recovery/test_recovery_slip39_advanced_dryrun.py similarity index 100% rename from tests/device_tests/recovery/test_slip39_advanced_dryrun.py rename to tests/device_tests/reset_recovery/test_recovery_slip39_advanced_dryrun.py diff --git a/tests/device_tests/recovery/test_slip39_basic.py b/tests/device_tests/reset_recovery/test_recovery_slip39_basic.py similarity index 100% rename from tests/device_tests/recovery/test_slip39_basic.py rename to tests/device_tests/reset_recovery/test_recovery_slip39_basic.py diff --git a/tests/device_tests/recovery/test_slip39_basic_dryrun.py b/tests/device_tests/reset_recovery/test_recovery_slip39_basic_dryrun.py similarity index 100% rename from tests/device_tests/recovery/test_slip39_basic_dryrun.py rename to tests/device_tests/reset_recovery/test_recovery_slip39_basic_dryrun.py diff --git a/tests/device_tests/test_reset_backup.py b/tests/device_tests/reset_recovery/test_reset_backup.py similarity index 99% rename from tests/device_tests/test_reset_backup.py rename to tests/device_tests/reset_recovery/test_reset_backup.py index 6b6b343f7..47bc5b084 100644 --- a/tests/device_tests/test_reset_backup.py +++ b/tests/device_tests/reset_recovery/test_reset_backup.py @@ -23,7 +23,7 @@ from shamir_mnemonic import shamir from trezorlib import device, messages from trezorlib.messages import BackupType, ButtonRequestType as B -from ..common import EXTERNAL_ENTROPY, click_through, read_and_confirm_mnemonic +from ...common import EXTERNAL_ENTROPY, click_through, read_and_confirm_mnemonic def backup_flow_bip39(client): diff --git a/tests/device_tests/reset/test_bip39_skipbackup.py b/tests/device_tests/reset_recovery/test_reset_bip39_skipbackup.py similarity index 99% rename from tests/device_tests/reset/test_bip39_skipbackup.py rename to tests/device_tests/reset_recovery/test_reset_bip39_skipbackup.py index 672a25bc6..206882d97 100644 --- a/tests/device_tests/reset/test_bip39_skipbackup.py +++ b/tests/device_tests/reset_recovery/test_reset_bip39_skipbackup.py @@ -21,7 +21,7 @@ from trezorlib import messages from ...common import generate_entropy -pytestmark = [pytest.mark.skip_t2] +pytestmark = pytest.mark.skip_t2 EXTERNAL_ENTROPY = b"zlutoucky kun upel divoke ody" * 2 STRENGTH = 128 diff --git a/tests/device_tests/reset/test_bip39.py b/tests/device_tests/reset_recovery/test_reset_bip39_t1.py similarity index 99% rename from tests/device_tests/reset/test_bip39.py rename to tests/device_tests/reset_recovery/test_reset_bip39_t1.py index 98e235b1d..98eeeb2a8 100644 --- a/tests/device_tests/reset/test_bip39.py +++ b/tests/device_tests/reset_recovery/test_reset_bip39_t1.py @@ -21,7 +21,7 @@ from trezorlib import device, messages from ...common import generate_entropy -pytestmark = [pytest.mark.skip_t1] +pytestmark = pytest.mark.skip_t2 def reset_device(client, strength): diff --git a/tests/device_tests/reset/test_bip39_t2.py b/tests/device_tests/reset_recovery/test_reset_bip39_t2.py similarity index 100% rename from tests/device_tests/reset/test_bip39_t2.py rename to tests/device_tests/reset_recovery/test_reset_bip39_t2.py diff --git a/tests/device_tests/test_reset_recovery_bip39.py b/tests/device_tests/reset_recovery/test_reset_recovery_bip39.py similarity index 98% rename from tests/device_tests/test_reset_recovery_bip39.py rename to tests/device_tests/reset_recovery/test_reset_recovery_bip39.py index 7be9dd7e0..9173d285d 100644 --- a/tests/device_tests/test_reset_recovery_bip39.py +++ b/tests/device_tests/reset_recovery/test_reset_recovery_bip39.py @@ -23,7 +23,7 @@ from trezorlib import btc, device, messages from trezorlib.messages import BackupType, ButtonRequestType as B from trezorlib.tools import parse_path -from ..common import EXTERNAL_ENTROPY, click_through, read_and_confirm_mnemonic +from ...common import EXTERNAL_ENTROPY, click_through, read_and_confirm_mnemonic @pytest.mark.skip_t1 diff --git a/tests/device_tests/test_reset_recovery_slip39_advanced.py b/tests/device_tests/reset_recovery/test_reset_recovery_slip39_advanced.py similarity index 99% rename from tests/device_tests/test_reset_recovery_slip39_advanced.py rename to tests/device_tests/reset_recovery/test_reset_recovery_slip39_advanced.py index 7b849e972..710f7baef 100644 --- a/tests/device_tests/test_reset_recovery_slip39_advanced.py +++ b/tests/device_tests/reset_recovery/test_reset_recovery_slip39_advanced.py @@ -22,7 +22,7 @@ from trezorlib import btc, device, messages from trezorlib.messages import BackupType, ButtonRequestType as B from trezorlib.tools import parse_path -from ..common import ( +from ...common import ( EXTERNAL_ENTROPY, click_through, read_and_confirm_mnemonic, diff --git a/tests/device_tests/test_reset_recovery_slip39_basic.py b/tests/device_tests/reset_recovery/test_reset_recovery_slip39_basic.py similarity index 98% rename from tests/device_tests/test_reset_recovery_slip39_basic.py rename to tests/device_tests/reset_recovery/test_reset_recovery_slip39_basic.py index 3e68d3519..41079d8f7 100644 --- a/tests/device_tests/test_reset_recovery_slip39_basic.py +++ b/tests/device_tests/reset_recovery/test_reset_recovery_slip39_basic.py @@ -23,7 +23,7 @@ from trezorlib import btc, device, messages from trezorlib.messages import BackupType, ButtonRequestType as B from trezorlib.tools import parse_path -from ..common import click_through, read_and_confirm_mnemonic, recovery_enter_shares +from ...common import click_through, read_and_confirm_mnemonic, recovery_enter_shares EXTERNAL_ENTROPY = b"zlutoucky kun upel divoke ody" * 2 MOCK_OS_URANDOM = mock.Mock(return_value=EXTERNAL_ENTROPY) diff --git a/tests/device_tests/reset/test_slip39_advanced.py b/tests/device_tests/reset_recovery/test_reset_slip39_advanced.py similarity index 100% rename from tests/device_tests/reset/test_slip39_advanced.py rename to tests/device_tests/reset_recovery/test_reset_slip39_advanced.py diff --git a/tests/device_tests/reset/test_slip39_basic.py b/tests/device_tests/reset_recovery/test_reset_slip39_basic.py similarity index 100% rename from tests/device_tests/reset/test_slip39_basic.py rename to tests/device_tests/reset_recovery/test_reset_slip39_basic.py diff --git a/tests/device_tests/stellar/__init__.py b/tests/device_tests/stellar/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/device_tests/test_stellar.py b/tests/device_tests/stellar/test_stellar.py similarity index 98% rename from tests/device_tests/test_stellar.py rename to tests/device_tests/stellar/test_stellar.py index 6771a6736..db3f909fe 100644 --- a/tests/device_tests/test_stellar.py +++ b/tests/device_tests/stellar/test_stellar.py @@ -57,7 +57,7 @@ import pytest from trezorlib import messages, protobuf, stellar from trezorlib.tools import parse_path -from ..common import parametrize_using_common_fixtures +from ...common import parametrize_using_common_fixtures def parameters_to_proto(parameters): diff --git a/tests/device_tests/test_msg_changepin.py b/tests/device_tests/test_msg_changepin_t1.py similarity index 100% rename from tests/device_tests/test_msg_changepin.py rename to tests/device_tests/test_msg_changepin_t1.py diff --git a/tests/device_tests/webauthn/__init__.py b/tests/device_tests/webauthn/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/device_tests/data_webauthn.py b/tests/device_tests/webauthn/data_webauthn.py similarity index 100% rename from tests/device_tests/data_webauthn.py rename to tests/device_tests/webauthn/data_webauthn.py diff --git a/tests/device_tests/test_msg_webauthn.py b/tests/device_tests/webauthn/test_msg_webauthn.py similarity index 99% rename from tests/device_tests/test_msg_webauthn.py rename to tests/device_tests/webauthn/test_msg_webauthn.py index c48f37d6e..b2409a347 100644 --- a/tests/device_tests/test_msg_webauthn.py +++ b/tests/device_tests/webauthn/test_msg_webauthn.py @@ -19,7 +19,7 @@ import pytest from trezorlib import fido from trezorlib.exceptions import Cancelled, TrezorFailure -from ..common import MNEMONIC12 +from ...common import MNEMONIC12 from .data_webauthn import CRED1, CRED2, CRED3, CREDS RK_CAPACITY = 100 diff --git a/tests/device_tests/test_u2f_counter.py b/tests/device_tests/webauthn/test_u2f_counter.py similarity index 100% rename from tests/device_tests/test_u2f_counter.py rename to tests/device_tests/webauthn/test_u2f_counter.py