diff --git a/tests/device_tests/bitcoin/test_authorize_coinjoin.py b/tests/device_tests/bitcoin/test_authorize_coinjoin.py index c09b27e3cd..e1cff4ec15 100644 --- a/tests/device_tests/bitcoin/test_authorize_coinjoin.py +++ b/tests/device_tests/bitcoin/test_authorize_coinjoin.py @@ -453,7 +453,7 @@ def test_sign_tx_spend(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ messages.ButtonRequest(code=B.Other), @@ -462,7 +462,7 @@ def test_sign_tx_spend(client: Client): request_output(0), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_output(0), @@ -528,7 +528,7 @@ def test_sign_tx_migration(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ messages.ButtonRequest(code=B.Other), @@ -537,7 +537,7 @@ def test_sign_tx_migration(client: Client): request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_2cc3c1), diff --git a/tests/device_tests/bitcoin/test_bcash.py b/tests/device_tests/bitcoin/test_bcash.py index 08b74d2db3..7f1fe78b5d 100644 --- a/tests/device_tests/bitcoin/test_bcash.py +++ b/tests/device_tests/bitcoin/test_bcash.py @@ -72,14 +72,14 @@ def test_send_bch_change(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_bc37c2), @@ -125,14 +125,14 @@ def test_send_bch_nochange(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_502e85), @@ -184,14 +184,14 @@ def test_send_bch_oldaddr(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_502e85), @@ -255,7 +255,7 @@ def test_attack_change_input(client: Client): return msg with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_filter(messages.TxAck, attack_processor) client.set_expected_responses( [ @@ -263,7 +263,7 @@ def test_attack_change_input(client: Client): request_output(0), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_bd32ff), @@ -331,13 +331,13 @@ def test_send_bch_multisig_wrongchange(client: Client): amount=23_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_062fbd), @@ -400,13 +400,13 @@ def test_send_bch_multisig_change(client: Client): amount=24_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -445,7 +445,7 @@ def test_send_bch_multisig_change(client: Client): request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -502,14 +502,14 @@ def test_send_bch_external_presigned(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_502e85), diff --git a/tests/device_tests/bitcoin/test_bgold.py b/tests/device_tests/bitcoin/test_bgold.py index 5411c5c2b3..10bb18bb88 100644 --- a/tests/device_tests/bitcoin/test_bgold.py +++ b/tests/device_tests/bitcoin/test_bgold.py @@ -71,14 +71,14 @@ def test_send_bitcoin_gold_change(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_6f0398), @@ -125,14 +125,14 @@ def test_send_bitcoin_gold_nochange(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_6f0398), @@ -195,7 +195,7 @@ def test_attack_change_input(client: Client): return msg with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_filter(messages.TxAck, attack_processor) client.set_expected_responses( [ @@ -203,7 +203,7 @@ def test_attack_change_input(client: Client): request_output(0), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_6f0398), @@ -257,13 +257,13 @@ def test_send_btg_multisig_change(client: Client): amount=1_252_382_934 - 24_000 - 1_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -302,7 +302,7 @@ def test_send_btg_multisig_change(client: Client): request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -351,16 +351,16 @@ def test_send_p2sh(client: Client): amount=1_252_382_934 - 11_000 - 12_300_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_db7239), @@ -405,13 +405,13 @@ def test_send_p2sh_witness_change(client: Client): amount=1_252_382_934 - 11_000 - 12_300_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -466,13 +466,13 @@ def test_send_multisig_1(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_7f1f6b), @@ -495,7 +495,7 @@ def test_send_multisig_1(client: Client): request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_7f1f6b), @@ -584,14 +584,14 @@ def test_send_btg_external_presigned(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_6f0398), diff --git a/tests/device_tests/bitcoin/test_dash.py b/tests/device_tests/bitcoin/test_dash.py index cb1966f33d..1f6441d196 100644 --- a/tests/device_tests/bitcoin/test_dash.py +++ b/tests/device_tests/bitcoin/test_dash.py @@ -57,13 +57,13 @@ def test_send_dash(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(inp1.prev_hash), @@ -105,14 +105,14 @@ def test_send_dash_dip2_input(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(inp1.prev_hash), diff --git a/tests/device_tests/bitcoin/test_decred.py b/tests/device_tests/bitcoin/test_decred.py index c031a95d75..b762498db1 100644 --- a/tests/device_tests/bitcoin/test_decred.py +++ b/tests/device_tests/bitcoin/test_decred.py @@ -72,13 +72,13 @@ def test_send_decred(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.FeeOverThreshold), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -194,14 +194,14 @@ def test_spend_from_stake_generation_and_revocation_decred(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_f8e2f2), @@ -276,7 +276,7 @@ def test_send_decred_change(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), @@ -284,7 +284,7 @@ def test_send_decred_change(client: Client): request_input(2), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -383,7 +383,7 @@ def test_decred_multisig_change(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), @@ -391,7 +391,7 @@ def test_decred_multisig_change(client: Client): request_output(0), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_9ac7d2), diff --git a/tests/device_tests/bitcoin/test_komodo.py b/tests/device_tests/bitcoin/test_komodo.py index 26c1de6eb7..dccfea95a5 100644 --- a/tests/device_tests/bitcoin/test_komodo.py +++ b/tests/device_tests/bitcoin/test_komodo.py @@ -61,13 +61,13 @@ def test_one_one_fee_sapling(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -126,16 +126,16 @@ def test_one_one_rewards_claim(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), messages.ButtonRequest(code=B.SignTx), request_input(0), diff --git a/tests/device_tests/bitcoin/test_multisig.py b/tests/device_tests/bitcoin/test_multisig.py index 061c39b587..abfe616410 100644 --- a/tests/device_tests/bitcoin/test_multisig.py +++ b/tests/device_tests/bitcoin/test_multisig.py @@ -83,12 +83,12 @@ def test_2_of_3(client: Client, chunkify: bool): ) # Expected responses are the same for both two signings - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") expected_responses = [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_6b07c1), diff --git a/tests/device_tests/bitcoin/test_multisig_change.py b/tests/device_tests/bitcoin/test_multisig_change.py index d2fcd0d350..6e155babbb 100644 --- a/tests/device_tests/bitcoin/test_multisig_change.py +++ b/tests/device_tests/bitcoin/test_multisig_change.py @@ -145,7 +145,7 @@ def _responses( change: int = 0, foreign: bool = False, ): - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") resp = [ request_input(0), request_input(1), @@ -154,7 +154,7 @@ def _responses( if change != 1: resp.append(messages.ButtonRequest(code=B.ConfirmOutput)) - if tt: + if is_core: resp.append(messages.ButtonRequest(code=B.ConfirmOutput)) elif foreign: resp.append(messages.ButtonRequest(code=B.UnknownDerivationPath)) @@ -163,7 +163,7 @@ def _responses( if change != 2: resp.append(messages.ButtonRequest(code=B.ConfirmOutput)) - if tt: + if is_core: resp.append(messages.ButtonRequest(code=B.ConfirmOutput)) elif foreign: resp.append(messages.ButtonRequest(code=B.UnknownDerivationPath)) diff --git a/tests/device_tests/bitcoin/test_op_return.py b/tests/device_tests/bitcoin/test_op_return.py index ef2dd46c94..f7410680b4 100644 --- a/tests/device_tests/bitcoin/test_op_return.py +++ b/tests/device_tests/bitcoin/test_op_return.py @@ -63,13 +63,13 @@ def test_opreturn(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), messages.ButtonRequest(code=B.SignTx), diff --git a/tests/device_tests/bitcoin/test_signtx.py b/tests/device_tests/bitcoin/test_signtx.py index ffbed3f2ae..42a2ac77c2 100644 --- a/tests/device_tests/bitcoin/test_signtx.py +++ b/tests/device_tests/bitcoin/test_signtx.py @@ -127,13 +127,13 @@ def test_one_one_fee(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_0dac36), @@ -181,13 +181,13 @@ def test_testnet_one_two_fee(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -232,13 +232,13 @@ def test_testnet_fee_high_warning(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.FeeOverThreshold), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -285,14 +285,14 @@ def test_one_two_fee(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_50f6f1), @@ -348,16 +348,16 @@ def test_one_three_fee(client: Client, chunkify: bool): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(2), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -420,7 +420,7 @@ def test_two_two(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), @@ -428,7 +428,7 @@ def test_two_two(client: Client): request_output(0), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_ac4ca0), @@ -565,13 +565,13 @@ def test_lots_of_change(client: Client): request_change_outputs = [request_output(i + 1) for i in range(cnt)] with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), ] + request_change_outputs + [ @@ -617,13 +617,13 @@ def test_fee_high_warning(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.FeeOverThreshold), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -706,13 +706,13 @@ def test_not_enough_funds(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.Failure(code=messages.FailureType.NotEnoughFunds), ] ) @@ -737,13 +737,13 @@ def test_p2sh(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_58d56a), @@ -825,7 +825,7 @@ def test_attack_change_outputs(client: Client): # Test if the transaction can be signed normally with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), @@ -833,7 +833,7 @@ def test_attack_change_outputs(client: Client): request_output(0), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_ac4ca0), @@ -993,14 +993,14 @@ def test_attack_change_input_address(client: Client): # Now run the attack, must trigger the exception with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_filter(messages.TxAck, attack_processor) client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -1045,13 +1045,13 @@ def test_spend_coinbase(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(FAKE_TXHASH_005f6f), @@ -1104,13 +1104,13 @@ def test_two_changes(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), request_output(2), messages.ButtonRequest(code=B.SignTx), @@ -1164,13 +1164,13 @@ def test_change_on_main_chain_allowed(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -1429,13 +1429,13 @@ def test_lock_time(client: Client, lock_time: int, sequence: int): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), messages.ButtonRequest(code=B.SignTx), request_input(0), diff --git a/tests/device_tests/bitcoin/test_signtx_external.py b/tests/device_tests/bitcoin/test_signtx_external.py index 656c12f464..15702acd47 100644 --- a/tests/device_tests/bitcoin/test_signtx_external.py +++ b/tests/device_tests/bitcoin/test_signtx_external.py @@ -216,20 +216,20 @@ def test_p2wpkh_in_p2sh_presigned(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(2), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_20912f), @@ -268,20 +268,20 @@ def test_p2wpkh_in_p2sh_presigned(client: Client): # Test corrupted script hash in scriptsig. inp1.script_sig[10] ^= 1 with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(2), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_20912f), @@ -401,14 +401,14 @@ def test_p2wsh_external_presigned(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_ec16dc), @@ -447,14 +447,14 @@ def test_p2wsh_external_presigned(client: Client): # Test corrupted signature in witness. inp2.witness[10] ^= 1 with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_ec16dc), @@ -513,14 +513,14 @@ def test_p2tr_external_presigned(client: Client): script_type=messages.OutputScriptType.PAYTOTAPROOT, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(1), @@ -546,14 +546,14 @@ def test_p2tr_external_presigned(client: Client): # Test corrupted signature in witness. inp2.witness[10] ^= 1 with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(1), @@ -617,17 +617,17 @@ def test_p2wpkh_with_proof(client: Client): with client: is_t1 = client.features.model == "1" - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_e5b7e2), @@ -711,14 +711,14 @@ def test_p2tr_with_proof(client: Client): with client: is_t1 = client.features.model == "1" - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_input(1), diff --git a/tests/device_tests/bitcoin/test_signtx_segwit.py b/tests/device_tests/bitcoin/test_signtx_segwit.py index 079b4382d7..2c9862678d 100644 --- a/tests/device_tests/bitcoin/test_signtx_segwit.py +++ b/tests/device_tests/bitcoin/test_signtx_segwit.py @@ -66,16 +66,16 @@ def test_send_p2sh(client: Client, chunkify: bool): amount=123_456_789 - 11_000 - 12_300_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_20912f), @@ -125,13 +125,13 @@ def test_send_p2sh_change(client: Client): amount=123_456_789 - 11_000 - 12_300_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -181,13 +181,13 @@ def test_testnet_segwit_big_amount(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(prev_hash), @@ -239,12 +239,12 @@ def test_send_multisig_1(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") expected_responses = [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_338e2d), @@ -307,17 +307,17 @@ def test_attack_change_input_address(client: Client): # Test if the transaction can be signed normally. with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), # The user is required to confirm transfer to another account. messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_20912f), @@ -387,14 +387,16 @@ def test_attack_mixed_inputs(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) - tt = client.features.model == "T" is_core = client.features.model in ("T", "R") expected_responses = [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=messages.ButtonRequestType.ConfirmOutput), - (tt, messages.ButtonRequest(code=messages.ButtonRequestType.ConfirmOutput)), + ( + is_core, + messages.ButtonRequest(code=messages.ButtonRequestType.ConfirmOutput), + ), (is_core, messages.ButtonRequest(code=messages.ButtonRequestType.SignTx)), messages.ButtonRequest(code=messages.ButtonRequestType.FeeOverThreshold), messages.ButtonRequest(code=messages.ButtonRequestType.SignTx), diff --git a/tests/device_tests/bitcoin/test_signtx_segwit_native.py b/tests/device_tests/bitcoin/test_signtx_segwit_native.py index 1ffb07496d..f2ad71b213 100644 --- a/tests/device_tests/bitcoin/test_signtx_segwit_native.py +++ b/tests/device_tests/bitcoin/test_signtx_segwit_native.py @@ -81,16 +81,16 @@ def test_send_p2sh(client: Client): amount=123_456_789 - 11_000 - 12_300_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_20912f), @@ -137,13 +137,13 @@ def test_send_p2sh_change(client: Client): amount=123_456_789 - 11_000 - 12_300_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -191,16 +191,16 @@ def test_send_native(client: Client): amount=100_000 - 40_000 - 10_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_b36780), @@ -279,13 +279,13 @@ def test_send_native_change(client: Client): amount=100_000 - 40_000 - 10_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -347,7 +347,7 @@ def test_send_both(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") is_core = client.features.model in ("T", "R") client.set_expected_responses( [ @@ -355,13 +355,13 @@ def test_send_both(client: Client): request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(2), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), (is_core, messages.ButtonRequest(code=B.SignTx)), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -433,12 +433,12 @@ def test_send_multisig_1(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") expected_responses = [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_b9abfa), @@ -511,12 +511,12 @@ def test_send_multisig_2(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") expected_responses = [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_b9abfa), @@ -596,13 +596,13 @@ def test_send_multisig_3_change(client: Client): script_type=messages.OutputScriptType.PAYTOP2SHWITNESS, ) - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") expected_responses = [ request_input(0), request_output(0), messages.ButtonRequest(code=B.UnknownDerivationPath), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_b9abfa), @@ -683,13 +683,13 @@ def test_send_multisig_4_change(client: Client): script_type=messages.OutputScriptType.PAYTOWITNESS, ) - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") expected_responses = [ request_input(0), request_output(0), messages.ButtonRequest(code=B.UnknownDerivationPath), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_b9abfa), @@ -785,18 +785,18 @@ def test_multisig_mismatch_inputs_single(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), # Ensure that the multisig output is not identified as a change output. messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_1c022d), diff --git a/tests/device_tests/bitcoin/test_signtx_taproot.py b/tests/device_tests/bitcoin/test_signtx_taproot.py index 2ac6972e37..af7cf02828 100644 --- a/tests/device_tests/bitcoin/test_signtx_taproot.py +++ b/tests/device_tests/bitcoin/test_signtx_taproot.py @@ -79,13 +79,13 @@ def test_send_p2tr(client: Client, chunkify: bool): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_output(0), @@ -134,14 +134,14 @@ def test_send_two_with_change(client: Client): amount=6_800 + 13_000 - 200 - 15_000, ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -224,7 +224,7 @@ def test_send_mixed(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") is_core = client.features.model in ("T", "R") client.set_expected_responses( [ @@ -236,18 +236,18 @@ def test_send_mixed(client: Client): # approve outputs request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(2), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(3), messages.ButtonRequest(code=B.ConfirmOutput), request_output(4), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), (is_core, messages.ButtonRequest(code=B.SignTx)), messages.ButtonRequest(code=B.SignTx), # verify inputs @@ -358,7 +358,7 @@ def test_attack_script_type(client: Client): return msg with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") is_core = client.features.model in ("T", "R") client.set_filter(messages.TxAck, attack_processor) client.set_expected_responses( @@ -367,7 +367,7 @@ def test_attack_script_type(client: Client): request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), (is_core, messages.ButtonRequest(code=B.SignTx)), messages.ButtonRequest(code=B.SignTx), request_input(0), diff --git a/tests/device_tests/bitcoin/test_zcash.py b/tests/device_tests/bitcoin/test_zcash.py index 96ad3e753a..256a6ed029 100644 --- a/tests/device_tests/bitcoin/test_zcash.py +++ b/tests/device_tests/bitcoin/test_zcash.py @@ -106,13 +106,13 @@ def test_one_one_fee_sapling(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_e38206), @@ -260,14 +260,14 @@ def test_external_presigned(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_e38206), diff --git a/tests/device_tests/nem/test_signtx_transfers.py b/tests/device_tests/nem/test_signtx_transfers.py index 4d6e855458..40491669a6 100644 --- a/tests/device_tests/nem/test_signtx_transfers.py +++ b/tests/device_tests/nem/test_signtx_transfers.py @@ -33,7 +33,7 @@ pytestmark = [ # assertion data from T1 @pytest.mark.parametrize("chunkify", (True, False)) def test_nem_signtx_simple(client: Client, chunkify: bool): - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") with client: client.set_expected_responses( [ @@ -42,7 +42,7 @@ def test_nem_signtx_simple(client: Client, chunkify: bool): # Unencrypted message messages.ButtonRequest(code=messages.ButtonRequestType.ConfirmOutput), ( - tt, + is_core, messages.ButtonRequest( code=messages.ButtonRequestType.ConfirmOutput ), @@ -85,7 +85,7 @@ def test_nem_signtx_simple(client: Client, chunkify: bool): @pytest.mark.setup_client(mnemonic=MNEMONIC12) def test_nem_signtx_encrypted_payload(client: Client): with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ # Confirm transfer and network fee @@ -93,7 +93,7 @@ def test_nem_signtx_encrypted_payload(client: Client): # Ask for encryption messages.ButtonRequest(code=messages.ButtonRequestType.ConfirmOutput), ( - tt, + is_core, messages.ButtonRequest( code=messages.ButtonRequestType.ConfirmOutput ), diff --git a/tests/device_tests/test_protection_levels.py b/tests/device_tests/test_protection_levels.py index e09147b7f4..b919e7d2bd 100644 --- a/tests/device_tests/test_protection_levels.py +++ b/tests/device_tests/test_protection_levels.py @@ -362,7 +362,7 @@ def test_signtx(client: Client): _assert_protection(client) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.use_pin_sequence([PIN4]) client.set_expected_responses( [ @@ -371,7 +371,7 @@ def test_signtx(client: Client): request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_meta(TXHASH_50f6f1), diff --git a/tests/device_tests/zcash/test_sign_tx.py b/tests/device_tests/zcash/test_sign_tx.py index 7ddc34e32c..388c8040ef 100644 --- a/tests/device_tests/zcash/test_sign_tx.py +++ b/tests/device_tests/zcash/test_sign_tx.py @@ -95,13 +95,13 @@ def test_spend_v4_input(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_output(0), @@ -144,13 +144,13 @@ def test_send_to_multisig(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_output(0), @@ -192,13 +192,13 @@ def test_spend_v5_input(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_output(0), @@ -246,13 +246,13 @@ def test_one_two(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -305,13 +305,13 @@ def test_unified_address(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), request_output(1), messages.ButtonRequest(code=B.SignTx), request_input(0), @@ -370,14 +370,14 @@ def test_external_presigned(client: Client): ) with client: - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") client.set_expected_responses( [ request_input(0), request_input(1), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(1), request_input(0), @@ -483,12 +483,12 @@ def test_spend_multisig(client: Client): ) # Expected responses are the same for both two signings - tt = client.features.model == "T" + is_core = client.features.model in ("T", "R") expected_responses = [ request_input(0), request_output(0), messages.ButtonRequest(code=B.ConfirmOutput), - (tt, messages.ButtonRequest(code=B.ConfirmOutput)), + (is_core, messages.ButtonRequest(code=B.ConfirmOutput)), messages.ButtonRequest(code=B.SignTx), request_input(0), request_output(0),