Skip to content

feat: surface typed Trezor PIN-failure errors via trezor-connect-rs 0.3.3#106

Merged
coreyphillips merged 1 commit into
masterfrom
feat/trezor-typed-pin-failure-errors
Jun 22, 2026
Merged

feat: surface typed Trezor PIN-failure errors via trezor-connect-rs 0.3.3#106
coreyphillips merged 1 commit into
masterfrom
feat/trezor-typed-pin-failure-errors

Conversation

@coreyphillips

@coreyphillips coreyphillips commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Resolves #105

Description

trezor-connect-rs 0.3.3 maps protocol Failure codes to typed DeviceError variants, so a wrong-PIN failure now surfaces as TrezorError::InvalidPin instead of a generic device error. The existing From impl already maps these variants; no conversion-logic change is needed and the FFI surface is unchanged.

  • Bumps trezor-connect-rs 0.3.2 -> 0.3.3 (non-iOS and iOS targets).
  • Added tests starting from raw FailureType codes (via the new public DeviceError::from_failure) asserting they reach the typed errors: 7 -> InvalidPin, 6 -> PinCancelled, 5 -> PinRequired, 4 -> UserCancelled, 99 -> generic DeviceError (code + message preserved).

….3.3

trezor-connect-rs 0.3.3 maps protocol Failure codes to typed DeviceError variants, so a wrong-PIN failure now surfaces as TrezorError::InvalidPin instead of a generic device error. The existing From impl already maps these variants; no conversion-logic change is needed and the FFI surface is unchanged.

- Bump trezor-connect-rs 0.3.2 -> 0.3.3 (non-iOS and iOS targets).
- Add tests starting from raw FailureType codes (via the new public DeviceError::from_failure) asserting they reach the typed errors: 7 -> InvalidPin, 6 -> PinCancelled, 5 -> PinRequired, 4 -> UserCancelled, 99 -> generic DeviceError (code + message preserved).
@coreyphillips coreyphillips requested a review from ovitrif June 22, 2026 16:19
@coreyphillips coreyphillips self-assigned this Jun 22, 2026
@coreyphillips

Copy link
Copy Markdown
Collaborator Author

Will create a new release for this PR once approved unless one is needed sooner.

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks.

@coreyphillips

Copy link
Copy Markdown
Collaborator Author

Release created here.

@coreyphillips coreyphillips merged commit af23c84 into master Jun 22, 2026
1 check passed
@coreyphillips coreyphillips deleted the feat/trezor-typed-pin-failure-errors branch June 22, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: surface typed trezor pin failures

2 participants