Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: NFT package JSON encoding #7

Merged
merged 3 commits into from
Jan 30, 2023
Merged

Fix: NFT package JSON encoding #7

merged 3 commits into from
Jan 30, 2023

Conversation

taramakage
Copy link
Contributor

@taramakage taramakage commented Jan 19, 2023

  1. On the Sending Chain side, unused optional fields won't show up in JSON
    1. if classUri/classData == "", omitted.
    2. if tokenUris/tokenData == [] or ["","",""], omitted.
    3. if tokenUris/tokenData == ["a","b",""] or ["a","b", "c"], show up as it is.
  2. On the Receiving Chain side, unused fields will be converted into pkg struct as below:
    1. field omitted will be converted as "" for string or ["","",""] for string array.
    2. "classUri/classData": null will be converted as empty string ""
    3. "tokenUris/tokenData": ["1", null, "3"] will be converted as ["1", "", "3"]

types/packet.go Outdated Show resolved Hide resolved
@aofengli aofengli merged commit 3717108 into main Jan 30, 2023
@aofengli aofengli deleted the yuandu/fix-json-encoding branch January 30, 2023 02:32
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.

3 participants