-
Notifications
You must be signed in to change notification settings - Fork 78
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
Proto encoding of registered types #276
base: master
Are you sure you want to change the base?
Conversation
amino should encode registered types as this protobuf message Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
…lled) Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
…ompat. tests in make file Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
struct instead of operating directly on the disfix bytes Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
TestCodecRoundtripUnarshalOnConcreteNonNilRegisteredTypeDef TestCodecRoundtripMarshalOnConcreteNonNilRegisteredTypeDef TestCodecRoundtripUnarshalOnConcreteNonNilRegisteredTypeDef TestCodecRoundtripMarshalOnConcreteNonNilRegisteredTypeDef Example Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
Still need much more testing though Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
5514d5e
to
d52af81
Compare
TODO:
|
comments & todos for @marbar3778 to catch up Signed-off-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
d52af81
to
035b43f
Compare
As discussed with @marbar3778 the changes here pose a problem when bechifying the consensus pubkey in the SDK: https://github.com/cosmos/cosmos-sdk/blob/f1adb7afd974ee50ac9ac83a315cde932f47d7ef/x/staking/types/validator.go#L181-L182 This increase is due to the overhead introduced here (prefix and value are encoded as fields now). The simplest way to understand and reproduce this is via running |
There seems to be another bug in the changes here. Add this test (in types/address_test.go in the sdk for instance): func TestValAddrMustMarshal(t *testing.T) {
var pub ed25519.PubKeyEd25519
tSlice := make([]types.ValAddress, 20)
for i := 0; i < 20; i++ {
rand.Read(pub[:])
acc := types.ValAddress(pub.Address())
tSlice[i] = acc
}
bz := codec.Cdc.MustMarshalBinaryLengthPrefixed(tSlice)
timeslice := []types.ValAddress{}
codec.Cdc.MustUnmarshalBinaryLengthPrefixed(bz, ×lice)
} |
The latter might be somewhat related to: #272 In |
This linter is INTENSE! |
ignore these linters will fix it in a coming pr |
ref: #267
@alexanderbez @jackzampolin this could do with more testing but I'd appreciate a first peek.