diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c078d1d6cdc..984c19868132 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -146,7 +146,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [#17348](https://github.com/cosmos/cosmos-sdk/pull/17348) Remove the `WrapServiceResult` function. * The `*sdk.Result` returned by the msg server router will not contain the `.Data` field. * (x/staking) [#17335](https://github.com/cosmos/cosmos-sdk/pull/17335) Remove usage of `"cosmossdk.io/x/staking/types".Infraction_*` in favour of `"cosmossdk.io/api/cosmos/staking/v1beta1".Infraction_` in order to remove dependency between modules on staking -* (x/gov) [#17496](https://github.com/cosmos/cosmos-sdk/pull/17469) in `x/gov/types/v1beta1/vote.go` `NewVote` was removed, constructing the struct is required for this type * (types) [#17426](https://github.com/cosmos/cosmos-sdk/pull/17426) `NewContext` does not take a `cmtproto.Header{}` any longer. * `WithChainID` / `WithBlockHeight` / `WithBlockHeader` must be used to set values on the context * (x/bank) [#17569](https://github.com/cosmos/cosmos-sdk/pull/17569) `BurnCoins` takes an address instead of a module name diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 1200fbc1e4aa..d2a45c71478a 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -1212,6 +1212,7 @@ var ( fd_Proposal_proposer protoreflect.FieldDescriptor fd_Proposal_expedited protoreflect.FieldDescriptor fd_Proposal_failed_reason protoreflect.FieldDescriptor + fd_Proposal_proposal_type protoreflect.FieldDescriptor ) func init() { @@ -1232,6 +1233,7 @@ func init() { fd_Proposal_proposer = md_Proposal.Fields().ByName("proposer") fd_Proposal_expedited = md_Proposal.Fields().ByName("expedited") fd_Proposal_failed_reason = md_Proposal.Fields().ByName("failed_reason") + fd_Proposal_proposal_type = md_Proposal.Fields().ByName("proposal_type") } var _ protoreflect.Message = (*fastReflection_Proposal)(nil) @@ -1389,6 +1391,12 @@ func (x *fastReflection_Proposal) Range(f func(protoreflect.FieldDescriptor, pro return } } + if x.ProposalType != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.ProposalType)) + if !f(fd_Proposal_proposal_type, value) { + return + } + } } // Has reports whether a field is populated. @@ -1434,6 +1442,8 @@ func (x *fastReflection_Proposal) Has(fd protoreflect.FieldDescriptor) bool { return x.Expedited != false case "cosmos.gov.v1.Proposal.failed_reason": return x.FailedReason != "" + case "cosmos.gov.v1.Proposal.proposal_type": + return x.ProposalType != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1480,6 +1490,8 @@ func (x *fastReflection_Proposal) Clear(fd protoreflect.FieldDescriptor) { x.Expedited = false case "cosmos.gov.v1.Proposal.failed_reason": x.FailedReason = "" + case "cosmos.gov.v1.Proposal.proposal_type": + x.ProposalType = 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1547,6 +1559,9 @@ func (x *fastReflection_Proposal) Get(descriptor protoreflect.FieldDescriptor) p case "cosmos.gov.v1.Proposal.failed_reason": value := x.FailedReason return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Proposal.proposal_type": + value := x.ProposalType + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1601,6 +1616,8 @@ func (x *fastReflection_Proposal) Set(fd protoreflect.FieldDescriptor, value pro x.Expedited = value.Bool() case "cosmos.gov.v1.Proposal.failed_reason": x.FailedReason = value.Interface().(string) + case "cosmos.gov.v1.Proposal.proposal_type": + x.ProposalType = (ProposalType)(value.Enum()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1674,6 +1691,8 @@ func (x *fastReflection_Proposal) Mutable(fd protoreflect.FieldDescriptor) proto panic(fmt.Errorf("field expedited of message cosmos.gov.v1.Proposal is not mutable")) case "cosmos.gov.v1.Proposal.failed_reason": panic(fmt.Errorf("field failed_reason of message cosmos.gov.v1.Proposal is not mutable")) + case "cosmos.gov.v1.Proposal.proposal_type": + panic(fmt.Errorf("field proposal_type of message cosmos.gov.v1.Proposal is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1724,6 +1743,8 @@ func (x *fastReflection_Proposal) NewField(fd protoreflect.FieldDescriptor) prot return protoreflect.ValueOfBool(false) case "cosmos.gov.v1.Proposal.failed_reason": return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Proposal.proposal_type": + return protoreflect.ValueOfEnum(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1854,6 +1875,9 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.ProposalType != 0 { + n += 2 + runtime.Sov(uint64(x.ProposalType)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1883,6 +1907,13 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.ProposalType != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ProposalType)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } if len(x.FailedReason) > 0 { i -= len(x.FailedReason) copy(dAtA[i:], x.FailedReason) @@ -2555,6 +2586,25 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { } x.FailedReason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 16: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalType", wireType) + } + x.ProposalType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ProposalType |= ProposalType(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2596,6 +2646,7 @@ var ( fd_TallyResult_abstain_count protoreflect.FieldDescriptor fd_TallyResult_no_count protoreflect.FieldDescriptor fd_TallyResult_no_with_veto_count protoreflect.FieldDescriptor + fd_TallyResult_spam_count protoreflect.FieldDescriptor ) func init() { @@ -2605,6 +2656,7 @@ func init() { fd_TallyResult_abstain_count = md_TallyResult.Fields().ByName("abstain_count") fd_TallyResult_no_count = md_TallyResult.Fields().ByName("no_count") fd_TallyResult_no_with_veto_count = md_TallyResult.Fields().ByName("no_with_veto_count") + fd_TallyResult_spam_count = md_TallyResult.Fields().ByName("spam_count") } var _ protoreflect.Message = (*fastReflection_TallyResult)(nil) @@ -2696,6 +2748,12 @@ func (x *fastReflection_TallyResult) Range(f func(protoreflect.FieldDescriptor, return } } + if x.SpamCount != "" { + value := protoreflect.ValueOfString(x.SpamCount) + if !f(fd_TallyResult_spam_count, value) { + return + } + } } // Has reports whether a field is populated. @@ -2719,6 +2777,8 @@ func (x *fastReflection_TallyResult) Has(fd protoreflect.FieldDescriptor) bool { return x.NoCount != "" case "cosmos.gov.v1.TallyResult.no_with_veto_count": return x.NoWithVetoCount != "" + case "cosmos.gov.v1.TallyResult.spam_count": + return x.SpamCount != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.TallyResult")) @@ -2743,6 +2803,8 @@ func (x *fastReflection_TallyResult) Clear(fd protoreflect.FieldDescriptor) { x.NoCount = "" case "cosmos.gov.v1.TallyResult.no_with_veto_count": x.NoWithVetoCount = "" + case "cosmos.gov.v1.TallyResult.spam_count": + x.SpamCount = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.TallyResult")) @@ -2771,6 +2833,9 @@ func (x *fastReflection_TallyResult) Get(descriptor protoreflect.FieldDescriptor case "cosmos.gov.v1.TallyResult.no_with_veto_count": value := x.NoWithVetoCount return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.TallyResult.spam_count": + value := x.SpamCount + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.TallyResult")) @@ -2799,6 +2864,8 @@ func (x *fastReflection_TallyResult) Set(fd protoreflect.FieldDescriptor, value x.NoCount = value.Interface().(string) case "cosmos.gov.v1.TallyResult.no_with_veto_count": x.NoWithVetoCount = value.Interface().(string) + case "cosmos.gov.v1.TallyResult.spam_count": + x.SpamCount = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.TallyResult")) @@ -2827,6 +2894,8 @@ func (x *fastReflection_TallyResult) Mutable(fd protoreflect.FieldDescriptor) pr panic(fmt.Errorf("field no_count of message cosmos.gov.v1.TallyResult is not mutable")) case "cosmos.gov.v1.TallyResult.no_with_veto_count": panic(fmt.Errorf("field no_with_veto_count of message cosmos.gov.v1.TallyResult is not mutable")) + case "cosmos.gov.v1.TallyResult.spam_count": + panic(fmt.Errorf("field spam_count of message cosmos.gov.v1.TallyResult is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.TallyResult")) @@ -2848,6 +2917,8 @@ func (x *fastReflection_TallyResult) NewField(fd protoreflect.FieldDescriptor) p return protoreflect.ValueOfString("") case "cosmos.gov.v1.TallyResult.no_with_veto_count": return protoreflect.ValueOfString("") + case "cosmos.gov.v1.TallyResult.spam_count": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.TallyResult")) @@ -2933,6 +3004,10 @@ func (x *fastReflection_TallyResult) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.SpamCount) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2962,6 +3037,13 @@ func (x *fastReflection_TallyResult) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.SpamCount) > 0 { + i -= len(x.SpamCount) + copy(dAtA[i:], x.SpamCount) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SpamCount))) + i-- + dAtA[i] = 0x2a + } if len(x.NoWithVetoCount) > 0 { i -= len(x.NoWithVetoCount) copy(dAtA[i:], x.NoWithVetoCount) @@ -3167,6 +3249,38 @@ func (x *fastReflection_TallyResult) ProtoMethods() *protoiface.Methods { } x.NoWithVetoCount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SpamCount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SpamCount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -6988,37 +7102,119 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// ProposalType enumerates the valid proposal types. +// All proposal types are v1.Proposal which have different voting periods or tallying logic. +type ProposalType int32 + +const ( + // PROPOSAL_TYPE_UNSPECIFIED defines no proposal type, which fallback to PROPOSAL_TYPE_STANDARD. + ProposalType_PROPOSAL_TYPE_UNSPECIFIED ProposalType = 0 + // PROPOSAL_TYPE_STANDARD defines the type for a standard proposal. + ProposalType_PROPOSAL_TYPE_STANDARD ProposalType = 1 + // PROPOSAL_TYPE_MULTIPLE_CHOICE defines the type for a multiple choice proposal. + ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE ProposalType = 2 + // PROPOSAL_TYPE_OPTIMISTIC defines the type for an optimistic proposal. + ProposalType_PROPOSAL_TYPE_OPTIMISTIC ProposalType = 3 + // PROPOSAL_TYPE_EXPEDITED defines the type for an expedited proposal. + ProposalType_PROPOSAL_TYPE_EXPEDITED ProposalType = 4 +) + +// Enum value maps for ProposalType. +var ( + ProposalType_name = map[int32]string{ + 0: "PROPOSAL_TYPE_UNSPECIFIED", + 1: "PROPOSAL_TYPE_STANDARD", + 2: "PROPOSAL_TYPE_MULTIPLE_CHOICE", + 3: "PROPOSAL_TYPE_OPTIMISTIC", + 4: "PROPOSAL_TYPE_EXPEDITED", + } + ProposalType_value = map[string]int32{ + "PROPOSAL_TYPE_UNSPECIFIED": 0, + "PROPOSAL_TYPE_STANDARD": 1, + "PROPOSAL_TYPE_MULTIPLE_CHOICE": 2, + "PROPOSAL_TYPE_OPTIMISTIC": 3, + "PROPOSAL_TYPE_EXPEDITED": 4, + } +) + +func (x ProposalType) Enum() *ProposalType { + p := new(ProposalType) + *p = x + return p +} + +func (x ProposalType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProposalType) Descriptor() protoreflect.EnumDescriptor { + return file_cosmos_gov_v1_gov_proto_enumTypes[0].Descriptor() +} + +func (ProposalType) Type() protoreflect.EnumType { + return &file_cosmos_gov_v1_gov_proto_enumTypes[0] +} + +func (x ProposalType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ProposalType.Descriptor instead. +func (ProposalType) EnumDescriptor() ([]byte, []int) { + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{0} +} + // VoteOption enumerates the valid vote options for a given governance proposal. type VoteOption int32 const ( // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. VoteOption_VOTE_OPTION_UNSPECIFIED VoteOption = 0 - // VOTE_OPTION_YES defines a yes vote option. + // VOTE_OPTION_ONE defines the first proposal vote option. + VoteOption_VOTE_OPTION_ONE VoteOption = 1 + // VOTE_OPTION_YES defines the yes proposal vote option. VoteOption_VOTE_OPTION_YES VoteOption = 1 - // VOTE_OPTION_ABSTAIN defines an abstain vote option. + // VOTE_OPTION_TWO defines the second proposal vote option. + VoteOption_VOTE_OPTION_TWO VoteOption = 2 + // VOTE_OPTION_ABSTAIN defines the abstain proposal vote option. VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 - // VOTE_OPTION_NO defines a no vote option. + // VOTE_OPTION_THREE defines the third proposal vote option. + VoteOption_VOTE_OPTION_THREE VoteOption = 3 + // VOTE_OPTION_NO defines the no proposal vote option. VoteOption_VOTE_OPTION_NO VoteOption = 3 - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + // VOTE_OPTION_FOUR defines the fourth proposal vote option. + VoteOption_VOTE_OPTION_FOUR VoteOption = 4 + // VOTE_OPTION_NO_WITH_VETO defines the no with veto proposal vote option. VoteOption_VOTE_OPTION_NO_WITH_VETO VoteOption = 4 + // VOTE_OPTION_SPAM defines the spam proposal vote option. + VoteOption_VOTE_OPTION_SPAM VoteOption = 5 ) // Enum value maps for VoteOption. var ( VoteOption_name = map[int32]string{ 0: "VOTE_OPTION_UNSPECIFIED", - 1: "VOTE_OPTION_YES", - 2: "VOTE_OPTION_ABSTAIN", - 3: "VOTE_OPTION_NO", - 4: "VOTE_OPTION_NO_WITH_VETO", + 1: "VOTE_OPTION_ONE", + // Duplicate value: 1: "VOTE_OPTION_YES", + 2: "VOTE_OPTION_TWO", + // Duplicate value: 2: "VOTE_OPTION_ABSTAIN", + 3: "VOTE_OPTION_THREE", + // Duplicate value: 3: "VOTE_OPTION_NO", + 4: "VOTE_OPTION_FOUR", + // Duplicate value: 4: "VOTE_OPTION_NO_WITH_VETO", + 5: "VOTE_OPTION_SPAM", } VoteOption_value = map[string]int32{ "VOTE_OPTION_UNSPECIFIED": 0, + "VOTE_OPTION_ONE": 1, "VOTE_OPTION_YES": 1, + "VOTE_OPTION_TWO": 2, "VOTE_OPTION_ABSTAIN": 2, + "VOTE_OPTION_THREE": 3, "VOTE_OPTION_NO": 3, + "VOTE_OPTION_FOUR": 4, "VOTE_OPTION_NO_WITH_VETO": 4, + "VOTE_OPTION_SPAM": 5, } ) @@ -7033,11 +7229,11 @@ func (x VoteOption) String() string { } func (VoteOption) Descriptor() protoreflect.EnumDescriptor { - return file_cosmos_gov_v1_gov_proto_enumTypes[0].Descriptor() + return file_cosmos_gov_v1_gov_proto_enumTypes[1].Descriptor() } func (VoteOption) Type() protoreflect.EnumType { - return &file_cosmos_gov_v1_gov_proto_enumTypes[0] + return &file_cosmos_gov_v1_gov_proto_enumTypes[1] } func (x VoteOption) Number() protoreflect.EnumNumber { @@ -7046,7 +7242,7 @@ func (x VoteOption) Number() protoreflect.EnumNumber { // Deprecated: Use VoteOption.Descriptor instead. func (VoteOption) EnumDescriptor() ([]byte, []int) { - return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{0} + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{1} } // ProposalStatus enumerates the valid statuses of a proposal. @@ -7103,11 +7299,11 @@ func (x ProposalStatus) String() string { } func (ProposalStatus) Descriptor() protoreflect.EnumDescriptor { - return file_cosmos_gov_v1_gov_proto_enumTypes[1].Descriptor() + return file_cosmos_gov_v1_gov_proto_enumTypes[2].Descriptor() } func (ProposalStatus) Type() protoreflect.EnumType { - return &file_cosmos_gov_v1_gov_proto_enumTypes[1] + return &file_cosmos_gov_v1_gov_proto_enumTypes[2] } func (x ProposalStatus) Number() protoreflect.EnumNumber { @@ -7116,7 +7312,7 @@ func (x ProposalStatus) Number() protoreflect.EnumNumber { // Deprecated: Use ProposalStatus.Descriptor instead. func (ProposalStatus) EnumDescriptor() ([]byte, []int) { - return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{1} + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{2} } // WeightedVoteOption defines a unit of vote for vote split. @@ -7266,11 +7462,18 @@ type Proposal struct { // expedited defines if the proposal is expedited // // Since: cosmos-sdk 0.50 + // Deprecated: Use ProposalType instead. + // + // Deprecated: Do not use. Expedited bool `protobuf:"varint,14,opt,name=expedited,proto3" json:"expedited,omitempty"` // failed_reason defines the reason why the proposal failed // // Since: cosmos-sdk 0.50 FailedReason string `protobuf:"bytes,15,opt,name=failed_reason,json=failedReason,proto3" json:"failed_reason,omitempty"` + // proposal_type defines the type of the proposal + // + // Since: cosmos-sdk 0.51 + ProposalType ProposalType `protobuf:"varint,16,opt,name=proposal_type,json=proposalType,proto3,enum=cosmos.gov.v1.ProposalType" json:"proposal_type,omitempty"` } func (x *Proposal) Reset() { @@ -7384,6 +7587,7 @@ func (x *Proposal) GetProposer() string { return "" } +// Deprecated: Do not use. func (x *Proposal) GetExpedited() bool { if x != nil { return x.Expedited @@ -7398,6 +7602,13 @@ func (x *Proposal) GetFailedReason() string { return "" } +func (x *Proposal) GetProposalType() ProposalType { + if x != nil { + return x.ProposalType + } + return ProposalType_PROPOSAL_TYPE_UNSPECIFIED +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { state protoimpl.MessageState @@ -7405,13 +7616,15 @@ type TallyResult struct { unknownFields protoimpl.UnknownFields // yes_count is the number of yes votes on a proposal. - YesCount string `protobuf:"bytes,1,opt,name=yes_count,json=yesCount,proto3" json:"yes_count,omitempty"` + YesCount string `protobuf:"bytes,1,opt,name=yes_count,json=yesCount,proto3" json:"yes_count,omitempty"` // option 1 // abstain_count is the number of abstain votes on a proposal. - AbstainCount string `protobuf:"bytes,2,opt,name=abstain_count,json=abstainCount,proto3" json:"abstain_count,omitempty"` + AbstainCount string `protobuf:"bytes,2,opt,name=abstain_count,json=abstainCount,proto3" json:"abstain_count,omitempty"` // option 2 // no_count is the number of no votes on a proposal. - NoCount string `protobuf:"bytes,3,opt,name=no_count,json=noCount,proto3" json:"no_count,omitempty"` + NoCount string `protobuf:"bytes,3,opt,name=no_count,json=noCount,proto3" json:"no_count,omitempty"` // option 3 // no_with_veto_count is the number of no with veto votes on a proposal. - NoWithVetoCount string `protobuf:"bytes,4,opt,name=no_with_veto_count,json=noWithVetoCount,proto3" json:"no_with_veto_count,omitempty"` + NoWithVetoCount string `protobuf:"bytes,4,opt,name=no_with_veto_count,json=noWithVetoCount,proto3" json:"no_with_veto_count,omitempty"` // option 4 + // spam_count is the number of spam votes on a proposal. + SpamCount string `protobuf:"bytes,5,opt,name=spam_count,json=spamCount,proto3" json:"spam_count,omitempty"` } func (x *TallyResult) Reset() { @@ -7462,6 +7675,13 @@ func (x *TallyResult) GetNoWithVetoCount() string { return "" } +func (x *TallyResult) GetSpamCount() string { + if x != nil { + return x.SpamCount + } + return "" +} + // Vote defines a vote on a governance proposal. // A Vote consists of a proposal ID, the voter, and the vote option. type Vote struct { @@ -7899,7 +8119,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x84, 0x06, 0x0a, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xca, 0x06, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, @@ -7944,139 +8164,164 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x12, 0x23, - 0x0a, 0x0d, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x22, 0xd7, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x79, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x79, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x33, 0x0a, 0x0d, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x6e, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x3b, 0x0a, 0x12, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76, 0x65, 0x74, 0x6f, - 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, - 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0f, 0x6e, 0x6f, - 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb6, 0x01, - 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, - 0x64, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xdd, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, - 0x1f, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, - 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x12, 0x6d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xea, 0xde, 0x1f, 0x1c, - 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, - 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x58, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, - 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, - 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, - 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x12, 0x20, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, + 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x22, 0x86, 0x02, 0x0a, 0x0b, 0x54, 0x61, + 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x79, 0x65, 0x73, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, + 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x79, 0x65, + 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x0d, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, + 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, 0x61, + 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x6e, + 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x6e, + 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x12, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, + 0x68, 0x5f, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, + 0x6e, 0x74, 0x52, 0x0f, 0x6e, 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x73, 0x70, 0x61, 0x6d, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x09, 0x73, 0x70, 0x61, 0x6d, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0xb6, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, + 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xdd, 0x01, 0x0a, 0x0d, + 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, + 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x1d, 0xc8, + 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, + 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x24, 0xea, 0xde, 0x1f, 0x1c, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, + 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x58, 0x0a, 0x0c, 0x56, + 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, + 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, + 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, + 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, - 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, - 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, - 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0x8f, 0x08, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, 0x0b, - 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, - 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, - 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, - 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, - 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, - 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x05, 0x20, + 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, + 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, - 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x19, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x69, - 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x69, - 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, - 0x12, 0x42, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x13, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, - 0x61, 0x74, 0x69, 0x6f, 0x12, 0x4a, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x12, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x74, - 0x12, 0x57, 0x0a, 0x17, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x6f, - 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, - 0x1f, 0x01, 0x52, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, - 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x78, 0x70, - 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, - 0x64, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x58, 0x0a, 0x15, 0x65, 0x78, - 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x13, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, - 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, - 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x41, - 0x0a, 0x1d, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x62, 0x75, 0x72, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x72, 0x65, 0x76, 0x6f, 0x74, - 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x76, - 0x65, 0x74, 0x6f, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x62, 0x75, 0x72, 0x6e, 0x56, - 0x6f, 0x74, 0x65, 0x56, 0x65, 0x74, 0x6f, 0x12, 0x3a, 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x5f, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, - 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, - 0x74, 0x69, 0x6f, 0x2a, 0x89, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, - 0x45, 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, + 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, + 0x6c, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x8f, 0x08, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x6d, 0x69, + 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, + 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, + 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, + 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, + 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, + 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x19, 0x6d, 0x69, + 0x6e, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x6d, + 0x69, 0x6e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x42, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x4a, 0x0a, 0x14, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x64, 0x65, 0x73, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x44, 0x65, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x17, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, + 0x65, 0x64, 0x5f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, + 0x65, 0x64, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x3f, + 0x0a, 0x13, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x65, 0x78, 0x70, + 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, + 0x58, 0x0a, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, + 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x4d, + 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x75, 0x72, + 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x51, 0x75, 0x6f, + 0x72, 0x75, 0x6d, 0x12, 0x41, 0x0a, 0x1d, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, + 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x62, 0x75, 0x72, 0x6e, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, + 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, + 0x6f, 0x74, 0x65, 0x5f, 0x76, 0x65, 0x74, 0x6f, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, + 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x56, 0x65, 0x74, 0x6f, 0x12, 0x3a, 0x0a, 0x11, + 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x2a, 0xa7, 0x01, 0x0a, 0x0c, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x50, 0x52, 0x4f, + 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, + 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, + 0x52, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x50, 0x4c, 0x45, 0x5f, 0x43, + 0x48, 0x4f, 0x49, 0x43, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4d, 0x49, 0x53, + 0x54, 0x49, 0x43, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, + 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x50, 0x45, 0x44, 0x49, 0x54, 0x45, 0x44, + 0x10, 0x04, 0x2a, 0xfa, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, + 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x4e, + 0x45, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, + 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x12, 0x17, 0x0a, + 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, + 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, + 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x45, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, - 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x2a, + 0x03, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x46, 0x4f, 0x55, 0x52, 0x10, 0x04, 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, + 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, + 0x45, 0x54, 0x4f, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x50, 0x41, 0x4d, 0x10, 0x05, 0x1a, 0x02, 0x10, 0x01, 0x2a, 0xce, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, @@ -8115,50 +8360,52 @@ func file_cosmos_gov_v1_gov_proto_rawDescGZIP() []byte { return file_cosmos_gov_v1_gov_proto_rawDescData } -var file_cosmos_gov_v1_gov_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_cosmos_gov_v1_gov_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_cosmos_gov_v1_gov_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_cosmos_gov_v1_gov_proto_goTypes = []interface{}{ - (VoteOption)(0), // 0: cosmos.gov.v1.VoteOption - (ProposalStatus)(0), // 1: cosmos.gov.v1.ProposalStatus - (*WeightedVoteOption)(nil), // 2: cosmos.gov.v1.WeightedVoteOption - (*Deposit)(nil), // 3: cosmos.gov.v1.Deposit - (*Proposal)(nil), // 4: cosmos.gov.v1.Proposal - (*TallyResult)(nil), // 5: cosmos.gov.v1.TallyResult - (*Vote)(nil), // 6: cosmos.gov.v1.Vote - (*DepositParams)(nil), // 7: cosmos.gov.v1.DepositParams - (*VotingParams)(nil), // 8: cosmos.gov.v1.VotingParams - (*TallyParams)(nil), // 9: cosmos.gov.v1.TallyParams - (*Params)(nil), // 10: cosmos.gov.v1.Params - (*v1beta1.Coin)(nil), // 11: cosmos.base.v1beta1.Coin - (*anypb.Any)(nil), // 12: google.protobuf.Any - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 14: google.protobuf.Duration + (ProposalType)(0), // 0: cosmos.gov.v1.ProposalType + (VoteOption)(0), // 1: cosmos.gov.v1.VoteOption + (ProposalStatus)(0), // 2: cosmos.gov.v1.ProposalStatus + (*WeightedVoteOption)(nil), // 3: cosmos.gov.v1.WeightedVoteOption + (*Deposit)(nil), // 4: cosmos.gov.v1.Deposit + (*Proposal)(nil), // 5: cosmos.gov.v1.Proposal + (*TallyResult)(nil), // 6: cosmos.gov.v1.TallyResult + (*Vote)(nil), // 7: cosmos.gov.v1.Vote + (*DepositParams)(nil), // 8: cosmos.gov.v1.DepositParams + (*VotingParams)(nil), // 9: cosmos.gov.v1.VotingParams + (*TallyParams)(nil), // 10: cosmos.gov.v1.TallyParams + (*Params)(nil), // 11: cosmos.gov.v1.Params + (*v1beta1.Coin)(nil), // 12: cosmos.base.v1beta1.Coin + (*anypb.Any)(nil), // 13: google.protobuf.Any + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 15: google.protobuf.Duration } var file_cosmos_gov_v1_gov_proto_depIdxs = []int32{ - 0, // 0: cosmos.gov.v1.WeightedVoteOption.option:type_name -> cosmos.gov.v1.VoteOption - 11, // 1: cosmos.gov.v1.Deposit.amount:type_name -> cosmos.base.v1beta1.Coin - 12, // 2: cosmos.gov.v1.Proposal.messages:type_name -> google.protobuf.Any - 1, // 3: cosmos.gov.v1.Proposal.status:type_name -> cosmos.gov.v1.ProposalStatus - 5, // 4: cosmos.gov.v1.Proposal.final_tally_result:type_name -> cosmos.gov.v1.TallyResult - 13, // 5: cosmos.gov.v1.Proposal.submit_time:type_name -> google.protobuf.Timestamp - 13, // 6: cosmos.gov.v1.Proposal.deposit_end_time:type_name -> google.protobuf.Timestamp - 11, // 7: cosmos.gov.v1.Proposal.total_deposit:type_name -> cosmos.base.v1beta1.Coin - 13, // 8: cosmos.gov.v1.Proposal.voting_start_time:type_name -> google.protobuf.Timestamp - 13, // 9: cosmos.gov.v1.Proposal.voting_end_time:type_name -> google.protobuf.Timestamp - 2, // 10: cosmos.gov.v1.Vote.options:type_name -> cosmos.gov.v1.WeightedVoteOption - 11, // 11: cosmos.gov.v1.DepositParams.min_deposit:type_name -> cosmos.base.v1beta1.Coin - 14, // 12: cosmos.gov.v1.DepositParams.max_deposit_period:type_name -> google.protobuf.Duration - 14, // 13: cosmos.gov.v1.VotingParams.voting_period:type_name -> google.protobuf.Duration - 11, // 14: cosmos.gov.v1.Params.min_deposit:type_name -> cosmos.base.v1beta1.Coin - 14, // 15: cosmos.gov.v1.Params.max_deposit_period:type_name -> google.protobuf.Duration - 14, // 16: cosmos.gov.v1.Params.voting_period:type_name -> google.protobuf.Duration - 14, // 17: cosmos.gov.v1.Params.expedited_voting_period:type_name -> google.protobuf.Duration - 11, // 18: cosmos.gov.v1.Params.expedited_min_deposit:type_name -> cosmos.base.v1beta1.Coin - 19, // [19:19] is the sub-list for method output_type - 19, // [19:19] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 1, // 0: cosmos.gov.v1.WeightedVoteOption.option:type_name -> cosmos.gov.v1.VoteOption + 12, // 1: cosmos.gov.v1.Deposit.amount:type_name -> cosmos.base.v1beta1.Coin + 13, // 2: cosmos.gov.v1.Proposal.messages:type_name -> google.protobuf.Any + 2, // 3: cosmos.gov.v1.Proposal.status:type_name -> cosmos.gov.v1.ProposalStatus + 6, // 4: cosmos.gov.v1.Proposal.final_tally_result:type_name -> cosmos.gov.v1.TallyResult + 14, // 5: cosmos.gov.v1.Proposal.submit_time:type_name -> google.protobuf.Timestamp + 14, // 6: cosmos.gov.v1.Proposal.deposit_end_time:type_name -> google.protobuf.Timestamp + 12, // 7: cosmos.gov.v1.Proposal.total_deposit:type_name -> cosmos.base.v1beta1.Coin + 14, // 8: cosmos.gov.v1.Proposal.voting_start_time:type_name -> google.protobuf.Timestamp + 14, // 9: cosmos.gov.v1.Proposal.voting_end_time:type_name -> google.protobuf.Timestamp + 0, // 10: cosmos.gov.v1.Proposal.proposal_type:type_name -> cosmos.gov.v1.ProposalType + 3, // 11: cosmos.gov.v1.Vote.options:type_name -> cosmos.gov.v1.WeightedVoteOption + 12, // 12: cosmos.gov.v1.DepositParams.min_deposit:type_name -> cosmos.base.v1beta1.Coin + 15, // 13: cosmos.gov.v1.DepositParams.max_deposit_period:type_name -> google.protobuf.Duration + 15, // 14: cosmos.gov.v1.VotingParams.voting_period:type_name -> google.protobuf.Duration + 12, // 15: cosmos.gov.v1.Params.min_deposit:type_name -> cosmos.base.v1beta1.Coin + 15, // 16: cosmos.gov.v1.Params.max_deposit_period:type_name -> google.protobuf.Duration + 15, // 17: cosmos.gov.v1.Params.voting_period:type_name -> google.protobuf.Duration + 15, // 18: cosmos.gov.v1.Params.expedited_voting_period:type_name -> google.protobuf.Duration + 12, // 19: cosmos.gov.v1.Params.expedited_min_deposit:type_name -> cosmos.base.v1beta1.Coin + 20, // [20:20] is the sub-list for method output_type + 20, // [20:20] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_cosmos_gov_v1_gov_proto_init() } @@ -8281,7 +8528,7 @@ func file_cosmos_gov_v1_gov_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_gov_v1_gov_proto_rawDesc, - NumEnums: 2, + NumEnums: 3, NumMessages: 9, NumExtensions: 0, NumServices: 0, diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 1f4fd832f946..89d043090cbf 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -130,6 +130,7 @@ var ( fd_MsgSubmitProposal_title protoreflect.FieldDescriptor fd_MsgSubmitProposal_summary protoreflect.FieldDescriptor fd_MsgSubmitProposal_expedited protoreflect.FieldDescriptor + fd_MsgSubmitProposal_proposal_type protoreflect.FieldDescriptor ) func init() { @@ -142,6 +143,7 @@ func init() { fd_MsgSubmitProposal_title = md_MsgSubmitProposal.Fields().ByName("title") fd_MsgSubmitProposal_summary = md_MsgSubmitProposal.Fields().ByName("summary") fd_MsgSubmitProposal_expedited = md_MsgSubmitProposal.Fields().ByName("expedited") + fd_MsgSubmitProposal_proposal_type = md_MsgSubmitProposal.Fields().ByName("proposal_type") } var _ protoreflect.Message = (*fastReflection_MsgSubmitProposal)(nil) @@ -251,6 +253,12 @@ func (x *fastReflection_MsgSubmitProposal) Range(f func(protoreflect.FieldDescri return } } + if x.ProposalType != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.ProposalType)) + if !f(fd_MsgSubmitProposal_proposal_type, value) { + return + } + } } // Has reports whether a field is populated. @@ -280,6 +288,8 @@ func (x *fastReflection_MsgSubmitProposal) Has(fd protoreflect.FieldDescriptor) return x.Summary != "" case "cosmos.gov.v1.MsgSubmitProposal.expedited": return x.Expedited != false + case "cosmos.gov.v1.MsgSubmitProposal.proposal_type": + return x.ProposalType != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -310,6 +320,8 @@ func (x *fastReflection_MsgSubmitProposal) Clear(fd protoreflect.FieldDescriptor x.Summary = "" case "cosmos.gov.v1.MsgSubmitProposal.expedited": x.Expedited = false + case "cosmos.gov.v1.MsgSubmitProposal.proposal_type": + x.ProposalType = 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -353,6 +365,9 @@ func (x *fastReflection_MsgSubmitProposal) Get(descriptor protoreflect.FieldDesc case "cosmos.gov.v1.MsgSubmitProposal.expedited": value := x.Expedited return protoreflect.ValueOfBool(value) + case "cosmos.gov.v1.MsgSubmitProposal.proposal_type": + value := x.ProposalType + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -391,6 +406,8 @@ func (x *fastReflection_MsgSubmitProposal) Set(fd protoreflect.FieldDescriptor, x.Summary = value.Interface().(string) case "cosmos.gov.v1.MsgSubmitProposal.expedited": x.Expedited = value.Bool() + case "cosmos.gov.v1.MsgSubmitProposal.proposal_type": + x.ProposalType = (ProposalType)(value.Enum()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -433,6 +450,8 @@ func (x *fastReflection_MsgSubmitProposal) Mutable(fd protoreflect.FieldDescript panic(fmt.Errorf("field summary of message cosmos.gov.v1.MsgSubmitProposal is not mutable")) case "cosmos.gov.v1.MsgSubmitProposal.expedited": panic(fmt.Errorf("field expedited of message cosmos.gov.v1.MsgSubmitProposal is not mutable")) + case "cosmos.gov.v1.MsgSubmitProposal.proposal_type": + panic(fmt.Errorf("field proposal_type of message cosmos.gov.v1.MsgSubmitProposal is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -462,6 +481,8 @@ func (x *fastReflection_MsgSubmitProposal) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfString("") case "cosmos.gov.v1.MsgSubmitProposal.expedited": return protoreflect.ValueOfBool(false) + case "cosmos.gov.v1.MsgSubmitProposal.proposal_type": + return protoreflect.ValueOfEnum(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -562,6 +583,9 @@ func (x *fastReflection_MsgSubmitProposal) ProtoMethods() *protoiface.Methods { if x.Expedited { n += 2 } + if x.ProposalType != 0 { + n += 1 + runtime.Sov(uint64(x.ProposalType)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -591,6 +615,11 @@ func (x *fastReflection_MsgSubmitProposal) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.ProposalType != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ProposalType)) + i-- + dAtA[i] = 0x40 + } if x.Expedited { i-- if x.Expedited { @@ -926,6 +955,25 @@ func (x *fastReflection_MsgSubmitProposal) ProtoMethods() *protoiface.Methods { } } x.Expedited = bool(v != 0) + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalType", wireType) + } + x.ProposalType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ProposalType |= ProposalType(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -7039,7 +7087,17 @@ type MsgSubmitProposal struct { // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 + // Deprecated: Use the PROPOSAL_TYPE_EXPEDITED proposal type instead. + // When this field is set and no proposal_type is set, the proposal_type + // will be set to PROPOSAL_TYPE_EXPEDITED for backwards compatibility. + // + // Deprecated: Do not use. Expedited bool `protobuf:"varint,7,opt,name=expedited,proto3" json:"expedited,omitempty"` + // proposal_type defines the type of proposal + // When not set defaults to PROPOSAL_TYPE_STANDARD + // + // Since: cosmos-sdk 0.51 + ProposalType ProposalType `protobuf:"varint,8,opt,name=proposal_type,json=proposalType,proto3,enum=cosmos.gov.v1.ProposalType" json:"proposal_type,omitempty"` } func (x *MsgSubmitProposal) Reset() { @@ -7104,6 +7162,7 @@ func (x *MsgSubmitProposal) GetSummary() string { return "" } +// Deprecated: Do not use. func (x *MsgSubmitProposal) GetExpedited() bool { if x != nil { return x.Expedited @@ -7111,6 +7170,13 @@ func (x *MsgSubmitProposal) GetExpedited() bool { return false } +func (x *MsgSubmitProposal) GetProposalType() ProposalType { + if x != nil { + return x.ProposalType + } + return ProposalType_PROPOSAL_TYPE_UNSPECIFIED +} + // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. type MsgSubmitProposalResponse struct { state protoimpl.MessageState @@ -7690,7 +7756,7 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x03, 0x0a, 0x11, 0x4d, 0x73, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xeb, 0x03, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, @@ -7712,162 +7778,167 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x3a, 0x31, - 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x8a, 0xe7, 0xb0, - 0x2a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, - 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x22, 0x3c, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, - 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x22, - 0xbb, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, - 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, - 0x1e, 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, - 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x35, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, - 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x1e, 0x0a, - 0x1c, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe5, 0x01, - 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, - 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, - 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, - 0x12, 0x31, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, - 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, - 0x24, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x15, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, - 0x67, 0x56, 0x6f, 0x74, 0x65, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xff, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, - 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x0b, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, - 0x69, 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, - 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, - 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x2c, 0x82, 0xe7, - 0xb0, 0x2a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x1d, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x56, 0x6f, - 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, - 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe6, 0x01, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x0b, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, - 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x3a, 0x2b, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, - 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x22, 0x14, - 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x12, 0x38, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x36, 0x82, 0xe7, 0xb0, 0x2a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x2f, - 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8a, 0x01, - 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x12, 0x30, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, - 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x22, 0xc1, 0x01, 0x0a, 0x19, 0x4d, - 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0f, 0xea, - 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x52, 0x0a, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x0d, 0x63, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, - 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, - 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, - 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x32, 0xe8, - 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, + 0x12, 0x20, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, + 0x65, 0x64, 0x12, 0x40, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x54, 0x79, 0x70, 0x65, 0x3a, 0x31, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0x3c, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x11, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, - 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x2b, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x49, 0x64, 0x22, 0xbb, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x4e, + 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x1e, 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, + 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x35, 0x82, 0xe7, + 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, + 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x56, - 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x1e, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, - 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x56, - 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, - 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x1a, 0x26, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, - 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x19, + 0x65, 0x6e, 0x74, 0x22, 0x1e, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0xe5, 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x12, + 0x35, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x24, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x76, 0x6f, 0x74, 0x65, + 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x22, 0x11, 0x0a, 0x0f, 0x4d, + 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xff, + 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x65, 0x64, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x3a, 0x2c, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x8a, 0xe7, + 0xb0, 0x2a, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, + 0x2f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, + 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe6, 0x01, 0x0a, 0x0a, + 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x14, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, + 0x64, 0x12, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x2b, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x0f, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, + 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x38, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, + 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x3a, 0x36, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, + 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x8a, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x30, 0x0a, 0x0b, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0f, + 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x52, + 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x3a, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, + 0x22, 0xc1, 0x01, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, + 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x5f, 0x69, 0x64, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, + 0x12, 0x49, 0x0a, 0x0d, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x63, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x63, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x48, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x32, 0xe8, 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0e, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x26, 0x2e, 0x63, + 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x11, 0x45, 0x78, + 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, + 0x65, 0x1a, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, + 0x64, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, + 0x64, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x07, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x12, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, + 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0e, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x98, 0x01, 0x0a, 0x11, 0x63, 0x6f, - 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, + 0x98, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, + 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -7900,39 +7971,41 @@ var file_cosmos_gov_v1_tx_proto_goTypes = []interface{}{ (*MsgCancelProposalResponse)(nil), // 13: cosmos.gov.v1.MsgCancelProposalResponse (*anypb.Any)(nil), // 14: google.protobuf.Any (*v1beta1.Coin)(nil), // 15: cosmos.base.v1beta1.Coin - (VoteOption)(0), // 16: cosmos.gov.v1.VoteOption - (*WeightedVoteOption)(nil), // 17: cosmos.gov.v1.WeightedVoteOption - (*Params)(nil), // 18: cosmos.gov.v1.Params - (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp + (ProposalType)(0), // 16: cosmos.gov.v1.ProposalType + (VoteOption)(0), // 17: cosmos.gov.v1.VoteOption + (*WeightedVoteOption)(nil), // 18: cosmos.gov.v1.WeightedVoteOption + (*Params)(nil), // 19: cosmos.gov.v1.Params + (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp } var file_cosmos_gov_v1_tx_proto_depIdxs = []int32{ 14, // 0: cosmos.gov.v1.MsgSubmitProposal.messages:type_name -> google.protobuf.Any 15, // 1: cosmos.gov.v1.MsgSubmitProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin - 14, // 2: cosmos.gov.v1.MsgExecLegacyContent.content:type_name -> google.protobuf.Any - 16, // 3: cosmos.gov.v1.MsgVote.option:type_name -> cosmos.gov.v1.VoteOption - 17, // 4: cosmos.gov.v1.MsgVoteWeighted.options:type_name -> cosmos.gov.v1.WeightedVoteOption - 15, // 5: cosmos.gov.v1.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin - 18, // 6: cosmos.gov.v1.MsgUpdateParams.params:type_name -> cosmos.gov.v1.Params - 19, // 7: cosmos.gov.v1.MsgCancelProposalResponse.canceled_time:type_name -> google.protobuf.Timestamp - 0, // 8: cosmos.gov.v1.Msg.SubmitProposal:input_type -> cosmos.gov.v1.MsgSubmitProposal - 2, // 9: cosmos.gov.v1.Msg.ExecLegacyContent:input_type -> cosmos.gov.v1.MsgExecLegacyContent - 4, // 10: cosmos.gov.v1.Msg.Vote:input_type -> cosmos.gov.v1.MsgVote - 6, // 11: cosmos.gov.v1.Msg.VoteWeighted:input_type -> cosmos.gov.v1.MsgVoteWeighted - 8, // 12: cosmos.gov.v1.Msg.Deposit:input_type -> cosmos.gov.v1.MsgDeposit - 10, // 13: cosmos.gov.v1.Msg.UpdateParams:input_type -> cosmos.gov.v1.MsgUpdateParams - 12, // 14: cosmos.gov.v1.Msg.CancelProposal:input_type -> cosmos.gov.v1.MsgCancelProposal - 1, // 15: cosmos.gov.v1.Msg.SubmitProposal:output_type -> cosmos.gov.v1.MsgSubmitProposalResponse - 3, // 16: cosmos.gov.v1.Msg.ExecLegacyContent:output_type -> cosmos.gov.v1.MsgExecLegacyContentResponse - 5, // 17: cosmos.gov.v1.Msg.Vote:output_type -> cosmos.gov.v1.MsgVoteResponse - 7, // 18: cosmos.gov.v1.Msg.VoteWeighted:output_type -> cosmos.gov.v1.MsgVoteWeightedResponse - 9, // 19: cosmos.gov.v1.Msg.Deposit:output_type -> cosmos.gov.v1.MsgDepositResponse - 11, // 20: cosmos.gov.v1.Msg.UpdateParams:output_type -> cosmos.gov.v1.MsgUpdateParamsResponse - 13, // 21: cosmos.gov.v1.Msg.CancelProposal:output_type -> cosmos.gov.v1.MsgCancelProposalResponse - 15, // [15:22] is the sub-list for method output_type - 8, // [8:15] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 16, // 2: cosmos.gov.v1.MsgSubmitProposal.proposal_type:type_name -> cosmos.gov.v1.ProposalType + 14, // 3: cosmos.gov.v1.MsgExecLegacyContent.content:type_name -> google.protobuf.Any + 17, // 4: cosmos.gov.v1.MsgVote.option:type_name -> cosmos.gov.v1.VoteOption + 18, // 5: cosmos.gov.v1.MsgVoteWeighted.options:type_name -> cosmos.gov.v1.WeightedVoteOption + 15, // 6: cosmos.gov.v1.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin + 19, // 7: cosmos.gov.v1.MsgUpdateParams.params:type_name -> cosmos.gov.v1.Params + 20, // 8: cosmos.gov.v1.MsgCancelProposalResponse.canceled_time:type_name -> google.protobuf.Timestamp + 0, // 9: cosmos.gov.v1.Msg.SubmitProposal:input_type -> cosmos.gov.v1.MsgSubmitProposal + 2, // 10: cosmos.gov.v1.Msg.ExecLegacyContent:input_type -> cosmos.gov.v1.MsgExecLegacyContent + 4, // 11: cosmos.gov.v1.Msg.Vote:input_type -> cosmos.gov.v1.MsgVote + 6, // 12: cosmos.gov.v1.Msg.VoteWeighted:input_type -> cosmos.gov.v1.MsgVoteWeighted + 8, // 13: cosmos.gov.v1.Msg.Deposit:input_type -> cosmos.gov.v1.MsgDeposit + 10, // 14: cosmos.gov.v1.Msg.UpdateParams:input_type -> cosmos.gov.v1.MsgUpdateParams + 12, // 15: cosmos.gov.v1.Msg.CancelProposal:input_type -> cosmos.gov.v1.MsgCancelProposal + 1, // 16: cosmos.gov.v1.Msg.SubmitProposal:output_type -> cosmos.gov.v1.MsgSubmitProposalResponse + 3, // 17: cosmos.gov.v1.Msg.ExecLegacyContent:output_type -> cosmos.gov.v1.MsgExecLegacyContentResponse + 5, // 18: cosmos.gov.v1.Msg.Vote:output_type -> cosmos.gov.v1.MsgVoteResponse + 7, // 19: cosmos.gov.v1.Msg.VoteWeighted:output_type -> cosmos.gov.v1.MsgVoteWeightedResponse + 9, // 20: cosmos.gov.v1.Msg.Deposit:output_type -> cosmos.gov.v1.MsgDepositResponse + 11, // 21: cosmos.gov.v1.Msg.UpdateParams:output_type -> cosmos.gov.v1.MsgUpdateParamsResponse + 13, // 22: cosmos.gov.v1.Msg.CancelProposal:output_type -> cosmos.gov.v1.MsgCancelProposalResponse + 16, // [16:23] is the sub-list for method output_type + 9, // [9:16] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_cosmos_gov_v1_tx_proto_init() } diff --git a/proto/buf.yaml b/proto/buf.yaml index 4e05b2f00335..cebaa25e5ce2 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -20,5 +20,6 @@ lint: - SERVICE_SUFFIX - PACKAGE_VERSION_SUFFIX - RPC_REQUEST_STANDARD_NAME + - ENUM_NO_ALLOW_ALIAS ignore: - tendermint diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 8ab849500d00..e270086ab2ae 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -12,18 +12,45 @@ import "amino/amino.proto"; option go_package = "cosmossdk.io/x/gov/types/v1"; +// ProposalType enumerates the valid proposal types. +// All proposal types are v1.Proposal which have different voting periods or tallying logic. +enum ProposalType { + // PROPOSAL_TYPE_UNSPECIFIED defines no proposal type, which fallback to PROPOSAL_TYPE_STANDARD. + PROPOSAL_TYPE_UNSPECIFIED = 0; + // PROPOSAL_TYPE_STANDARD defines the type for a standard proposal. + PROPOSAL_TYPE_STANDARD = 1; + // PROPOSAL_TYPE_MULTIPLE_CHOICE defines the type for a multiple choice proposal. + PROPOSAL_TYPE_MULTIPLE_CHOICE = 2; + // PROPOSAL_TYPE_OPTIMISTIC defines the type for an optimistic proposal. + PROPOSAL_TYPE_OPTIMISTIC = 3; + // PROPOSAL_TYPE_EXPEDITED defines the type for an expedited proposal. + PROPOSAL_TYPE_EXPEDITED = 4; +} + // VoteOption enumerates the valid vote options for a given governance proposal. enum VoteOption { + option allow_alias = true; + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. VOTE_OPTION_UNSPECIFIED = 0; - // VOTE_OPTION_YES defines a yes vote option. + // VOTE_OPTION_ONE defines the first proposal vote option. + VOTE_OPTION_ONE = 1; + // VOTE_OPTION_YES defines the yes proposal vote option. VOTE_OPTION_YES = 1; - // VOTE_OPTION_ABSTAIN defines an abstain vote option. + // VOTE_OPTION_TWO defines the second proposal vote option. + VOTE_OPTION_TWO = 2; + // VOTE_OPTION_ABSTAIN defines the abstain proposal vote option. VOTE_OPTION_ABSTAIN = 2; - // VOTE_OPTION_NO defines a no vote option. + // VOTE_OPTION_THREE defines the third proposal vote option. + VOTE_OPTION_THREE = 3; + // VOTE_OPTION_NO defines the no proposal vote option. VOTE_OPTION_NO = 3; - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + // VOTE_OPTION_FOUR defines the fourth proposal vote option. + VOTE_OPTION_FOUR = 4; + // VOTE_OPTION_NO_WITH_VETO defines the no with veto proposal vote option. VOTE_OPTION_NO_WITH_VETO = 4; + // VOTE_OPTION_SPAM defines the spam proposal vote option. + VOTE_OPTION_SPAM = 5; } // WeightedVoteOption defines a unit of vote for vote split. @@ -102,12 +129,18 @@ message Proposal { // expedited defines if the proposal is expedited // // Since: cosmos-sdk 0.50 - bool expedited = 14; + // Deprecated: Use ProposalType instead. + bool expedited = 14 [deprecated = true]; // failed_reason defines the reason why the proposal failed // // Since: cosmos-sdk 0.50 string failed_reason = 15; + + // proposal_type defines the type of the proposal + // + // Since: cosmos-sdk 0.51 + ProposalType proposal_type = 16; } // ProposalStatus enumerates the valid statuses of a proposal. @@ -134,13 +167,15 @@ enum ProposalStatus { // TallyResult defines a standard tally for a governance proposal. message TallyResult { // yes_count is the number of yes votes on a proposal. - string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"]; + string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"]; // option 1 // abstain_count is the number of abstain votes on a proposal. - string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"]; + string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"]; // option 2 // no_count is the number of no votes on a proposal. - string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"]; + string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"]; // option 3 // no_with_veto_count is the number of no with veto votes on a proposal. - string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"]; + string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"]; // option 4 + // spam_count is the number of spam votes on a proposal. + string spam_count = 5 [(cosmos_proto.scalar) = "cosmos.Int"]; } // Vote defines a vote on a governance proposal. diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 7519a74d1d9e..78577d443d21 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -81,7 +81,16 @@ message MsgSubmitProposal { // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 - bool expedited = 7; + // Deprecated: Use the PROPOSAL_TYPE_EXPEDITED proposal type instead. + // When this field is set and no proposal_type is set, the proposal_type + // will be set to PROPOSAL_TYPE_EXPEDITED for backwards compatibility. + bool expedited = 7 [deprecated = true]; + + // proposal_type defines the type of proposal + // When not set defaults to PROPOSAL_TYPE_STANDARD + // + // Since: cosmos-sdk 0.51 + ProposalType proposal_type = 8; } // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. diff --git a/tests/integration/bank/app_test.go b/tests/integration/bank/app_test.go index f1ef5ef9ed7e..2fc2ad33ff41 100644 --- a/tests/integration/bank/app_test.go +++ b/tests/integration/bank/app_test.go @@ -390,7 +390,7 @@ func TestMsgSetSendEnabled(t *testing.T) { "set default send enabled to true", "Change send enabled", "Modify send enabled and set to true", - false, + govv1.ProposalType_PROPOSAL_TYPE_STANDARD, ) require.NoError(t, err, "making goodGovProp") diff --git a/tests/integration/gov/genesis_test.go b/tests/integration/gov/genesis_test.go index c099e0c838c3..32e41f0998fe 100644 --- a/tests/integration/gov/genesis_test.go +++ b/tests/integration/gov/genesis_test.go @@ -77,11 +77,11 @@ func TestImportExportQueues(t *testing.T) { ctx = s1.app.BaseApp.NewContext(false) // Create two proposals, put the second into the voting period - proposal1, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "test", "description", addrs[0], false) + proposal1, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID1 := proposal1.Id - proposal2, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "test", "description", addrs[0], false) + proposal2, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID2 := proposal2.Id diff --git a/tests/integration/gov/keeper/grpc_query_test.go b/tests/integration/gov/keeper/grpc_query_test.go index 2c3c20cbef72..1cf5056bbf5e 100644 --- a/tests/integration/gov/keeper/grpc_query_test.go +++ b/tests/integration/gov/keeper/grpc_query_test.go @@ -12,128 +12,6 @@ import ( "cosmossdk.io/x/gov/types/v1beta1" ) -func TestGRPCQueryTally(t *testing.T) { - t.Parallel() - f := initFixture(t) - - ctx, queryClient := f.ctx, f.queryClient - - addrs, _ := createValidators(t, f, []int64{5, 5, 5}) - - var ( - req *v1.QueryTallyResultRequest - expRes *v1.QueryTallyResultResponse - proposal v1.Proposal - ) - - testCases := []struct { - msg string - malleate func() - expPass bool - expErrMsg string - }{ - { - "empty request", - func() { - req = &v1.QueryTallyResultRequest{} - }, - false, - "proposal id can not be 0", - }, - { - "zero proposal id request", - func() { - req = &v1.QueryTallyResultRequest{ProposalId: 0} - }, - false, - "proposal id can not be 0", - }, - { - "query non existed proposal", - func() { - req = &v1.QueryTallyResultRequest{ProposalId: 1} - }, - false, - "proposal 1 doesn't exist", - }, - { - "create a proposal and get tally", - func() { - var err error - proposal, err = f.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "description", addrs[0], false) - assert.NilError(t, err) - assert.Assert(t, proposal.String() != "") - - req = &v1.QueryTallyResultRequest{ProposalId: proposal.Id} - - tallyResult := v1.EmptyTallyResult() - expRes = &v1.QueryTallyResultResponse{ - Tally: &tallyResult, - } - }, - true, - "", - }, - { - "request tally after few votes", - func() { - proposal.Status = v1.StatusVotingPeriod - err := f.govKeeper.SetProposal(ctx, proposal) - assert.NilError(t, err) - assert.NilError(t, f.govKeeper.AddVote(ctx, proposal.Id, addrs[0], v1.NewNonSplitVoteOption(v1.OptionYes), "")) - assert.NilError(t, f.govKeeper.AddVote(ctx, proposal.Id, addrs[1], v1.NewNonSplitVoteOption(v1.OptionYes), "")) - assert.NilError(t, f.govKeeper.AddVote(ctx, proposal.Id, addrs[2], v1.NewNonSplitVoteOption(v1.OptionYes), "")) - - req = &v1.QueryTallyResultRequest{ProposalId: proposal.Id} - - expRes = &v1.QueryTallyResultResponse{ - Tally: &v1.TallyResult{ - YesCount: math.NewInt(3 * 5 * 1000000).String(), - NoCount: "0", - AbstainCount: "0", - NoWithVetoCount: "0", - }, - } - }, - true, - "", - }, - { - "request final tally after status changed", - func() { - proposal.Status = v1.StatusPassed - err := f.govKeeper.SetProposal(ctx, proposal) - assert.NilError(t, err) - proposal, _ = f.govKeeper.Proposals.Get(ctx, proposal.Id) - - req = &v1.QueryTallyResultRequest{ProposalId: proposal.Id} - - expRes = &v1.QueryTallyResultResponse{ - Tally: proposal.FinalTallyResult, - } - }, - true, - "", - }, - } - - for _, testCase := range testCases { - t.Run(fmt.Sprintf("Case %s", testCase.msg), func(t *testing.T) { - testCase.malleate() - - tally, err := queryClient.TallyResult(gocontext.Background(), req) - - if testCase.expPass { - assert.NilError(t, err) - assert.Equal(t, expRes.String(), tally.String()) - } else { - assert.ErrorContains(t, err, testCase.expErrMsg) - assert.Assert(t, tally == nil) - } - }) - } -} - func TestLegacyGRPCQueryTally(t *testing.T) { t.Parallel() @@ -155,35 +33,11 @@ func TestLegacyGRPCQueryTally(t *testing.T) { expPass bool expErrMsg string }{ - { - "empty request", - func() { - req = &v1beta1.QueryTallyResultRequest{} - }, - false, - "proposal id can not be 0", - }, - { - "zero proposal id request", - func() { - req = &v1beta1.QueryTallyResultRequest{ProposalId: 0} - }, - false, - "proposal id can not be 0", - }, - { - "query non existed proposal", - func() { - req = &v1beta1.QueryTallyResultRequest{ProposalId: 1} - }, - false, - "proposal 1 doesn't exist", - }, { "create a proposal and get tally", func() { var err error - proposal, err = f.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "description", addrs[0], false) + proposal, err = f.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) assert.Assert(t, proposal.String() != "") @@ -221,23 +75,6 @@ func TestLegacyGRPCQueryTally(t *testing.T) { true, "", }, - { - "request final tally after status changed", - func() { - proposal.Status = v1.StatusPassed - err := f.govKeeper.SetProposal(ctx, proposal) - assert.NilError(t, err) - proposal, _ = f.govKeeper.Proposals.Get(ctx, proposal.Id) - - req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.Id} - - expRes = &v1beta1.QueryTallyResultResponse{ - Tally: v1TallyToV1Beta1Tally(*proposal.FinalTallyResult), - } - }, - true, - "", - }, } for _, testCase := range testCases { @@ -256,16 +93,3 @@ func TestLegacyGRPCQueryTally(t *testing.T) { }) } } - -func v1TallyToV1Beta1Tally(t v1.TallyResult) v1beta1.TallyResult { - yes, _ := math.NewIntFromString(t.YesCount) - no, _ := math.NewIntFromString(t.NoCount) - noWithVeto, _ := math.NewIntFromString(t.NoWithVetoCount) - abstain, _ := math.NewIntFromString(t.AbstainCount) - return v1beta1.TallyResult{ - Yes: yes, - No: no, - NoWithVeto: noWithVeto, - Abstain: abstain, - } -} diff --git a/tests/integration/gov/keeper/tally_test.go b/tests/integration/gov/keeper/tally_test.go index 45f0c28b4b56..3449c7b8ea33 100644 --- a/tests/integration/gov/keeper/tally_test.go +++ b/tests/integration/gov/keeper/tally_test.go @@ -22,7 +22,7 @@ func TestTallyNoOneVotes(t *testing.T) { createValidators(t, f, []int64{5, 5, 5}) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -49,7 +49,7 @@ func TestTallyNoQuorum(t *testing.T) { addrs := simtestutil.AddTestAddrsIncremental(f.bankKeeper, f.stakingKeeper, ctx, 1, math.NewInt(10000000)) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -75,7 +75,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { addrs, _ := createValidators(t, f, []int64{5, 5, 5}) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -104,7 +104,7 @@ func TestTallyOnlyValidators51No(t *testing.T) { valAccAddrs, _ := createValidators(t, f, []int64{5, 6, 0}) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -131,7 +131,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { valAccAddrs, _ := createValidators(t, f, []int64{5, 6, 0}) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -159,7 +159,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { valAccAddrs, _ := createValidators(t, f, []int64{6, 6, 7}) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -188,7 +188,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { valAccAddrs, _ := createValidators(t, f, []int64{6, 6, 7}) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -217,7 +217,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { valAccAddrs, _ := createValidators(t, f, []int64{6, 6, 7}) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -247,7 +247,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { valAccAddr1, valAccAddr2 := valAccAddrs[0], valAccAddrs[1] tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -284,7 +284,7 @@ func TestTallyDelgatorOverride(t *testing.T) { _, err = f.stakingKeeper.EndBlocker(ctx) assert.NilError(t, err) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -323,7 +323,7 @@ func TestTallyDelgatorInherit(t *testing.T) { _, err = f.stakingKeeper.EndBlocker(ctx) assert.NilError(t, err) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -365,7 +365,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { _, err = f.stakingKeeper.EndBlocker(ctx) assert.NilError(t, err) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -410,7 +410,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { _, err = f.stakingKeeper.EndBlocker(ctx) assert.NilError(t, err) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -456,7 +456,7 @@ func TestTallyJailedValidator(t *testing.T) { assert.NilError(t, f.stakingKeeper.Jail(ctx, sdk.ConsAddress(consAddr))) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -492,7 +492,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { assert.NilError(t, err) tp := TestProposal - proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) + proposal, err := f.govKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) assert.NilError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -513,7 +513,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { expectedAbstain := f.stakingKeeper.TokensFromConsensusPower(ctx, 0) expectedNo := f.stakingKeeper.TokensFromConsensusPower(ctx, 10) expectedNoWithVeto := f.stakingKeeper.TokensFromConsensusPower(ctx, 0) - expectedTallyResult := v1.NewTallyResult(expectedYes, expectedAbstain, expectedNo, expectedNoWithVeto) + expectedTallyResult := v1.NewTallyResult(expectedYes, expectedAbstain, expectedNo, expectedNoWithVeto, math.ZeroInt()) assert.Assert(t, tallyResults.Equals(expectedTallyResult)) } diff --git a/x/gov/CHANGELOG.md b/x/gov/CHANGELOG.md index f8265f6782bb..fff41b51bedd 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -31,4 +31,18 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) Add SPAM vote proposals. +* [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) Add proposal types to proposals. + +### Improvements + +* [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) Repurpose `govcliutils.NormalizeProposalType` to work for gov v1 proposal types. + ### API Breaking Changes + +* [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) All functions that were taking an expedited bool parameter now take a `ProposalType` parameter instead. +* [#17496](https://github.com/cosmos/cosmos-sdk/pull/17496) in `x/gov/types/v1beta1/vote.go` `NewVote` was removed, constructing the struct is required for this type. + +### Deprecated + +* [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) The field `v1.Proposal.Expedited` is deprecated and will be removed in the next release. diff --git a/x/gov/README.md b/x/gov/README.md index bb3bb94fc5de..7414f8a22490 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -2,6 +2,8 @@ sidebar_position: 1 --- + + # `x/gov` ## Abstract @@ -33,33 +35,33 @@ can be adapted to any Proof-Of-Stake blockchain by replacing *ATOM* with the nat staking token of the chain. * [Concepts](#concepts) - * [Proposal submission](#proposal-submission) - * [Deposit](#deposit) - * [Vote](#vote) - * [Software Upgrade](#software-upgrade) + * [Proposal submission](#proposal-submission) + * [Deposit](#deposit) + * [Vote](#vote) + * [Software Upgrade](#software-upgrade) * [State](#state) - * [Proposals](#proposals) - * [Parameters and base types](#parameters-and-base-types) - * [Deposit](#deposit-1) - * [ValidatorGovInfo](#validatorgovinfo) - * [Stores](#stores) - * [Proposal Processing Queue](#proposal-processing-queue) - * [Legacy Proposal](#legacy-proposal) + * [Proposals](#proposals) + * [Parameters and base types](#parameters-and-base-types) + * [Deposit](#deposit-1) + * [ValidatorGovInfo](#validatorgovinfo) + * [Stores](#stores) + * [Proposal Processing Queue](#proposal-processing-queue) + * [Legacy Proposal](#legacy-proposal) * [Messages](#messages) - * [Proposal Submission](#proposal-submission-1) - * [Deposit](#deposit-2) - * [Vote](#vote-1) + * [Proposal Submission](#proposal-submission-1) + * [Deposit](#deposit-2) + * [Vote](#vote-1) * [Events](#events) - * [EndBlocker](#endblocker) - * [Handlers](#handlers) + * [EndBlocker](#endblocker) + * [Handlers](#handlers) * [Parameters](#parameters) * [Client](#client) - * [CLI](#cli) - * [gRPC](#grpc) - * [REST](#rest) + * [CLI](#cli) + * [gRPC](#grpc) + * [REST](#rest) * [Metadata](#metadata) - * [Proposal](#proposal-3) - * [Vote](#vote-5) + * [Proposal](#proposal-3) + * [Vote](#vote-5) * [Future Improvements](#future-improvements) ## Concepts @@ -231,13 +233,13 @@ Later, we may add permissioned keys that could only sign txs from certain module #### Burnable Params -There are three parameters that define if the deposit of a proposal should be burned or returned to the depositors. +There are three parameters that define if the deposit of a proposal should be burned or returned to the depositors. -* `BurnVoteVeto` burns the proposal deposit if the proposal gets vetoed. +* `BurnVoteVeto` burns the proposal deposit if the proposal gets vetoed. * `BurnVoteQuorum` burns the proposal deposit if the proposal deposit if the vote does not reach quorum. -* `BurnProposalDepositPrevote` burns the proposal deposit if it does not enter the voting phase. +* `BurnProposalDepositPrevote` burns the proposal deposit if it does not enter the voting phase. -> Note: These parameters are modifiable via governance. +> Note: These parameters are modifiable via governance. ## State @@ -253,12 +255,12 @@ There are three parameters that define if the deposit of a proposal should be bu Since this is more of a social feature than a technical feature, we'll now get into some items that may have been useful to have in a genesis constitution: * What limitations on governance exist, if any? - * is it okay for the community to slash the wallet of a whale that they no longer feel that they want around? (viz: Juno Proposal 4 and 16) - * can governance "socially slash" a validator who is using unapproved MEV? (viz: commonwealth.im/osmosis) - * In the event of an economic emergency, what should validators do? - * Terra crash of May, 2022, saw validators choose to run a new binary with code that had not been approved by governance, because the governance token had been inflated to nothing. + * is it okay for the community to slash the wallet of a whale that they no longer feel that they want around? (viz: Juno Proposal 4 and 16) + * can governance "socially slash" a validator who is using unapproved MEV? (viz: commonwealth.im/osmosis) + * In the event of an economic emergency, what should validators do? + * Terra crash of May, 2022, saw validators choose to run a new binary with code that had not been approved by governance, because the governance token had been inflated to nothing. * What is the purpose of the chain, specifically? - * best example of this is the Cosmos hub, where different founding groups, have different interpertations of the purpose of the network. + * best example of this is the Cosmos hub, where different founding groups, have different interpertations of the purpose of the network. This genesis entry, "constitution" hasn't been designed for existing chains, who should likely just ratify a constitution using their governance system. Instead, this is for new chains. It will allow for validators to have a much clearer idea of purpose and the expecations placed on them while operating thier nodes. Likewise, for community members, the constitution will give them some idea of what to expect from both the "chain team" and the validators, respectively. @@ -358,13 +360,7 @@ const ( VoteNo = 0x2 VoteNoWithVeto = 0x3 VoteAbstain = 0x4 -) - -type ProposalType string - -const ( - ProposalTypePlainText = "Text" - ProposalTypeSoftwareUpgrade = "SoftwareUpgrade" + VoteSpam = 0x5 ) type ProposalStatus byte @@ -527,7 +523,7 @@ The `initialDeposit` must be strictly positive and conform to the accepted denom * Initialise `Proposal`'s attributes * Decrease balance of sender by `InitialDeposit` * If `MinDeposit` is reached: - * Push `proposalID` in `ProposalProcessingQueue` + * Push `proposalID` in `ProposalProcessingQueue` * Transfer `InitialDeposit` from the `Proposer` to the governance `ModuleAccount` ### Deposit @@ -551,7 +547,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/tx.pro * Add `deposit` of sender in `proposal.Deposits` * Increase `proposal.TotalDeposit` by sender's `deposit` * If `MinDeposit` is reached: - * Push `proposalID` in `ProposalProcessingQueueEnd` + * Push `proposalID` in `ProposalProcessingQueueEnd` * Transfer `Deposit` from the `proposer` to the governance `ModuleAccount` ### Vote @@ -654,7 +650,6 @@ The governance module contains the following parameters: | burn_vote_veto | bool | true | | min_initial_deposit_ratio | string | "0.1" | - **NOTE**: The governance module contains parameters that are objects unlike other modules. If only a subset of parameters are desired to be changed, only they need to be included and not the entire parameter object structure. diff --git a/x/gov/abci.go b/x/gov/abci.go index 79a69402b7e7..688619083dbc 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -84,7 +84,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { logger.Info( "proposal did not meet minimum deposit; deleted", "proposal", proposal.Id, - "expedited", proposal.Expedited, + "proposal_type", proposal.ProposalType, "title", proposal.Title, "min_deposit", sdk.NewCoins(proposal.GetMinDepositFromParams(params)...).String(), "total_deposit", sdk.NewCoins(proposal.TotalDeposit...).String(), @@ -131,7 +131,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { // the deposit at this point since the proposal is converted to regular. // As a result, the deposits are either deleted or refunded in all cases // EXCEPT when an expedited proposal fails. - if passes || !proposal.Expedited { + if passes || !(proposal.ProposalType == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) { if burnDeposits { err = keeper.DeleteAndBurnDeposits(ctx, proposal.Id) } else { @@ -199,12 +199,13 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { tagValue = types.AttributeValueProposalFailed logMsg = fmt.Sprintf("passed, but msg %d (%s) failed on execution: %s", idx, sdk.MsgTypeURL(msg), err) } - case proposal.Expedited: + case proposal.ProposalType == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED: // When expedited proposal fails, it is converted // to a regular proposal. As a result, the voting period is extended, and, // once the regular voting period expires again, the tally is repeated // according to the regular proposal rules. - proposal.Expedited = false + proposal.ProposalType = v1.ProposalType_PROPOSAL_TYPE_STANDARD + proposal.Expedited = false // can be removed as never read but kept for state coherence params, err := keeper.Params.Get(ctx) if err != nil { return false, err @@ -246,7 +247,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { "proposal tallied", "proposal", proposal.Id, "status", proposal.Status.String(), - "expedited", proposal.Expedited, + "proposal_type", proposal.ProposalType, "title", proposal.Title, "results", logMsg, ) @@ -317,7 +318,7 @@ func failUnsupportedProposal( logger.Info( "proposal failed to decode; deleted", "proposal", proposal.Id, - "expedited", proposal.Expedited, + "proposal_type", proposal.ProposalType, "title", proposal.Title, "results", errMsg, ) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 4133da6a0eb6..e6106fc1ccfa 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -31,7 +31,7 @@ func TestUnregisteredProposal_InactiveProposalFails(t *testing.T) { startTime, endTime := time.Now().Add(-4*time.Hour), ctx.BlockHeader().Time proposal, err := v1.NewProposal([]sdk.Msg{ &v1.Proposal{}, // invalid proposal message - }, 1, startTime, startTime, "", "Unsupported proposal", "Unsupported proposal", addrs[0], false) + }, 1, startTime, startTime, "", "Unsupported proposal", "Unsupported proposal", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) err = suite.GovKeeper.SetProposal(ctx, proposal) @@ -59,7 +59,7 @@ func TestUnregisteredProposal_ActiveProposalFails(t *testing.T) { startTime, endTime := time.Now().Add(-4*time.Hour), ctx.BlockHeader().Time proposal, err := v1.NewProposal([]sdk.Msg{ &v1.Proposal{}, // invalid proposal message - }, 1, startTime, startTime, "", "Unsupported proposal", "Unsupported proposal", addrs[0], false) + }, 1, startTime, startTime, "", "Unsupported proposal", "Unsupported proposal", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) proposal.Status = v1.StatusVotingPeriod proposal.VotingEndTime = &endTime @@ -98,7 +98,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) require.NoError(t, err) @@ -143,7 +143,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) require.NoError(t, err) @@ -166,7 +166,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) require.NoError(t, err) @@ -206,7 +206,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) require.NoError(t, err) @@ -235,15 +235,15 @@ func TestTickPassedDepositPeriod(t *testing.T) { func TestTickPassedVotingPeriod(t *testing.T) { testcases := []struct { - name string - expedited bool + name string + proposalType v1.ProposalType }{ { name: "regular - deleted", }, { - name: "expedited - converted to regular", - expedited: true, + name: "expedited - converted to regular", + proposalType: v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, }, } @@ -252,7 +252,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { suite := createTestSuite(t) app := suite.App ctx := app.BaseApp.NewContext(false) - depositMultiplier := getDepositMultiplier(tc.expedited) + depositMultiplier := getDepositMultiplier(tc.proposalType) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens.Mul(math.NewInt(depositMultiplier))) SortAddresses(addrs) @@ -262,7 +262,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { checkActiveProposalsQueue(t, ctx, suite.GovKeeper) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 5*depositMultiplier))} - newProposalMsg, err := v1.NewMsgSubmitProposal([]sdk.Msg{mkTestLegacyContent(t)}, proposalCoins, addrs[0].String(), "", "Proposal", "description of proposal", tc.expedited) + newProposalMsg, err := v1.NewMsgSubmitProposal([]sdk.Msg{mkTestLegacyContent(t)}, proposalCoins, addrs[0].String(), "", "Proposal", "description of proposal", tc.proposalType) require.NoError(t, err) res, err := govMsgSvr.SubmitProposal(ctx, newProposalMsg) @@ -283,7 +283,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { params, _ := suite.GovKeeper.Params.Get(ctx) votingPeriod := params.VotingPeriod - if tc.expedited { + if tc.proposalType == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED { votingPeriod = params.ExpeditedVotingPeriod } @@ -301,7 +301,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { err = gov.EndBlocker(ctx, suite.GovKeeper) require.NoError(t, err) - if !tc.expedited { + if tc.proposalType != v1.ProposalType_PROPOSAL_TYPE_EXPEDITED { checkActiveProposalsQueue(t, ctx, suite.GovKeeper) return } @@ -312,7 +312,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { proposal, err = suite.GovKeeper.Proposals.Get(ctx, res.ProposalId) require.Nil(t, err) require.Equal(t, v1.StatusVotingPeriod, proposal.Status) - require.False(t, proposal.Expedited) + require.False(t, proposal.ProposalType == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) require.Equal(t, proposal.VotingStartTime.Add(*params.VotingPeriod), *proposal.VotingEndTime) }) } @@ -320,15 +320,16 @@ func TestTickPassedVotingPeriod(t *testing.T) { func TestProposalPassedEndblocker(t *testing.T) { testcases := []struct { - name string - expedited bool + name string + proposalType v1.ProposalType }{ { - name: "regular", + name: "regular", + proposalType: v1.ProposalType_PROPOSAL_TYPE_STANDARD, }, { - name: "expedited", - expedited: true, + name: "expedited", + proposalType: v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, }, } @@ -337,7 +338,7 @@ func TestProposalPassedEndblocker(t *testing.T) { suite := createTestSuite(t) app := suite.App ctx := app.BaseApp.NewContext(false) - depositMultiplier := getDepositMultiplier(tc.expedited) + depositMultiplier := getDepositMultiplier(tc.proposalType) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens.Mul(math.NewInt(depositMultiplier))) SortAddresses(addrs) @@ -354,7 +355,7 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NotNil(t, macc) initialModuleAccCoins := suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "title", "summary", proposer, tc.expedited) + proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "title", "summary", proposer, tc.proposalType) require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10*depositMultiplier))} @@ -404,14 +405,14 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { ac := addresscodec.NewBech32Codec("cosmos") addrStr, err := ac.BytesToString(authtypes.NewModuleAddress(types.ModuleName)) require.NoError(t, err) - addrStr1, err := ac.BytesToString(addrs[0]) + toAddrStr, err := ac.BytesToString(addrs[0]) require.NoError(t, err) createValidators(t, stakingMsgSvr, ctx, []sdk.ValAddress{valAddr}, []int64{10}) _, err = suite.StakingKeeper.EndBlocker(ctx) require.NoError(t, err) - msg := banktypes.NewMsgSend(addrStr, addrStr1, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000)))) - proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msg}, "", "title", "summary", proposer, false) + msg := banktypes.NewMsgSend(addrStr, toAddrStr, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000)))) + proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msg}, "", "title", "summary", proposer, v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10))) @@ -473,7 +474,7 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { suite := createTestSuite(t) app := suite.App ctx := app.BaseApp.NewContext(false) - depositMultiplier := getDepositMultiplier(true) + depositMultiplier := getDepositMultiplier(v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 3, valTokens.Mul(math.NewInt(depositMultiplier))) params, err := suite.GovKeeper.Params.Get(ctx) require.NoError(t, err) @@ -500,7 +501,7 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { depositorInitialBalance := suite.BankKeeper.GetAllBalances(ctx, addrs[1]) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 5*depositMultiplier))} - newProposalMsg, err := v1.NewMsgSubmitProposal([]sdk.Msg{}, proposalCoins, proposer.String(), "metadata", "title", "summary", true) + newProposalMsg, err := v1.NewMsgSubmitProposal([]sdk.Msg{}, proposalCoins, proposer.String(), "metadata", "title", "summary", v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) require.NoError(t, err) res, err := govMsgSvr.SubmitProposal(ctx, newProposalMsg) @@ -565,7 +566,7 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { proposal, err = suite.GovKeeper.Proposals.Get(ctx, res.ProposalId) require.Nil(t, err) require.Equal(t, v1.StatusVotingPeriod, proposal.Status) - require.False(t, proposal.Expedited) + require.False(t, proposal.ProposalType == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) require.Equal(t, proposal.VotingStartTime.Add(*params.VotingPeriod), *proposal.VotingEndTime) // We also want to make sure that the deposit is not refunded yet and is still present in the module account @@ -646,12 +647,13 @@ func createValidators(t *testing.T, stakingMsgSvr stakingtypes.MsgServer, ctx sd // With expedited proposal's minimum deposit set higher than the default deposit, we must // initialize and deposit an amount depositMultiplier times larger // than the regular min deposit amount. -func getDepositMultiplier(expedited bool) int64 { - if expedited { +func getDepositMultiplier(proposalType v1.ProposalType) int64 { + switch proposalType { + case v1.ProposalType_PROPOSAL_TYPE_EXPEDITED: return v1.DefaultMinExpeditedDepositTokensRatio + default: + return 1 } - - return 1 } func checkActiveProposalsQueue(t *testing.T, ctx sdk.Context, k *keeper.Keeper) { diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index 6167a0bfd8f7..d63e0dc24118 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -111,7 +111,7 @@ Where proposal.json contains: "deposit": "10stake", "title": "My proposal", "summary": "A short summary of my proposal", - "expedited": false + "proposal_type": "standard", } metadata example: @@ -138,7 +138,7 @@ metadata example: return err } - msg, err := v1.NewMsgSubmitProposal(msgs, deposit, clientCtx.GetFromAddress().String(), proposal.Metadata, proposal.Title, proposal.Summary, proposal.Expedited) + msg, err := v1.NewMsgSubmitProposal(msgs, deposit, clientCtx.GetFromAddress().String(), proposal.Metadata, proposal.Title, proposal.Summary, proposal.proposalType) if err != nil { return fmt.Errorf("invalid message: %w", err) } diff --git a/x/gov/client/cli/util.go b/x/gov/client/cli/util.go index 908de47055a9..760a6344683a 100644 --- a/x/gov/client/cli/util.go +++ b/x/gov/client/cli/util.go @@ -4,12 +4,14 @@ import ( "encoding/json" "fmt" "os" + "strings" "github.com/spf13/cobra" "github.com/spf13/pflag" govutils "cosmossdk.io/x/gov/client/utils" govv1 "cosmossdk.io/x/gov/types/v1" + "cosmossdk.io/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -48,7 +50,10 @@ func parseSubmitLegacyProposal(fs *pflag.FlagSet) (*legacyProposal, error) { proposalType, _ := fs.GetString(FlagProposalType) proposal.Title, _ = fs.GetString(FlagTitle) proposal.Description, _ = fs.GetString(FlagDescription) - proposal.Type = govutils.NormalizeProposalType(proposalType) + + if strings.EqualFold(proposalType, "text") { + proposal.Type = v1beta1.ProposalTypeText + } proposal.Deposit, _ = fs.GetString(FlagDeposit) if err := proposal.validate(); err != nil { return nil, err @@ -83,12 +88,14 @@ func parseSubmitLegacyProposal(fs *pflag.FlagSet) (*legacyProposal, error) { // proposal defines the new Msg-based proposal. type proposal struct { // Msgs defines an array of sdk.Msgs proto-JSON-encoded as Anys. - Messages []json.RawMessage `json:"messages,omitempty"` - Metadata string `json:"metadata"` - Deposit string `json:"deposit"` - Title string `json:"title"` - Summary string `json:"summary"` - Expedited bool `json:"expedited"` + Messages []json.RawMessage `json:"messages,omitempty"` + Metadata string `json:"metadata"` + Deposit string `json:"deposit"` + Title string `json:"title"` + Summary string `json:"summary"` + ProposalTypeStr string `json:"proposal_type,omitempty"` + + proposalType govv1.ProposalType `json:"-"` } // parseSubmitProposal reads and parses the proposal. @@ -105,6 +112,12 @@ func parseSubmitProposal(cdc codec.Codec, path string) (proposal, []sdk.Msg, sdk return proposal, nil, nil, err } + proposalType := govv1.ProposalType_PROPOSAL_TYPE_STANDARD + if proposal.ProposalTypeStr != "" { + proposalType = govutils.NormalizeProposalType(proposal.ProposalTypeStr) + } + proposal.proposalType = proposalType + msgs := make([]sdk.Msg, len(proposal.Messages)) for i, anyJSON := range proposal.Messages { var msg sdk.Msg @@ -168,10 +181,14 @@ func ReadGovPropCmdFlags(proposer string, flagSet *pflag.FlagSet) (*govv1.MsgSub return nil, fmt.Errorf("could not read summary: %w", err) } - rv.Expedited, err = flagSet.GetBool(FlagExpedited) + expedited, err := flagSet.GetBool(FlagExpedited) if err != nil { return nil, fmt.Errorf("could not read expedited: %w", err) } + if expedited { + rv.Expedited = true + rv.ProposalType = govv1.ProposalType_PROPOSAL_TYPE_EXPEDITED + } rv.Proposer = proposer diff --git a/x/gov/client/cli/util_test.go b/x/gov/client/cli/util_test.go index 1fd3c4cb1802..bc8245df63aa 100644 --- a/x/gov/client/cli/util_test.go +++ b/x/gov/client/cli/util_test.go @@ -184,7 +184,7 @@ func TestParseSubmitProposal(t *testing.T) { "title": "My awesome title", "summary": "My awesome summary", "deposit": "1000test", - "expedited": true + "proposal_type": "expedited" } `, addr, addr, addr, addr, addr, base64.StdEncoding.EncodeToString(expectedMetadata))) @@ -223,7 +223,7 @@ func TestParseSubmitProposal(t *testing.T) { require.Equal(t, "My awesome description", textProp.Description) require.Equal(t, "My awesome title", proposal.Title) require.Equal(t, "My awesome summary", proposal.Summary) - require.Equal(t, true, proposal.Expedited) + require.Equal(t, v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, proposal.proposalType) err = okJSON.Close() require.Nil(t, err, "unexpected error") diff --git a/x/gov/client/utils/utils.go b/x/gov/client/utils/utils.go index 930fb7c0d788..7ac1c77f2156 100644 --- a/x/gov/client/utils/utils.go +++ b/x/gov/client/utils/utils.go @@ -3,26 +3,47 @@ package utils import ( "strings" - "cosmossdk.io/x/gov/types/v1beta1" + v1 "cosmossdk.io/x/gov/types/v1" ) // NormalizeVoteOption - normalize user specified vote option func NormalizeVoteOption(option string) string { - switch option { - case "Yes", "yes": - return v1beta1.OptionYes.String() + switch { + case strings.EqualFold(option, "yes"): + return v1.OptionYes.String() - case "Abstain", "abstain": - return v1beta1.OptionAbstain.String() + case strings.EqualFold(option, "abstain"): + return v1.OptionAbstain.String() - case "No", "no": - return v1beta1.OptionNo.String() + case strings.EqualFold(option, "no"): + return v1.OptionNo.String() - case "NoWithVeto", "no_with_veto", "no-with-veto": - return v1beta1.OptionNoWithVeto.String() + case strings.EqualFold(option, "nowithveto"): + return v1.OptionNoWithVeto.String() + case strings.EqualFold(option, "spam"): + return v1.OptionSpam.String() + } + + // extra check for no_with_veto + if option == "no_with_veto" || option == "no-with-veto" { + return v1.OptionNoWithVeto.String() + } + + return option +} + +// NormalizeProposalType - normalize user specified proposal type. +func NormalizeProposalType(proposalType string) v1.ProposalType { + switch proposalType { + case "Expedited", "expedited": + return v1.ProposalType_PROPOSAL_TYPE_EXPEDITED + case "MultipleChoice", "multiple_choice", "multiple-choice": + return v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE + case "Optimistic", "optimistic": + return v1.ProposalType_PROPOSAL_TYPE_OPTIMISTIC default: - return option + return v1.ProposalType_PROPOSAL_TYPE_STANDARD } } @@ -40,28 +61,17 @@ func NormalizeWeightedVoteOptions(options string) string { return strings.Join(newOptions, ",") } -// NormalizeProposalType - normalize user specified proposal type. -func NormalizeProposalType(proposalType string) string { - switch proposalType { - case "Text", "text": - return v1beta1.ProposalTypeText - - default: - return "" - } -} - // NormalizeProposalStatus - normalize user specified proposal status. func NormalizeProposalStatus(status string) string { switch status { case "DepositPeriod", "deposit_period": - return v1beta1.StatusDepositPeriod.String() + return v1.StatusDepositPeriod.String() case "VotingPeriod", "voting_period": - return v1beta1.StatusVotingPeriod.String() + return v1.StatusVotingPeriod.String() case "Passed", "passed": - return v1beta1.StatusPassed.String() + return v1.StatusPassed.String() case "Rejected", "rejected": - return v1beta1.StatusRejected.String() + return v1.StatusRejected.String() default: return status } diff --git a/x/gov/client/utils/utils_test.go b/x/gov/client/utils/utils_test.go index 1ff88f1f16dc..135d64c2b79e 100644 --- a/x/gov/client/utils/utils_test.go +++ b/x/gov/client/utils/utils_test.go @@ -15,31 +15,31 @@ func TestNormalizeWeightedVoteOptions(t *testing.T) { }{ "simple Yes": { options: "Yes", - normalized: "VOTE_OPTION_YES=1", + normalized: "VOTE_OPTION_ONE=1", }, "simple yes": { options: "yes", - normalized: "VOTE_OPTION_YES=1", + normalized: "VOTE_OPTION_ONE=1", }, "formal yes": { options: "yes=1", - normalized: "VOTE_OPTION_YES=1", + normalized: "VOTE_OPTION_ONE=1", }, "half yes half no": { options: "yes=0.5,no=0.5", - normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.5", + normalized: "VOTE_OPTION_ONE=0.5,VOTE_OPTION_THREE=0.5", }, "3 options": { options: "Yes=0.5,No=0.4,NoWithVeto=0.1", - normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.4,VOTE_OPTION_NO_WITH_VETO=0.1", + normalized: "VOTE_OPTION_ONE=0.5,VOTE_OPTION_THREE=0.4,VOTE_OPTION_FOUR=0.1", }, "zero weight option": { options: "Yes=0.5,No=0.5,NoWithVeto=0", - normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.5,VOTE_OPTION_NO_WITH_VETO=0", + normalized: "VOTE_OPTION_ONE=0.5,VOTE_OPTION_THREE=0.5,VOTE_OPTION_FOUR=0", }, "minus weight option": { options: "Yes=0.5,No=0.6,NoWithVeto=-0.1", - normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.6,VOTE_OPTION_NO_WITH_VETO=-0.1", + normalized: "VOTE_OPTION_ONE=0.5,VOTE_OPTION_THREE=0.6,VOTE_OPTION_FOUR=-0.1", }, "empty options": { options: "", diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index c149ca560b5d..196fe346e590 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -281,7 +281,7 @@ func (keeper Keeper) RefundAndDeleteDeposits(ctx context.Context, proposalID uin // validateInitialDeposit validates if initial deposit is greater than or equal to the minimum // required at the time of proposal submission. This threshold amount is determined by // the deposit parameters. Returns nil on success, error otherwise. -func (keeper Keeper) validateInitialDeposit(ctx context.Context, params v1.Params, initialDeposit sdk.Coins, expedited bool) error { +func (keeper Keeper) validateInitialDeposit(ctx context.Context, params v1.Params, initialDeposit sdk.Coins, proposalType v1.ProposalType) error { if !initialDeposit.IsValid() || initialDeposit.IsAnyNegative() { return errors.Wrap(sdkerrors.ErrInvalidCoins, initialDeposit.String()) } @@ -295,9 +295,10 @@ func (keeper Keeper) validateInitialDeposit(ctx context.Context, params v1.Param } var minDepositCoins sdk.Coins - if expedited { + switch proposalType { + case v1.ProposalType_PROPOSAL_TYPE_EXPEDITED: minDepositCoins = params.ExpeditedMinDeposit - } else { + default: minDepositCoins = params.MinDeposit } diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 3def399e811b..79f7efd92742 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -24,15 +24,16 @@ const ( func TestDeposits(t *testing.T) { testcases := []struct { - name string - expedited bool + name string + proposalType v1.ProposalType }{ { - name: "regular", + name: "regular", + proposalType: v1.ProposalType_PROPOSAL_TYPE_STANDARD, }, { - name: "expedited", - expedited: true, + name: "expedited", + proposalType: v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, }, } @@ -46,7 +47,7 @@ func TestDeposits(t *testing.T) { // initialize and deposit an amount depositMultiplier times larger // than the regular min deposit amount. depositMultiplier := int64(1) - if tc.expedited { + if tc.proposalType == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED { depositMultiplier = v1.DefaultMinExpeditedDepositTokensRatio } @@ -54,7 +55,7 @@ func TestDeposits(t *testing.T) { authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0], tc.expedited) + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0], tc.proposalType) require.NoError(t, err) proposalID := proposal.Id @@ -146,7 +147,7 @@ func TestDeposits(t *testing.T) { require.Equal(t, addr1Initial, bankKeeper.GetAllBalances(ctx, TestAddrs[1])) // Test delete and burn deposits - proposal, err = govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0], true) + proposal, err = govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0], v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) require.NoError(t, err) proposalID = proposal.Id _, err = govKeeper.AddDeposit(ctx, proposalID, TestAddrs[0], fourStake) @@ -226,7 +227,7 @@ func TestDepositAmount(t *testing.T) { require.NoError(t, err) tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", testAddrs[0], false) + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", testAddrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) proposalID := proposal.Id @@ -343,7 +344,11 @@ func TestValidateInitialDeposit(t *testing.T) { err := govKeeper.Params.Set(ctx, params) require.NoError(t, err) - err = govKeeper.ValidateInitialDeposit(ctx, tc.initialDeposit, tc.expedited) + if tc.expedited { + err = govKeeper.ValidateInitialDeposit(ctx, tc.initialDeposit, v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) + } else { + err = govKeeper.ValidateInitialDeposit(ctx, tc.initialDeposit, v1.ProposalType_PROPOSAL_TYPE_STANDARD) + } if tc.expectError { require.Error(t, err) @@ -416,7 +421,7 @@ func TestChargeDeposit(t *testing.T) { require.NoError(t, err) tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0], false) + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) proposalID := proposal.Id // deposit to proposal diff --git a/x/gov/keeper/export_test.go b/x/gov/keeper/export_test.go index f9db25240adb..1421e96781d1 100644 --- a/x/gov/keeper/export_test.go +++ b/x/gov/keeper/export_test.go @@ -1,14 +1,18 @@ package keeper -import sdk "github.com/cosmos/cosmos-sdk/types" +import ( + v1 "cosmossdk.io/x/gov/types/v1" + + sdk "github.com/cosmos/cosmos-sdk/types" +) // ValidateInitialDeposit is a helper function used only in deposit tests which returns the same // functionality of validateInitialDeposit private function. -func (k Keeper) ValidateInitialDeposit(ctx sdk.Context, initialDeposit sdk.Coins, expedited bool) error { +func (k Keeper) ValidateInitialDeposit(ctx sdk.Context, initialDeposit sdk.Coins, proposalType v1.ProposalType) error { params, err := k.Params.Get(ctx) if err != nil { return err } - return k.validateInitialDeposit(ctx, params, initialDeposit, expedited) + return k.validateInitialDeposit(ctx, params, initialDeposit, proposalType) } diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index efc6c63d5395..e92700dc2a23 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -58,7 +58,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) suite.Require().NoError(err) - submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], false) + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -139,7 +139,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) suite.Require().NoError(err) - submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], false) + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -155,7 +155,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) suite.Require().NoError(err) - submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], true) + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -216,7 +216,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { testProposal := []sdk.Msg{ v1.NewMsgVote(govAddress, uint64(i), v1.OptionYes, ""), } - proposal, err := suite.govKeeper.SubmitProposal(ctx, testProposal, "", "title", "summary", addrs[0], false) + proposal, err := suite.govKeeper.SubmitProposal(ctx, testProposal, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NotEmpty(proposal) suite.Require().NoError(err) testProposals = append(testProposals, &proposal) @@ -415,7 +415,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposals() { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) suite.Require().NoError(err) - submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], false) + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) }, @@ -496,7 +496,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], false) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) req = &v1.QueryVoteRequest{ @@ -611,7 +611,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], false) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) req = &v1beta1.QueryVoteRequest{ @@ -718,7 +718,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], false) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) req = &v1.QueryVotesRequest{ @@ -822,7 +822,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], false) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) req = &v1beta1.QueryVotesRequest{ @@ -1110,7 +1110,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], false) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -1212,7 +1212,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], false) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -1303,7 +1303,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], true) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) suite.Require().NoError(err) req = &v1.QueryDepositsRequest{ @@ -1400,7 +1400,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], false) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) req = &v1beta1.QueryDepositsRequest{ @@ -1502,6 +1502,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { AbstainCount: "1", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, SubmitTime: &propTime, VotingStartTime: &propTime, @@ -1518,6 +1519,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { AbstainCount: "1", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", } }, true, @@ -1544,6 +1546,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", } }, true, @@ -1570,6 +1573,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", } }, true, @@ -1641,6 +1645,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() { AbstainCount: "1", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, SubmitTime: &propTime, VotingStartTime: &propTime, diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index 1b7fb616f0fd..85d187294c7a 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -75,7 +75,7 @@ func TestHooks(t *testing.T) { require.False(t, govHooksReceiver.AfterProposalVotingPeriodEndedValid) tp := TestProposal - _, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) + _, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) require.True(t, govHooksReceiver.AfterProposalSubmissionValid) @@ -88,7 +88,7 @@ func TestHooks(t *testing.T) { require.True(t, govHooksReceiver.AfterProposalFailedMinDepositValid) - p2, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) + p2, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) activated, err := govKeeper.AddDeposit(ctx, p2.Id, addrs[0], minDeposit) diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index da7f83e62d85..f53406677427 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -89,17 +89,17 @@ func TestIncrementProposalNumber(t *testing.T) { require.NoError(t, err) tp := TestProposal - _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, false) + _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, false) + _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, true) + _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, true) + _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, false) + _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) - proposal6, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, false) + proposal6, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) require.Equal(t, uint64(6), proposal6.Id) @@ -116,7 +116,7 @@ func TestProposalQueues(t *testing.T) { // create test proposals tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, false) + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", addrBz, v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) has, err := govKeeper.InactiveProposalsQueue.Has(ctx, collections.Join(*proposal.DepositEndTime, proposal.Id)) diff --git a/x/gov/keeper/migrations.go b/x/gov/keeper/migrations.go index b91df665b104..5b95c821025c 100644 --- a/x/gov/keeper/migrations.go +++ b/x/gov/keeper/migrations.go @@ -2,6 +2,7 @@ package keeper import ( v5 "cosmossdk.io/x/gov/migrations/v5" + v6 "cosmossdk.io/x/gov/migrations/v6" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -37,3 +38,8 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { func (m Migrator) Migrate4to5(ctx sdk.Context) error { return v5.MigrateStore(ctx, m.keeper.storeService, m.keeper.cdc, m.keeper.Constitution) } + +// Migrate4to5 migrates from version 5 to 6. +func (m Migrator) Migrate5to6(ctx sdk.Context) error { + return v6.MigrateStore(ctx, m.keeper.Proposals) +} diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 87c5c4c34720..2bbf32e76a32 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -76,7 +76,12 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos return nil, fmt.Errorf("failed to get governance parameters: %w", err) } - if err := k.validateInitialDeposit(ctx, params, initialDeposit, msg.Expedited); err != nil { + proposalType := msg.ProposalType + if msg.Expedited { // checking for backward compatibility + proposalType = v1.ProposalType_PROPOSAL_TYPE_EXPEDITED + } + + if err := k.validateInitialDeposit(ctx, params, initialDeposit, proposalType); err != nil { return nil, err } @@ -84,7 +89,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos return nil, err } - proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata, msg.Title, msg.Summary, proposer, msg.Expedited) + proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata, msg.Title, msg.Summary, proposer, proposalType) if err != nil { return nil, err } @@ -321,7 +326,7 @@ func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgS "", msg.GetContent().GetTitle(), msg.GetContent().GetDescription(), - false, // legacy proposals cannot be expedited + v1.ProposalType_PROPOSAL_TYPE_STANDARD, // legacy proposals can only be standard ) if err != nil { return nil, err diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 0c8be118bc42..a9156f3f8527 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -51,7 +51,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { strings.Repeat("1", 100), "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -66,7 +66,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -81,7 +81,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -96,7 +96,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "Proposal", "", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -111,7 +111,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "{\"title\":\"Proposal\", \"description\":\"description of proposal\"}", "Proposal2", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -126,7 +126,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "{\"title\":\"Proposal\", \"description\":\"description of proposal\"}", "Proposal", "description", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -141,7 +141,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "Metadata", strings.Repeat("1", 256), "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -156,7 +156,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { strings.Repeat("1", 256), "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -171,7 +171,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "Proposal", strings.Repeat("1", 10201), - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -186,7 +186,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -201,7 +201,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -216,7 +216,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -231,7 +231,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -246,7 +246,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: true, @@ -261,7 +261,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: false, @@ -275,7 +275,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) }, expErr: false, @@ -315,7 +315,7 @@ func (suite *KeeperTestSuite) TestMsgCancelProposal() { coins, proposer.String(), "", "title", "summary", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -364,7 +364,7 @@ func (suite *KeeperTestSuite) TestMsgCancelProposal() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -415,7 +415,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -436,7 +436,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { preRun: func() uint64 { return proposalID }, - option: v1.VoteOption_VOTE_OPTION_YES, + option: v1.VoteOption_VOTE_OPTION_ONE, voter: sdk.AccAddress{}, metadata: "", expErr: true, @@ -461,7 +461,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -470,7 +470,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { suite.Require().NotNil(res.ProposalId) return res.ProposalId }, - option: v1.VoteOption_VOTE_OPTION_YES, + option: v1.VoteOption_VOTE_OPTION_ONE, voter: proposer, metadata: "", expErr: true, @@ -480,7 +480,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { preRun: func() uint64 { return proposalID }, - option: v1.VoteOption_VOTE_OPTION_YES, + option: v1.VoteOption_VOTE_OPTION_ONE, voter: proposer, metadata: strings.Repeat("a", 300), expErr: true, @@ -490,7 +490,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { preRun: func() uint64 { return proposalID }, - option: v1.VoteOption_VOTE_OPTION_YES, + option: v1.VoteOption_VOTE_OPTION_ONE, voter: sdk.AccAddress(strings.Repeat("a", 300)), metadata: "", expErr: true, @@ -505,7 +505,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -514,7 +514,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { suite.Require().NotNil(res.ProposalId) return res.ProposalId }, - option: v1.VoteOption_VOTE_OPTION_YES, + option: v1.VoteOption_VOTE_OPTION_ONE, voter: proposer, metadata: "", expErr: false, @@ -558,7 +558,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -624,7 +624,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { voter: proposer, metadata: "", expErr: true, - expErrMsg: `option:VOTE_OPTION_YES weight:"0.000000000000000000" : invalid vote option`, + expErrMsg: `option:VOTE_OPTION_ONE weight:"0.000000000000000000" : invalid vote option`, }, "negative weight": { preRun: func() uint64 { @@ -636,7 +636,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { voter: proposer, metadata: "", expErr: true, - expErrMsg: `option:VOTE_OPTION_YES weight:"-1.000000000000000000" : invalid vote option`, + expErrMsg: `option:VOTE_OPTION_ONE weight:"-1.000000000000000000" : invalid vote option`, }, "empty options": { preRun: func() uint64 { @@ -679,7 +679,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -688,7 +688,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { suite.Require().NotNil(res.ProposalId) return res.ProposalId }, - option: v1.NewNonSplitVoteOption(v1.VoteOption_VOTE_OPTION_YES), + option: v1.NewNonSplitVoteOption(v1.VoteOption_VOTE_OPTION_ONE), voter: proposer, metadata: "", expErr: true, @@ -698,7 +698,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { preRun: func() uint64 { return proposalID }, - option: v1.NewNonSplitVoteOption(v1.VoteOption_VOTE_OPTION_YES), + option: v1.NewNonSplitVoteOption(v1.VoteOption_VOTE_OPTION_ONE), voter: proposer, metadata: strings.Repeat("a", 300), expErr: true, @@ -708,7 +708,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { preRun: func() uint64 { return proposalID }, - option: v1.NewNonSplitVoteOption(v1.VoteOption_VOTE_OPTION_YES), + option: v1.NewNonSplitVoteOption(v1.VoteOption_VOTE_OPTION_ONE), voter: sdk.AccAddress(strings.Repeat("a", 300)), metadata: "", expErr: true, @@ -723,7 +723,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -732,7 +732,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { suite.Require().NotNil(res.ProposalId) return res.ProposalId }, - option: v1.NewNonSplitVoteOption(v1.VoteOption_VOTE_OPTION_YES), + option: v1.NewNonSplitVoteOption(v1.VoteOption_VOTE_OPTION_ONE), voter: proposer, metadata: "", expErr: false, @@ -746,7 +746,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -802,7 +802,7 @@ func (suite *KeeperTestSuite) TestMsgDeposit() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -1012,7 +1012,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -1058,7 +1058,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -1092,7 +1092,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -1145,7 +1145,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -1229,7 +1229,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { voter: proposer, metadata: "", expErr: true, - expErrMsg: `option:VOTE_OPTION_YES weight:"0.000000000000000000" : invalid vote option`, + expErrMsg: `option:VOTE_OPTION_ONE weight:"0.000000000000000000" : invalid vote option`, }, "negative weight": { preRun: func() uint64 { @@ -1244,7 +1244,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { voter: proposer, metadata: "", expErr: true, - expErrMsg: `option:VOTE_OPTION_YES weight:"-1.000000000000000000" : invalid vote option`, + expErrMsg: `option:VOTE_OPTION_ONE weight:"-1.000000000000000000" : invalid vote option`, }, "empty options": { preRun: func() uint64 { @@ -1295,7 +1295,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -1339,7 +1339,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -1396,7 +1396,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgDeposit() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -1781,7 +1781,7 @@ func (suite *KeeperTestSuite) TestSubmitProposal_InitialDeposit() { err := govKeeper.Params.Set(ctx, params) suite.Require().NoError(err) - msg, err := v1.NewMsgSubmitProposal(TestProposal, tc.initialDeposit, address.String(), "test", "Proposal", "description of proposal", false) + msg, err := v1.NewMsgSubmitProposal(TestProposal, tc.initialDeposit, address.String(), "test", "Proposal", "description of proposal", v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) // System under test diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 6750c5dea802..6d673824f3d4 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -17,15 +17,14 @@ import ( ) // SubmitProposal creates a new proposal given an array of messages -func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, metadata, title, summary string, proposer sdk.AccAddress, expedited bool) (v1.Proposal, error) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - +func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, metadata, title, summary string, proposer sdk.AccAddress, proposalType v1.ProposalType) (v1.Proposal, error) { // This method checks that all message metadata, summary and title // has te expected length defined in the module configuration. if err := keeper.validateProposalLengths(metadata, title, summary); err != nil { return v1.Proposal{}, err } + sdkCtx := sdk.UnwrapSDKContext(ctx) // Will hold a string slice of all Msg type URLs. msgs := []string{} @@ -90,7 +89,7 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met submitTime := sdkCtx.HeaderInfo().Time depositPeriod := params.MaxDepositPeriod - proposal, err := v1.NewProposal(messages, proposalID, submitTime, submitTime.Add(*depositPeriod), metadata, title, summary, proposer, expedited) + proposal, err := v1.NewProposal(messages, proposalID, submitTime, submitTime.Add(*depositPeriod), metadata, title, summary, proposer, proposalType) if err != nil { return v1.Proposal{}, err } diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 27cfeeaf55cc..e23dfbf20e4e 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -20,17 +20,20 @@ import ( // TODO(tip): remove this func (suite *KeeperTestSuite) TestGetSetProposal() { testCases := map[string]struct { - expedited bool + proposalType v1.ProposalType }{ - "regular proposal": {}, + "unspecified proposal type": {}, + "regular proposal": { + proposalType: v1.ProposalType_PROPOSAL_TYPE_STANDARD, + }, "expedited proposal": { - expedited: true, + proposalType: v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, }, } for _, tc := range testCases { tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", suite.addrs[0], tc.expedited) + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", suite.addrs[0], tc.proposalType) suite.Require().NoError(err) proposalID := proposal.Id err = suite.govKeeper.SetProposal(suite.ctx, proposal) @@ -45,11 +48,14 @@ func (suite *KeeperTestSuite) TestGetSetProposal() { // TODO(tip): remove this func (suite *KeeperTestSuite) TestDeleteProposal() { testCases := map[string]struct { - expedited bool + proposalType v1.ProposalType }{ - "regular proposal": {}, + "unspecified proposal type": {}, + "regular proposal": { + proposalType: v1.ProposalType_PROPOSAL_TYPE_STANDARD, + }, "expedited proposal": { - expedited: true, + proposalType: v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, }, } @@ -58,7 +64,7 @@ func (suite *KeeperTestSuite) TestDeleteProposal() { suite.Require().ErrorIs(suite.govKeeper.DeleteProposal(suite.ctx, 10), collections.ErrNotFound) tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", suite.addrs[0], tc.expedited) + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", suite.addrs[0], tc.proposalType) suite.Require().NoError(err) proposalID := proposal.Id err = suite.govKeeper.SetProposal(suite.ctx, proposal) @@ -73,16 +79,17 @@ func (suite *KeeperTestSuite) TestDeleteProposal() { func (suite *KeeperTestSuite) TestActivateVotingPeriod() { testCases := []struct { - name string - expedited bool + name string + proposalType v1.ProposalType }{ - {name: "regular proposal"}, - {name: "expedited proposal", expedited: true}, + {name: "unspecified proposal type"}, + {name: "regular proposal", proposalType: v1.ProposalType_PROPOSAL_TYPE_STANDARD}, + {name: "expedited proposal", proposalType: v1.ProposalType_PROPOSAL_TYPE_EXPEDITED}, } for _, tc := range testCases { tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", suite.addrs[0], tc.expedited) + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", suite.addrs[0], tc.proposalType) suite.Require().NoError(err) suite.Require().Nil(proposal.VotingStartTime) @@ -103,17 +110,18 @@ func (suite *KeeperTestSuite) TestActivateVotingPeriod() { func (suite *KeeperTestSuite) TestDeleteProposalInVotingPeriod() { testCases := []struct { - name string - expedited bool + name string + proposalType v1.ProposalType }{ - {name: "regular proposal"}, - {name: "expedited proposal", expedited: true}, + {name: "unspecified proposal type"}, + {name: "regular proposal", proposalType: v1.ProposalType_PROPOSAL_TYPE_STANDARD}, + {name: "expedited proposal", proposalType: v1.ProposalType_PROPOSAL_TYPE_EXPEDITED}, } for _, tc := range testCases { suite.reset() tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", suite.addrs[0], tc.expedited) + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", suite.addrs[0], tc.proposalType) suite.Require().NoError(err) suite.Require().Nil(proposal.VotingStartTime) @@ -150,31 +158,31 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { tp := v1beta1.TextProposal{Title: "title", Description: "description"} testCases := []struct { - content v1beta1.Content - authority string - metadata string - expedited bool - expectedErr error + content v1beta1.Content + authority string + metadata string + proposalType v1.ProposalType + expectedErr error }{ - {&tp, govAcct, "", false, nil}, - {&tp, govAcct, "", true, nil}, + {&tp, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, nil}, + {&tp, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, nil}, // Keeper does not check the validity of title and description, no error - {&v1beta1.TextProposal{Title: "", Description: "description"}, govAcct, "", false, nil}, - {&v1beta1.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, govAcct, "", false, nil}, - {&v1beta1.TextProposal{Title: "title", Description: ""}, govAcct, "", false, nil}, - {&v1beta1.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, govAcct, "", true, nil}, + {&v1beta1.TextProposal{Title: "", Description: "description"}, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, nil}, + {&v1beta1.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, nil}, + {&v1beta1.TextProposal{Title: "title", Description: ""}, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, nil}, + {&v1beta1.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, nil}, // error when metadata is too long (>10000) - {&tp, govAcct, strings.Repeat("a", 100001), true, types.ErrMetadataTooLong}, + {&tp, govAcct, strings.Repeat("a", 100001), v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, types.ErrMetadataTooLong}, // error when signer is not gov acct - {&tp, randomAddr.String(), "", false, types.ErrInvalidSigner}, + {&tp, randomAddr.String(), "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, types.ErrInvalidSigner}, // error only when invalid route - {&invalidProposalRoute{}, govAcct, "", false, types.ErrNoProposalHandlerExists}, + {&invalidProposalRoute{}, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, types.ErrNoProposalHandlerExists}, } for i, tc := range testCases { prop, err := v1.NewLegacyContent(tc.content, tc.authority) suite.Require().NoError(err) - _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, tc.metadata, "title", "", suite.addrs[0], tc.expedited) + _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, tc.metadata, "title", "", suite.addrs[0], tc.proposalType) suite.Require().True(errors.Is(tc.expectedErr, err), "tc #%d; got: %v, expected: %v", i, err, tc.expectedErr) } } @@ -184,16 +192,16 @@ func (suite *KeeperTestSuite) TestCancelProposal() { tp := v1beta1.TextProposal{Title: "title", Description: "description"} prop, err := v1.NewLegacyContent(&tp, govAcct) suite.Require().NoError(err) - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[0], false) + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) proposalID := proposal.Id - proposal2, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[1], true) + proposal2, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[1], v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) suite.Require().NoError(err) proposal2ID := proposal2.Id // proposal3 is only used to check the votes for proposals which doesn't go through `CancelProposal` are still present in state - proposal3, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[2], false) + proposal3, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[2], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) proposal3ID := proposal3.Id diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index a66528c9b7a3..fc84b7830ed1 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -20,6 +20,7 @@ func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, b results[v1.OptionAbstain] = math.LegacyZeroDec() results[v1.OptionNo] = math.LegacyZeroDec() results[v1.OptionNoWithVeto] = math.LegacyZeroDec() + results[v1.OptionSpam] = math.LegacyZeroDec() totalVotingPower := math.LegacyZeroDec() currValidators := make(map[string]v1.ValidatorGovInfo) @@ -136,6 +137,11 @@ func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, b return false, params.BurnVoteQuorum, tallyResults, nil } + // If there are more spam votes than the sum of all other options, proposal fails + if results[v1.OptionSpam].GTE(results[v1.OptionOne].Add(results[v1.OptionTwo].Add(results[v1.OptionThree].Add(results[v1.OptionFour])))) { + return false, true, tallyResults, nil + } + // If no one votes (everyone abstains), proposal fails if totalVotingPower.Sub(results[v1.OptionAbstain]).Equal(math.LegacyZeroDec()) { return false, false, tallyResults, nil diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index a3df191673ce..3061d9f5f354 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -34,8 +34,7 @@ func TestTally(t *testing.T) { // handy functions setTotalBonded = func(s suite, n int64) { s.mocks.stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec("cosmosvaloper")).AnyTimes() - s.mocks.stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()). - Return(sdkmath.NewInt(n), nil) + s.mocks.stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()).Return(sdkmath.NewInt(n), nil) } delegatorVote = func(s suite, voter sdk.AccAddress, delegations []stakingtypes.Delegation, vote v1.VoteOption) { err := s.keeper.AddVote(s.ctx, s.proposal.Id, voter, v1.NewNonSplitVoteOption(vote), "") @@ -57,7 +56,7 @@ func TestTally(t *testing.T) { ) tests := []struct { name string - expedited bool + proposalType v1.ProposalType setup func(suite) expectedPass bool expectedBurn bool @@ -76,6 +75,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -90,13 +90,14 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { name: "one validator votes: prop fails/burn deposit", setup: func(s suite) { setTotalBonded(s, 10000000) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_THREE) }, expectedPass: false, expectedBurn: true, // burn because quorum not reached @@ -105,13 +106,14 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "1000000", NoWithVetoCount: "0", + SpamCount: "0", }, }, { name: "one account votes without delegation: prop fails/burn deposit", setup: func(s suite) { setTotalBonded(s, 10000000) - delegatorVote(s, s.delAddrs[0], nil, v1.VoteOption_VOTE_OPTION_YES) + delegatorVote(s, s.delAddrs[0], nil, v1.VoteOption_VOTE_OPTION_ONE) }, expectedPass: false, expectedBurn: true, // burn because quorum not reached @@ -120,6 +122,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -131,7 +134,7 @@ func TestTally(t *testing.T) { ValidatorAddress: s.valAddrs[0].String(), Shares: sdkmath.LegacyNewDec(42), }} - delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_YES) + delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) }, expectedPass: false, expectedBurn: true, // burn because quorum not reached @@ -140,6 +143,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -151,8 +155,8 @@ func TestTally(t *testing.T) { ValidatorAddress: s.valAddrs[0].String(), Shares: sdkmath.LegacyNewDec(42), }} - delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) }, expectedPass: false, expectedBurn: true, // burn because quorum not reached @@ -161,6 +165,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -172,8 +177,8 @@ func TestTally(t *testing.T) { ValidatorAddress: s.valAddrs[0].String(), Shares: sdkmath.LegacyNewDec(42), }} - delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) + delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_THREE) }, expectedPass: false, expectedBurn: true, // burn because quorum not reached @@ -182,6 +187,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "999958", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -205,10 +211,10 @@ func TestTally(t *testing.T) { Shares: sdkmath.LegacyNewDec(21), }, } - delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) - validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ABSTAIN) + delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_TWO) }, expectedPass: false, expectedBurn: true, // burn because quorum not reached @@ -217,16 +223,17 @@ func TestTally(t *testing.T) { AbstainCount: "1000000", NoCount: "999979", NoWithVetoCount: "0", + SpamCount: "0", }, }, { name: "quorum reached with only abstain: prop fails", setup: func(s suite) { setTotalBonded(s, 10000000) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ABSTAIN) - validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ABSTAIN) - validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ABSTAIN) - validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ABSTAIN) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_TWO) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_TWO) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_TWO) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_TWO) }, expectedPass: false, expectedBurn: false, @@ -235,19 +242,20 @@ func TestTally(t *testing.T) { AbstainCount: "4000000", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { name: "quorum reached with veto>1/3: prop fails/burn deposit", setup: func(s suite) { setTotalBonded(s, 10000000) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_NO_WITH_VETO) - validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_NO_WITH_VETO) - validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_NO_WITH_VETO) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_FOUR) + validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_FOUR) + validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_FOUR) }, expectedPass: false, expectedBurn: true, @@ -256,16 +264,17 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "3000000", + SpamCount: "0", }, }, { name: "quorum reached with yes<=.5: prop fails", setup: func(s suite) { setTotalBonded(s, 10000000) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) - validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_NO) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_THREE) }, expectedPass: false, expectedBurn: false, @@ -274,19 +283,20 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "2000000", NoWithVetoCount: "0", + SpamCount: "0", }, }, { name: "quorum reached with yes>.5: prop succeeds", setup: func(s suite) { setTotalBonded(s, 10000000) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_NO) - validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_NO) - validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_NO_WITH_VETO) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_FOUR) }, expectedPass: true, expectedBurn: false, @@ -295,18 +305,19 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "2000000", NoWithVetoCount: "1000000", + SpamCount: "0", }, }, { name: "quorum reached thanks to abstain, yes>.5: prop succeeds", setup: func(s suite) { setTotalBonded(s, 10000000) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) - validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ABSTAIN) - validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_ABSTAIN) - validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_ABSTAIN) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_TWO) + validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_TWO) + validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_TWO) }, expectedPass: true, expectedBurn: false, @@ -315,20 +326,21 @@ func TestTally(t *testing.T) { AbstainCount: "3000000", NoCount: "1000000", NoWithVetoCount: "0", + SpamCount: "0", }, }, { - name: "quorum reached with yes<=.667: expedited prop fails", - expedited: true, + name: "quorum reached with yes<=.667: expedited prop fails", + proposalType: v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, setup: func(s suite) { setTotalBonded(s, 10000000) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_NO) - validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_NO) - validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_NO_WITH_VETO) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_FOUR) }, expectedPass: false, expectedBurn: false, @@ -337,20 +349,21 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "2000000", NoWithVetoCount: "1000000", + SpamCount: "0", }, }, { - name: "quorum reached with yes>.667: expedited prop succeeds", - expedited: true, + name: "quorum reached with yes>.667: expedited prop succeeds", + proposalType: v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, setup: func(s suite) { setTotalBonded(s, 10000000) - validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_YES) - validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_NO) - validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_NO_WITH_VETO) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_FOUR) }, expectedPass: true, expectedBurn: false, @@ -359,6 +372,30 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "1000000", NoWithVetoCount: "1000000", + SpamCount: "0", + }, + }, + { + name: "quorum reached with spam > all other votes: prop fails/burn deposit", + setup: func(s suite) { + setTotalBonded(s, 10000000) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + // spam votes + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_SPAM) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_SPAM) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_SPAM) + validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_SPAM) + validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_SPAM) + validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_SPAM) + }, + expectedPass: false, + expectedBurn: true, + expectedTally: v1.TallyResult{ + YesCount: "1000000", + AbstainCount: "0", + NoCount: "0", + NoWithVetoCount: "0", + SpamCount: "6000000", }, }, } @@ -394,7 +431,7 @@ func TestTally(t *testing.T) { return nil }) // Submit and activate a proposal - proposal, err := govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", delAddrs[0], tt.expedited) + proposal, err := govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", delAddrs[0], tt.proposalType) require.NoError(t, err) err = govKeeper.ActivateVotingPeriod(ctx, proposal) require.NoError(t, err) diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index e5fcd96e46bd..3220249e2b39 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -21,7 +21,7 @@ func TestVotes(t *testing.T) { authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) proposalID := proposal.Id metadata := "metadata" diff --git a/x/gov/migrations/v3/convert_test.go b/x/gov/migrations/v3/convert_test.go index 0c899ba088e4..3b44f9724552 100644 --- a/x/gov/migrations/v3/convert_test.go +++ b/x/gov/migrations/v3/convert_test.go @@ -120,6 +120,7 @@ func TestConvertToLegacyTallyResult(t *testing.T) { NoCount: tallyResult.NoCount, AbstainCount: tallyResult.AbstainCount, NoWithVetoCount: tallyResult.NoWithVetoCount, + SpamCount: tallyResult.SpamCount, }, expErr: true, }, @@ -129,6 +130,7 @@ func TestConvertToLegacyTallyResult(t *testing.T) { NoCount: "invalid", AbstainCount: tallyResult.AbstainCount, NoWithVetoCount: tallyResult.NoWithVetoCount, + SpamCount: tallyResult.SpamCount, }, expErr: true, }, @@ -138,6 +140,7 @@ func TestConvertToLegacyTallyResult(t *testing.T) { NoCount: tallyResult.NoCount, AbstainCount: "invalid", NoWithVetoCount: tallyResult.NoWithVetoCount, + SpamCount: tallyResult.SpamCount, }, expErr: true, }, @@ -147,6 +150,7 @@ func TestConvertToLegacyTallyResult(t *testing.T) { NoCount: tallyResult.NoCount, AbstainCount: tallyResult.AbstainCount, NoWithVetoCount: "invalid", + SpamCount: tallyResult.SpamCount, }, expErr: true, }, diff --git a/x/gov/migrations/v6/store.go b/x/gov/migrations/v6/store.go new file mode 100644 index 000000000000..0a4a96f77a22 --- /dev/null +++ b/x/gov/migrations/v6/store.go @@ -0,0 +1,29 @@ +package v6 + +import ( + "cosmossdk.io/collections" + v1 "cosmossdk.io/x/gov/types/v1" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// MigrateStore performs in-place store migrations from v5 (v0.50) to v6 (v0.51). The +// migration includes: +// +// Addition of new field in params to store types of proposals that can be submitted. +func MigrateStore(ctx sdk.Context, proposalCollection collections.Map[uint64, v1.Proposal]) error { + // Migrate proposals + return proposalCollection.Walk(ctx, nil, func(key uint64, proposal v1.Proposal) (bool, error) { + if proposal.Expedited { + proposal.ProposalType = v1.ProposalType_PROPOSAL_TYPE_EXPEDITED + } else { + proposal.ProposalType = v1.ProposalType_PROPOSAL_TYPE_STANDARD + } + + if err := proposalCollection.Set(ctx, key, proposal); err != nil { + return false, err + } + + return false, nil + }) +} diff --git a/x/gov/migrations/v6/store_test.go b/x/gov/migrations/v6/store_test.go new file mode 100644 index 000000000000..0474fe332d0c --- /dev/null +++ b/x/gov/migrations/v6/store_test.go @@ -0,0 +1,3 @@ +package v6_test + +// TODO(@julienrbrt): Add migration tests when feature complete. diff --git a/x/gov/module.go b/x/gov/module.go index 63f870b22d3c..0b6f261afbc9 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -35,7 +35,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) -const ConsensusVersion = 5 +const ConsensusVersion = 6 var ( _ module.AppModuleBasic = AppModuleBasic{} @@ -288,6 +288,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err := cfg.RegisterMigration(govtypes.ModuleName, 4, m.Migrate4to5); err != nil { panic(fmt.Sprintf("failed to migrate x/gov from version 4 to 5: %v", err)) } + + if err := cfg.RegisterMigration(govtypes.ModuleName, 5, m.Migrate5to6); err != nil { + panic(fmt.Sprintf("failed to migrate x/gov from version 5 to 6: %v", err)) + } } // InitGenesis performs genesis initialization for the gov module. It returns diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index afd979d64524..60d73f30cccc 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -237,6 +237,11 @@ func simulateMsgSubmitProposal( return simtypes.NoOpMsg(types.ModuleName, TypeMsgSubmitProposal, "unable to generate deposit"), nil, err } + proposalType := v1.ProposalType_PROPOSAL_TYPE_STANDARD + if expedited { + proposalType = v1.ProposalType_PROPOSAL_TYPE_EXPEDITED + } + msg, err := v1.NewMsgSubmitProposal( proposalMsgs, deposit, @@ -244,7 +249,7 @@ func simulateMsgSubmitProposal( simtypes.RandStringOfLength(r, 100), simtypes.RandStringOfLength(r, 100), simtypes.RandStringOfLength(r, 100), - expedited, + proposalType, ) if err != nil { return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "unable to generate a submit proposal msg"), nil, err diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 59109228f62f..f1b92a5cf363 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -215,7 +215,7 @@ func TestSimulateMsgCancelProposal(t *testing.T) { params, _ := suite.GovKeeper.Params.Get(ctx) depositPeriod := params.MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "title", "summary", proposer, false) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "title", "summary", proposer, v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) err = suite.GovKeeper.SetProposal(ctx, proposal) @@ -258,7 +258,7 @@ func TestSimulateMsgDeposit(t *testing.T) { params, _ := suite.GovKeeper.Params.Get(ctx) depositPeriod := params.MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) err = suite.GovKeeper.SetProposal(ctx, proposal) @@ -302,7 +302,7 @@ func TestSimulateMsgVote(t *testing.T) { params, _ := suite.GovKeeper.Params.Get(ctx) depositPeriod := params.MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) err = suite.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -344,7 +344,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { params, _ := suite.GovKeeper.Params.Get(ctx) depositPeriod := params.MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "test", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "test", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) err = suite.GovKeeper.ActivateVotingPeriod(ctx, proposal) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 509021687711..90f831dc1831 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -32,36 +32,97 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// ProposalType enumerates the valid proposal types. +// All proposal types are v1.Proposal which have different voting periods or tallying logic. +type ProposalType int32 + +const ( + // PROPOSAL_TYPE_UNSPECIFIED defines no proposal type, which fallback to PROPOSAL_TYPE_STANDARD. + ProposalType_PROPOSAL_TYPE_UNSPECIFIED ProposalType = 0 + // PROPOSAL_TYPE_STANDARD defines the type for a standard proposal. + ProposalType_PROPOSAL_TYPE_STANDARD ProposalType = 1 + // PROPOSAL_TYPE_MULTIPLE_CHOICE defines the type for a multiple choice proposal. + ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE ProposalType = 2 + // PROPOSAL_TYPE_OPTIMISTIC defines the type for an optimistic proposal. + ProposalType_PROPOSAL_TYPE_OPTIMISTIC ProposalType = 3 + // PROPOSAL_TYPE_EXPEDITED defines the type for an expedited proposal. + ProposalType_PROPOSAL_TYPE_EXPEDITED ProposalType = 4 +) + +var ProposalType_name = map[int32]string{ + 0: "PROPOSAL_TYPE_UNSPECIFIED", + 1: "PROPOSAL_TYPE_STANDARD", + 2: "PROPOSAL_TYPE_MULTIPLE_CHOICE", + 3: "PROPOSAL_TYPE_OPTIMISTIC", + 4: "PROPOSAL_TYPE_EXPEDITED", +} + +var ProposalType_value = map[string]int32{ + "PROPOSAL_TYPE_UNSPECIFIED": 0, + "PROPOSAL_TYPE_STANDARD": 1, + "PROPOSAL_TYPE_MULTIPLE_CHOICE": 2, + "PROPOSAL_TYPE_OPTIMISTIC": 3, + "PROPOSAL_TYPE_EXPEDITED": 4, +} + +func (x ProposalType) String() string { + return proto.EnumName(ProposalType_name, int32(x)) +} + +func (ProposalType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{0} +} + // VoteOption enumerates the valid vote options for a given governance proposal. type VoteOption int32 const ( // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. VoteOption_VOTE_OPTION_UNSPECIFIED VoteOption = 0 - // VOTE_OPTION_YES defines a yes vote option. + // VOTE_OPTION_ONE defines the first proposal vote option. + VoteOption_VOTE_OPTION_ONE VoteOption = 1 + // VOTE_OPTION_YES defines the yes proposal vote option. VoteOption_VOTE_OPTION_YES VoteOption = 1 - // VOTE_OPTION_ABSTAIN defines an abstain vote option. + // VOTE_OPTION_TWO defines the second proposal vote option. + VoteOption_VOTE_OPTION_TWO VoteOption = 2 + // VOTE_OPTION_ABSTAIN defines the abstain proposal vote option. VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 - // VOTE_OPTION_NO defines a no vote option. + // VOTE_OPTION_THREE defines the third proposal vote option. + VoteOption_VOTE_OPTION_THREE VoteOption = 3 + // VOTE_OPTION_NO defines the no proposal vote option. VoteOption_VOTE_OPTION_NO VoteOption = 3 - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + // VOTE_OPTION_FOUR defines the fourth proposal vote option. + VoteOption_VOTE_OPTION_FOUR VoteOption = 4 + // VOTE_OPTION_NO_WITH_VETO defines the no with veto proposal vote option. VoteOption_VOTE_OPTION_NO_WITH_VETO VoteOption = 4 + // VOTE_OPTION_SPAM defines the spam proposal vote option. + VoteOption_VOTE_OPTION_SPAM VoteOption = 5 ) var VoteOption_name = map[int32]string{ 0: "VOTE_OPTION_UNSPECIFIED", - 1: "VOTE_OPTION_YES", - 2: "VOTE_OPTION_ABSTAIN", - 3: "VOTE_OPTION_NO", - 4: "VOTE_OPTION_NO_WITH_VETO", + 1: "VOTE_OPTION_ONE", + // Duplicate value: 1: "VOTE_OPTION_YES", + 2: "VOTE_OPTION_TWO", + // Duplicate value: 2: "VOTE_OPTION_ABSTAIN", + 3: "VOTE_OPTION_THREE", + // Duplicate value: 3: "VOTE_OPTION_NO", + 4: "VOTE_OPTION_FOUR", + // Duplicate value: 4: "VOTE_OPTION_NO_WITH_VETO", + 5: "VOTE_OPTION_SPAM", } var VoteOption_value = map[string]int32{ "VOTE_OPTION_UNSPECIFIED": 0, + "VOTE_OPTION_ONE": 1, "VOTE_OPTION_YES": 1, + "VOTE_OPTION_TWO": 2, "VOTE_OPTION_ABSTAIN": 2, + "VOTE_OPTION_THREE": 3, "VOTE_OPTION_NO": 3, + "VOTE_OPTION_FOUR": 4, "VOTE_OPTION_NO_WITH_VETO": 4, + "VOTE_OPTION_SPAM": 5, } func (x VoteOption) String() string { @@ -69,7 +130,7 @@ func (x VoteOption) String() string { } func (VoteOption) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{0} + return fileDescriptor_e05cb1c0d030febb, []int{1} } // ProposalStatus enumerates the valid statuses of a proposal. @@ -118,7 +179,7 @@ func (x ProposalStatus) String() string { } func (ProposalStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{1} + return fileDescriptor_e05cb1c0d030febb, []int{2} } // WeightedVoteOption defines a unit of vote for vote split. @@ -282,11 +343,16 @@ type Proposal struct { // expedited defines if the proposal is expedited // // Since: cosmos-sdk 0.50 - Expedited bool `protobuf:"varint,14,opt,name=expedited,proto3" json:"expedited,omitempty"` + // Deprecated: Use ProposalType instead. + Expedited bool `protobuf:"varint,14,opt,name=expedited,proto3" json:"expedited,omitempty"` // Deprecated: Do not use. // failed_reason defines the reason why the proposal failed // // Since: cosmos-sdk 0.50 FailedReason string `protobuf:"bytes,15,opt,name=failed_reason,json=failedReason,proto3" json:"failed_reason,omitempty"` + // proposal_type defines the type of the proposal + // + // Since: cosmos-sdk 0.51 + ProposalType ProposalType `protobuf:"varint,16,opt,name=proposal_type,json=proposalType,proto3,enum=cosmos.gov.v1.ProposalType" json:"proposal_type,omitempty"` } func (m *Proposal) Reset() { *m = Proposal{} } @@ -413,6 +479,7 @@ func (m *Proposal) GetProposer() string { return "" } +// Deprecated: Do not use. func (m *Proposal) GetExpedited() bool { if m != nil { return m.Expedited @@ -427,6 +494,13 @@ func (m *Proposal) GetFailedReason() string { return "" } +func (m *Proposal) GetProposalType() ProposalType { + if m != nil { + return m.ProposalType + } + return ProposalType_PROPOSAL_TYPE_UNSPECIFIED +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { // yes_count is the number of yes votes on a proposal. @@ -437,6 +511,8 @@ type TallyResult struct { NoCount string `protobuf:"bytes,3,opt,name=no_count,json=noCount,proto3" json:"no_count,omitempty"` // no_with_veto_count is the number of no with veto votes on a proposal. NoWithVetoCount string `protobuf:"bytes,4,opt,name=no_with_veto_count,json=noWithVetoCount,proto3" json:"no_with_veto_count,omitempty"` + // spam_count is the number of spam votes on a proposal. + SpamCount string `protobuf:"bytes,5,opt,name=spam_count,json=spamCount,proto3" json:"spam_count,omitempty"` } func (m *TallyResult) Reset() { *m = TallyResult{} } @@ -500,6 +576,13 @@ func (m *TallyResult) GetNoWithVetoCount() string { return "" } +func (m *TallyResult) GetSpamCount() string { + if m != nil { + return m.SpamCount + } + return "" +} + // Vote defines a vote on a governance proposal. // A Vote consists of a proposal ID, the voter, and the vote option. type Vote struct { @@ -949,6 +1032,7 @@ func (m *Params) GetMinDepositRatio() string { } func init() { + proto.RegisterEnum("cosmos.gov.v1.ProposalType", ProposalType_name, ProposalType_value) proto.RegisterEnum("cosmos.gov.v1.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1.WeightedVoteOption") @@ -965,96 +1049,106 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1422 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x73, 0xd3, 0x46, - 0x1b, 0x8e, 0x6c, 0xc7, 0x71, 0x5e, 0xff, 0x88, 0xd9, 0x04, 0xa2, 0x04, 0xe2, 0x04, 0x7f, 0x0c, - 0x93, 0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, 0xa8, 0xe6, 0x35, 0x74, - 0x19, 0x96, 0x46, 0x31, 0xdb, 0x8d, 0x76, 0x7d, 0xeb, 0xb3, 0x00, 0x12, 0x43, 0x8b, 0x70, 0x61, - 0x14, 0xd2, 0xac, 0xb4, 0x5a, 0xb5, 0xaa, 0x0c, 0x7a, 0xd4, 0x67, 0xd4, 0x36, 0x6b, 0x1b, 0xed, - 0x5a, 0x35, 0x9f, 0x18, 0xc7, 0xbc, 0x57, 0xa9, 0x3f, 0xa8, 0x55, 0xf3, 0x93, 0xeb, 0xb7, 0x5f, - 0xbe, 0x2d, 0x68, 0xaf, 0xde, 0x16, 0xb4, 0x3f, 0xdf, 0x16, 0xb4, 0xe7, 0xef, 0x0a, 0x13, 0xaf, - 0xde, 0x15, 0x26, 0x7e, 0x7b, 0x57, 0x98, 0xf8, 0xe2, 0xa2, 0xac, 0x09, 0xb3, 0xbf, 0x2c, 0x11, - 0x5a, 0x3e, 0x14, 0xbf, 0x00, 0xf9, 0xa0, 0x87, 0x99, 0xff, 0xf3, 0x2e, 0x29, 0xa6, 0xe5, 0xd6, - 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdf, 0xb5, 0x41, 0x36, 0x1f, 0x0e, 0x00, 0x00, + // 1581 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4d, 0x53, 0xe3, 0xc8, + 0x19, 0x46, 0xfe, 0xc2, 0x7e, 0xfd, 0x81, 0x68, 0x60, 0x11, 0xb0, 0x18, 0xd6, 0xd9, 0xda, 0x22, + 0x64, 0xc7, 0x0e, 0xbb, 0x99, 0x1c, 0x76, 0x52, 0x95, 0xf8, 0x43, 0x13, 0x44, 0x01, 0x76, 0x64, + 0x01, 0x33, 0xb9, 0xa8, 0x04, 0xea, 0x31, 0xaa, 0x58, 0x6a, 0x47, 0x6a, 0x33, 0xf8, 0x0f, 0xe4, + 0x9a, 0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e1, 0x3f, 0xef, 0xca, 0xc2, 0x8b, 0xf7, 0xe5, 0xb9, 0xd7, 0xef, 0xcb, + 0x73, 0xff, 0x7c, 0x5f, 0x9e, 0xfb, 0xf5, 0x46, 0xd0, 0xae, 0x9e, 0xf9, 0x9b, 0xaa, 0x45, 0x6a, + 0xd7, 0xec, 0x8b, 0xdc, 0xff, 0x29, 0xea, 0xf9, 0x9f, 0xdb, 0x19, 0x76, 0x90, 0x7c, 0xfb, 0xff, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x83, 0xbf, 0x15, 0xa8, 0xaf, 0x0f, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1161,6 +1255,13 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ProposalType != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.ProposalType)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } if len(m.FailedReason) > 0 { i -= len(m.FailedReason) copy(dAtA[i:], m.FailedReason) @@ -1319,6 +1420,13 @@ func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SpamCount) > 0 { + i -= len(m.SpamCount) + copy(dAtA[i:], m.SpamCount) + i = encodeVarintGov(dAtA, i, uint64(len(m.SpamCount))) + i-- + dAtA[i] = 0x2a + } if len(m.NoWithVetoCount) > 0 { i -= len(m.NoWithVetoCount) copy(dAtA[i:], m.NoWithVetoCount) @@ -1815,6 +1923,9 @@ func (m *Proposal) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } + if m.ProposalType != 0 { + n += 2 + sovGov(uint64(m.ProposalType)) + } return n } @@ -1840,6 +1951,10 @@ func (m *TallyResult) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } + l = len(m.SpamCount) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -2733,6 +2848,25 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } m.FailedReason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalType", wireType) + } + m.ProposalType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalType |= ProposalType(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) @@ -2911,6 +3045,38 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { } m.NoWithVetoCount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpamCount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpamCount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 812c05250564..847f35f75e3a 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -18,7 +18,7 @@ func NewMsgSubmitProposal( messages []sdk.Msg, initialDeposit sdk.Coins, proposer, metadata, title, summary string, - expedited bool, + proposalType ProposalType, ) (*MsgSubmitProposal, error) { m := &MsgSubmitProposal{ InitialDeposit: initialDeposit, @@ -26,7 +26,7 @@ func NewMsgSubmitProposal( Metadata: metadata, Title: title, Summary: summary, - Expedited: expedited, + ProposalType: proposalType, } anys, err := sdktx.SetMsgs(messages) diff --git a/x/gov/types/v1/msgs_test.go b/x/gov/types/v1/msgs_test.go index 80e9c638abad..29155a123be4 100644 --- a/x/gov/types/v1/msgs_test.go +++ b/x/gov/types/v1/msgs_test.go @@ -45,34 +45,34 @@ func TestMsgDepositGetSignBytes(t *testing.T) { func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { pc := codec.NewProtoCodec(types.NewInterfaceRegistry()) testcases := []struct { - name string - proposal []sdk.Msg - title string - summary string - expedited bool - expSignBz string + name string + proposal []sdk.Msg + title string + summary string + proposalType v1.ProposalType + expSignBz string }{ { "MsgVote", []sdk.Msg{v1.NewMsgVote(addrs[0], 1, v1.OptionYes, "")}, "gov/MsgVote", "Proposal for a governance vote msg", - false, - `{"type":"cosmos-sdk/v1/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/v1/MsgVote","value":{"option":1,"proposal_id":"1","voter":"cosmos1w3jhxap3gempvr"}}],"summary":"Proposal for a governance vote msg","title":"gov/MsgVote"}}`, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, + `{"type":"cosmos-sdk/v1/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/v1/MsgVote","value":{"option":1,"proposal_id":"1","voter":"cosmos1w3jhxap3gempvr"}}],"proposal_type":1,"summary":"Proposal for a governance vote msg","title":"gov/MsgVote"}}`, }, { "MsgSend", []sdk.Msg{banktypes.NewMsgSend(addrStrs[0], addrStrs[0], sdk.NewCoins())}, "bank/MsgSend", "Proposal for a bank msg send", - false, - fmt.Sprintf(`{"type":"cosmos-sdk/v1/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/MsgSend","value":{"amount":[],"from_address":"%s","to_address":"%s"}}],"summary":"Proposal for a bank msg send","title":"bank/MsgSend"}}`, addrStrs[0], addrStrs[0]), + v1.ProposalType_PROPOSAL_TYPE_STANDARD, + fmt.Sprintf(`{"type":"cosmos-sdk/v1/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/MsgSend","value":{"amount":[],"from_address":"%s","to_address":"%s"}}],"proposal_type":1,"summary":"Proposal for a bank msg send","title":"bank/MsgSend"}}`, addrStrs[0], addrStrs[0]), }, } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - msg, err := v1.NewMsgSubmitProposal(tc.proposal, sdk.NewCoins(), "", "", tc.title, tc.summary, tc.expedited) + msg, err := v1.NewMsgSubmitProposal(tc.proposal, sdk.NewCoins(), "", "", tc.title, tc.summary, tc.proposalType) require.NoError(t, err) bz, err := pc.MarshalAminoJSON(msg) require.NoError(t, err) diff --git a/x/gov/types/v1/proposal.go b/x/gov/types/v1/proposal.go index 79bc095b56e1..61fde762248c 100644 --- a/x/gov/types/v1/proposal.go +++ b/x/gov/types/v1/proposal.go @@ -23,7 +23,7 @@ const ( ) // NewProposal creates a new Proposal instance -func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time.Time, metadata, title, summary string, proposer sdk.AccAddress, expedited bool) (Proposal, error) { +func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time.Time, metadata, title, summary string, proposer sdk.AccAddress, proposalType ProposalType) (Proposal, error) { msgs, err := sdktx.SetMsgs(messages) if err != nil { return Proposal{}, err @@ -31,6 +31,11 @@ func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time. tally := EmptyTallyResult() + // undefined proposal type defaults to standard + if proposalType == ProposalType_PROPOSAL_TYPE_UNSPECIFIED { + proposalType = ProposalType_PROPOSAL_TYPE_STANDARD + } + p := Proposal{ Id: id, Messages: msgs, @@ -42,7 +47,12 @@ func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time. Title: title, Summary: summary, Proposer: proposer.String(), - Expedited: expedited, + ProposalType: proposalType, + } + + // expedited field is deprecated but we want to keep setting it for backwards compatibility + if proposalType == ProposalType_PROPOSAL_TYPE_EXPEDITED { + p.Expedited = true } return p, nil diff --git a/x/gov/types/v1/proposals_test.go b/x/gov/types/v1/proposals_test.go index bf2902108b1b..2152a60e1bbb 100644 --- a/x/gov/types/v1/proposals_test.go +++ b/x/gov/types/v1/proposals_test.go @@ -37,7 +37,7 @@ func TestNestedAnys(t *testing.T) { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, "cosmos1govacct") require.NoError(t, err) - proposal, err := v1.NewProposal([]sdk.Msg{msgContent}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) + proposal, err := v1.NewProposal([]sdk.Msg{msgContent}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) require.NotPanics(t, func() { _ = proposal.String() }) @@ -46,32 +46,34 @@ func TestNestedAnys(t *testing.T) { func TestProposalSetExpedited(t *testing.T) { const startExpedited = false - proposal, err := v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), startExpedited) + proposal, err := v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) require.Equal(t, startExpedited, proposal.Expedited) + require.Equal(t, proposal.ProposalType, v1.ProposalType_PROPOSAL_TYPE_STANDARD) - proposal, err = v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), !startExpedited) + proposal, err = v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) require.NoError(t, err) require.Equal(t, !startExpedited, proposal.Expedited) + require.Equal(t, proposal.ProposalType, v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) } func TestProposalGetMinDepositFromParams(t *testing.T) { testcases := []struct { - expedited bool + proposalType v1.ProposalType expectedMinDeposit math.Int }{ { - expedited: true, + proposalType: v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, expectedMinDeposit: v1.DefaultMinExpeditedDepositTokens, }, { - expedited: false, + proposalType: v1.ProposalType_PROPOSAL_TYPE_STANDARD, expectedMinDeposit: v1.DefaultMinDepositTokens, }, } for _, tc := range testcases { - proposal, err := v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), tc.expedited) + proposal, err := v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), tc.proposalType) require.NoError(t, err) actualMinDeposit := proposal.GetMinDepositFromParams(v1.DefaultParams()) diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index 08c1fa283f3e..707496b97190 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -29,12 +29,13 @@ func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens math.Int, delegato } // NewTallyResult creates a new TallyResult instance -func NewTallyResult(yes, abstain, no, noWithVeto math.Int) TallyResult { +func NewTallyResult(option1, option2, option3, option4, spam math.Int) TallyResult { return TallyResult{ - YesCount: yes.String(), - AbstainCount: abstain.String(), - NoCount: no.String(), - NoWithVetoCount: noWithVeto.String(), + YesCount: option1.String(), + AbstainCount: option2.String(), + NoCount: option3.String(), + NoWithVetoCount: option4.String(), + SpamCount: spam.String(), } } @@ -45,12 +46,13 @@ func NewTallyResultFromMap(results map[VoteOption]math.LegacyDec) TallyResult { results[OptionAbstain].TruncateInt(), results[OptionNo].TruncateInt(), results[OptionNoWithVeto].TruncateInt(), + results[OptionSpam].TruncateInt(), ) } // EmptyTallyResult returns an empty TallyResult. func EmptyTallyResult() TallyResult { - return NewTallyResult(math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt()) + return NewTallyResult(math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt()) } // Equals returns if two tally results are equal. @@ -58,5 +60,6 @@ func (tr TallyResult) Equals(comp TallyResult) bool { return tr.YesCount == comp.YesCount && tr.AbstainCount == comp.AbstainCount && tr.NoCount == comp.NoCount && - tr.NoWithVetoCount == comp.NoWithVetoCount + tr.NoWithVetoCount == comp.NoWithVetoCount && + tr.SpamCount == comp.SpamCount } diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 754caf7782ae..143df2acc7f1 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -60,7 +60,15 @@ type MsgSubmitProposal struct { // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 - Expedited bool `protobuf:"varint,7,opt,name=expedited,proto3" json:"expedited,omitempty"` + // Deprecated: Use the PROPOSAL_TYPE_EXPEDITED proposal type instead. + // When this field is set and no proposal_type is set, the proposal_type + // will be set to PROPOSAL_TYPE_EXPEDITED for backwards compatibility. + Expedited bool `protobuf:"varint,7,opt,name=expedited,proto3" json:"expedited,omitempty"` // Deprecated: Do not use. + // proposal_type defines the type of proposal + // When not set defaults to PROPOSAL_TYPE_STANDARD + // + // Since: cosmos-sdk 0.51 + ProposalType ProposalType `protobuf:"varint,8,opt,name=proposal_type,json=proposalType,proto3,enum=cosmos.gov.v1.ProposalType" json:"proposal_type,omitempty"` } func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } @@ -138,6 +146,7 @@ func (m *MsgSubmitProposal) GetSummary() string { return "" } +// Deprecated: Do not use. func (m *MsgSubmitProposal) GetExpedited() bool { if m != nil { return m.Expedited @@ -145,6 +154,13 @@ func (m *MsgSubmitProposal) GetExpedited() bool { return false } +func (m *MsgSubmitProposal) GetProposalType() ProposalType { + if m != nil { + return m.ProposalType + } + return ProposalType_PROPOSAL_TYPE_UNSPECIFIED +} + // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. type MsgSubmitProposalResponse struct { // proposal_id defines the unique id of the proposal. @@ -848,75 +864,77 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 1080 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcb, 0x6f, 0x1b, 0x45, - 0x18, 0xcf, 0xe6, 0x61, 0x27, 0x93, 0x97, 0xb2, 0x72, 0xdb, 0xf5, 0x52, 0xd6, 0xee, 0x16, 0x81, - 0x95, 0x92, 0x5d, 0x1c, 0x48, 0x85, 0x4c, 0x85, 0x54, 0x87, 0x57, 0x25, 0x0c, 0xd5, 0x16, 0x8a, - 0x84, 0x90, 0xac, 0xb5, 0x77, 0xd8, 0xac, 0xea, 0xdd, 0x59, 0x79, 0xc6, 0x56, 0x7c, 0x43, 0x1c, - 0x73, 0xea, 0x99, 0x3b, 0x12, 0xe2, 0x94, 0x43, 0x6f, 0x3d, 0x71, 0xab, 0x38, 0x55, 0x9c, 0x38, - 0xb5, 0x28, 0x11, 0x04, 0xf1, 0x4f, 0x80, 0xe6, 0xb1, 0xeb, 0x7d, 0xc5, 0x29, 0x1c, 0xb8, 0x24, - 0x3b, 0xdf, 0x6b, 0xbe, 0xdf, 0xef, 0x9b, 0xef, 0xfb, 0x0c, 0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x50, 0xc8, 0xba, 0x9e, 0xa3, 0x48, 0x75, 0xa9, 0xb1, - 0x68, 0x81, 0x48, 0x74, 0xc7, 0xd1, 0x1f, 0x4b, 0xa0, 0xd2, 0xc1, 0xee, 0xfb, 0x87, 0xb0, 0xff, - 0x31, 0x63, 0x6f, 0x1f, 0x05, 0x04, 0x06, 0x44, 0xfe, 0x04, 0x94, 0xfb, 0xfc, 0x93, 0x79, 0x9d, - 0x53, 0xe7, 0xb6, 0xf6, 0xf3, 0xa3, 0x1d, 0x35, 0xd5, 0x0a, 0x51, 0x15, 0x99, 0xaf, 0x15, 0x05, - 0xa1, 0xb8, 0xed, 0x11, 0x39, 0x40, 0x43, 0x8f, 0x4c, 0x94, 0x79, 0xc6, 0xc9, 0x54, 0xd0, 0xda, - 0xa3, 0xb8, 0xa7, 0x67, 0x0a, 0x5c, 0xcf, 0x01, 0xcf, 0x25, 0xa9, 0x6b, 0xe0, 0x6a, 0x91, 0x3c, - 0x82, 0xaf, 0xff, 0x2e, 0x81, 0x72, 0x07, 0xbb, 0xf7, 0x11, 0x81, 0xf2, 0x5e, 0x01, 0x15, 0xed, - 0xca, 0x5f, 0xcf, 0x6a, 0x49, 0x31, 0x7f, 0x35, 0x09, 0x82, 0x64, 0x03, 0x2c, 0x8d, 0x11, 0x81, - 0x43, 0x9e, 0xf3, 0x8c, 0xe7, 0xc2, 0xcd, 0xe4, 0x26, 0x28, 0xa1, 0x90, 0x78, 0x28, 0x60, 0xef, - 0x6b, 0x63, 0xfa, 0xc8, 0x39, 0x3b, 0x06, 0xcd, 0xe5, 0x53, 0x66, 0x60, 0x09, 0xc3, 0x59, 0xcf, - 0xab, 0xf5, 0x0a, 0x25, 0x86, 0x87, 0xa6, 0xa4, 0x5c, 0xca, 0x91, 0x42, 0xe3, 0xe9, 0x5b, 0x60, - 0x53, 0x7c, 0xc6, 0xd0, 0xff, 0x96, 0x62, 0xd9, 0x17, 0xd0, 0x73, 0x0f, 0x08, 0x74, 0xfe, 0x2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0xbd, 0x27, 0x27, - 0x9a, 0xf4, 0xf4, 0x44, 0x93, 0x7e, 0x3b, 0xd1, 0xa4, 0x87, 0xa7, 0xda, 0xdc, 0xd3, 0x53, 0x6d, - 0xee, 0xd7, 0x53, 0x6d, 0xee, 0xcb, 0x97, 0x78, 0x24, 0xec, 0x3c, 0x30, 0x3c, 0x24, 0xe6, 0x02, - 0xfb, 0xe9, 0x47, 0x7f, 0x68, 0x97, 0xd8, 0xb3, 0x7f, 0xf3, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x04, 0x0a, 0x84, 0x9f, 0xa8, 0x0b, 0x00, 0x00, + // 1114 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcb, 0x6f, 0xdc, 0x44, + 0x18, 0xcf, 0xe4, 0xb5, 0xc9, 0xe4, 0xa5, 0x8c, 0xb6, 0xad, 0xe3, 0x16, 0xef, 0xd6, 0x45, 0xb0, + 0x4a, 0x89, 0xcd, 0x06, 0x52, 0xa1, 0xa5, 0x42, 0x74, 0xc3, 0xab, 0x12, 0x81, 0xca, 0x2d, 0x45, + 0x42, 0x48, 0x91, 0xb3, 0x1e, 0x1c, 0xab, 0x6b, 0x8f, 0xb5, 0x33, 0xbb, 0xca, 0xde, 0x10, 0xc7, + 0x9c, 0x7a, 0xe6, 0x2f, 0x40, 0x9c, 0x72, 0xe8, 0xad, 0x27, 0x6e, 0x15, 0xa7, 0x8a, 0x13, 0xa7, + 0x16, 0x25, 0x82, 0x20, 0xf8, 0x23, 0x40, 0x33, 0x1e, 0x7b, 0xfd, 0xca, 0xa6, 0x70, 0xe8, 0x65, + 0xd7, 0xf3, 0xbd, 0xe6, 0xfb, 0xfd, 0xbe, 0x6f, 0xbe, 0x19, 0x78, 0xb1, 0x43, 0xa8, 0x4f, 0xa8, + 0xe9, 0x92, 0x81, 0x39, 0x68, 0x9a, 0xec, 0xc0, 0x08, 0x7b, 0x84, 0x11, 0xb4, 0x14, 0xc9, 0x0d, + 0x97, 0x0c, 0x8c, 0x41, 0x53, 0xd5, 0xa4, 0xd9, 0x9e, 0x4d, 0xb1, 0x39, 0x68, 0xee, 0x61, 0x66, + 0x37, 0xcd, 0x0e, 0xf1, 0x82, 0xc8, 0x5c, 0xbd, 0x94, 0x0d, 0xc3, 0xbd, 0x22, 0x45, 0xd5, 0x25, + 0x2e, 0x11, 0x9f, 0x26, 0xff, 0x92, 0xd2, 0xb5, 0xc8, 0x7c, 0x37, 0x52, 0xc8, 0xad, 0xa4, 0xca, + 0x25, 0xc4, 0xed, 0x62, 0x53, 0xac, 0xf6, 0xfa, 0xdf, 0x98, 0x76, 0x30, 0xcc, 0x6d, 0xe2, 0x53, + 0x97, 0x6f, 0xe2, 0x53, 0x57, 0x2a, 0x56, 0x6d, 0xdf, 0x0b, 0x88, 0x29, 0x7e, 0xa5, 0xa8, 0x96, + 0x0f, 0xc3, 0x3c, 0x1f, 0x53, 0x66, 0xfb, 0x61, 0x64, 0xa0, 0xff, 0x3d, 0x05, 0x57, 0x77, 0xa8, + 0x7b, 0xb7, 0xbf, 0xe7, 0x7b, 0xec, 0x4e, 0x8f, 0x84, 0x84, 0xda, 0x5d, 0xf4, 0x26, 0x9c, 0xf3, + 0x31, 0xa5, 0xb6, 0x8b, 0xa9, 0x02, 0xea, 0x53, 0x8d, 0x85, 0xcd, 0xaa, 0x11, 0x45, 0x32, 0xe2, + 0x48, 0xc6, 0xad, 0x60, 0x68, 0x25, 0x56, 0xe8, 0x10, 0xc0, 0x15, 0x2f, 0xf0, 0x98, 0x67, 0x77, + 0x77, 0x1d, 0x1c, 0x12, 0xea, 0x31, 0x65, 0x52, 0x78, 0xae, 0x19, 0x12, 0x18, 0x27, 0xcd, 0x90, + 0xa4, 0x19, 0xdb, 0xc4, 0x0b, 0xda, 0x1f, 0x3d, 0x79, 0x56, 0x9b, 0xf8, 0xf1, 0x79, 0xad, 0xe1, + 0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0x1e, 0x4f, 0x5f, + 0x85, 0x2b, 0xf2, 0x33, 0x81, 0xfe, 0x0f, 0x48, 0x64, 0x5f, 0x62, 0xcf, 0xdd, 0xe7, 0xfd, 0xf9, + 0x92, 0x28, 0x78, 0x17, 0x56, 0x22, 0x64, 0x54, 0x99, 0x12, 0xe3, 0xe2, 0x6a, 0x8e, 0x83, 0x38, + 0xa1, 0x14, 0x17, 0xb1, 0xc7, 0x58, 0x32, 0xde, 0xc8, 0x92, 0xf1, 0x4a, 0x29, 0x19, 0x71, 0x70, + 0x7d, 0x0d, 0x5e, 0xca, 0x89, 0x12, 0x72, 0xfe, 0x00, 0x10, 0xee, 0x50, 0x37, 0x9e, 0x2d, 0xff, + 0x93, 0x97, 0x1b, 0x70, 0x5e, 0x8e, 0x45, 0x72, 0x3e, 0x37, 0x23, 0x53, 0x74, 0x13, 0xce, 0xda, + 0x3e, 0xe9, 0x07, 0x4c, 0xd2, 0x33, 0x66, 0x9a, 0xce, 0xf3, 0x69, 0x1a, 0xed, 0x2c, 0x7d, 0x5a, + 0xd7, 0xc5, 0x51, 0x49, 0xa2, 0x71, 0x22, 0x94, 0x02, 0x11, 0x12, 0x99, 0x5e, 0x85, 0x68, 0xb4, + 0x4a, 0xe0, 0x3f, 0x8e, 0x7a, 0xe3, 0x8b, 0xd0, 0xb1, 0x19, 0xbe, 0x63, 0xf7, 0x6c, 0x9f, 0x72, + 0x30, 0xa3, 0xf3, 0x09, 0xce, 0x03, 0x93, 0x98, 0xa2, 0x77, 0xe0, 0x6c, 0x28, 0x22, 0x08, 0x06, + 0x16, 0x36, 0x2f, 0xe4, 0x87, 0x9d, 0x50, 0x66, 0x80, 0x44, 0xf6, 0xad, 0x1b, 0xc5, 0x33, 0x7f, + 0x2d, 0x05, 0xe4, 0x20, 0xbe, 0x71, 0x73, 0x99, 0xca, 0xba, 0xa6, 0x45, 0x09, 0xb0, 0x43, 0x20, + 0x6e, 0xbe, 0x6d, 0x3b, 0xe8, 0xe0, 0x6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0xb1, 0xe2, 0xd5, 0xcf, 0x1d, + 0xa9, 0x92, 0xea, 0x67, 0x2d, 0xca, 0xaa, 0x5f, 0x7e, 0x12, 0xd4, 0x99, 0x6f, 0xf9, 0x58, 0x68, + 0x6f, 0x3d, 0x39, 0xd6, 0xc0, 0xd3, 0x63, 0x0d, 0xfc, 0x76, 0xac, 0x81, 0x87, 0x27, 0xda, 0xc4, + 0xd3, 0x13, 0x6d, 0xe2, 0xd7, 0x13, 0x6d, 0xe2, 0xab, 0xcb, 0x51, 0x24, 0xea, 0x3c, 0x30, 0x3c, + 0x22, 0xe7, 0x82, 0x78, 0x40, 0xf2, 0xe7, 0xfa, 0xac, 0x68, 0xfb, 0xb7, 0xfe, 0x0d, 0x00, 0x00, + 0xff, 0xff, 0x46, 0x1f, 0x89, 0xe5, 0xee, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1261,6 +1279,11 @@ func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ProposalType != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalType)) + i-- + dAtA[i] = 0x40 + } if m.Expedited { i-- if m.Expedited { @@ -1831,6 +1854,9 @@ func (m *MsgSubmitProposal) Size() (n int) { if m.Expedited { n += 2 } + if m.ProposalType != 0 { + n += 1 + sovTx(uint64(m.ProposalType)) + } return n } @@ -2278,6 +2304,25 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } } m.Expedited = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalType", wireType) + } + m.ProposalType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalType |= ProposalType(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index edadc770756b..068952d71099 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -11,11 +11,17 @@ import ( ) const ( - OptionEmpty = VoteOption_VOTE_OPTION_UNSPECIFIED - OptionYes = VoteOption_VOTE_OPTION_YES - OptionNo = VoteOption_VOTE_OPTION_NO - OptionNoWithVeto = VoteOption_VOTE_OPTION_NO_WITH_VETO - OptionAbstain = VoteOption_VOTE_OPTION_ABSTAIN + OptionEmpty = VoteOption_VOTE_OPTION_UNSPECIFIED + OptionOne = VoteOption_VOTE_OPTION_ONE + OptionTwo = VoteOption_VOTE_OPTION_TWO + OptionThree = VoteOption_VOTE_OPTION_THREE + OptionFour = VoteOption_VOTE_OPTION_FOUR + OptionSpam = VoteOption_VOTE_OPTION_SPAM + + OptionYes = OptionOne + OptionNo = OptionThree + OptionNoWithVeto = OptionFour + OptionAbstain = OptionTwo ) // NewVote creates a new Vote instance @@ -103,7 +109,7 @@ func (v WeightedVoteOptions) String() string { func VoteOptionFromString(str string) (VoteOption, error) { option, ok := VoteOption_value[str] if !ok { - return OptionEmpty, fmt.Errorf("'%s' is not a valid vote option, available options: yes/no/no_with_veto/abstain", str) + return OptionEmpty, fmt.Errorf("'%s' is not a valid vote option, available options: yes,option_one/no,option_three/no_with_veto,option_four/abstain,option_two/spam", str) } return VoteOption(option), nil } @@ -132,10 +138,11 @@ func WeightedVoteOptionsFromString(str string) (WeightedVoteOptions, error) { // ValidVoteOption returns true if the vote option is valid and false otherwise. func ValidVoteOption(option VoteOption) bool { - if option == OptionYes || - option == OptionAbstain || - option == OptionNo || - option == OptionNoWithVeto { + if option == OptionOne || + option == OptionTwo || + option == OptionThree || + option == OptionFour || + option == OptionSpam { return true } return false