Closed liamsi closed 5 years ago
I don't think this is a problem for the SDK. We don't use [][]T
in amino encodings from what I can see.
I was under the same impression. But I was not 100% sure as one can't easy spot type aliases where this still might be used implicitly, e.g.
type SomeType struct {
FooBars []Foo
}
// this can be in a different package:
type Foo []Bar
Amino certainly allows this as one can see in the tests, e.g.:
My suggestion here would be to throw an error in case amino detects this. This would ensure that users won't use this in the future, too.
Ahhh yes! Good point. I'll have to double check that we're not doing this, but I doubt we are. And if we are, I'm sure we can resolve it.
Thanks @alexanderbez!
Amino allows encoding of
[][]T
directly or as fields (whereT
can be different from []byte). This does not have a matching representation in protobuf, meaning that sth. likemessage MsgName { repeated repeated T = 1;}
is not allowed in protobuf (for somemessage T { /* ...*/ }
.Not sure how much this is used in the SDK. Tendermint only uses [][]byte as far as I can see.
(note that
[][]byte
fields are still ok as it can be represented asrepeated bytes
is valid in protobuf, too)