diff --git a/CHANGELOG.md b/CHANGELOG.md index 12f80bde5a4a..12fef95ccd40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/x/gov/types/v1/proposal.go b/x/gov/types/v1/proposal.go index cb04be0d45a5..2e8f40cafffc 100644 --- a/x/gov/types/v1/proposal.go +++ b/x/gov/types/v1/proposal.go @@ -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) { diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index 94d9ab52de62..b752cb2b4f4c 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -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 { diff --git a/x/gov/types/v1beta1/proposal.go b/x/gov/types/v1beta1/proposal.go index 09b6db0041e5..daecf3b5d1e4 100644 --- a/x/gov/types/v1beta1/proposal.go +++ b/x/gov/types/v1beta1/proposal.go @@ -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': diff --git a/x/gov/types/v1beta1/vote.go b/x/gov/types/v1beta1/vote.go index c5b60b5fc0d9..ecec54e490d5 100644 --- a/x/gov/types/v1beta1/vote.go +++ b/x/gov/types/v1beta1/vote.go @@ -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 {