Skip to content

Commit

Permalink
Revert changes for keybase encoding (#5814)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgimeno authored Mar 17, 2020
1 parent a5af94d commit 1c7da83
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
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 {
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

0 comments on commit 1c7da83

Please sign in to comment.