Skip to content

fix(web-client): align NoteType enum discriminants with miden_client::note::NoteType#22

Open
WiktorStarczewski wants to merge 1 commit into
nextfrom
wiktor/migrate-2134-note-type
Open

fix(web-client): align NoteType enum discriminants with miden_client::note::NoteType#22
WiktorStarczewski wants to merge 1 commit into
nextfrom
wiktor/migrate-2134-note-type

Conversation

@WiktorStarczewski
Copy link
Copy Markdown
Collaborator

Migrated from miden-client#2134 (author: @AlexWaker) as part of the web-sdk split (web/WASM components moved out of miden-client into this dedicated repo — see miden-client #1992 / #2135).

Summary (per the original PR)

  • Adds compile-time assertions to keep the web-client NoteType enum's JS-facing discriminant values (Private = 0b10, Public = 0b01) aligned with miden_client::note::NoteType.
  • wasm_bindgen requires exported C-style enum discriminants to be numeric literals, so the web-client enum keeps literal values and verifies them against the native enum at compile time.
  • Removes the stale Keep these masks in sync with miden-protocol/src/note/note_type.rs comment now that the static asserts enforce the invariant.

Context

Closes the web-sdk side of miden-client#1749. The CLI-side change (bin/miden-cli/src/commands/notes.rs) stays on the original miden-client PR.

…t::note::NoteType via compile-time assertions

Migrated from 0xMiden/miden-client#2134 (author: AlexWaker) as part of
the web-sdk split. Original PR: 0xMiden/miden-client#2134
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.

1 participant