Skip to content

refactor: address claims accessor review follow-ups - #492

Open
SeanROlszewski wants to merge 2 commits into
mainfrom
seanolszewski/claims-accessor-review-followups
Open

refactor: address claims accessor review follow-ups#492
SeanROlszewski wants to merge 2 commits into
mainfrom
seanolszewski/claims-accessor-review-followups

Conversation

@SeanROlszewski

@SeanROlszewski SeanROlszewski commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the four review comments on #490:

  1. Trim the claims() doc comment — reduced to the summary line.
  2. Arc in claims() -> Vec<Arc<FieldElement>> — investigated and it's load-bearing: uniffi objects only implement Lower behind an Arc, so sequences of objects must be Vec<Arc<T>>. Dropping it fails scaffolding compilation with the trait bound 'FieldElement: uniffi::Lower<UniFfiTag>' is not satisfied (bare owned objects are accepted only as top-level return values, which is why sub() gets away without one). Left a code comment so the next reader doesn't retry it.
  3. Remove claims_hex() — gone; callers now read claims() and encode the specific elements they need, making per-claim selection the deliberate act.
  4. Trim the fetch_credential doc comment — reduced to the summary + # Errors (kept for missing_errors_doc).

Testing: cargo test -p walletkit-core --lib green (tests updated for the removed method); clippy (pedantic) clean.


Note

Low Risk
Small public API removal on FFI Credential; callers must switch to claims() + per-element encoding, with no auth or storage logic changes.

Overview
Follow-up cleanup on the credential claims API: claims_hex() is removed, so callers must use claims() and encode individual FieldElement values (e.g. to_hex_string()) when they need hex.

claims() and fetch_credential doc comments are shortened; unit and storage tests are updated to assert via claims() instead of the removed helper.

Reviewed by Cursor Bugbot for commit d865a61. Bugbot is set up for automated code reviews on this repo. Configure here.

Trims the claims() and fetch_credential doc comments to their summary
lines, and removes claims_hex() so callers make a deliberate per-claim
selection instead of grabbing a pre-encoded full vector.

claims() keeps Vec<Arc<FieldElement>>: uniffi objects only implement
Lower behind an Arc, so sequences of objects must be Vec<Arc<T>> —
dropping the Arc fails scaffolding compilation. A code comment now
records that.
paolodamico
paolodamico previously approved these changes Aug 31, 2026
Comment thread crates/walletkit-core/src/credential.rs Outdated
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.

3 participants