Skip to content

Fix/serde zkapp uri token symbol string parsing#190

Closed
jk89 wants to merge 2 commits intoRaspberry-Devs:mainfrom
Nori-zk:fix/serde-zkapp-uri-token-symbol-string-parsing
Closed

Fix/serde zkapp uri token symbol string parsing#190
jk89 wants to merge 2 commits intoRaspberry-Devs:mainfrom
Nori-zk:fix/serde-zkapp-uri-token-symbol-string-parsing

Conversation

@jk89
Copy link
Copy Markdown
Contributor

@jk89 jk89 commented Apr 6, 2026

Summary

ZkappUri and TokenSymbol fields fail to parse when set to JSON strings as produced by o1js, because the derived serde on Vec<u8> expects a JSON byte array (e.g. [77,79,67,75]) instead of a plain string (e.g. "MOCK"). Additionally, ZkappUri had an incorrect 32-character length limit that rejected real URLs, and from_str_network silently swallowed parse errors behind a generic "Unknown transaction type" message.

Structure

This PR contains two commits designed to be reviewed in sequence:

  1. 0219014 test: Adds four failing tests that document the issue — a real deploy-v0.0.4 fixture that fails to parse, minimal reproductions for zkappUri and tokenSymbol as strings, and a test proving the 32-char limit rejects valid URLs. Checkout this commit and run cargo test -p mina-tx --lib to see the failures.
  2. f04d8b6 fix: Adds custom string-based serde impls for both types, removes the 32-char limit, and surfaces actual parse errors in from_str_network. Checkout this commit and run cargo test -p mina-tx --lib to see all tests pass.

jk89 added 2 commits April 6, 2026 12:04
…o parse when set to JSON strings as produced by o1js, because the derived serde on Vec<u8> expects a JSON byte array instead. Added test for the real deploy-v0.0.4-unsigned.json fixture which fails to parse due to the zkappUri string field, a minimal reproduction for zkappUri as a string, a test proving the incorrect 32-character ZkappUri length limit rejects real URLs, and a minimal reproduction for tokenSymbol as a string. All four tests currently fail documenting the limitation.
…ol to accept JSON strings as produced by o1js, removed the incorrect 32-character ZkappUri length limit, and fixed from_str_network to surface actual serde errors instead of swallowing them. Resolves all four failing tests from the previous commit.
@scaraven
Copy link
Copy Markdown
Member

scaraven commented Apr 6, 2026

Closed, see #192 for the updated PR

@scaraven scaraven closed this Apr 6, 2026
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