Closed liamsi closed 5 years ago
In protobuf there is https://github.com/golang/protobuf/blob/14aad3d5ea4c323bcd7a2137e735da24a76e814c/ptypes/timestamp/timestamp.pb.go#L99-L108 where seconds and nanos are encoded as varint. See also the corresponding proto file / message: https://github.com/golang/protobuf/blob/14aad3d5ea4c323bcd7a2137e735da24a76e814c/ptypes/timestamp/timestamp.proto#L121-L133
varint
In amino, we currently encode time as fixed length (signed) ints: https://github.com/tendermint/go-amino/blob/2106ca61d91029c931fd54968c2bb02dc96b1412/encoder.go#L123-L136
I think it could be worthwhile to change this behaviour. Then, people working on amino in other languages, or interefacing via vanilla protobuf could just use proto's encoding / types.
Closed via #224
In protobuf there is https://github.com/golang/protobuf/blob/14aad3d5ea4c323bcd7a2137e735da24a76e814c/ptypes/timestamp/timestamp.pb.go#L99-L108 where seconds and nanos are encoded as
varint
. See also the corresponding proto file / message: https://github.com/golang/protobuf/blob/14aad3d5ea4c323bcd7a2137e735da24a76e814c/ptypes/timestamp/timestamp.proto#L121-L133In amino, we currently encode time as fixed length (signed) ints: https://github.com/tendermint/go-amino/blob/2106ca61d91029c931fd54968c2bb02dc96b1412/encoder.go#L123-L136
I think it could be worthwhile to change this behaviour. Then, people working on amino in other languages, or interefacing via vanilla protobuf could just use proto's encoding / types.