Update trezor to 0.20.1 - #641
Closed
Uxío (Uxio0) wants to merge 2 commits into
Closed
Uxío (Uxio0) wants to merge 2 commits into
Uxío (Uxio0) wants to merge 2 commits into
Conversation
Migrate trezorlib usage to the new session-based API: ethereum calls now take a Session instead of a TrezorClient, ClickUI moved to trezorlib.cli.ui, and the client is built with get_default_client + get_default_session. - Wire button/pin/code-entry callbacks and host passphrase entry - Handle DeviceLockedError in the exception translation decorator - Update tests for the session-based API
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: febed5c790
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
get_default_session forces on-device passphrase entry for devices that advertise the PassphraseEntry capability (Trezor T/Safe), ignoring the host callback. Build the session directly so the passphrase is entered on the host, unless the device only allows on-device entry.
Member
Author
|
Closed by #670 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Update
trezorfrom0.13.10to0.20.1(latest).Why
This is not a plain version bump —
trezorlib0.20.x moved to a session-based API, so the integration had to be migrated:get_address,sign_tx,sign_tx_eip1559,sign_typed_data_hash,sign_message) now take aSessioninstead of aTrezorClient.ClickUImoved fromtrezorlib.uitotrezorlib.cli.uiand no longer takespassphrase_on_host; it now just supplies the button/pin callbacks.get_default_client(app_name, button_callback=..., pin_callback=..., code_entry_callback=...), and the session comes fromget_default_session(client, passphrase_callback=...).Changes
get_trezor_client()→get_trezor_session(): builds the client and opens a session via the library helpers. Passphrase is entered on the host unless the device requires on-device entry (get_default_sessionhandles the on-device vs host choice, which avoids thePassphraseErrorthat a forced host passphrase raises on devices set to "always enter passphrase on device").code_entry_callback=get_code_entry_codeso unpaired THP devices get an interactive prompt instead of an uncaughtTrezorException.DeviceLockedErrorinraise_trezor_exception_as_hw_wallet_exception→HardwareWalletException("Trezor device is locked").get_trezor_session, drop the removedTrezorClient(..., ui=..., _init_device=False)construction).uv.lock(dropsecdsa/six, addsnoiseprotocol).