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

Disallow nil in lists (repeated fields) #212

Closed
liamsi opened this issue Aug 2, 2018 · 2 comments
Closed

Disallow nil in lists (repeated fields) #212

liamsi opened this issue Aug 2, 2018 · 2 comments
Assignees

Comments

@liamsi
Copy link
Contributor

liamsi commented Aug 2, 2018

Different from protobuf we currently allow to encode nil in repeated fields. This causes ambiguity while decoding. For more details see:
#209 (comment)

This is a simple yet bigger change as it will err on many fuzzer rounds.

@jaekwon
Copy link
Contributor

jaekwon commented Aug 5, 2018

A bit more nuanced because Tendermint requires this feature, e.g. in Commit where []*Vote and vote may be nil to denote absence.

This PR solves it by letting you denote a field tag amino:"empty_elements" which then behaves in the way you specified, otherwise the behavior is the same (e.g. what Tendermint currently expects).

#206

@jaekwon
Copy link
Contributor

jaekwon commented Aug 5, 2018

Closing because I think it's fixed, but please re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants