You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SwiftExampleApp: Register Contract paste re-sorts nested schema members #6080
The Register Contract flow's pasteboard importer (PasteboardContractCandidate.classify in RegisterContractSourceView.swift) parses the pasted contract with Foundation JSONSerialization and writes each section back with jsonString, which uses .sortedKeys. That reorders the members of every nested object in a document schema. A document type's properties are stored in position order: from protocol version 15, registration refuses an object whose members are out of position order. So a valid contract pasted from the clipboard can come back reordered, and registering it then fails.
Proposal
Split the pasted contract with the Rust splitter added in #6053 (split_contract_update_source, exported as platform_wallet_split_contract_update_source), or a create-flow sibling of it. It returns each section as JSON text in source order, so Swift fills the form without re-serializing.
Context
Found while fixing the same problem for the Update Contract screen in #6053.
Activity