Skip to content

Add amino encoding functionality to proto Struct#1502

Merged
antho1404 merged 2 commits intodevfrom
feature/struct-amino
Nov 15, 2019
Merged

Add amino encoding functionality to proto Struct#1502
antho1404 merged 2 commits intodevfrom
feature/struct-amino

Conversation

@NicolasMahe
Copy link
Copy Markdown
Member

@NicolasMahe NicolasMahe commented Nov 15, 2019

  • Add amino:"unsafe" flag to proto Number type to make it work with amino.
  • Add MarshalAmino and UnmarshalAmino functions to proto Struct type to transform the Fields type from map[string]*Value to a key/value value and vice-versa. The key/value array is sorted by keys to guarantee its order and generate the same hash (see order of values in the tests).

Suggested solution from tendermint/go-amino#154 (comment)
Closes #1492
Related to #1493

@NicolasMahe NicolasMahe added this to the next milestone Nov 15, 2019
@NicolasMahe NicolasMahe self-assigned this Nov 15, 2019
Comment thread protobuf/types/struct.go Outdated
Comment thread protobuf/types/struct.go Outdated
Comment thread protobuf/types/struct_test.go Outdated
Comment thread protobuf/types/struct_test.go Outdated
Comment thread protobuf/types/struct_test.go
Comment thread protobuf/types/codec.go
@antho1404 antho1404 merged commit 6092ba3 into dev Nov 15, 2019
@antho1404 antho1404 deleted the feature/struct-amino branch November 15, 2019 10:11
@NicolasMahe NicolasMahe added the release:add Pull requests that add something label Nov 26, 2019
@NicolasMahe NicolasMahe mentioned this pull request Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:add Pull requests that add something

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make amino support map for binary encoding

3 participants