Conversation
WalkthroughThis update introduces a new "attach to pin" feature. It adds new message types, fields, and enums for managing passphrase and PIN attachment. The UI and device logic are extended to support attaching passphrases to PINs, session handling, and related error flows. CLI and Python APIs are updated. Changes
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Clippy (1.86.0)warning: Caused by: ✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
There was a problem hiding this comment.
Actionable comments posted: 29
🔭 Outside diff range comments (2)
core/src/apps/common/request_pin.py (1)
277-277: Add missing parentheses:_set_last_unlock_time()core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (1)
495-498: Wrong error message.if (se_aes256_decrypt(data.buf, data.len, piv, value.buf, value.len, (uint8_t *)vstr.buf) != 0) { - mp_raise_ValueError("Encrypt failed"); + mp_raise_ValueError("Decrypt failed"); }
🧹 Nitpick comments (14)
core/src/trezor/wire/errors.py (1)
86-88: Same error code as FirmwareError might confuse clients.Both use
FailureType.FirmwareError. Is this intentional?core/src/apps/common/passphrase.py (1)
67-67: Magic number should be a constant.Extract
30as a named constant for clarity.core/src/storage/device.py (1)
361-362: Fix hex notation.Use lowercase
0x17instead of0X17for consistency.- _AUTO_PASSPHRASE = (0X17) + _AUTO_PASSPHRASE = (0x17)core/src/trezor/ui/layouts/lvgl/__init__.py (2)
1274-1279: Simplify the if-else block.- min_len = 4 - if attach_wall_only: - min_len = 6 - else: - min_len = 4 + min_len = 6 if attach_wall_only else 4
1274-1278: Use ternary operator.Replace with
min_len = 6 if attach_wall_only else 4.- min_len = 4 - if attach_wall_only: - min_len = 6 - else: - min_len = 4 + min_len = 6 if attach_wall_only else 4core/src/apps/base.py (1)
719-721: Use idiomatic empty check.- if session_id is None or session_id == b"": + if not session_id:core/src/trezor/lvglui/scrs/pinscreen.py (3)
189-189: Typo: "standy_wall_only"Should be "standard_wall_only".
- self.standy_wall_only = kwargs.get("standy_wall_only", False) + self.standard_wall_only = kwargs.get("standard_wall_only", False)
239-239: Incomplete commentRemove or complete the comment.
- # if standy_wall_only :
320-320: Typo: "standy_wall_only"Should be "standard_wall_only".
- if self.standy_wall_only and passphrase.is_passphrase_pin_enabled(): + if self.standard_wall_only and passphrase.is_passphrase_pin_enabled():core/embed/trezorhal/se_thd89.c (2)
1162-1162: Use PIN_MAX_LEN instead of 50.- uint8_t pin_buf[50 + 2] = {0}; + uint8_t pin_buf[PIN_MAX_LEN + 2] = {0};
1227-1234: Remove dead code.core/src/trezor/lvglui/scrs/homescreen.py (2)
1001-1002: Remove commented code.Delete unused code instead of commenting it out.
- # device.set_passphrase_auto_status(False)
4557-4558: Combine the nested if statements.Use a single if with
andinstead of nesting.- if code == lv.EVENT.CLICKED: - if target == self.attach_to_pin: + if code == lv.EVENT.CLICKED and target == self.attach_to_pin:core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (1)
1001-1003: Error message lacks detail.The message doesn't specify the minimum length of 6.
if (passphrase_pin_buf.len < 6) { - mp_raise_ValueError("Passphrase pin length not valid"); + mp_raise_ValueError("Passphrase pin must be at least 6 characters"); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (2)
core/mocks/generated/trezorconfig.pyiis excluded by!**/generated/**core/mocks/generated/trezorcrypto/se_thd89.pyiis excluded by!**/generated/**
📒 Files selected for processing (42)
common/protob/messages-common.proto(3 hunks)common/protob/messages-management.proto(4 hunks)common/protob/messages.proto(3 hunks)core/embed/extmod/modtrezorconfig/modtrezorconfig.c(1 hunks)core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h(5 hunks)core/embed/trezorhal/se_thd89.c(10 hunks)core/embed/trezorhal/se_thd89.h(4 hunks)core/src/all_modules.py(2 hunks)core/src/apps/base.py(10 hunks)core/src/apps/common/passphrase.py(4 hunks)core/src/apps/common/pin_constants.py(1 hunks)core/src/apps/common/request_pin.py(8 hunks)core/src/apps/common/seed.py(2 hunks)core/src/apps/management/change_pin.py(3 hunks)core/src/apps/management/recovery_device/__init__.py(4 hunks)core/src/apps/management/wipe_device.py(1 hunks)core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py(1 hunks)core/src/apps/ur_registry/helpers.py(1 hunks)core/src/apps/workflow_handlers.py(2 hunks)core/src/boot.py(1 hunks)core/src/storage/cache.py(2 hunks)core/src/storage/device.py(7 hunks)core/src/trezor/enums/ButtonRequestType.py(1 hunks)core/src/trezor/enums/Capability.py(1 hunks)core/src/trezor/enums/MessageType.py(2 hunks)core/src/trezor/enums/__init__.py(3 hunks)core/src/trezor/lvglui/i18n/locales/ja.py(2 hunks)core/src/trezor/lvglui/scrs/address.py(1 hunks)core/src/trezor/lvglui/scrs/components/keyboard.py(5 hunks)core/src/trezor/lvglui/scrs/components/listitem.py(1 hunks)core/src/trezor/lvglui/scrs/homescreen.py(18 hunks)core/src/trezor/lvglui/scrs/lockscreen.py(3 hunks)core/src/trezor/lvglui/scrs/passphrase.py(2 hunks)core/src/trezor/lvglui/scrs/pinscreen.py(5 hunks)core/src/trezor/messages.py(6 hunks)core/src/trezor/uart.py(2 hunks)core/src/trezor/ui/layouts/lvgl/__init__.py(4 hunks)core/src/trezor/ui/layouts/lvgl/attach_to_pin.py(1 hunks)core/src/trezor/wire/errors.py(1 hunks)python/src/trezorlib/cli/device.py(2 hunks)python/src/trezorlib/device.py(2 hunks)python/src/trezorlib/messages.py(12 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (10)
core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py (1)
core/src/apps/ur_registry/chains/__init__.py (1)
MismatchError(7-9)
core/src/trezor/lvglui/scrs/address.py (1)
core/src/storage/cache.py (1)
get_session_id(238-239)
core/src/trezor/wire/errors.py (1)
core/src/trezor/enums/__init__.py (1)
FailureType(453-468)
core/src/apps/ur_registry/helpers.py (2)
core/src/apps/common/passphrase.py (2)
is_enabled(11-12)is_passphrase_pin_enabled(15-16)core/src/storage/device.py (1)
is_passphrase_pin_enabled(1424-1432)
core/src/apps/management/recovery_device/__init__.py (3)
core/src/trezor/lvglui/i18n/__init__.py (2)
gettext(31-32)i18n_refresh(18-25)core/src/trezor/ui/layouts/lvgl/__init__.py (2)
show_popup(1166-1183)confirm_action(96-145)core/src/apps/common/pin_constants.py (1)
PinType(17-23)
core/src/trezor/enums/__init__.py (2)
core/src/trezor/messages.py (4)
GetPassphraseState(3948-3964)PassphraseState(3966-3982)UnLockDevice(3984-3988)UnLockDeviceResponse(3990-4006)python/src/trezorlib/messages.py (4)
GetPassphraseState(5526-5543)PassphraseState(5546-5563)UnLockDevice(5566-5567)UnLockDeviceResponse(5570-5587)
core/src/apps/workflow_handlers.py (3)
core/src/trezor/enums/__init__.py (1)
MessageType(27-451)core/src/trezor/messages.py (9)
BatchGetPublickeys(2860-2876)GetAddress(958-980)GetPublicKey(916-938)EthereumGetAddress(5610-5626)CardanoGetAddress(1816-1838)BinanceGetAddress(556-570)BinanceGetPublicKey(586-600)EthereumGetPublicKey(5578-5592)NostrGetPublicKey(7554-7568)core/src/apps/base.py (3)
wrapper(31-34)wrapper(661-663)check_version_compatibility(19-27)
core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (2)
core/embed/trezorhal/se_thd89.c (6)
se_session_get_type(1954-1960)se_get_pin_passphrase_space(1473-1479)se_set_pin_passphrase(1397-1412)se_get_pin_passphrase_ret(1482-1482)se_delete_pin_passphrase(1438-1450)se_check_passphrase_btc_test_address(1452-1471)core/embed/trezorhal/se_thd89.h (6)
se_session_get_type(139-139)se_get_pin_passphrase_space(121-121)se_set_pin_passphrase(117-118)se_get_pin_passphrase_ret(120-120)se_delete_pin_passphrase(119-119)se_check_passphrase_btc_test_address(122-122)
python/src/trezorlib/messages.py (3)
core/src/trezor/messages.py (4)
GetPassphraseState(3948-3964)PassphraseState(3966-3982)UnLockDevice(3984-3988)UnLockDeviceResponse(3990-4006)python/src/trezorlib/protobuf.py (2)
Field(148-179)MessageType(189-249)core/src/trezor/enums/__init__.py (1)
MessageType(27-451)
core/src/trezor/lvglui/scrs/pinscreen.py (8)
core/src/apps/common/passphrase.py (2)
get(23-30)is_passphrase_pin_enabled(15-16)core/src/trezor/lvglui/lv_colors.py (1)
lv_colors(9-69)core/src/trezor/lvglui/scrs/lockscreen.py (1)
_show_fingerprint_prompt_if_necessary(161-169)core/src/trezor/lvglui/scrs/components/keyboard.py (1)
NumberKeyboard(399-613)core/src/storage/device.py (1)
is_passphrase_pin_enabled(1424-1432)core/src/trezor/loop.py (2)
publish(461-466)wait(277-293)core/src/trezor/lvglui/scrs/common.py (5)
destroy(619-623)FullSizeWindow(362-703)request(148-149)request(307-308)request(589-607)core/src/trezor/ui/layouts/lvgl/__init__.py (1)
show_warning(508-532)
🪛 Ruff (0.12.2)
core/src/apps/common/request_pin.py
154-154: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
160-160: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
162-162: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
181-181: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
196-196: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
223-223: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
241-241: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
305-305: Do not assert False (python -O removes these calls), raise AssertionError()
Replace assert False
(B011)
core/src/trezor/ui/layouts/lvgl/__init__.py
1275-1278: Use ternary operator min_len = 6 if attach_wall_only else 4 instead of if-else-block
Replace if-else-block with min_len = 6 if attach_wall_only else 4
(SIM108)
core/src/apps/base.py
706-711: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
core/src/trezor/lvglui/scrs/homescreen.py
5557-5558: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Defs check
- GitHub Check: Gen check
- GitHub Check: Style check
🔇 Additional comments (73)
core/src/trezor/enums/ButtonRequestType.py (1)
24-24: LGTM! Enum value follows existing pattern.core/src/trezor/lvglui/scrs/components/listitem.py (1)
32-32: Minor styling improvement looks good.core/src/apps/management/wipe_device.py (1)
24-28: Good enhancement - adds type safety to PIN verification.core/src/trezor/enums/Capability.py (1)
12-12: Capability addition follows proper sequential numbering.core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py (1)
78-80: Good improvement - makes error handling consistent across debug modes.core/src/trezor/lvglui/i18n/locales/ja.py (1)
897-947: Translation updates look good.The wording changes improve clarity for hidden PIN functionality.
core/src/trezor/lvglui/scrs/address.py (1)
126-126: Session ID tracking addition looks correct.Proper placement between session end and start.
core/src/all_modules.py (2)
370-371: New module import follows existing pattern.Correct qstring interning approach.
584-585: Pin constants module import looks good.Follows the established pattern.
core/src/boot.py (1)
36-38: PIN type specification looks correct.Proper integration with new PIN management.
core/src/apps/ur_registry/helpers.py (1)
75-77: Logic correctly extends suffix condition for passphrase PIN mode.The OR condition properly handles both regular passphrase and passphrase PIN scenarios for device name derivation.
core/src/trezor/enums/MessageType.py (1)
107-108: New message types properly defined.Values follow the established numbering scheme and support the unlock device functionality.
core/src/storage/cache.py (2)
35-35: Cache key properly defined with sessionless flag.Follows existing pattern for sessionless cache keys.
146-146: Field allocation correctly sized for boolean flag.1-byte field is appropriate for the attach client flag.
core/src/trezor/enums/__init__.py (3)
448-451: Message type enums correctly added.Values align with protobuf definitions and follow established numbering.
491-491: Button request type properly defined.AttachPin value follows the pattern for special button types.
656-656: Capability enum correctly extended.AttachToPin capability properly numbered sequentially.
core/src/trezor/lvglui/scrs/passphrase.py (3)
9-9: Default value maintains backward compatibility.min_len parameter properly defaults to 0.
21-21: Minimum length passed to keyboard component.Correctly forwards the constraint to the keyboard.
25-26: UI state properly updated for pre-filled text.Button state and count tips correctly refreshed when result is provided.
core/src/apps/management/change_pin.py (1)
37-38: Imports VerifiedPinType and PinResult exist in apps.common.pin_constants. No action needed.
core/src/trezor/lvglui/scrs/lockscreen.py (1)
19-31: LGTM!Debug prints are properly guarded and the safer attribute check improves robustness.
Also applies to: 76-101, 126-127
common/protob/messages-common.proto (1)
78-78: LGTM!Protobuf extensions for attach pin feature are properly defined.
Also applies to: 123-123, 134-134
common/protob/messages.proto (2)
80-80: Verify wire_tiny removal is intentional.Removing
wire_tinyfromMessageType_Initializechanges behavior. Confirm this is needed for attach pin feature.
609-612: LGTM!New message types for passphrase state and device unlock are properly defined.
core/src/apps/common/pin_constants.py (1)
1-28: LGTM!New constants file is well-structured.
core/src/apps/common/seed.py (1)
70-154: LGTM!Conditional passphrase handling is consistent throughout.
core/src/trezor/lvglui/scrs/components/keyboard.py (2)
891-891: Fix LVGL constant usage.Changed from
FLAG.FOCUSEDtoSTATE.FOCUSED. Good catch.
866-868: Minimum length validation properly implemented.The OK button state updates based on input length. Visual feedback is clear.
Also applies to: 1130-1147, 1210-1218
core/embed/extmod/modtrezorconfig/modtrezorconfig.c (2)
113-167: Function signature and return type updated correctly.The
unlockfunction now accepts an optionalpin_use_typeparameter and returns a tuple.
169-180: Consistent update to check_pin function.Matches the unlock function changes.
core/src/apps/common/passphrase.py (4)
3-3: Import looks good.
15-21: Helper functions look correct.
42-42: Unused return value.The
get_pin_passphrase_space()call result is not used here but is used in_request_on_host(). Is this redundant?
74-88: Attach pin flow looks correct.python/src/trezorlib/device.py (3)
369-369: Field name uses camelCase.
onlyMainPindoesn't match Python naming style.
443-459: Initialize function looks good.
461-464: Unlock function is correct.python/src/trezorlib/cli/device.py (3)
206-223: CLI command looks good.
753-781: Initialize command is correct.
783-794: Unlock command implementation is fine.core/src/apps/workflow_handlers.py (4)
108-109: Handler registration is correct.
393-398: Handler wrapping logic looks good.
442-442: Commented code.
EOSGetPublicKeyis commented out. Intentional?
447-456: Version check wrapper is correct.common/protob/messages-management.proto (5)
42-43: Unusual field numbers.Field numbers 8000+ are very high. Is this intentional?
134-134: New capability looks correct.
195-196: Feature flags added correctly.
816-816: Comment removed.
821-821: Underscore prefix on new field.Why does
_only_main_pinhave an underscore prefix?core/src/storage/device.py (4)
32-33: LGTM!Variables follow established naming and typing patterns.
250-253: LGTM!Struct definitions follow existing patterns correctly.
Also applies to: 289-290
412-412: Verify PIN attempts reduction.Reducing from 10 to 5 attempts is a breaking change. Confirm this aligns with product requirements.
1484-1485: LGTM!Cache clearing correctly handles new variables.
Also applies to: 1524-1525
core/src/trezor/messages.py (5)
839-846: Code looks good.Field addition follows existing patterns.
855-855: Clean implementation.Also applies to: 862-862
2913-2914: Fields added correctly.Also applies to: 2921-2922
3025-3026: Proper field definitions.Also applies to: 3113-3114
3948-4007: New message classes implemented correctly.All follow standard protobuf patterns.
core/src/trezor/ui/layouts/lvgl/__init__.py (1)
1200-1212: No issues found.The passphrase request changes look correct.
core/embed/trezorhal/se_thd89.h (7)
15-19: LGTM!
21-35: LGTM!
37-44: LGTM!
112-112: LGTM!
116-122: LGTM!
139-139: LGTM!
256-256: LGTM!core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (6)
27-28: LGTM!
166-178: LGTM!
964-977: LGTM!
1036-1063: LGTM!
1065-1085: LGTM!
1105-1106: LGTM!Also applies to: 1163-1174
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (6)
core/src/trezor/lvglui/res/attach-to-pin-guide.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/attach_to_pin_display.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/attach_to_pin_dot_group.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/icon-attach-to-pin.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/nav-icon.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/pin_lock.pngis excluded by!**/*.png
📒 Files selected for processing (13)
core/src/storage/device.py(9 hunks)core/src/trezor/lvglui/i18n/keys.py(1 hunks)core/src/trezor/lvglui/i18n/locales/de.py(1 hunks)core/src/trezor/lvglui/i18n/locales/en.py(1 hunks)core/src/trezor/lvglui/i18n/locales/es.py(1 hunks)core/src/trezor/lvglui/i18n/locales/fr.py(1 hunks)core/src/trezor/lvglui/i18n/locales/it.py(1 hunks)core/src/trezor/lvglui/i18n/locales/ja.py(3 hunks)core/src/trezor/lvglui/i18n/locales/ko.py(1 hunks)core/src/trezor/lvglui/i18n/locales/pt_br.py(1 hunks)core/src/trezor/lvglui/i18n/locales/ru.py(1 hunks)core/src/trezor/lvglui/i18n/locales/zh_cn.py(1 hunks)core/src/trezor/lvglui/i18n/locales/zh_hk.py(1 hunks)
✅ Files skipped from review due to trivial changes (6)
- core/src/trezor/lvglui/i18n/locales/pt_br.py
- core/src/trezor/lvglui/i18n/locales/de.py
- core/src/trezor/lvglui/i18n/locales/es.py
- core/src/trezor/lvglui/i18n/locales/fr.py
- core/src/trezor/lvglui/i18n/locales/ru.py
- core/src/trezor/lvglui/i18n/locales/ko.py
🚧 Files skipped from review as they are similar to previous changes (2)
- core/src/trezor/lvglui/i18n/locales/ja.py
- core/src/storage/device.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Defs check
- GitHub Check: Style check
- GitHub Check: Gen check
🔇 Additional comments (4)
core/src/trezor/lvglui/i18n/locales/zh_cn.py (1)
1020-1020: Translation looks good.Clear and grammatically correct Chinese.
core/src/trezor/lvglui/i18n/locales/it.py (1)
1020-1020: Translation looks good.Clear and grammatically correct Italian.
core/src/trezor/lvglui/i18n/locales/en.py (1)
1020-1020: Translation looks good.Clear and grammatically correct English.
core/src/trezor/lvglui/i18n/keys.py (1)
1017-1017: LGTM.Clear message format and appropriate subtitle classification.
a17cd1c to
7b2881d
Compare
* Revert "Revert "disable D-Cache during jpeg decoding. (OneKeyHQ#340)" (OneKeyHQ#341)" This reverts commit 7ebd207. * fix(jpeg): resolve issues caused by input cache during decoding. * feat(ui): draw progress bar using LVGL components. * fix(btc-only): correct command response error.
…neKeyHQ#350) Signed-off-by: Lu1zz <yu.lu@onekey.so>
Signed-off-by: Adam BZH <adam@onekey.so>
* feat(core): add Kaspa address format toggle for Address Book * feat(core): add support for safe execTransaction/approveHash support * feat(core): optimize display of ETH zero-value transfers with non-null data * fix(core): fix the delegate resource issue with tron * fix(core): optimize vibrate * feat(core): add support for slip-39 backup * fix(core): fix gen/style check issue * fix(Kaspa): add i18n keys * chore(core): bump version to 4.15.0
Signed-off-by: Lu1zz <yu.lu@onekey.so>
7b2881d to
c8d31a4
Compare
There was a problem hiding this comment.
Actionable comments posted: 18
🔭 Outside diff range comments (1)
core/src/apps/common/request_pin.py (1)
277-277: Add missing parentheses.Function call needs parentheses.
- _set_last_unlock_time + _set_last_unlock_time()
♻️ Duplicate comments (27)
core/src/apps/common/request_pin.py (7)
172-172: Remove debug print.- print("usertype", usertype)
154-154: Fix typo: "cancle" → "cancel".- raise wire.PinCancelled("cancle") + raise wire.PinCancelled("cancel")
162-162: Fix typo: "cancle" → "cancel".- raise wire.PinCancelled("cancle") + raise wire.PinCancelled("cancel")
181-181: Fix typo: "cancle" → "cancel".- raise wire.PinCancelled("cancle") + raise wire.PinCancelled("cancel")
196-196: Fix typo: "cancle" → "cancel".- raise wire.PinCancelled("cancle") + raise wire.PinCancelled("cancel")
223-223: Fix typo: "cancle" → "cancel".- raise wire.PinCancelled("cancle") + raise wire.PinCancelled("cancel")
241-241: Fix garbled text.- raise wire.PinCancelled("cal cale ..") + raise wire.PinCancelled("cancel")python/src/trezorlib/messages.py (5)
459-460: Fix capitalization."UnLockDevice" should be "UnlockDevice".
4342-4342: Fix field name."is_contains_attach" is bad grammar. Use "contains_attach" or "has_attach".
4352-4352: Fix parameter name."is_contains_attach" needs fixing to match the field name change.
5566-5568: Fix class name."UnLockDevice" should be "UnlockDevice".
5570-5571: Fix class name."UnLockDeviceResponse" should be "UnlockDeviceResponse".
core/src/trezor/lvglui/scrs/pinscreen.py (3)
219-223: Duplicate codeThe subtitle text is set twice.
475-477: Remove debug printDebug prints should not be in production code.
576-577: Inconsistent minimum length checkThe check requires 6 but keyboard has
min_len=4.core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (2)
244-244: Remove debug print.
250-252: Wrap debug print in debug check.core/embed/trezorhal/se_thd89.c (2)
1341-1351: PIN_MAX_LENGTH and PASSPHRASE_MAX_LENGTH are undefined.Use PIN_MAX_LEN instead.
1417-1419: PIN_MAX_LENGTH is undefined.Use PIN_MAX_LEN.
core/src/trezor/ui/layouts/lvgl/__init__.py (4)
1210-1211: Inconsistent error handling.Why return
Noneonly whenmin_lenis exactly 1?
1238-1238: Fix typo."standy_wall_only" should be "standard_wall_only".
1261-1261: Fix typo."standy_wall_only" should be "standard_wall_only".
1283-1283: Fix typo."standy_wall_only" should be "standard_wall_only".
core/src/trezor/lvglui/scrs/homescreen.py (1)
991-993: Remove debug print
Debug output must not stay in production.core/src/apps/base.py (3)
165-169: Magic number needs explaining.
690-699: Incomplete condition check.
746-750: Bare except too broad.
🧹 Nitpick comments (31)
core/embed/trezorhal/jpeg_dma.c (1)
280-280: Consider using actual JPEG size for cache clean.Using
g_inputJpegSizeinstead ofMAX_JPEG_SIZEwould be more efficient.- SCB_CleanDCache_by_Addr((uint32_t *)g_inputJpegBuffer, MAX_JPEG_SIZE); + SCB_CleanDCache_by_Addr((uint32_t *)g_inputJpegBuffer, g_inputJpegSize);core/src/apps/ethereum/onekey/sign_tx_eip1559.py (1)
105-105: Drop the underscore prefix.The variable is local, not private.
- _is_safe_tx = False + is_safe_tx_flag = Falsecore/src/trezor/lvglui/scrs/components/button.py (1)
270-275: Simplify the vibration logic.Too many branches. Pick one approach.
- if not self.is_haptic_feedback: - motor.vibrate(motor.WHISPER) - else: - # if self.switch.get_state() != lv.STATE.CHECKED: - # motor.vibrate(motor.WHISPER, force=True) - motor.vibrate(motor.WHISPER, force=True) + force = self.is_haptic_feedback + motor.vibrate(motor.WHISPER, force=force)core/src/storage/recovery_shares.py (4)
10-15: Remove commented codeDead code should be deleted, not commented out.
19-27: Remove commented codeDead code should be deleted, not commented out.
31-32: Remove commented codeDead code should be deleted, not commented out.
43-47: Remove commented codeDead code should be deleted, not commented out.
core/src/trezor/lvglui/scrs/recovery_device.py (1)
152-152: Remove commented codeDead code should be deleted, not commented out.
core/src/apps/common/backup_types.py (1)
70-87: Use a dictionary instead of if statements.def get_num_of_words_per_share( backup_type: BackupType, secret_length_bytes: int ) -> int: if is_slip39_backup_type(backup_type): if secret_length_bytes == 16: return 20 elif secret_length_bytes == 32: return 33 else: - if secret_length_bytes == 16: - return 12 - elif secret_length_bytes == 24: - return 18 - elif secret_length_bytes == 32: - return 24 + bip39_words = {16: 12, 24: 18, 32: 24} + if secret_length_bytes in bip39_words: + return bip39_words[secret_length_bytes] # Invalid backup type and secret length combination raise RuntimeErrorcore/src/trezor/ui/layouts/lvgl/reset.py (3)
43-43: Remove commented code.Delete the commented line.
- # header_title = _(i18n_keys.TITLE__RECOVERY_PHRASE)
86-88: Remove debug print.Debug statements don't belong in production code.
- if __debug__: - print(f"mnemonic display result: {result}")
103-104: Remove commented code.Delete these commented lines.
- # # remove current checked words - # non_duplicates.remove(share_words[offset])core/src/trezor/lvglui/scrs/common.py (4)
495-496: Remove debug print.- if __debug__: - print("on_draw_post_end called.")
502-503: Remove debug print.- if __debug__: - print("vibrate start...")
514-515: Remove debug print.- if __debug__: - print(f"vibrate necessary ? {self.icon_path}")
521-522: Remove debug print.- if __debug__: - print("vibrate necessary: true")core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (2)
1037-1037: Fix spacing in type annotation.Missing space after comma in tuple type.
-/// tuple[bool,bool]: +/// tuple[bool, bool]:
1074-1076: Address length validation is arbitrary.64-byte limit seems arbitrary without justification.
Consider using Bitcoin address format specific limits instead of arbitrary 64 bytes.
core/embed/trezorhal/motor.c (2)
44-46: Fix typo."dont" should be "don't".
- // dont disable clock, as it may used by other peripherals + // don't disable clock, as it may used by other peripherals
117-117: Fix grammar."non zero" should be "non-zero".
- // we don't have to filter non zero values + // we don't have to filter non-zero valuescore/src/apps/management/recovery_device/homescreen.py (1)
94-94: Fix grammar.Remove redundant "be".
- # Both will be either set or unset. We use 'backup_type is None' to detect status of both. + # Both will either be set or unset. We use 'backup_type is None' to detect status of both.core/src/apps/ethereum/onekey/sign_tx.py (1)
265-265: Use formal language.Replace "aka" with "i.e.".
- in (196, 228) # assume data is 00 aka the recipient is not a contract + in (196, 228) # assume data is 00 i.e. the recipient is not a contractcore/src/trezor/ui/layouts/lvgl/attach_to_pin.py (1)
385-385: Remove commented code.- # screen.btn_no.enable(lv_colors.ONEKEY_RED_1, text_color=lv_colors.BLACK)core/src/apps/management/recovery_device/layout.py (4)
112-115: Remove commented code.- # if is_slip39: - # text = "The entered recovery\nshares are valid and\nmatch what is currently\nin the device." - # raise - # else:
135-137: Remove commented code.- # if is_slip39: - # raise - # else:
164-166: Remove commented code.- # if backup_types.is_slip39_word_count(len(mnemonics)): - # pass - # else:
175-179: Remove commented code.- # await show_warning( - # ctx, - # "warning_known_share", - # "Share already entered,\nplease enter\na different share.", - # )core/src/trezor/ui/layouts/lvgl/__init__.py (1)
1274-1278: Simplify conditional assignment.Use ternary operator:
min_len = 6 if attach_wall_only else 4- min_len = 4 - if attach_wall_only: - min_len = 6 - else: - min_len = 4 + min_len = 6 if attach_wall_only else 4core/src/trezor/ui/layouts/lvgl/altcoin.py (1)
27-32: Extract duplicate logic.Same conditional logic appears in lines 164-169. Extract to helper function.
+def _get_title_and_striped(amount: str, raw_data: bytes | None) -> tuple[str, bool]: + if amount.split(" ")[0] == "0" and raw_data is not None: + return _(i18n_keys.TITLE_REQUEST_CONFIRMATION), False + else: + short_amount, striped = strip_amount(amount) + return _(i18n_keys.TITLE__SEND_MULTILINE).format(short_amount), stripedcore/src/apps/management/reset_device/layout.py (1)
66-68: Long i18n key name hurts readability.Consider shortening:
CONTENT__YOU_HAVE_COMPLETED_VERIFICATION_OF_SHARE_STR_OF_STR_RECOVERY_PHRASEcore/src/apps/base.py (1)
706-711: Combine nested if statements.- if ( - fingerprints.is_available() - and fingerprints.is_unlocked() - and not config.is_unlocked() - ): - if storage.device.is_passphrase_pin_enabled(): - storage.device.set_passphrase_pin_enabled(False) + if ( + fingerprints.is_available() + and fingerprints.is_unlocked() + and not config.is_unlocked() + and storage.device.is_passphrase_pin_enabled() + ): + storage.device.set_passphrase_pin_enabled(False)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (12)
core/mocks/generated/trezorconfig.pyiis excluded by!**/generated/**core/mocks/generated/trezorcrypto/se_thd89.pyiis excluded by!**/generated/**core/mocks/generated/trezorcrypto/slip39.pyiis excluded by!**/generated/**core/mocks/generated/trezorio/__init__.pyiis excluded by!**/generated/**core/src/trezor/lvglui/res/attach-to-pin-guide.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/attach_to_pin_display.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/attach_to_pin_dot_group.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/icon-attach-to-pin.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/nav-icon.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/pin_lock.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/s-arrow-down.pngis excluded by!**/*.pngcore/src/trezor/lvglui/res/ss-mul-share.pngis excluded by!**/*.png
📒 Files selected for processing (118)
common/protob/messages-common.proto(3 hunks)common/protob/messages-management.proto(5 hunks)common/protob/messages-tron.proto(1 hunks)common/protob/messages.proto(3 hunks)core/embed/extmod/modtrezorconfig/modtrezorconfig.c(4 hunks)core/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h(2 hunks)core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h(5 hunks)core/embed/extmod/modtrezorcrypto/modtrezorcrypto-shamir.h(3 hunks)core/embed/extmod/modtrezorcrypto/modtrezorcrypto-slip39.h(4 hunks)core/embed/extmod/modtrezorio/modtrezorio-motor.h(1 hunks)core/embed/extmod/modtrezorui/mipi_lcd.c(1 hunks)core/embed/firmware/version.h(1 hunks)core/embed/lvgl/lv_jpeg_stm32.c(1 hunks)core/embed/rust/src/trezorhal/bip39.rs(1 hunks)core/embed/trezorhal/device.c(1 hunks)core/embed/trezorhal/jpeg_dma.c(1 hunks)core/embed/trezorhal/motor.c(3 hunks)core/embed/trezorhal/motor.h(2 hunks)core/embed/trezorhal/motor_patterns.h(1 hunks)core/embed/trezorhal/se_thd89.c(13 hunks)core/embed/trezorhal/se_thd89.h(4 hunks)core/src/all_modules.py(4 hunks)core/src/apps/base.py(10 hunks)core/src/apps/cardano/seed.py(1 hunks)core/src/apps/common/backup.py(1 hunks)core/src/apps/common/backup_types.py(1 hunks)core/src/apps/common/mnemonic.py(2 hunks)core/src/apps/common/passphrase.py(4 hunks)core/src/apps/common/pin_constants.py(1 hunks)core/src/apps/common/request_pin.py(8 hunks)core/src/apps/common/seed.py(2 hunks)core/src/apps/debug/load_device.py(2 hunks)core/src/apps/ethereum/layout.py(4 hunks)core/src/apps/ethereum/onekey/sign_safe_tx.py(3 hunks)core/src/apps/ethereum/onekey/sign_tx.py(7 hunks)core/src/apps/ethereum/onekey/sign_tx_eip1559.py(3 hunks)core/src/apps/ethereum/sign_tx.py(2 hunks)core/src/apps/ethereum/sign_tx_eip1559.py(2 hunks)core/src/apps/ethereum/tokens.py(1 hunks)core/src/apps/ethereum/tokens.py.mako(1 hunks)core/src/apps/management/backup_types.py(0 hunks)core/src/apps/management/change_pin.py(3 hunks)core/src/apps/management/recovery_device/__init__.py(5 hunks)core/src/apps/management/recovery_device/create_mul_shares.py(1 hunks)core/src/apps/management/recovery_device/homescreen.py(13 hunks)core/src/apps/management/recovery_device/layout.py(9 hunks)core/src/apps/management/recovery_device/recover.py(6 hunks)core/src/apps/management/recovery_device/word_validity.py(4 hunks)core/src/apps/management/reset_device/__init__.py(6 hunks)core/src/apps/management/reset_device/layout.py(7 hunks)core/src/apps/management/wipe_device.py(1 hunks)core/src/apps/tron/serialize.py(1 hunks)core/src/apps/tron/sign_tx.py(1 hunks)core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py(1 hunks)core/src/apps/ur_registry/helpers.py(1 hunks)core/src/apps/workflow_handlers.py(1 hunks)core/src/boot.py(1 hunks)core/src/storage/cache.py(2 hunks)core/src/storage/device.py(13 hunks)core/src/storage/recovery.py(1 hunks)core/src/storage/recovery_shares.py(2 hunks)core/src/trezor/crypto/slip39.py(24 hunks)core/src/trezor/enums/BackupType.py(1 hunks)core/src/trezor/enums/ButtonRequestType.py(1 hunks)core/src/trezor/enums/Capability.py(1 hunks)core/src/trezor/enums/MessageType.py(2 hunks)core/src/trezor/enums/__init__.py(4 hunks)core/src/trezor/lvglui/i18n/keys.py(3 hunks)core/src/trezor/lvglui/i18n/locales/de.py(3 hunks)core/src/trezor/lvglui/i18n/locales/en.py(3 hunks)core/src/trezor/lvglui/i18n/locales/es.py(4 hunks)core/src/trezor/lvglui/i18n/locales/fr.py(4 hunks)core/src/trezor/lvglui/i18n/locales/it.py(3 hunks)core/src/trezor/lvglui/i18n/locales/ja.py(6 hunks)core/src/trezor/lvglui/i18n/locales/ko.py(3 hunks)core/src/trezor/lvglui/i18n/locales/pt_br.py(4 hunks)core/src/trezor/lvglui/i18n/locales/ru.py(4 hunks)core/src/trezor/lvglui/i18n/locales/zh_cn.py(4 hunks)core/src/trezor/lvglui/i18n/locales/zh_hk.py(4 hunks)core/src/trezor/lvglui/scrs/address.py(10 hunks)core/src/trezor/lvglui/scrs/common.py(4 hunks)core/src/trezor/lvglui/scrs/components/button.py(4 hunks)core/src/trezor/lvglui/scrs/components/container.py(1 hunks)core/src/trezor/lvglui/scrs/components/keyboard.py(15 hunks)core/src/trezor/lvglui/scrs/components/listitem.py(5 hunks)core/src/trezor/lvglui/scrs/components/navigation.py(1 hunks)core/src/trezor/lvglui/scrs/components/radio.py(2 hunks)core/src/trezor/lvglui/scrs/components/slider.py(3 hunks)core/src/trezor/lvglui/scrs/fingerprints.py(6 hunks)core/src/trezor/lvglui/scrs/homescreen.py(21 hunks)core/src/trezor/lvglui/scrs/lockscreen.py(3 hunks)core/src/trezor/lvglui/scrs/passphrase.py(2 hunks)core/src/trezor/lvglui/scrs/pinscreen.py(5 hunks)core/src/trezor/lvglui/scrs/recovery_device.py(7 hunks)core/src/trezor/lvglui/scrs/reset_device.py(7 hunks)core/src/trezor/lvglui/scrs/template.py(18 hunks)core/src/trezor/messages.py(8 hunks)core/src/trezor/motor.py(1 hunks)core/src/trezor/pin.py(1 hunks)core/src/trezor/qr.py(1 hunks)core/src/trezor/uart.py(4 hunks)core/src/trezor/ui/components/tt/keyboard_slip39.py(2 hunks)core/src/trezor/ui/layouts/lvgl/__init__.py(7 hunks)core/src/trezor/ui/layouts/lvgl/altcoin.py(6 hunks)core/src/trezor/ui/layouts/lvgl/attach_to_pin.py(1 hunks)core/src/trezor/ui/layouts/lvgl/recovery.py(3 hunks)core/src/trezor/ui/layouts/lvgl/reset.py(4 hunks)core/src/trezor/utils.py(1 hunks)core/src/trezor/wire/errors.py(1 hunks)crypto/bip39.c(4 hunks)crypto/bip39.h(1 hunks)crypto/slip39.c(6 hunks)crypto/slip39.h(2 hunks)crypto/slip39_wordlist.h(2 hunks)python/src/trezorlib/cli/device.py(2 hunks)python/src/trezorlib/device.py(2 hunks)python/src/trezorlib/messages.py(15 hunks)vendor/lvgl_mp(1 hunks)
💤 Files with no reviewable changes (1)
- core/src/apps/management/backup_types.py
✅ Files skipped from review due to trivial changes (14)
- core/embed/firmware/version.h
- core/embed/extmod/modtrezorcrypto/modtrezorcrypto-shamir.h
- core/embed/lvgl/lv_jpeg_stm32.c
- vendor/lvgl_mp
- core/embed/trezorhal/device.c
- common/protob/messages-tron.proto
- core/src/trezor/wire/errors.py
- core/src/trezor/utils.py
- core/src/all_modules.py
- core/src/apps/ethereum/sign_tx.py
- core/src/trezor/lvglui/i18n/locales/pt_br.py
- crypto/slip39_wordlist.h
- core/src/trezor/lvglui/i18n/locales/ja.py
- core/src/trezor/lvglui/i18n/locales/es.py
🚧 Files skipped from review as they are similar to previous changes (33)
- core/src/trezor/enums/ButtonRequestType.py
- core/src/apps/management/wipe_device.py
- core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py
- core/src/boot.py
- core/src/apps/ur_registry/helpers.py
- core/src/trezor/enums/Capability.py
- core/src/trezor/enums/MessageType.py
- core/src/trezor/lvglui/i18n/locales/en.py
- core/src/trezor/lvglui/scrs/passphrase.py
- core/src/trezor/lvglui/i18n/locales/de.py
- core/src/trezor/lvglui/scrs/lockscreen.py
- core/src/storage/cache.py
- core/src/trezor/uart.py
- core/src/apps/common/seed.py
- core/src/apps/management/change_pin.py
- core/src/apps/common/pin_constants.py
- python/src/trezorlib/device.py
- core/src/apps/management/recovery_device/init.py
- core/src/trezor/lvglui/i18n/locales/zh_hk.py
- core/src/trezor/lvglui/i18n/locales/zh_cn.py
- core/src/apps/workflow_handlers.py
- core/src/trezor/enums/init.py
- core/src/trezor/lvglui/i18n/locales/ko.py
- python/src/trezorlib/cli/device.py
- core/src/trezor/lvglui/i18n/locales/ru.py
- core/src/apps/common/passphrase.py
- common/protob/messages.proto
- core/src/trezor/lvglui/i18n/locales/fr.py
- core/src/trezor/lvglui/i18n/locales/it.py
- common/protob/messages-common.proto
- core/embed/trezorhal/se_thd89.h
- core/src/storage/device.py
- common/protob/messages-management.proto
🧰 Additional context used
🧬 Code Graph Analysis (15)
core/src/trezor/qr.py (1)
core/src/trezor/motor.py (2)
vibrate(24-47)vibrate(51-54)
core/src/trezor/ui/components/tt/keyboard_slip39.py (1)
crypto/slip39.c (1)
button_sequence_to_word(94-112)
core/embed/rust/src/trezorhal/bip39.rs (2)
crypto/bip39.c (1)
mnemonic_word_completion_mask(327-342)crypto/bip39.h (1)
mnemonic_word_completion_mask(58-59)
core/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h (2)
crypto/bip39.c (2)
mnemonic_complete_word(284-317)mnemonic_word_completion_mask(327-342)crypto/bip39.h (2)
mnemonic_complete_word(56-56)mnemonic_word_completion_mask(58-59)
core/src/apps/cardano/seed.py (2)
core/src/apps/common/mnemonic.py (2)
is_bip39(20-25)get_seed(28-68)core/src/apps/common/seed.py (2)
get_seed(123-130)get_seed(137-156)
core/embed/extmod/modtrezorcrypto/modtrezorcrypto-slip39.h (2)
crypto/bip39.c (2)
mnemonic_complete_word(284-317)mnemonic_word_completion_mask(327-342)crypto/bip39.h (2)
mnemonic_complete_word(56-56)mnemonic_word_completion_mask(58-59)
core/src/trezor/motor.py (1)
core/src/storage/device.py (1)
keyboard_haptic_enabled(710-719)
core/src/trezor/pin.py (3)
core/src/trezor/lvglui/scrs/common.py (1)
FullSizeWindow(362-703)core/src/trezor/lvglui/i18n/__init__.py (1)
gettext(31-32)core/src/trezor/lvglui/lv_colors.py (1)
lv_colors(9-69)
core/src/apps/management/recovery_device/word_validity.py (2)
core/src/trezor/enums/__init__.py (1)
BackupType(610-616)core/src/apps/common/backup_types.py (2)
is_slip39_backup_type(25-32)is_slip39_advanced_backup_type(35-39)
core/embed/trezorhal/motor.c (2)
core/embed/trezorhal/motor.h (16)
motor_ctrl(29-29)motor_reset(32-32)motor_init(27-27)motor_deinit(28-28)motor_is_busy(30-30)motor_play(31-31)motor_resonant_finder(35-35)motor_set_builtin_play_method(38-38)motor_play_whisper(41-41)motor_play_light(42-42)motor_play_medium(43-43)motor_play_heavy(44-44)motor_play_success(47-47)motor_play_warning(48-48)motor_play_error(49-49)motor_play_slide(50-50)core/embed/trezorhal/motor_patterns.h (8)
seq_Success(45-68)seq_Success(45-45)seq_Warning(70-93)seq_Warning(70-70)seq_Error(95-131)seq_Error(95-95)seq_Slide(133-163)seq_Slide(133-133)
core/embed/extmod/modtrezorio/modtrezorio-motor.h (2)
core/embed/trezorhal/motor.c (7)
motor_play_whisper(185-188)motor_play_light(190-193)motor_play_medium(195-198)motor_play_heavy(200-203)motor_play_success(206-210)motor_play_warning(212-216)motor_play_error(218-222)core/embed/trezorhal/motor.h (7)
motor_play_whisper(41-41)motor_play_light(42-42)motor_play_medium(43-43)motor_play_heavy(44-44)motor_play_success(47-47)motor_play_warning(48-48)motor_play_error(49-49)
core/src/trezor/lvglui/scrs/pinscreen.py (8)
core/src/trezor/utils.py (2)
get(614-620)lcd_resume(168-197)core/src/apps/common/passphrase.py (2)
get(23-30)is_passphrase_pin_enabled(15-16)core/src/trezor/lvglui/scrs/lockscreen.py (1)
_show_fingerprint_prompt_if_necessary(161-169)core/src/trezor/lvglui/scrs/components/keyboard.py (1)
NumberKeyboard(399-613)core/src/storage/device.py (1)
is_passphrase_pin_enabled(1424-1432)core/src/trezor/loop.py (2)
publish(461-466)wait(277-293)core/src/trezor/lvglui/scrs/common.py (5)
destroy(619-623)FullSizeWindow(362-703)request(148-149)request(307-308)request(589-607)core/src/trezor/wire/__init__.py (4)
wait(86-87)wait(136-137)wait(213-219)wait(380-386)
core/src/trezor/lvglui/scrs/address.py (6)
core/src/storage/cache.py (1)
get_session_id(238-239)core/src/trezor/wire/errors.py (1)
DataError(21-23)core/src/trezor/lvglui/i18n/__init__.py (1)
gettext(31-32)core/src/trezor/lvglui/scrs/template.py (1)
ADDRESS_OFFLINE_RETURN_TYPE(249-252)core/src/trezor/enums/__init__.py (1)
MessageType(27-451)core/src/trezor/messages.py (23)
GetAddress(958-980)EthereumGetAddressOneKey(5340-5356)SolanaGetAddress(7994-8008)TronGetAddress(9262-9276)TonGetAddress(9084-9108)KaspaGetAddress(5914-5934)SuiGetAddress(8648-8662)CardanoGetAddress(1816-1838)RippleGetAddress(7782-7796)AptosGetAddress(306-320)AlephiumGetAddress(76-94)AlgorandGetAddress(246-260)BenfenGetAddress(424-438)ConfluxGetAddress(2448-2464)CosmosGetAddress(2598-2614)FilecoinGetAddress(5850-5866)NearGetAddress(6902-6916)NervosGetAddress(7352-7368)NeoGetAddress(7286-7300)NexaGetAddress(7454-7470)NostrGetPublicKey(7554-7568)PolkadotGetAddress(7714-7732)ScdoGetAddress(7870-7884)
core/src/trezor/lvglui/scrs/homescreen.py (9)
core/src/trezor/lvglui/scrs/common.py (9)
on_click(142-143)on_click(301-302)AnimScreen(56-204)collect_animation_targets(159-160)_load_scr(162-177)_load_scr(318-321)load_screen(187-195)load_screen(331-343)Screen(207-352)core/src/trezor/lvglui/scrs/components/pageable.py (3)
on_gesture(78-102)Indicator(111-133)set_active(127-133)core/src/trezor/lvglui/scrs/address.py (2)
STATE(16-22)AddressManager(13-408)core/src/trezor/lvglui/scrs/components/container.py (1)
ContainerFlexCol(8-48)core/src/trezor/lvglui/scrs/components/button.py (5)
clear_state(277-278)add_state(280-281)ListItemBtnWithSwitch(209-281)ListItemBtn(88-206)enable(71-75)core/src/storage/device.py (5)
is_passphrase_pin_enabled(1424-1432)is_passphrase_enabled(909-913)set_passphrase_always_on_device(1034-1037)set_passphrase_enabled(916-923)set_passphrase_pin_enabled(1435-1450)core/src/apps/base.py (1)
lock_device_if_unlocked(562-566)core/src/trezor/loop.py (1)
spawn(488-602)core/src/trezor/lvglui/scrs/components/listitem.py (1)
DisplayItemWithFont_30(170-194)
core/src/trezor/messages.py (3)
python/src/trezorlib/messages.py (5)
GetPassphraseState(5526-5543)MessageType(36-460)PassphraseState(5546-5563)UnLockDevice(5566-5567)UnLockDeviceResponse(5570-5587)core/src/trezor/enums/__init__.py (1)
MessageType(27-451)python/src/trezorlib/protobuf.py (1)
MessageType(189-249)
🪛 Ruff (0.12.2)
core/src/trezor/pin.py
43-43: Found useless expression. Either assign it to a variable or remove it.
(B018)
80-81: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
core/src/apps/common/backup_types.py
79-84: Use a dictionary instead of consecutive if statements
(SIM116)
core/src/apps/common/request_pin.py
154-154: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
160-160: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
162-162: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
181-181: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
196-196: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
223-223: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
241-241: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
305-305: Do not assert False (python -O removes these calls), raise AssertionError()
Replace assert False
(B011)
core/src/apps/ethereum/onekey/sign_tx.py
344-352: Return the condition directly
(SIM103)
356-365: Return the condition directly
(SIM103)
core/src/trezor/lvglui/scrs/reset_device.py
137-138: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
401-402: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
576-577: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
core/src/trezor/ui/layouts/lvgl/__init__.py
1275-1278: Use ternary operator min_len = 6 if attach_wall_only else 4 instead of if-else-block
Replace if-else-block with min_len = 6 if attach_wall_only else 4
(SIM108)
core/src/trezor/lvglui/scrs/homescreen.py
4930-4931: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
core/src/apps/base.py
706-711: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
🔇 Additional comments (110)
core/embed/extmod/modtrezorui/mipi_lcd.c (1)
710-710: Good improvement using symbolic constant.Replacing the magic number with
LTDC_CDSR_VSYNCSimproves readability.core/src/trezor/qr.py (1)
241-241: Good explicit vibration pattern specification.Using
motor.SUCCESSis clearer than relying on default behavior.core/src/trezor/enums/BackupType.py (1)
8-10: New backup type constants look good.Sequential values and consistent naming pattern.
core/src/trezor/lvglui/scrs/components/container.py (1)
138-140: LGTM - UI padding refinementClean change from uniform vertical padding to separate top/bottom padding control.
crypto/slip39.h (2)
28-28: LGTM - SLIP39 wordlist constantStandard macro definition for word count.
41-41: LGTM - SLIP39 wordlist declarationProper external array declaration.
core/src/apps/tron/serialize.py (1)
201-203: LGTM - Optional field serializationCorrect implementation following existing pattern for optional fields.
core/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip39.h (2)
38-38: LGTM - Updated function callCorrect addition of
is_slip39parameter set tofalsefor BIP39 wordlist.
57-57: LGTM - Updated function callCorrect addition of
is_slip39parameter set tofalsefor BIP39 wordlist.core/src/apps/ethereum/sign_tx_eip1559.py (2)
87-87: LGTM - Extract raw data logicClean extraction of raw data detection logic.
98-98: LGTM - Pass extracted variableCorrect usage of extracted
has_raw_datavariable.crypto/slip39.c (1)
34-111: Consistent identifier updates look good.The standardization of
WORDS_COUNTtoSLIP39_WORD_COUNTandslip39_wordlisttoSLIP39_WORDLISTmaintains consistent naming across the codebase.core/embed/rust/src/trezorhal/bip39.rs (1)
44-44: FFI parameter addition is correct.The
falseparameter correctly indicates BIP39 wordlist usage in the updated function signature.core/src/apps/tron/sign_tx.py (1)
97-103: Verify removal of fee limit check is intentional.The fee limit safety check was removed. Confirm this won't allow excessive fees without user awareness.
core/src/apps/ethereum/tokens.py.mako (1)
39-49: Consistent return type improvement.Returning
UNKNOWN_TOKENinstead ofNoneeliminates null checks and improves type safety.core/src/trezor/lvglui/scrs/components/radio.py (2)
104-104: State tracking attribute added.The
changedflag helps track selection modifications.
122-122: Change detection logic is correct.Setting
changed = Truewhen item is selected properly tracks user interactions.core/src/apps/ethereum/tokens.py (1)
30-30: LGTM! Type safety improvement.The return type change eliminates null returns and guarantees a valid token response.
core/src/apps/cardano/seed.py (1)
209-217: LGTM! Clear conditional logic.The branching correctly handles THD89 and mnemonic type cases.
core/src/apps/common/mnemonic.py (3)
1-1: LGTM! Consistent import alias.The alias is used consistently throughout the file.
48-58: LGTM! Extended SLIP-39 backup support.The extendable parameter correctly extends backup type handling.
66-67: LGTM! Simplified conditional logic.Direct error checking removes unnecessary branching.
core/src/trezor/lvglui/i18n/keys.py (3)
2094-2097: Comment updates look good.Clear, simple language for backup types.
2211-2213: Comment improvement is clear.Better wording for invalid share message.
2231-2238: New attach-to-pin keys added correctly.All four new string keys follow the existing pattern.
core/src/apps/ethereum/onekey/sign_safe_tx.py (3)
43-45: Hash precomputation improves flow.EIP-712 encoding with
\x19\x01prefix is correct.
59-61: Passing precomputed hashes to confirmation function.Cleaner approach than computing hashes after confirmation.
83-83: Function rename reflects its purpose better.
get_safe_message_hashis more accurate thanget_safe_tx_hash.core/src/apps/common/backup.py (1)
14-46: Stub implementation is well-structured.Commented code shows clear implementation plan.
core/src/trezor/lvglui/scrs/components/navigation.py (2)
6-12: Parameterization improves flexibility.Default values maintain backward compatibility.
16-23: Parameters used correctly.Replaces hardcoded values with configurable options.
core/src/apps/management/recovery_device/word_validity.py (4)
1-4: Import reorganization is clean.TYPE_CHECKING guard avoids runtime imports.
24-28: Local imports avoid circular dependencies.Good practice for optional runtime imports.
42-46: Uses new backup type utility functions.Cleaner than direct enum comparisons.
52-52: Function renamed to indicate private use.Leading underscore follows Python conventions.
core/src/storage/recovery.py (6)
137-139: LGTM - Clean global state initialization
141-143: LGTM - Simple flag setter
146-148: LGTM - Clean flag getter
150-154: LGTM - Proper error handling
156-159: LGTM - Clean secret setter
161-165: LGTM - Clean state resetcore/src/trezor/lvglui/scrs/fingerprints.py (7)
234-235: LGTM - Consistent animation method
426-426: LGTM - Clean flag initialization
429-429: LGTM - Flag reset logic
442-444: LGTM - Vibration throttling
457-457: LGTM - Success feedback
493-501: LGTM - Improved flow organization
568-569: LGTM - Success feedback in finallycore/src/storage/recovery_shares.py (1)
6-6: LGTM - Clean dictionary initializationcrypto/bip39.c (9)
34-34: LGTM - Required header include
255-257: LGTM - Clean parameter addition
260-262: LGTM - Proper wordlist selection
267-269: LGTM - Consistent wordlist logic
284-285: LGTM - Clean parameter addition
293-293: LGTM - Proper function call
297-301: LGTM - Consistent wordlist selection
327-328: LGTM - Clean parameter addition
333-335: LGTM - Proper wordlist selectioncore/src/trezor/lvglui/scrs/recovery_device.py (11)
8-8: LGTM - Updated import
14-14: LGTM - Clean parameter addition
25-25: LGTM - Proper parameter passing
27-27: LGTM - Consistent naming
55-55: LGTM - Consistent naming
59-59: LGTM - Reasonable timing
63-63: LGTM - Clean parameter addition
67-67: LGTM - UI positioning change
101-101: LGTM - Fixed calculation
133-135: LGTM - Scroll behavior config
171-171: LGTM - Fixed button checkcore/embed/extmod/modtrezorio/modtrezorio-motor.h (1)
59-166: Code looks good.core/src/apps/management/recovery_device/recover.py (1)
1-118: Changes look good.core/src/apps/management/recovery_device/create_mul_shares.py (1)
1-164: New file looks good.core/embed/trezorhal/motor_patterns.h (1)
1-164: Header file is well-structured.core/embed/trezorhal/motor.h (1)
21-24: Good typo fix.Fixed "durration_us" to "duration_us".
core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (2)
27-28: Constants already defined
USER_PIN_ENTEREDandPASSPHRASE_PIN_ENTEREDlive incore/embed/trezorhal/se_thd89.h. No extra definitions needed.Likely an incorrect or invalid review comment.
1011-1013: Passphrase validation contradicts error message.Code raises error for empty passphrase but comment says it "cannot be empty". This is confusing.
- if (passphrase_buf.len == 0) { - mp_raise_ValueError("Passphrase cannot be empty"); - } + // Allow empty passphrase for standard usage + // if (passphrase_buf.len == 0) { + // mp_raise_ValueError("Passphrase cannot be empty"); + // }Likely an incorrect or invalid review comment.
core/src/trezor/lvglui/scrs/template.py (12)
86-86: Good refactoringUsing the utility function for address formatting.
Also applies to: 350-350
184-246: Clean consolidationUnified derivation screen reduces code duplication.
251-252: Better namingMore descriptive constant names.
315-315: Network support expandedAdded Kaspa to supported networks.
402-419: Proper event routingNetwork-specific event publishing with error handling.
436-463: Well-structured optionsNetwork-specific derivation paths properly configured.
917-1018: New Safe transaction UIWell-structured approval hash display component.
1020-1232: Comprehensive Safe transaction displayGood warning for delegate calls and clear operation display.
1435-1435: Proper conditional renderingAmount component created only when needed.
Also applies to: 1458-1460
1091-1092: Clear operation displayColor-coded operation types for visual clarity.
Also applies to: 1532-1532
3680-3687: Enhanced navigationMore flexible navigation component with customizable styling.
3783-3783: Better haptic feedbackSpecific vibration modes for different interactions.
Also applies to: 3792-3792
core/embed/extmod/modtrezorconfig/modtrezorconfig.c (4)
113-120: Function signature change looks correct.The new
pin_use_typeparameter and tuple return type align with the enhanced PIN verification system.
119-167: Implementation correctly handles the new PIN type system.The function properly validates arguments, calls the secure element with the pin type, and returns the expected tuple format.
169-180: Simple delegation to unlock function is appropriate.Since check_pin now has the same signature and behavior as unlock, this delegation makes sense.
597-642: SLIP39 import function implementation looks solid.Proper parameter validation, secure element integration, and error handling are all in place.
core/src/trezor/ui/layouts/lvgl/__init__.py (4)
1200-1200: Good addition of min_len parameter.This enhances passphrase validation capabilities.
1602-1602: Action string update looks appropriate.The slide-to-continue message aligns with the UI flow.
2639-2674: New Safe approve hash function looks comprehensive.Properly handles all required parameters and UI integration.
2677-2730: New Safe exec transaction function is well-structured.Handles complex parameter set appropriately for the UI requirements.
crypto/bip39.h (1)
56-59: Implementations match newis_slip39signatures.core/src/apps/debug/load_device.py (1)
9-9: Import path is validcore/src/trezor/lvglui/scrs/components/slider.py (1)
74-74: Motor vibration enhancements look good.Proper use of new motor API patterns. Event handling logic correct.
Also applies to: 127-129, 136-136, 156-156
core/src/trezor/ui/layouts/lvgl/recovery.py (1)
63-65: Good SLIP39 support.Also applies to: 144-144
core/embed/extmod/modtrezorcrypto/modtrezorcrypto-slip39.h (2)
27-57: Clean refactor to string prefixes.
92-92: Good error message updates.Also applies to: 108-109
core/src/apps/management/reset_device/layout.py (1)
32-40: Smart chunking logic.core/src/apps/base.py (1)
15-28: Solid attach-to-pin implementation.Also applies to: 158-161, 251-276, 688-774
core/src/trezor/crypto/slip39.py (2)
70-94: Well-designed extendable backup support.Also applies to: 124-125, 145-146, 160-161, 506-515
250-311: Good validation in extend_mnemonics.core/src/trezor/lvglui/scrs/components/keyboard.py (2)
236-260: Good job adding consistent haptic feedback.The PRESSED event handlers for motor vibration are implemented uniformly across all keyboard types.
Also applies to: 522-522, 745-745, 1124-1124
61-67: SLIP-39 support looks good.The conditional word completion and mask logic properly handles both BIP39 and SLIP39 mnemonics.
Also applies to: 340-349
core/src/trezor/lvglui/scrs/address.py (1)
411-792: Smart refactoring to use a generator.The iterator pattern saves memory by yielding chain configs on demand.
core/src/apps/ethereum/layout.py (1)
597-872: Safe transaction support is thorough.Both legacy and EIP-1559 fee models are properly handled across all new functions.
| # pyright: off | ||
| word = slip39.button_sequence_to_word(self.button_sequence) | ||
| # pyright: on |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Fix underlying type issues instead of disabling checks.
Consider addressing the root type problem rather than disabling pyright.
🤖 Prompt for AI Agents
In core/src/trezor/ui/components/tt/keyboard_slip39.py around lines 180 to 182,
the pyright type checking is disabled for the line assigning word from
slip39.button_sequence_to_word(self.button_sequence). Instead of turning off
pyright, investigate the type mismatch causing the error. Adjust the type
annotations or convert the input/output types appropriately so that the call to
button_sequence_to_word matches expected types and passes pyright checks without
disabling them.
| # pyright: off | ||
| self.mask = slip39.KEYBOARD_FULL_MASK | ||
| # pyright: on |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Fix underlying type issues instead of disabling checks.
Consider addressing the root type problem rather than disabling pyright.
🤖 Prompt for AI Agents
In core/src/trezor/ui/components/tt/keyboard_slip39.py around lines 126 to 128,
the pyright type checking is disabled to avoid type errors with self.mask
assignment. Instead of turning off pyright, investigate the type of
slip39.KEYBOARD_FULL_MASK and ensure it matches the expected type of self.mask.
Adjust type annotations or perform necessary type conversions so that the
assignment is type-safe and pyright checks pass without disabling them.
| if _scr_need_create: | ||
| if message is not None: | ||
| text = "" | ||
| if message == "read fp data": |
There was a problem hiding this comment.
Unclear abbreviation.
"read fp data" should be "read fingerprint data".
🤖 Prompt for AI Agents
In core/src/trezor/pin.py at line 51, replace the abbreviation "read fp data"
with the full phrase "read fingerprint data" to improve code clarity and
readability.
| if _scr_need_create: | ||
| try: | ||
| _scr.subtitle | ||
| except Exception: | ||
| _scr = None | ||
| _scr_need_create = True |
There was a problem hiding this comment.
Fix logic error.
The code checks if _scr is None, then tries to access _scr.subtitle. This will always fail.
🧰 Tools
🪛 Ruff (0.12.2)
43-43: Found useless expression. Either assign it to a variable or remove it.
(B018)
🤖 Prompt for AI Agents
In core/src/trezor/pin.py around lines 41 to 46, the code attempts to access
_scr.subtitle even when _scr might be None, causing an error. Fix this by first
checking if _scr is not None before trying to access its subtitle attribute,
ensuring the attribute access only happens on a valid _scr object.
| if __debug__: | ||
| print("is_safe_tx", _is_safe_tx) |
There was a problem hiding this comment.
Remove debug print.
- if __debug__:
- print("is_safe_tx", _is_safe_tx)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if __debug__: | |
| print("is_safe_tx", _is_safe_tx) |
🤖 Prompt for AI Agents
In core/src/apps/ethereum/onekey/sign_tx_eip1559.py at lines 181 to 182, remove
the debug print statement that outputs "is_safe_tx" and its value. This print is
only for debugging and should be deleted to clean up the code.
| if target == self.attach_to_pin: | ||
| global _attach_to_pin_task_running | ||
|
|
||
| _attach_to_pin_task_running = True | ||
|
|
||
| async def handle_attach_to_pin(): | ||
| try: | ||
| from trezor.ui.layouts.lvgl.attach_to_pin import ( | ||
| show_attach_to_pin_window, | ||
| ) | ||
|
|
||
| ctx = wire.DUMMY_CONTEXT | ||
| result = await show_attach_to_pin_window(ctx) | ||
|
|
||
| if result: | ||
| if hasattr(self, "prev_scr") and self.prev_scr: | ||
| self.load_screen(self) | ||
| else: | ||
| self.load_screen(self) | ||
|
|
||
| return result | ||
| except Exception: | ||
| if hasattr(self, "prev_scr") and self.prev_scr: | ||
| self.load_screen(self) | ||
| else: | ||
| self.load_screen(self) | ||
| return False | ||
| finally: | ||
| global _attach_to_pin_task_running | ||
| _attach_to_pin_task_running = False | ||
|
|
There was a problem hiding this comment.
Flag unused
_attach_to_pin_task_running is never read, so it can’t prevent double clicks.
🤖 Prompt for AI Agents
In core/src/trezor/lvglui/scrs/homescreen.py around lines 4931 to 4961, the
variable _attach_to_pin_task_running is set but never read, so it does not
prevent double clicks as intended. To fix this, add a check at the start of the
function to return early if _attach_to_pin_task_running is True, ensuring the
task does not run multiple times concurrently. Keep setting it to True when
starting and False when finishing the task to properly track the running state.
| def vibrate( | ||
| style: VIBRATE_STYLE = LIGHT, force: bool = False | ||
| ) -> VIBRATE_STYLE | None: | ||
| if not storage_device.keyboard_haptic_enabled() and not force: | ||
| return None | ||
| if style == WHISPER: | ||
| MOTOR_CTL.play_whisper() | ||
| elif style == LIGHT: | ||
| MOTOR_CTL.play_light() | ||
| elif style == MEDIUM: | ||
| MOTOR_CTL.play_medium() | ||
| elif style == HEAVY: | ||
| MOTOR_CTL.play_heavy() | ||
| elif style == SUCCESS: | ||
| MOTOR_CTL.play_success() | ||
| elif style == WARNING: | ||
| MOTOR_CTL.play_warning() | ||
| elif style == ERROR: | ||
| MOTOR_CTL.play_error() | ||
| else: | ||
| if __debug__: | ||
| print("vibrate strong") | ||
| MOTOR_CTL.tick() | ||
| print(f"vibrate: unknown style {style}") | ||
| pass | ||
| return style |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify breaking changes across codebase.
Function signature changed from vibrate(weak: bool) to vibrate(style: VIBRATE_STYLE, force: bool). Check all callers updated.
🏁 Script executed:
#!/bin/bash
# Search for old vibrate function calls that might not be updated
rg -A 3 "vibrate\(" --type py | grep -E "(True|False)" | head -20Length of output: 896
🏁 Script executed:
#!/bin/bash
rg -n "motor\.vibrate\(weak=True\)" core/src/trezor/uart.pyLength of output: 110
Update leftover vibrate call
- core/src/trezor/uart.py:147 still uses
motor.vibrate(weak=True)
🤖 Prompt for AI Agents
In core/src/trezor/uart.py around line 147, update the call to motor.vibrate by
replacing the deprecated argument weak=True with the current style argument
using the appropriate VIBRATE_STYLE enum value. This ensures compatibility with
the updated vibrate method signature in core/src/trezor/motor.py which no longer
accepts weak but uses style instead.
| await button_request(ctx, "word_count", code=ButtonRequestType.MnemonicWordCount) | ||
|
|
||
| optional_str = ( | ||
| _(i18n_keys.OPTION__STR_WRODS).format(12) |
There was a problem hiding this comment.
Fix typo: WRODS → WORDS
- _(i18n_keys.OPTION__STR_WRODS).format(12)
+ _(i18n_keys.OPTION__STR_WORDS).format(12)Also applies to: 22-22, 24-24, 26-26, 28-28
🤖 Prompt for AI Agents
In core/src/trezor/ui/layouts/lvgl/recovery.py at lines 20, 22, 24, 26, and 28,
there is a typo in the i18n key where "WRODS" should be corrected to "WORDS".
Update all these occurrences by replacing "OPTION__STR_WRODS" with
"OPTION__STR_WORDS" to fix the typo.
| backup_type = storage_device.get_backup_type() | ||
| if backup_type == BackupType.Bip39: | ||
| optional_str = ( | ||
| _(i18n_keys.OPTION__STR_WRODS).format(12) |
There was a problem hiding this comment.
Fix typo: WRODS → WORDS
- _(i18n_keys.OPTION__STR_WRODS).format(12)
+ _(i18n_keys.OPTION__STR_WORDS).format(12)- _(i18n_keys.OPTION__STR_WRODS).format(18)
+ _(i18n_keys.OPTION__STR_WORDS).format(18)- _(i18n_keys.OPTION__STR_WRODS).format(24)
+ _(i18n_keys.OPTION__STR_WORDS).format(24)- _(i18n_keys.OPTION__STR_WRODS).format(20)
+ _(i18n_keys.OPTION__STR_WORDS).format(20)- _(i18n_keys.OPTION__STR_WRODS).format(33)
+ _(i18n_keys.OPTION__STR_WORDS).format(33)Also applies to: 40-40, 42-42, 46-46, 48-48
🤖 Prompt for AI Agents
In core/src/trezor/ui/layouts/lvgl/recovery.py at lines 38, 40, 42, 46, and 48,
there is a typo in the i18n key 'OPTION__STR_WRODS' which should be corrected to
'OPTION__STR_WORDS'. Update all these occurrences to fix the typo.
| # else: | ||
| # self.item.enable_bg_color(enable=False) | ||
| # self.btn_yes.disable() | ||
| # endregion |
There was a problem hiding this comment.
Remove the orphaned comment.
The # endregion comment has no matching # region comment.
🤖 Prompt for AI Agents
In core/src/trezor/lvglui/scrs/reset_device.py at line 197, remove the orphaned
comment '# endregion' because there is no corresponding '# region' comment to
match it.
Summary by CodeRabbit
New Features
Enhancements
Bug Fixes
Documentation
Chores