diff --git a/core/src/apps/base.py b/core/src/apps/base.py index 20384a18e1..3dfc37db1e 100644 --- a/core/src/apps/base.py +++ b/core/src/apps/base.py @@ -93,7 +93,11 @@ def get_features() -> Features: bootloader_locked=utils.bootloader_locked(), ) - if utils.INTERNAL_MODEL in ("T1B1", "T2B1"): + if ( + utils.INTERNAL_MODEL == "T1B1" # pylint: disable=consider-using-in + or utils.INTERNAL_MODEL == "T2B1" + or utils.INTERNAL_MODEL == "T3B1" + ): f.homescreen_format = HomescreenFormat.ToiG else: f.homescreen_format = HomescreenFormat.Jpeg diff --git a/core/src/apps/bitcoin/sign_tx/layout.py b/core/src/apps/bitcoin/sign_tx/layout.py index cf4044cc8a..3e6eaf4534 100644 --- a/core/src/apps/bitcoin/sign_tx/layout.py +++ b/core/src/apps/bitcoin/sign_tx/layout.py @@ -100,8 +100,14 @@ async def confirm_output( if output.address_n and not output.multisig: from trezor import utils - # Showing the account string only for T2B1 model - show_account_str = utils.INTERNAL_MODEL == "T2B1" + # Showing the account string only for model_tr layout + # TODO expose layout_type so that we can check for it, instead of listing + # all models that use the layout? + show_account_str = ( + # pylint: disable-next=consider-using-in + utils.INTERNAL_MODEL == "T2B1" + or utils.INTERNAL_MODEL == "T3B1" + ) script_type = CHANGE_OUTPUT_TO_INPUT_SCRIPT_TYPES[output.script_type] address_label = ( address_n_to_name( diff --git a/core/src/apps/debug/__init__.py b/core/src/apps/debug/__init__.py index bd80af92d6..c9d81389b5 100644 --- a/core/src/apps/debug/__init__.py +++ b/core/src/apps/debug/__init__.py @@ -178,11 +178,16 @@ if __debug__: if ( x is not None and y is not None - and utils.INTERNAL_MODEL in ("T2T1", "T3T1", "D001") + and utils.INTERNAL_MODEL # pylint: disable=internal-model-tuple-comparison + in ("T2T1", "T3T1", "D001") ): click_chan.publish((debug_events.last_event, x, y, msg.hold_ms)) # Button devices press specific button - elif msg.physical_button is not None and utils.INTERNAL_MODEL in ("T2B1",): + elif ( + msg.physical_button is not None + and utils.INTERNAL_MODEL # pylint: disable=internal-model-tuple-comparison + in ("T2B1", "T3B1") + ): button_chan.publish( (debug_events.last_event, msg.physical_button, msg.hold_ms) ) diff --git a/core/src/apps/management/recovery_device/homescreen.py b/core/src/apps/management/recovery_device/homescreen.py index 717a62cdc6..375e4704ac 100644 --- a/core/src/apps/management/recovery_device/homescreen.py +++ b/core/src/apps/management/recovery_device/homescreen.py @@ -94,8 +94,9 @@ async def _continue_recovery_process() -> Success: if is_first_step: # If we are starting recovery, ask for word count first... # _request_word_count - # For TT, just continuing straight to word count keyboard - if utils.INTERNAL_MODEL == "T2B1": + # For others than model_tr, just continue straight to word count keyboard + # pylint: disable-next=consider-using-in + if utils.INTERNAL_MODEL == "T2B1" or utils.INTERNAL_MODEL == "T3B1": await layout.homescreen_dialog( TR.buttons__continue, TR.recovery__num_of_words ) diff --git a/core/src/apps/workflow_handlers.py b/core/src/apps/workflow_handlers.py index 2631f614eb..2bc7ac692b 100644 --- a/core/src/apps/workflow_handlers.py +++ b/core/src/apps/workflow_handlers.py @@ -56,9 +56,11 @@ def _find_message_handler_module(msg_type: int) -> str: return "apps.management.reboot_to_bootloader" if ( - utils.INTERNAL_MODEL in ("T2B1", "T3T1") - and msg_type == MessageType.ShowDeviceTutorial - ): + # pylint: disable-next=consider-using-in + utils.INTERNAL_MODEL == "T2B1" + or utils.INTERNAL_MODEL == "T3B1" + or utils.INTERNAL_MODEL == "T3T1" + ) and msg_type == MessageType.ShowDeviceTutorial: return "apps.management.show_tutorial" if utils.USE_BACKLIGHT and msg_type == MessageType.SetBrightness: diff --git a/core/src/boot.py b/core/src/boot.py index 9e3086a839..2df18c35a2 100644 --- a/core/src/boot.py +++ b/core/src/boot.py @@ -25,8 +25,11 @@ if utils.USE_OPTIGA: # have to use "==" over "in (list)" so that it can be statically replaced # with the correct value during the build process -# pylint: disable-next=consider-using-in -if utils.INTERNAL_MODEL == "T2T1" or utils.INTERNAL_MODEL == "T2B1": +if ( # pylint: disable-next=consider-using-in + utils.INTERNAL_MODEL == "T2T1" + or utils.INTERNAL_MODEL == "T2B1" + or utils.INTERNAL_MODEL == "T3B1" +): _WELCOME_SCREEN_MS = 1000 # how long do we want to show welcome screen (minimum) else: _WELCOME_SCREEN_MS = 0 diff --git a/core/src/trezor/ui/__init__.py b/core/src/trezor/ui/__init__.py index 7f7c6bf63e..3a15955549 100644 --- a/core/src/trezor/ui/__init__.py +++ b/core/src/trezor/ui/__init__.py @@ -53,7 +53,12 @@ else: # in both debug and production, emulator needs to draw the screen explicitly -if utils.EMULATOR or utils.INTERNAL_MODEL in ("T1B1", "T2B1"): +if ( + utils.EMULATOR + or utils.INTERNAL_MODEL == "T1B1" + or utils.INTERNAL_MODEL == "T2B1" + or utils.INTERNAL_MODEL == "T3B1" +): loop.after_step_hook = refresh diff --git a/core/tests/test_apps.bitcoin.signtx_decred.py b/core/tests/test_apps.bitcoin.signtx_decred.py index 490538e0b8..4136f59132 100644 --- a/core/tests/test_apps.bitcoin.signtx_decred.py +++ b/core/tests/test_apps.bitcoin.signtx_decred.py @@ -1,6 +1,6 @@ from common import * # isort:skip -if utils.INTERNAL_MODEL not in ("T2B1", "T3T1"): +if utils.INTERNAL_MODEL in ("T1B1", "T2T1"): from trezor.crypto import bip39 from trezor.enums import AmountUnit, OutputScriptType from trezor.enums.RequestType import TXFINISHED, TXINPUT, TXMETA, TXOUTPUT @@ -405,5 +405,5 @@ class TestSignTxDecred(unittest.TestCase): if __name__ == "__main__": - if utils.INTERNAL_MODEL not in ("T2B1", "T3T1"): + if utils.INTERNAL_MODEL in ("T1B1", "T2T1"): unittest.main() diff --git a/core/tests/test_apps.common.coins.py b/core/tests/test_apps.common.coins.py index ba3008e824..68ff3bd8ac 100644 --- a/core/tests/test_apps.common.coins.py +++ b/core/tests/test_apps.common.coins.py @@ -22,7 +22,7 @@ class TestCoins(unittest.TestCase): ("ZEC", "Zcash", 7352), ("TAZ", "Zcash Testnet", 7461), ] - if utils.INTERNAL_MODEL not in ("T2B1", "T3T1"): + if utils.INTERNAL_MODEL in ("T1B1", "T2T1"): ref.extend( [ ("NMC", "Namecoin", 52),