chore: remove custom marshaling of proposal status (#13160)
* remove custom marshaling * remove custom marshaling inother places * add changelog entry
This commit is contained in:
parent
d47970d673
commit
adf6bf5747
@ -127,6 +127,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
* (x/genutil)[#12956](https://github.com/cosmos/cosmos-sdk/pull/12956) `genutil.AppModuleBasic` has a new attribute: genesis transaction validation function. The existing validation logic is implemented in `genutiltypes.DefaultMessageValidator`. Use `genutil.NewAppModuleBasic` to create a new genutil Module Basic.
|
||||
* (codec) [#12964](https://github.com/cosmos/cosmos-sdk/pull/12964) `ProtoCodec.MarshalInterface` now returns an error when serializing unregistered types and a subsequent `ProtoCodec.UnmarshalInterface` would fail.
|
||||
* (x/staking) [#12973](https://github.com/cosmos/cosmos-sdk/pull/12973) Removed `stakingkeeper.RandomValidator`. Use `testutil.RandSliceElem(r, sk.GetAllValidators(ctx))` instead.
|
||||
* (x/gov) [13160](https://github.com/cosmos/cosmos-sdk/pull/13160) Remove custom marshaling of proposl and voteoption.
|
||||
|
||||
### CLI Breaking Changes
|
||||
|
||||
|
||||
@ -94,17 +94,6 @@ func ProposalStatusFromString(str string) (ProposalStatus, error) {
|
||||
return ProposalStatus(num), nil
|
||||
}
|
||||
|
||||
// Marshal needed for protobuf compatibility
|
||||
func (status ProposalStatus) Marshal() ([]byte, error) {
|
||||
return []byte{byte(status)}, nil
|
||||
}
|
||||
|
||||
// Unmarshal needed for protobuf compatibility
|
||||
func (status *ProposalStatus) Unmarshal(data []byte) error {
|
||||
*status = ProposalStatus(data[0])
|
||||
return nil
|
||||
}
|
||||
|
||||
// Format implements the fmt.Formatter interface.
|
||||
|
||||
func (status ProposalStatus) Format(s fmt.State, verb rune) {
|
||||
|
||||
@ -143,17 +143,6 @@ func ValidVoteOption(option VoteOption) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Marshal needed for protobuf compatibility.
|
||||
func (vo VoteOption) Marshal() ([]byte, error) {
|
||||
return []byte{byte(vo)}, nil
|
||||
}
|
||||
|
||||
// Unmarshal needed for protobuf compatibility.
|
||||
func (vo *VoteOption) Unmarshal(data []byte) error {
|
||||
*vo = VoteOption(data[0])
|
||||
return nil
|
||||
}
|
||||
|
||||
// Format implements the fmt.Formatter interface.
|
||||
func (vo VoteOption) Format(s fmt.State, verb rune) {
|
||||
switch verb {
|
||||
|
||||
@ -137,19 +137,7 @@ func ProposalStatusFromString(str string) (ProposalStatus, error) {
|
||||
return ProposalStatus(num), nil
|
||||
}
|
||||
|
||||
// Marshal needed for protobuf compatibility
|
||||
func (status ProposalStatus) Marshal() ([]byte, error) {
|
||||
return []byte{byte(status)}, nil
|
||||
}
|
||||
|
||||
// Unmarshal needed for protobuf compatibility
|
||||
func (status *ProposalStatus) Unmarshal(data []byte) error {
|
||||
*status = ProposalStatus(data[0])
|
||||
return nil
|
||||
}
|
||||
|
||||
// Format implements the fmt.Formatter interface.
|
||||
|
||||
func (status ProposalStatus) Format(s fmt.State, verb rune) {
|
||||
switch verb {
|
||||
case 's':
|
||||
|
||||
@ -129,17 +129,6 @@ func ValidVoteOption(option VoteOption) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Marshal needed for protobuf compatibility.
|
||||
func (vo VoteOption) Marshal() ([]byte, error) {
|
||||
return []byte{byte(vo)}, nil
|
||||
}
|
||||
|
||||
// Unmarshal needed for protobuf compatibility.
|
||||
func (vo *VoteOption) Unmarshal(data []byte) error {
|
||||
*vo = VoteOption(data[0])
|
||||
return nil
|
||||
}
|
||||
|
||||
// Format implements the fmt.Formatter interface.
|
||||
func (vo VoteOption) Format(s fmt.State, verb rune) {
|
||||
switch verb {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user