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

feat: json-sort #71

Merged
merged 7 commits into from
Jun 9, 2022
Merged

feat: json-sort #71

merged 7 commits into from
Jun 9, 2022

Conversation

kimurayu45z
Copy link
Contributor

@kimurayu45z kimurayu45z commented Jun 8, 2022

You can check the work by

npx jest codec -t txBuilder

I solve this problem by using the keys order of the prototype(javascript term) of the instance. Really techy and depends on the fuckin specification of protobufjs.
In protobufjs, the order of fields are preserved in prototype, but not in the actual instance.

@kimurayu45z
Copy link
Contributor Author

kimurayu45z commented Jun 8, 2022

Really sorry for my bad action...

The names were changed, so "replace all" in vscode is needed... sorry...
※don't replace packAny before unpackAny

unpackAny → protoAnyToInstance
packAny → instanceToProtoAny
unpackCosmosAny → protoJSONToInstance
packCosmosAny → instanceToProtoJSON
packAnyFromCosmosJSON → protoJSONToProtoAny

@kimurayu45z kimurayu45z mentioned this pull request Jun 8, 2022
@kimurayu45z kimurayu45z merged commit 7d2d28e into main Jun 9, 2022
@kimurayu45z kimurayu45z deleted the json-sort branch June 9, 2022 03:53
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