Skip to content

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

Open
SeanROlszewski wants to merge 1 commit into
mainfrom
seanolszewski/claims-accessor-review-followups
Open

refactor: address claims accessor review follow-ups#492
SeanROlszewski wants to merge 1 commit 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
API surface and documentation cleanup only; behavior of claim access is unchanged aside from removing the convenience hex helper.

Overview
Follow-up on credential claims API review: claims_hex() is removed so FFI callers use claims() and encode only the field elements they need (e.g. to_hex_string()), instead of a bulk hex helper.

claims() keeps returning Vec<Arc<FieldElement>>; the long disclosure-oriented rustdoc is replaced with a short summary plus an inline note that Arc is required for UniFFI sequences of objects. fetch_credential rustdoc is shortened (no tie-in to proof generation / claims_hex). Tests are updated accordingly.

Reviewed by Cursor Bugbot for commit 700c632. 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.
/// serialize — it is an accessor, not a disclosure mechanism; whether and
/// which claims leave the device is entirely the host app's policy.
//
// `Arc` is load-bearing: uniffi objects only implement `Lower` behind an

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no need to have this. removing the Arc will immediately raise a compilation error to anyone confused like me

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