diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a19fb7b3..88549940f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/crypto/keys/keybase_base.go b/crypto/keys/keybase_base.go index 86ed00677..47c7e60d7 100644 --- a/crypto/keys/keybase_base.go +++ b/crypto/keys/keybase_base.go @@ -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") } diff --git a/crypto/keys/types.go b/crypto/keys/types.go index c91f2905b..89f5cb2d5 100644 --- a/crypto/keys/types.go +++ b/crypto/keys/types.go @@ -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 } diff --git a/go.mod b/go.mod index 26ea1b272..76a69ba2e 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.11.1 github.com/gibson042/canonicaljson-go v1.0.3 github.com/gogo/protobuf v1.3.1 - github.com/golang/mock v1.4.2 + github.com/golang/mock v1.4.3 github.com/golang/protobuf v1.4.0-rc.4 github.com/gorilla/handlers v1.4.2 github.com/gorilla/mux v1.7.4 diff --git a/go.sum b/go.sum index ca38f6113..83bf29675 100644 --- a/go.sum +++ b/go.sum @@ -132,8 +132,8 @@ github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.4.2 h1:fXIkPzOBCwDUPvYmOPzETABgbqpYlYNigQ2o64eMr5c= -github.com/golang/mock v1.4.2/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/x/distribution/spec/07_params.md b/x/distribution/spec/07_params.md index 5a933e923..432a4e5a9 100644 --- a/x/distribution/spec/07_params.md +++ b/x/distribution/spec/07_params.md @@ -6,9 +6,12 @@ order: 7 The distribution module contains the following parameters: -| Key | Type | Example | -|---------------------|--------------|------------------------| -| communitytax | string (dec) | "0.020000000000000000" | -| baseproposerreward | string (dec) | "0.010000000000000000" | -| bonusproposerreward | string (dec) | "0.040000000000000000" | -| withdrawaddrenabled | bool | true | +| Key | Type | Example | +| ------------------- | ------------ | -------------------------- | +| communitytax | string (dec) | "0.020000000000000000" [0] | +| baseproposerreward | string (dec) | "0.010000000000000000" [1] | +| bonusproposerreward | string (dec) | "0.040000000000000000" [1] | +| withdrawaddrenabled | bool | true | + +* [0] The value of `communitytax` must be positive and cannot exceed 1.00. +* [1] `baseproposerreward` and `bonusproposerreward` must be positive and their sum cannot exceed 1.00.