Revert changes for keybase encoding (#5814)

This commit is contained in:
Jonathan Gimeno 2020-03-17 01:36:05 +01:00 committed by GitHub
parent a5af94d3ef
commit 1c7da830c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -48,6 +48,8 @@ balances or a single balance by denom when the `denom` query parameter is presen
* [\#5785](https://github.com/cosmos/cosmos-sdk/issues/5785) JSON strings coerced to valid UTF-8 bytes at JSON marshalling time
are now replaced by human-readable expressions. This change can potentially break compatibility with all those client side tools
that parse log messages.
* (client) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) The `tx encode/decode` commands, due to change on encoding break compatibility with
older clients.
### API Breaking Changes
@ -148,7 +150,7 @@ Buffers for state serialization instead of Amino.
to define their own concrete `MsgSubmitProposal` types.
* The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by
requiring a concrete codec to know how to serialize `Proposal` types.
* (codec) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) Now we favor the use of MarshalBinaryBare instead of LengthPrefixed in all cases that is not needed.
* (codec) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) Now we favor the use of `(Un)MarshalBinaryBare` instead of `(Un)MarshalBinaryLengthPrefixed` in all cases that are not needed.
### Improvements

View File

@ -124,7 +124,7 @@ func (kb baseKeybase) DecodeSignature(info Info, msg []byte) (sig []byte, pub tm
return nil, nil, err
}
if err := CryptoCdc.UnmarshalBinaryBare([]byte(signed), sig); err != nil {
if err := CryptoCdc.UnmarshalBinaryLengthPrefixed([]byte(signed), sig); err != nil {
return nil, nil, errors.Wrap(err, "failed to decode signature")
}

View File

@ -337,12 +337,12 @@ func (i multiInfo) GetPath() (*hd.BIP44Params, error) {
// encoding info
func marshalInfo(i Info) []byte {
return CryptoCdc.MustMarshalBinaryBare(i)
return CryptoCdc.MustMarshalBinaryLengthPrefixed(i)
}
// decoding info
func unmarshalInfo(bz []byte) (info Info, err error) {
err = CryptoCdc.UnmarshalBinaryBare(bz, &info)
err = CryptoCdc.UnmarshalBinaryLengthPrefixed(bz, &info)
return
}