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

Don't encode zero values in time #178

Merged
merged 1 commit into from
Jun 16, 2018

Conversation

liamsi
Copy link
Contributor

@liamsi liamsi commented Jun 13, 2018

Skip over default values (zeroes) in EncodeTime (as proto3 does).

@liamsi liamsi merged commit eff9e54 into tendermint:develop Jun 16, 2018
@liamsi
Copy link
Contributor Author

liamsi commented Jun 16, 2018

Thanks @melekes !

liamsi added a commit to liamsi/go-amino that referenced this pull request Jul 4, 2018
liamsi added a commit to liamsi/tendermint that referenced this pull request Jul 18, 2018
liamsi added a commit that referenced this pull request Aug 17, 2018
* DecodeInt{8, 16} negative limit checks + tests (#125)

Updates #120

Also adds a test for Byteslice encoding and decoding
roundtripping and part slicing then rejoining.

* fix circleci2.0

* some metalinter issues

* skip over default values when encoding time (#178)

* do not encode empty structs, unless `amino:"write_empty"` is set (#179)

* skip over empty structs by default

* slightly more info on panics

* Fix zero time decoding (#190)

- fix decoding of skipped fields in time, or completely skipped time 
- necessary because sec=0 and ns=0 do not result in time.Time{} and vice versa

* Prepare release 0.11.0 (#193)

* Fix time decoding & encoding of arrays and structs

- top-level entry functions called with BinFieldNum:1 to properly encode e.g. arrays of structs (see non-time related test)
- add defaultValue method, different from #196 it deals with multiply nested pointers

* Removed dependency on tmlibs/common

* Always write empty if struct field is pointer

* add tests for #206

- test for pointers to empty struct and nil pointer

* fix proto3 compatibility for empty structs

* Add EmptyStruct to fuzz tests

* Revert "fix proto3 compatibility for empty structs"

* Do not allow encoding of nil struct pointers in a slice/array

* By default, 0-length list elements are decoded as nil
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.

2 participants