Skip to content

Replace usize with u32 or smaller#65

Merged
notmandatory merged 2 commits intomasterfrom
fix/replace_usize
Apr 8, 2026
Merged

Replace usize with u32 or smaller#65
notmandatory merged 2 commits intomasterfrom
fix/replace_usize

Conversation

@notmandatory
Copy link
Copy Markdown
Member

Description

Replace usize with u32 or smaller appropriate type. The max size integer needed by the CKTAP protocol is a u32 so the usize type shouldn't be part of the public API of this library. Removing the usize type also removes the need to convert from usize to smaller types in the uniFFI language bindings.

Notes to the reviewers

This is a BREAKING CHANGE.

Changelog notice

  • Replace usize with u32 or smaller appropriate types in the public API.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@notmandatory notmandatory requested a review from reez as a code owner April 7, 2026 22:42
@notmandatory notmandatory added this to the Release 0.3.0 milestone Apr 7, 2026
@notmandatory notmandatory self-assigned this Apr 7, 2026
@reez
Copy link
Copy Markdown
Collaborator

reez commented Apr 7, 2026

Rust side cleanup looks good but since PR description also calls out UniFFI bindings I think maybe the corresponding cktap-ffi status+error types still need to be updated as well for the generated Swift API to fully reflect this change. For example I think this might need to happen in sats_card.rs:

Screenshot 2026-04-07 at 6 44 34 PM

@notmandatory
Copy link
Copy Markdown
Member Author

Rust side cleanup looks good but since PR description also calls out UniFFI bindings I think maybe the corresponding cktap-ffi status+error types still need to be updated as well for the generated Swift API to fully reflect this change. For example I think this might need to happen in sats_card.rs:

Oh shoot! I should have caught that. Fixed now and also rebased to pickup changes from master.

@reez
Copy link
Copy Markdown
Collaborator

reez commented Apr 8, 2026

Rust side cleanup looks good but since PR description also calls out UniFFI bindings I think maybe the corresponding cktap-ffi status+error types still need to be updated as well for the generated Swift API to fully reflect this change. For example I think this might need to happen in sats_card.rs:

Oh shoot! I should have caught that. Fixed now and also rebased to pickup changes from master.

those changes look good

added one additional comment/question

@notmandatory notmandatory merged commit 9d54cd0 into master Apr 8, 2026
11 checks passed
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.

2 participants