Skip to content

fix: flatten SignedOrder serialization to match Rust serde#37

Open
init4samwise wants to merge 1 commit intomainfrom
fix/signed-order-serialization-flatten
Open

fix: flatten SignedOrder serialization to match Rust serde#37
init4samwise wants to merge 1 commit intomainfrom
fix/signed-order-serialization-flatten

Conversation

@init4samwise
Copy link
Contributor

Summary

  • Fixes SerializedSignedOrder type to hoist owner and signature to the top level, matching Rust's #[serde(flatten)] on Permit2Batch
  • Updates serializeOrder() and deserializeOrder() to produce/consume the correct flattened shape
  • Adds test asserting serialized output matches Rust test vector JSON shape

Closes ENG-2039

Test plan

  • All 191 existing tests pass (including round-trip tests against Rust vectors)
  • New test verifies serialized shape matches Rust vector JSON exactly
  • pnpm typecheck, pnpm lint, pnpm format:check all pass

🤖 Generated with Claude Code

…st serde

Rust's SignedOrder uses #[serde(flatten)] on the Permit2Batch field,
which hoists `owner` and `signature` to be siblings of `permit` in JSON.
The TypeScript type and serialization functions were nesting them inside
`permit`, causing a shape mismatch with the Rust implementation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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