Add MarshalBinary/UnmarshalBinary interface support#300
Open
jordaaash wants to merge 12 commits intotendermint:ismail/any_aminofrom
jordaaash:jordansexton/any_amino/binary_marshaler
Open
Add MarshalBinary/UnmarshalBinary interface support#300jordaaash wants to merge 12 commits intotendermint:ismail/any_aminofrom jordaaash:jordansexton/any_amino/binary_marshaler
jordaaash wants to merge 12 commits intotendermint:ismail/any_aminofrom
jordaaash:jordansexton/any_amino/binary_marshaler
Conversation
jordaaash
commented
Dec 17, 2019
golangcibot
reviewed
Dec 17, 2019
golangcibot
reviewed
Dec 17, 2019
jordaaash
commented
Dec 17, 2019
alexanderbez
approved these changes
Dec 18, 2019
alexanderbez
left a comment
There was a problem hiding this comment.
ACK -- pending approval by Jae & Zaki and CI fixing.
golangcibot
reviewed
Dec 18, 2019
Contributor
|
Relevant: #301 - "The binary and json were intentionally written to mirror the code structure, so this kind of translation is easy." Given the current impl, the divergence in JSON hints at divergence in function, whereby this optimization doesn't work for embedded structs (whereas such does work for json). In #301 what I want to convey is that we should continue to maintain code structure parity between binary and json, so that we solve common issues for both and reduce potential bugs. Once the implementations diverge, it will become difficult or impossible to keep in sync. Anyways, great case study; thank you for the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR provides a mechanism to completely override the Amino encoding of a type by implementing the
BinaryMarshalerandBinaryUnmarshalerinterfaces.Amino prefix bytes will still be prepended. Implementing
MarshalAmino/UnmarshalAminois not required. This should unblock tendermint/tendermint#4245