feat(core): add support for EIP-7702 transaction signing#383
feat(core): add support for EIP-7702 transaction signing#383somebodyLi merged 5 commits intomainfrom
Conversation
1. add support for tron sign message V2 by usb/QR 2. add support for create tron account and verify tron address by QR 3. add support for tron transaction signing by QR
WalkthroughAdds EIP-7702 (Ethereum) signing flow, TRON message/transaction support (incl. UR), and Aptos SIWA message. Updates protobufs, enums, host libs, UI (LVGL templates/components, i18n), and routing. Introduces UR base classes and Solana refactor. Bumps firmware minor version, adjusts wire behavior, and updates requirements. Changes
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120+ minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type 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: 37
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (12)
core/src/trezor/lvglui/i18n/locales/de.py (1)
602-602: Fix stray apostrophe in stringTrailing apostrophe at end of sentence.
core/src/apps/common/request_pin.py (4)
123-128: Wrong identity check on pin_use_type
Uses 'is' after casting to int; condition unreliable.
130-136: ticks wrap-around bug in cache check
ticks_ms subtraction is unsafe; wrap-around breaks the cache gate.
154-154: Typos in error messages
"cancle" and "cal cale .." are user-facing.Also applies to: 162-162, 178-178, 194-194, 221-221, 230-230
268-268: Forgot to call _set_last_unlock_time
Missing parentheses; timestamp never updates.core/src/apps/management/recovery_device/create_mul_shares.py (1)
133-165: Unbalanced unimport scope on cancel; cleanup not guaranteed on exceptions.core/src/apps/ur_registry/chains/solana/sol_sign_request.py (1)
47-47: Use more specific exception type.Generic
Exceptionis too broad here.- raise Exception(f"Unexpected Request Type {req.get_request_type()}") + raise ValueError(f"Unexpected Request Type {req.get_request_type()}")core/src/trezor/ui/layouts/lvgl/__init__.py (4)
463-481: Confirm button text color ignored without bg colorPassing only btn_yes_text_color has no effect due to the guard.
- if btn_yes_bg_color: - screen.btn_yes.enable( - bg_color=btn_yes_bg_color or lv_colors.ONEKEY_GREEN, - text_color=btn_yes_text_color or lv_colors.WHITE, - ) + if btn_yes_bg_color is not None or btn_yes_text_color is not None: + screen.btn_yes.enable( + bg_color=btn_yes_bg_color or lv_colors.ONEKEY_GREEN, + text_color=btn_yes_text_color or lv_colors.WHITE, + )
1437-1455: Missing await on should_show_details (Sol transfer)Coroutine not awaited; flow is wrong.
- if should_show_details(ctx, to_addr, title): + if await should_show_details(ctx, to_addr, title):
1509-1527: Missing await on should_show_details (Sol token transfer)Coroutine not awaited; flow is wrong.
- if should_show_details(ctx, to_addr, title): + if await should_show_details(ctx, to_addr, title):
142-145: confirm_screen.slider may be undefined when hold=False
- core/src/trezor/ui/layouts/lvgl/init.py:143
Category:
core/src/apps/ur_registry/chains/hardware_requests/verify_address.py (1)
47-48: Wrong coin_name branch for BTC. Picks Testnet for 'btc'.
🧹 Nitpick comments (47)
core/src/trezor/lvglui/i18n/locales/de.py (4)
714-714: Inconsistent Air Gap naming“Luftspalt” vs “Air Gap”.
Also applies to: 784-784
743-743: Awkward German phrasing“Kann das Gerät sich … verbinden” reads clunky.
1030-1030: Formality mismatch“du” vs consistent “Sie”.
1027-1029: UI term inconsistency“Berührung/Ändern” vs prior “Tippen/Ändern”.
core/src/trezor/lvglui/i18n/locales/es.py (5)
714-716: Awkward Spanish and term inconsistency“Solo separación de aire” suena antinatural y es inconsistente con “Air Gap” usado en otras cadenas.
718-718: Terminology mismatch“monederos” vs “billetera” en el mismo locale.
870-870: Inconsistent networks listNo coincide con “Redes BTC, ETH y EVM” en Line 789.
1020-1020: Person inconsistencyUsa “Está” (3ª persona) mientras el resto usa “Estás” (2ª persona).
1027-1030: UI phrasing issues“Tocar” inconsistente con “Toca” en el archivo. “cambiarlo como tu fondo de pantalla” es gramaticalmente incorrecto.
core/src/trezor/lvglui/i18n/locales/it.py (4)
714-714: Terminologia incoerente: “Air Gap” vs “traferro”.
718-718: Grammatica: preposizione errata in “a wallet software”.
784-784: Coerenza: manca “NFC” rispetto alle altre stringhe Air Gap.
1030-1030: Concordanza di genere: “impostarla” non concorda con “sfondo” (masch.).core/src/trezor/lvglui/i18n/locales/pt_br.py (3)
715-718: Inconsistent wording: “desabilita” vs “desativa”.
Line 715 usa “desabilita”; Line 718 usa “desativa”. Mantenha consistente.
1027-1027: Verb mood mismatch: “Tocar”.
UI usa “Toque” em outros lugares.
1028-1028: Awkward noun: “Mudança”.
Soa errado para ação/botão.core/src/trezor/lvglui/i18n/locales/ru.py (2)
718-718: Несогласованное использование «ё»: «всё равно»
В остальных строках используется «е».
784-784: Несогласованное использование «ё»: «Включён»
Стилистика с «е» преобладает в файле.core/src/trezor/lvglui/i18n/locales/zh_hk.py (2)
870-870: 用詞不一致:「網絡/網路」
與行 745 不一致。
1027-1031: 異體字不一致:「爲/為」
與行 425 不一致。另:用語不一致「觸控/輕觸」。core/src/trezor/lvglui/i18n/locales/ko.py (4)
714-719: Inconsistent terms: '에어 갭' vs '에어갭' and '블루투스' vs 'Bluetooth'.
785-785: NFC omitted; conflicts with earlier Air Gap text.
118-118: '여기로' is ambiguous as a label.
635-635: '방향' may confuse in this context.core/src/apps/ur_registry/chains/base_sign_request.py (2)
74-76: Unused setter 'set_data_type'; value is never encoded or read.
143-166: Misleading variable name 'sol_sign_req' in a generic base class.core/src/apps/ur_registry/chains/base_signature.py (1)
74-77: Misleading error message and generic exceptionMessage is unclear and uses Exception.
core/src/trezor/lvglui/i18n/keys.py (1)
1723-1723: Grammar in key name“HAS_DISABLED” reads wrong.
core/src/trezor/lvglui/scrs/components/button.py (1)
20-20: Function call in default argumenttext=_(...) in defaults violates best practices.
core/src/trezor/lvglui/scrs/components/composite.py (1)
23-25: Typo in attribute name“pannel” is misspelled.
core/src/trezor/qr.py (1)
206-206: Typo: camear_scanSpelling error in function name.
core/src/trezor/lvglui/i18n/locales/zh_cn.py (2)
719-719: 术语不统一(Air Gap)仍使用 “Air Gap”,与“隔空签名模式”不一致。
785-785: 模块禁用描述不一致此处缺少 “NFC”,与 716 行不一致。
core/src/apps/ur_registry/chains/tron/tron_transaction.py (1)
11-11: Unused attribute: encodercore/src/trezor/lvglui/i18n/locales/fr.py (1)
714-714: Inconsistent term: “Entrefer” vs “Air Gap”Also applies to: 784-784
core/src/apps/ur_registry/chains/tron/tron_message.py (1)
11-11: Unused attribute: encodercore/src/trezor/lvglui/i18n/locales/ja.py (1)
714-716: Inconsistent spacing: エアギャップ vs エア ギャップAlso applies to: 784-784
core/src/apps/tron/serialize.py (2)
253-253: Consider using a more descriptive error message.The error message "Unsupported contract type" could be more helpful by including the actual type value.
- raise ValueError("Unsupported contract type") + raise ValueError(f"Unsupported contract type: {contract.WhichOneof('contract')}")
349-349: Simplify dictionary get() call.The
Nonedefault is implicit fordict.get().- if (contract_info := contract_parsers.get(contract_type, None)) is not None: + if (contract_info := contract_parsers.get(contract_type)) is not None:core/src/trezor/lvglui/i18n/locales/en.py (4)
714-719: Terminology inconsistent: “Air Gap Only” vs existing “Air Gap/Airgap”.Also applies to: 784-785
716-716: Comma usage inconsistent (“USB and NFC” vs “USB, and NFC”).Also applies to: 743-743
784-784: Missing NFC in status text.
1030-1030: Awkward phrasing: “change it as your wallpaper”.core/src/trezor/messages.py (1)
387-402: Ambiguous SIWA name and payload type.
“SIWA” commonly means Sign in with Apple. Using str for payload creates encoding ambiguity.core/src/apps/ur_registry/chains/tron/tron_sign_request.py (2)
4-6: Constant names break Python style.
40-40: Generic Exception used.common/protob/messages-aptos.proto (1)
68-76: Grammar: missing articles in comment.
📜 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
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (63)
common/protob/messages-aptos.proto(1 hunks)common/protob/messages-ethereum-onekey.proto(3 hunks)common/protob/messages-tron.proto(2 hunks)common/protob/messages.proto(2 hunks)core/embed/firmware/version.h(1 hunks)core/src/all_modules.py(7 hunks)core/src/apps/common/request_pin.py(2 hunks)core/src/apps/ethereum/layout.py(1 hunks)core/src/apps/ethereum/onekey/eip7702_delegators.py(1 hunks)core/src/apps/ethereum/onekey/keychain.py(2 hunks)core/src/apps/ethereum/onekey/sign_tx_eip7702.py(1 hunks)core/src/apps/management/recovery_device/create_mul_shares.py(2 hunks)core/src/apps/tron/layout.py(1 hunks)core/src/apps/tron/serialize.py(5 hunks)core/src/apps/tron/sign_message.py(3 hunks)core/src/apps/ur_registry/chains/base_sign_request.py(1 hunks)core/src/apps/ur_registry/chains/base_signature.py(1 hunks)core/src/apps/ur_registry/chains/hardware_requests/get_multi_accounts.py(1 hunks)core/src/apps/ur_registry/chains/hardware_requests/verify_address.py(1 hunks)core/src/apps/ur_registry/chains/requests_handler.py(2 hunks)core/src/apps/ur_registry/chains/solana/sol_sign_request.py(1 hunks)core/src/apps/ur_registry/chains/solana/sol_signature.py(1 hunks)core/src/apps/ur_registry/chains/tron/tron_message.py(1 hunks)core/src/apps/ur_registry/chains/tron/tron_sign_request.py(1 hunks)core/src/apps/ur_registry/chains/tron/tron_signature.py(1 hunks)core/src/apps/ur_registry/chains/tron/tron_transaction.py(1 hunks)core/src/apps/ur_registry/crypto_coin_info.py(1 hunks)core/src/apps/ur_registry/crypto_multi_accounts.py(2 hunks)core/src/apps/ur_registry/helpers.py(3 hunks)core/src/apps/ur_registry/registry_types.py(1 hunks)core/src/apps/ur_registry/ur_py/ur/cbor_lite.py(1 hunks)core/src/apps/workflow_handlers.py(2 hunks)core/src/trezor/enums/MessageType.py(2 hunks)core/src/trezor/enums/TronMessageType.py(1 hunks)core/src/trezor/enums/__init__.py(3 hunks)core/src/trezor/lvglui/__init__.py(1 hunks)core/src/trezor/lvglui/i18n/keys.py(3 hunks)core/src/trezor/lvglui/i18n/locales/de.py(5 hunks)core/src/trezor/lvglui/i18n/locales/en.py(6 hunks)core/src/trezor/lvglui/i18n/locales/es.py(5 hunks)core/src/trezor/lvglui/i18n/locales/fr.py(5 hunks)core/src/trezor/lvglui/i18n/locales/it.py(5 hunks)core/src/trezor/lvglui/i18n/locales/ja.py(6 hunks)core/src/trezor/lvglui/i18n/locales/ko.py(8 hunks)core/src/trezor/lvglui/i18n/locales/pt_br.py(5 hunks)core/src/trezor/lvglui/i18n/locales/ru.py(5 hunks)core/src/trezor/lvglui/i18n/locales/zh_cn.py(8 hunks)core/src/trezor/lvglui/i18n/locales/zh_hk.py(8 hunks)core/src/trezor/lvglui/scrs/components/button.py(3 hunks)core/src/trezor/lvglui/scrs/components/composite.py(1 hunks)core/src/trezor/lvglui/scrs/homescreen.py(6 hunks)core/src/trezor/lvglui/scrs/initscreen.py(1 hunks)core/src/trezor/lvglui/scrs/template.py(4 hunks)core/src/trezor/messages.py(6 hunks)core/src/trezor/qr.py(2 hunks)core/src/trezor/ui/layouts/lvgl/__init__.py(11 hunks)core/src/trezor/ui/layouts/lvgl/altcoin.py(1 hunks)core/src/trezor/wire/__init__.py(2 hunks)python/requirements-optional.txt(0 hunks)python/requirements.txt(1 hunks)python/src/trezorlib/cli/ethereum_onekey.py(7 hunks)python/src/trezorlib/ethereum_onekey.py(1 hunks)python/src/trezorlib/messages.py(8 hunks)
💤 Files with no reviewable changes (1)
- python/requirements-optional.txt
👮 Files not reviewed due to content moderation or server errors (12)
- core/embed/firmware/version.h
- core/src/trezor/enums/MessageType.py
- core/src/trezor/enums/TronMessageType.py
- core/src/apps/ur_registry/chains/solana/sol_signature.py
- core/src/apps/workflow_handlers.py
- core/src/trezor/enums/init.py
- core/src/apps/ur_registry/chains/requests_handler.py
- core/src/apps/ur_registry/chains/tron/tron_signature.py
- common/protob/messages.proto
- core/src/apps/ur_registry/helpers.py
- core/src/apps/ethereum/onekey/keychain.py
- core/src/all_modules.py
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/components/button.py
19-19: Do not perform function call _ in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
core/src/apps/tron/serialize.py
349-349: Use contract_parsers.get(contract_type) instead of contract_parsers.get(contract_type, None)
Replace contract_parsers.get(contract_type, None) with contract_parsers.get(contract_type)
(SIM910)
core/src/trezor/lvglui/scrs/components/composite.py
118-119: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
python/src/trezorlib/cli/ethereum_onekey.py
125-125: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
145-145: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
core/src/trezor/lvglui/scrs/template.py
656-657: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
971-971: Use key in dict instead of key in dict.keys()
Remove .keys()
(SIM118)
989-989: Use kwargs.get(section_name) instead of kwargs.get(section_name, None)
Replace kwargs.get(section_name, None) with kwargs.get(section_name)
(SIM910)
core/src/trezor/ui/layouts/lvgl/__init__.py
667-670: Return the condition directly
Inline condition
(SIM103)
698-701: Return the condition directly
Inline condition
(SIM103)
789-792: Return the condition directly
Inline condition
(SIM103)
2149-2152: Return the condition directly
Inline condition
(SIM103)
⏰ 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: Gen check
- GitHub Check: Defs check
- GitHub Check: Style check
🔇 Additional comments (35)
core/src/apps/common/request_pin.py (3)
28-28: Spelling: standy_wall_only
Likely a typo. Confirm API compatibility.Also applies to: 39-40, 78-78, 88-88, 119-119, 149-149, 217-217
138-138: Import placement: check for cycles
Unconditional in-function import may introduce a cycle.
208-218: Type-check the request_pin_on_device call
Ignore removed; confirm signature matches.core/src/trezor/lvglui/i18n/locales/pt_br.py (2)
784-784: NFC missing in Air Gap notice.
Outras mensagens do Air Gap citam Bluetooth, USB e NFC.
1030-1030: Ambiguous pronoun gender.
“defini-la” tem antecedente implícito.core/src/trezor/lvglui/i18n/locales/ru.py (1)
714-718: Несогласованная терминология: «Air Gap» vs «Airgap»
В этом файле также встречается «Airgap». Проверьте единообразие.core/src/trezor/lvglui/__init__.py (2)
190-190: Untranslated UI text; i18n regression
257-259: AirGap check missing; BLE may unhide in AirGapcore/src/apps/ur_registry/ur_py/ur/cbor_lite.py (1)
152-155: Potential type misuse in encodeEncodedBytesPrefixencodeTagAndValue expects an int length; bytes will break.
core/src/apps/tron/layout.py (1)
138-138: Unlocalized UI labelNew labels are not i18n keys.
common/protob/messages-tron.proto (1)
160-160: Default points to deprecated enum valuemessage_type default is V1, marked deprecated.
core/src/apps/ur_registry/chains/base_signature.py (1)
18-21: No action needed — get_tag is used in subclasses (TronSignature, SolSignature).core/src/trezor/qr.py (1)
91-105: Missing encoder fallback for TRON sign responsesIf TRON uses encoder (multi‑part), no UI output is shown.
core/src/apps/ur_registry/crypto_multi_accounts.py (1)
167-170: BITCOIN_ONLY riskTRON is added without BITCOIN_ONLY gating here.
Also applies to: 193-195
core/src/apps/ur_registry/registry_types.py (1)
18-20: UR tag allocation checkVerify 5201/5202 don’t collide with existing registry tags.
core/src/apps/ethereum/onekey/eip7702_delegators.py (1)
34-45: Parameter chain_id is ignored in _delegator_iterator.Misleading API. Readers expect chain filtering.
Also applies to: 46-55
core/src/apps/ethereum/layout.py (1)
154-166: Typo in parameter name: authorty_adrr.Inconsistent with authority_addr elsewhere.
python/src/trezorlib/cli/ethereum_onekey.py (1)
180-187: Type mismatch in _format_authorization_list.Annotation says Tuple[...] and nonce bytes, but returns list and nonce int.
common/protob/messages-ethereum-onekey.proto (1)
113-113: Fix typo in comment."i" should be capitalized.
- message EthereumSignTxEIP7702OneKey { + message EthereumSignTxEIP7702OneKey {Likely an incorrect or invalid review comment.
core/src/trezor/lvglui/scrs/homescreen.py (1)
1784-1786: Remove leading space in URL.URL has an unnecessary leading space.
- " https://help.onekey.so/articles/11461103" + "https://help.onekey.so/articles/11461103"Likely an incorrect or invalid review comment.
core/src/trezor/lvglui/scrs/template.py (1)
1071-1077: None values may render as “None” in fee section.core/src/trezor/ui/layouts/lvgl/__init__.py (3)
726-733: Possible 'None' rendered for delegate addressDelegate may be None and display as "None".
642-671: Confirmed TransactionOverviewSend publishes2, matchingSHOW_MORE = 2andCONFIRM_ACTION_TYPE.CONFIRM_ACTION_SHOW_MORE. No changes needed.
714-752: Couldn't locate CONFIRM_ACTION_TYPE in the repo. Verify that res codes from TransactionOverview align with CANCEL=0, SHOW_MORE=2, and default CONFIRM=1.core/src/trezor/messages.py (3)
5530-5536: authorization_signatures ordering unclear.
Confirm 1:1 alignment with authorization_list.
5651-5671: Duplicate signature fields across types.
Same signature data here and in EthereumTxRequestOneKey. Risk of divergence.
9434-9442: Back-compat risk for Tron message_type.
Older hosts may omit message_type. Ensure safe default behavior.python/src/trezorlib/messages.py (5)
845-848: Enum lacks 0 value; omitted field may decode to invalid 0.Also applies to: 11693-11706
1188-1203: Aptos SIWA payload uses string; other sign APIs use bytes.
7439-7463: Duplicate signature channels: Authorization.signature vs TxRequest.authorization_signatures.Also applies to: 7306-7319, 7232-7250
184-184: Confirm 20120 is unique across all message registries.
335-335: Confirm 10606 is unused and correctly routed in core.core/src/apps/ur_registry/chains/hardware_requests/verify_address.py (1)
15-16: 'address' param is required but unused.core/src/apps/ur_registry/chains/hardware_requests/get_multi_accounts.py (1)
39-46: Tron HDKey builder mismatchUsing generate_HDKey for Tron may produce wrong UR output.
Also applies to: 102-114
core/src/trezor/lvglui/scrs/initscreen.py (1)
69-73: Screen not loadedClick does not load the screen. No lv.scr_load call.
57d21be to
084d997
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
core/src/apps/management/recovery_device/create_mul_shares.py (1)
133-164: UI import scope leak;unimport_endnot guaranteed on early exits.core/src/trezor/lvglui/scrs/template.py (2)
3969-3974: Bug: invalid attribute “self.lv”Use lv, not self.lv.
- self.banner.align(self.lv.ALIGN.TOP_MID, 0, 40) + self.banner.align(lv.ALIGN.TOP_MID, 0, 40)
2814-2831: Typo: parameter “doamin”Rename to “domain” and update usage.
- doamin, + domain, @@ - self.container, _(i18n_keys.LIST_KEY__DOMAIN__COLON), doamin + self.container, _(i18n_keys.LIST_KEY__DOMAIN__COLON), domain
♻️ Duplicate comments (15)
core/src/trezor/lvglui/i18n/keys.py (8)
1569-1569: Typo: NFC/NFT mismatchNFT used; NFC expected.
1579-1579: Grammar: MEANSMEANS used; MEAN expected.
1608-1608: Typo: RETUNRNRETUNRN misspelled.
1829-1829: Typo: VEIRIFYVEIRIFY misspelled.
1925-1933: Prefix typo: GNOSIS_SAGE“SAGE” instead of “SAFE”.
2159-2161: Typo: TLTLE__TLTLE__ misspelled.
2205-2205: Naming: missing double underscoreBUTTON_ONEKEY_EXTENDED lacks BUTTON__.
2231-2231: Naming: missing double underscoreTITLE_UPGRADE_SMART_ACCOUNT, TITLE_REVOKE_SMART_ACCOUNT_DELEGATION, TITLE_SMART_ACCOUNT_DELEGATION_BLOCKED, BUTTON_UNDERSTAND.
Also applies to: 2240-2240, 2245-2245, 2252-2252
core/src/trezor/lvglui/i18n/locales/de.py (1)
784-784: Inconsistent disable listNFC missing.
core/src/trezor/lvglui/scrs/template.py (3)
647-651: Typo: attribute “pannel”Rename to the correct attribute.
- self.show_more = ShowMore(self.content_area, self.card_group.pannel) + self.show_more = ShowMore(self.content_area, self.card_group.panel)
1037-1079: Typo: parameter “authorty_adrr”Fix the name and its usage.
- authorty_adrr: str, + authority_addr: str, @@ - (_(i18n_keys.FIELDS_ACCOUNT), authorty_adrr), + (_(i18n_keys.FIELDS_ACCOUNT), authority_addr),
6049-6055: Separator won’t renderlv.line without points; switch to a styled object.
- self.line = lv.line(self.container) - self.line.set_size(408, 1) - self.line.add_style( - StyleWrapper().bg_color(lv_colors.ONEKEY_GRAY_2).bg_opa(), 0 - ) + self.separator = lv.obj(self.container) + self.separator.remove_style_all() + self.separator.set_size(408, 1) + self.separator.add_style( + StyleWrapper().bg_color(lv_colors.ONEKEY_GRAY_2).bg_opa().border_width(0), 0 + )python/src/trezorlib/messages.py (2)
7255-7261: 'to' marked required prevents contract creation.
7276-7294: init makes 'to' mandatory, blocking contract creation.core/src/trezor/messages.py (1)
5489-5524: 'to' required blocks contract creation (EIP-7702).
🧹 Nitpick comments (9)
core/src/apps/management/recovery_device/create_mul_shares.py (3)
64-64: Overbroad exception catch (BaseException).
83-84: Inconsistent variable name (srcvsscr).
134-134: Brittle tokenization;split(" ")breaks on multiple spaces.core/src/trezor/lvglui/i18n/keys.py (4)
1594-1596: Grammar: NOT SUPPORT“NOT SUPPORT” in key names.
1723-1723: Grammar: HAS vs HAVEPlural subject with HAS.
1725-1732: Naming: missing double underscoreTITLE_… keys use single underscore.
1780-1780: Naming: triple underscoreMSG___ prefix inconsistent.
core/src/trezor/lvglui/scrs/components/button.py (1)
19-23: Default arg calls function (B008)Function call in default value for text.
core/src/trezor/lvglui/i18n/locales/zh_cn.py (1)
714-714: 用语不自然。
📜 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
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (32)
common/protob/messages-aptos.proto(1 hunks)common/protob/messages-ethereum-onekey.proto(3 hunks)common/protob/messages.proto(2 hunks)core/embed/firmware/version.h(1 hunks)core/src/all_modules.py(7 hunks)core/src/apps/aptos/sign_siwa_message.py(1 hunks)core/src/apps/ethereum/onekey/eip7702_delegators.py(1 hunks)core/src/apps/management/recovery_device/create_mul_shares.py(2 hunks)core/src/apps/workflow_handlers.py(2 hunks)core/src/trezor/enums/MessageType.py(2 hunks)core/src/trezor/enums/TronMessageType.py(1 hunks)core/src/trezor/enums/__init__.py(3 hunks)core/src/trezor/lvglui/__init__.py(1 hunks)core/src/trezor/lvglui/i18n/keys.py(3 hunks)core/src/trezor/lvglui/i18n/locales/de.py(5 hunks)core/src/trezor/lvglui/i18n/locales/en.py(6 hunks)core/src/trezor/lvglui/i18n/locales/es.py(5 hunks)core/src/trezor/lvglui/i18n/locales/fr.py(5 hunks)core/src/trezor/lvglui/i18n/locales/it.py(5 hunks)core/src/trezor/lvglui/i18n/locales/ja.py(6 hunks)core/src/trezor/lvglui/i18n/locales/ko.py(8 hunks)core/src/trezor/lvglui/i18n/locales/pt_br.py(5 hunks)core/src/trezor/lvglui/i18n/locales/ru.py(5 hunks)core/src/trezor/lvglui/i18n/locales/zh_cn.py(8 hunks)core/src/trezor/lvglui/i18n/locales/zh_hk.py(8 hunks)core/src/trezor/lvglui/scrs/components/button.py(3 hunks)core/src/trezor/lvglui/scrs/homescreen.py(6 hunks)core/src/trezor/lvglui/scrs/initscreen.py(1 hunks)core/src/trezor/lvglui/scrs/template.py(4 hunks)core/src/trezor/messages.py(6 hunks)core/src/trezor/wire/__init__.py(2 hunks)python/src/trezorlib/messages.py(8 hunks)
🚧 Files skipped from review as they are similar to previous changes (20)
- core/src/trezor/lvglui/init.py
- core/embed/firmware/version.h
- core/src/trezor/enums/init.py
- common/protob/messages-aptos.proto
- core/src/apps/workflow_handlers.py
- common/protob/messages.proto
- core/src/all_modules.py
- core/src/apps/ethereum/onekey/eip7702_delegators.py
- core/src/trezor/wire/init.py
- core/src/trezor/lvglui/i18n/locales/pt_br.py
- core/src/trezor/lvglui/i18n/locales/ja.py
- common/protob/messages-ethereum-onekey.proto
- core/src/trezor/lvglui/i18n/locales/ru.py
- core/src/trezor/lvglui/i18n/locales/fr.py
- core/src/trezor/lvglui/i18n/locales/es.py
- core/src/trezor/lvglui/i18n/locales/zh_hk.py
- core/src/trezor/lvglui/i18n/locales/ko.py
- core/src/trezor/lvglui/scrs/homescreen.py
- core/src/trezor/lvglui/i18n/locales/it.py
- core/src/trezor/lvglui/i18n/locales/en.py
👮 Files not reviewed due to content moderation or server errors (3)
- core/src/trezor/enums/MessageType.py
- core/src/apps/aptos/sign_siwa_message.py
- core/src/trezor/lvglui/scrs/initscreen.py
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/template.py
656-657: Use a single if statement instead of nested if statements
Combine if statements using and
(SIM102)
971-971: Use key in dict instead of key in dict.keys()
Remove .keys()
(SIM118)
989-989: Use kwargs.get(section_name) instead of kwargs.get(section_name, None)
Replace kwargs.get(section_name, None) with kwargs.get(section_name)
(SIM910)
core/src/trezor/lvglui/scrs/components/button.py
19-19: Do not perform function call _ in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
⏰ 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: Style check
- GitHub Check: Defs check
- GitHub Check: Gen check
🔇 Additional comments (4)
core/src/apps/management/recovery_device/create_mul_shares.py (2)
85-86: Missing validation for threshold <= count.
112-112: Unchecked shape;mnemonics[0]may not belist[str].core/src/trezor/enums/TronMessageType.py (1)
5-5: 缺少 V1 常量。core/src/trezor/lvglui/i18n/locales/zh_cn.py (1)
784-784: 与前文不一致(缺少 NFC)。
| mods = utils.unimport_begin() | ||
| await _backup_multi_share(storage_recovery.get_slip39_checked_secret()) |
There was a problem hiding this comment.
mods may be undefined; unimport_end in finally can crash.
Also applies to: 71-71
🤖 Prompt for AI Agents
In core/src/apps/management/recovery_device/create_mul_shares.py around lines
62-63 (and also line 71), mods returned from utils.unimport_begin() may be
undefined and calling utils.unimport_end(mods) in the finally block can crash;
fix by initializing mods = None before the try, assign mods =
utils.unimport_begin() inside the try, and in the finally only call
utils.unimport_end(mods) if mods is not None (or truthy); apply the same pattern
to the other occurrence at line 71 so unimport_end is always guarded against an
undefined mods value.
| message_type: "TronMessageType" | ||
|
|
||
| def __init__( | ||
| self, | ||
| *, | ||
| message: "bytes", | ||
| address_n: "list[int] | None" = None, | ||
| message_type: "TronMessageType | None" = None, | ||
| ) -> None: |
There was a problem hiding this comment.
Type mismatch: message_type optional in init, non-optional in field.
🤖 Prompt for AI Agents
In core/src/trezor/messages.py around lines 9434-9442, the class-level
annotation declares message_type as non-optional while the __init__ parameter
makes it optional; change the field to be optional to match the constructor
(e.g., annotate message_type as "TronMessageType | None" or use
Optional[TronMessageType]) and ensure any default value is None so the type
signatures are consistent.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores