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

Revert changes for keybase encoding. #5814

Merged
merged 2 commits into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion crypto/keys/keybase_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
alessio marked this conversation as resolved.
Show resolved Hide resolved
return nil, nil, errors.Wrap(err, "failed to decode signature")
}

Expand Down
4 changes: 2 additions & 2 deletions crypto/keys/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down