From 62ef6939d7b44ed890b027d5a2780761c9c3628f Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 21 Nov 2023 18:01:16 +0100 Subject: [PATCH 01/17] feat(gov): add proposal types and spam votes --- api/cosmos/gov/v1/gov.pulsar.go | 672 ++++++++++++------ api/cosmos/nft/v1beta1/query.pulsar.go | 20 + api/cosmos/nft/v1beta1/query_grpc.pb.go | 20 + proto/cosmos/gov/v1/gov.proto | 51 +- testutil/testdata/query.pb.go | 7 +- testutil/testdata/testdata.pb.go | 7 +- testutil/testdata/testpb/query.pulsar.go | 7 +- testutil/testdata/testpb/query_grpc.pb.go | 1 - testutil/testdata/testpb/testdata.pulsar.go | 7 +- testutil/testdata/testpb/tx.pulsar.go | 9 +- testutil/testdata/testpb/tx_grpc.pb.go | 1 - .../testdata/testpb/unknonwnproto.pulsar.go | 13 +- testutil/testdata/tx.pb.go | 7 +- testutil/testdata/unknonwnproto.pb.go | 7 +- x/gov/abci.go | 2 +- x/gov/keeper/migrations.go | 6 + x/gov/keeper/msg_server_test.go | 18 +- x/gov/keeper/tally.go | 6 + x/gov/keeper/tally_test.go | 106 +-- x/gov/migrations/v6/store.go | 30 + x/gov/migrations/v6/store_test.go | 1 + x/gov/module.go | 6 +- x/gov/types/v1/gov.pb.go | 368 +++++++--- x/gov/types/v1/tally.go | 17 +- x/gov/types/v1/vote.go | 16 +- x/nft/query.pb.go | 40 ++ 26 files changed, 984 insertions(+), 461 deletions(-) create mode 100644 x/gov/migrations/v6/store.go create mode 100644 x/gov/migrations/v6/store_test.go diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 1200fbc1e4aa..120a2dad4f0b 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,103 @@ 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. - VoteOption_VOTE_OPTION_YES VoteOption = 1 - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 - // VOTE_OPTION_NO defines a no vote option. - VoteOption_VOTE_OPTION_NO VoteOption = 3 - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VoteOption_VOTE_OPTION_NO_WITH_VETO VoteOption = 4 + // VOTE_OPTION_ONE defines the first proposal vote option. + VoteOption_VOTE_OPTION_ONE VoteOption = 1 + // VOTE_OPTION_TWO defines the second proposal vote option. + VoteOption_VOTE_OPTION_TWO VoteOption = 2 + // VOTE_OPTION_THREE defines the third proposal vote option. + VoteOption_VOTE_OPTION_THREE VoteOption = 3 + // VOTE_OPTION_FOUR defines the fourth proposal vote option. + VoteOption_VOTE_OPTION_FOUR 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", + 2: "VOTE_OPTION_TWO", + 3: "VOTE_OPTION_THREE", + 4: "VOTE_OPTION_FOUR", + 5: "VOTE_OPTION_SPAM", } VoteOption_value = map[string]int32{ - "VOTE_OPTION_UNSPECIFIED": 0, - "VOTE_OPTION_YES": 1, - "VOTE_OPTION_ABSTAIN": 2, - "VOTE_OPTION_NO": 3, - "VOTE_OPTION_NO_WITH_VETO": 4, + "VOTE_OPTION_UNSPECIFIED": 0, + "VOTE_OPTION_ONE": 1, + "VOTE_OPTION_TWO": 2, + "VOTE_OPTION_THREE": 3, + "VOTE_OPTION_FOUR": 4, + "VOTE_OPTION_SPAM": 5, } ) @@ -7033,11 +7213,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 +7226,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 +7283,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 +7296,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 +7446,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 +7571,7 @@ func (x *Proposal) GetProposer() string { return "" } +// Deprecated: Do not use. func (x *Proposal) GetExpedited() bool { if x != nil { return x.Expedited @@ -7398,6 +7586,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 +7600,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 +7659,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 +8103,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,163 +8148,181 @@ 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, - 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, - 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, - 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, - 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, - 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, - 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, - 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, - 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, - 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, - 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, - 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, - 0x42, 0x99, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 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, + 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, 0x96, 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, 0x54, 0x57, 0x4f, 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, + 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, + 0x4f, 0x55, 0x52, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x50, 0x41, 0x4d, 0x10, 0x05, 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, 0x44, 0x10, 0x00, 0x12, + 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, + 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, + 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, + 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, + 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, + 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0x99, 0x01, 0x0a, + 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 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 ( @@ -8115,50 +8337,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 +8505,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/nft/v1beta1/query.pulsar.go b/api/cosmos/nft/v1beta1/query.pulsar.go index 5f0101a7084d..764855b26a88 100644 --- a/api/cosmos/nft/v1beta1/query.pulsar.go +++ b/api/cosmos/nft/v1beta1/query.pulsar.go @@ -10998,6 +10998,8 @@ func (x *QueryBalanceRequest) GetOwner() string { } // QueryBalanceByQueryStringRequest is the request type for the Query/Balance RPC method +// +// Since: nft v0.1.1 type QueryBalanceByQueryStringRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11081,6 +11083,8 @@ func (x *QueryBalanceResponse) GetAmount() uint64 { } // QueryBalanceByQueryStringResponse is the response type for the Query/Balance RPC method +// +// Since: nft v0.1.1 type QueryBalanceByQueryStringResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11164,6 +11168,8 @@ func (x *QueryOwnerRequest) GetId() string { } // QueryOwnerByQueryStringRequest is the request type for the Query/Owner RPC method +// +// Since: nft v0.1.1 type QueryOwnerByQueryStringRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11247,6 +11253,8 @@ func (x *QueryOwnerResponse) GetOwner() string { } // QueryOwnerByQueryStringResponse is the response type for the Query/Owner RPC method +// +// Since: nft v0.1.1 type QueryOwnerByQueryStringResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11321,6 +11329,8 @@ func (x *QuerySupplyRequest) GetClassId() string { } // QuerySupplyByQueryStringRequest is the request type for the Query/Supply RPC method +// +// Since: nft v0.1.1 type QuerySupplyByQueryStringRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11395,6 +11405,8 @@ func (x *QuerySupplyResponse) GetAmount() uint64 { } // QuerySupplyByQueryStringResponse is the response type for the Query/Supply RPC method +// +// Since: nft v0.1.1 type QuerySupplyByQueryStringResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11579,6 +11591,8 @@ func (x *QueryNFTRequest) GetId() string { } // QueryNFTByQueryStringRequest is the request type for the Query/NFT RPC method +// +// Since: nft v0.1.1 type QueryNFTByQueryStringRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11662,6 +11676,8 @@ func (x *QueryNFTResponse) GetNft() *NFT { } // QueryNFTByQueryStringResponse is the response type for the Query/NFT RPC method +// +// Since: nft v0.1.1 type QueryNFTByQueryStringResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11736,6 +11752,8 @@ func (x *QueryClassRequest) GetClassId() string { } // QueryClassByQueryStringRequest is the request type for the Query/Class RPC method +// +// Since: nft v0.1.1 type QueryClassByQueryStringRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11810,6 +11828,8 @@ func (x *QueryClassResponse) GetClass() *Class { } // QueryClassByQueryStringResponse is the response type for the Query/Class RPC method +// +// Since: nft v0.1.1 type QueryClassByQueryStringResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/cosmos/nft/v1beta1/query_grpc.pb.go b/api/cosmos/nft/v1beta1/query_grpc.pb.go index d25acc384af2..df71c4359a94 100644 --- a/api/cosmos/nft/v1beta1/query_grpc.pb.go +++ b/api/cosmos/nft/v1beta1/query_grpc.pb.go @@ -40,14 +40,20 @@ type QueryClient interface { // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) // BalancebyQueryString queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 + // + // Since: nft v0.1.1 BalanceByQueryString(ctx context.Context, in *QueryBalanceByQueryStringRequest, opts ...grpc.CallOption) (*QueryBalanceByQueryStringResponse, error) // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 Owner(ctx context.Context, in *QueryOwnerRequest, opts ...grpc.CallOption) (*QueryOwnerResponse, error) // OwnerByQueryString queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 + // + // Since: nft v0.1.1 OwnerByQueryString(ctx context.Context, in *QueryOwnerByQueryStringRequest, opts ...grpc.CallOption) (*QueryOwnerByQueryStringResponse, error) // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) // SupplyByQueryString queries the number of NFTs from the given class, same as totalSupply of ERC721. + // + // Since: nft v0.1.1 SupplyByQueryString(ctx context.Context, in *QuerySupplyByQueryStringRequest, opts ...grpc.CallOption) (*QuerySupplyByQueryStringResponse, error) // NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in // ERC721Enumerable @@ -55,10 +61,14 @@ type QueryClient interface { // NFT queries an NFT based on its class and id. NFT(ctx context.Context, in *QueryNFTRequest, opts ...grpc.CallOption) (*QueryNFTResponse, error) // NFTByQueryString queries an NFT based on its class and id. + // + // Since: nft v0.1.1 NFTByQueryString(ctx context.Context, in *QueryNFTByQueryStringRequest, opts ...grpc.CallOption) (*QueryNFTByQueryStringResponse, error) // Class queries an NFT class based on its id Class(ctx context.Context, in *QueryClassRequest, opts ...grpc.CallOption) (*QueryClassResponse, error) // Class queries an NFT class based on its id + // + // Since: nft v0.1.1 ClassByQueryString(ctx context.Context, in *QueryClassByQueryStringRequest, opts ...grpc.CallOption) (*QueryClassByQueryStringResponse, error) // Classes queries all NFT classes Classes(ctx context.Context, in *QueryClassesRequest, opts ...grpc.CallOption) (*QueryClassesResponse, error) @@ -187,14 +197,20 @@ type QueryServer interface { // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) // BalancebyQueryString queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 + // + // Since: nft v0.1.1 BalanceByQueryString(context.Context, *QueryBalanceByQueryStringRequest) (*QueryBalanceByQueryStringResponse, error) // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 Owner(context.Context, *QueryOwnerRequest) (*QueryOwnerResponse, error) // OwnerByQueryString queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 + // + // Since: nft v0.1.1 OwnerByQueryString(context.Context, *QueryOwnerByQueryStringRequest) (*QueryOwnerByQueryStringResponse, error) // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error) // SupplyByQueryString queries the number of NFTs from the given class, same as totalSupply of ERC721. + // + // Since: nft v0.1.1 SupplyByQueryString(context.Context, *QuerySupplyByQueryStringRequest) (*QuerySupplyByQueryStringResponse, error) // NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in // ERC721Enumerable @@ -202,10 +218,14 @@ type QueryServer interface { // NFT queries an NFT based on its class and id. NFT(context.Context, *QueryNFTRequest) (*QueryNFTResponse, error) // NFTByQueryString queries an NFT based on its class and id. + // + // Since: nft v0.1.1 NFTByQueryString(context.Context, *QueryNFTByQueryStringRequest) (*QueryNFTByQueryStringResponse, error) // Class queries an NFT class based on its id Class(context.Context, *QueryClassRequest) (*QueryClassResponse, error) // Class queries an NFT class based on its id + // + // Since: nft v0.1.1 ClassByQueryString(context.Context, *QueryClassByQueryStringRequest) (*QueryClassByQueryStringResponse, error) // Classes queries all NFT classes Classes(context.Context, *QueryClassesRequest) (*QueryClassesResponse, error) diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 8ab849500d00..1558255a33e2 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -12,18 +12,35 @@ 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 { // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. VOTE_OPTION_UNSPECIFIED = 0; - // VOTE_OPTION_YES defines a yes vote option. - VOTE_OPTION_YES = 1; - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VOTE_OPTION_ABSTAIN = 2; - // VOTE_OPTION_NO defines a no vote option. - VOTE_OPTION_NO = 3; - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VOTE_OPTION_NO_WITH_VETO = 4; + // VOTE_OPTION_ONE defines the first proposal vote option. + VOTE_OPTION_ONE = 1; + // VOTE_OPTION_TWO defines the second proposal vote option. + VOTE_OPTION_TWO = 2; + // VOTE_OPTION_THREE defines the third proposal vote option. + VOTE_OPTION_THREE = 3; + // VOTE_OPTION_FOUR defines the fourth proposal vote option. + VOTE_OPTION_FOUR = 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 +119,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 +157,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/testutil/testdata/query.pb.go b/testutil/testdata/query.pb.go index 0bb946d1a9a6..d104840c5dce 100644 --- a/testutil/testdata/query.pb.go +++ b/testutil/testdata/query.pb.go @@ -6,16 +6,15 @@ package testdata import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types "github.com/cosmos/cosmos-sdk/codec/types" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/testutil/testdata/testdata.pb.go b/testutil/testdata/testdata.pb.go index 93017231c60c..3db89888b056 100644 --- a/testutil/testdata/testdata.pb.go +++ b/testutil/testdata/testdata.pb.go @@ -5,13 +5,12 @@ package testdata import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/testutil/testdata/testpb/query.pulsar.go b/testutil/testdata/testpb/query.pulsar.go index f4e9bad12663..9b2a04bab5cc 100644 --- a/testutil/testdata/testpb/query.pulsar.go +++ b/testutil/testdata/testpb/query.pulsar.go @@ -3,15 +3,14 @@ package testpb import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/testutil/testdata/testpb/query_grpc.pb.go b/testutil/testdata/testpb/query_grpc.pb.go index e01aae23a5c3..565a93499d4b 100644 --- a/testutil/testdata/testpb/query_grpc.pb.go +++ b/testutil/testdata/testpb/query_grpc.pb.go @@ -8,7 +8,6 @@ package testpb import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/testutil/testdata/testpb/testdata.pulsar.go b/testutil/testdata/testpb/testdata.pulsar.go index 00473c4fd0e8..8802ea9cd312 100644 --- a/testutil/testdata/testpb/testdata.pulsar.go +++ b/testutil/testdata/testpb/testdata.pulsar.go @@ -3,16 +3,15 @@ package testpb import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/testutil/testdata/testpb/tx.pulsar.go b/testutil/testdata/testpb/tx.pulsar.go index d1a26a980dc6..5e4213c4802a 100644 --- a/testutil/testdata/testpb/tx.pulsar.go +++ b/testutil/testdata/testpb/tx.pulsar.go @@ -2,18 +2,17 @@ package testpb import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/amino" _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/testutil/testdata/testpb/tx_grpc.pb.go b/testutil/testdata/testpb/tx_grpc.pb.go index 103111c993a2..3971c84d770a 100644 --- a/testutil/testdata/testpb/tx_grpc.pb.go +++ b/testutil/testdata/testpb/tx_grpc.pb.go @@ -8,7 +8,6 @@ package testpb import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/testutil/testdata/testpb/unknonwnproto.pulsar.go b/testutil/testdata/testpb/unknonwnproto.pulsar.go index 5e5c214b36f5..84dbe6fbdb53 100644 --- a/testutil/testdata/testpb/unknonwnproto.pulsar.go +++ b/testutil/testdata/testpb/unknonwnproto.pulsar.go @@ -2,21 +2,20 @@ package testpb import ( + v1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" binary "encoding/binary" fmt "fmt" - io "io" - math "math" - reflect "reflect" - sort "sort" - sync "sync" - - v1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + math "math" + reflect "reflect" + sort "sort" + sync "sync" ) var ( diff --git a/testutil/testdata/tx.pb.go b/testutil/testdata/tx.pb.go index 70ed5f9952b7..e2d416faa41e 100644 --- a/testutil/testdata/tx.pb.go +++ b/testutil/testdata/tx.pb.go @@ -6,10 +6,6 @@ package testdata import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" @@ -18,6 +14,9 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/testutil/testdata/unknonwnproto.pb.go b/testutil/testdata/unknonwnproto.pb.go index 69d4059c44ef..3522a7253598 100644 --- a/testutil/testdata/unknonwnproto.pb.go +++ b/testutil/testdata/unknonwnproto.pb.go @@ -6,14 +6,13 @@ package testdata import ( encoding_binary "encoding/binary" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types "github.com/cosmos/cosmos-sdk/codec/types" tx "github.com/cosmos/cosmos-sdk/types/tx" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/gov/abci.go b/x/gov/abci.go index 6f813552e3b0..50a46c956eb4 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -199,7 +199,7 @@ 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 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_test.go b/x/gov/keeper/msg_server_test.go index 0c8be118bc42..f42f970661db 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index f1805aab5073..1a847210fc7e 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -21,6 +21,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) @@ -137,6 +138,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 9602b4d25055..52f599ac25ee 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -96,7 +96,7 @@ func TestTally(t *testing.T) { 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 @@ -111,7 +111,7 @@ func TestTally(t *testing.T) { 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 @@ -131,7 +131,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 @@ -151,8 +151,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 @@ -172,8 +172,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 @@ -205,10 +205,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 @@ -223,10 +223,10 @@ func TestTally(t *testing.T) { 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, @@ -241,13 +241,13 @@ func TestTally(t *testing.T) { 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, @@ -262,10 +262,10 @@ func TestTally(t *testing.T) { 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, @@ -280,13 +280,13 @@ func TestTally(t *testing.T) { 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, @@ -301,12 +301,12 @@ func TestTally(t *testing.T) { 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, @@ -322,13 +322,13 @@ func TestTally(t *testing.T) { expedited: true, 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, @@ -344,13 +344,13 @@ func TestTally(t *testing.T) { expedited: true, 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, diff --git a/x/gov/migrations/v6/store.go b/x/gov/migrations/v6/store.go new file mode 100644 index 000000000000..dc039ede2f85 --- /dev/null +++ b/x/gov/migrations/v6/store.go @@ -0,0 +1,30 @@ +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 + if err := 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 + } + proposalCollection.Set(ctx, key, proposal) + + return false, nil + }); err != nil { + return err + } + + return 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..41c0ebe310d5 --- /dev/null +++ b/x/gov/migrations/v6/store_test.go @@ -0,0 +1 @@ +package v6_test 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/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 509021687711..6e6cce5e32bf 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -32,36 +32,81 @@ 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. - VoteOption_VOTE_OPTION_YES VoteOption = 1 - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 - // VOTE_OPTION_NO defines a no vote option. - VoteOption_VOTE_OPTION_NO VoteOption = 3 - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VoteOption_VOTE_OPTION_NO_WITH_VETO VoteOption = 4 + // VOTE_OPTION_ONE defines the first proposal vote option. + VoteOption_VOTE_OPTION_ONE VoteOption = 1 + // VOTE_OPTION_TWO defines the second proposal vote option. + VoteOption_VOTE_OPTION_TWO VoteOption = 2 + // VOTE_OPTION_THREE defines the third proposal vote option. + VoteOption_VOTE_OPTION_THREE VoteOption = 3 + // VOTE_OPTION_FOUR defines the fourth proposal vote option. + VoteOption_VOTE_OPTION_FOUR 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", + 2: "VOTE_OPTION_TWO", + 3: "VOTE_OPTION_THREE", + 4: "VOTE_OPTION_FOUR", + 5: "VOTE_OPTION_SPAM", } var VoteOption_value = map[string]int32{ - "VOTE_OPTION_UNSPECIFIED": 0, - "VOTE_OPTION_YES": 1, - "VOTE_OPTION_ABSTAIN": 2, - "VOTE_OPTION_NO": 3, - "VOTE_OPTION_NO_WITH_VETO": 4, + "VOTE_OPTION_UNSPECIFIED": 0, + "VOTE_OPTION_ONE": 1, + "VOTE_OPTION_TWO": 2, + "VOTE_OPTION_THREE": 3, + "VOTE_OPTION_FOUR": 4, + "VOTE_OPTION_SPAM": 5, } func (x VoteOption) String() string { @@ -69,7 +114,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 +163,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 +327,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 +463,7 @@ func (m *Proposal) GetProposer() string { return "" } +// Deprecated: Do not use. func (m *Proposal) GetExpedited() bool { if m != nil { return m.Expedited @@ -427,6 +478,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 +495,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 +560,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 +1016,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 +1033,104 @@ 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, 0x8f, 0x0f, 0xec, 0x2f, 0x50, 0x7a, 0x80, 0xce, 0x74, 0x9c, 0xd8, 0x14, 0x67, 0x20, 0x76, - 0x65, 0x93, 0x40, 0x2f, 0x1a, 0x25, 0x5a, 0x9c, 0x9d, 0x5a, 0x5a, 0x57, 0xbb, 0x0e, 0xf1, 0xbd, - 0x97, 0x9e, 0xca, 0xb1, 0xa7, 0x4e, 0x8f, 0x3d, 0xf6, 0xc0, 0xf4, 0x6f, 0xe0, 0xd4, 0x61, 0xb8, - 0xb4, 0x97, 0xd2, 0x0e, 0x1c, 0x3a, 0xc3, 0x5f, 0xd1, 0xd1, 0xee, 0xca, 0x52, 0x1c, 0xb7, 0x49, - 0xb8, 0x24, 0xd2, 0xfb, 0x3e, 0xcf, 0xb3, 0xef, 0xbe, 0x3f, 0x76, 0x65, 0x98, 0xdf, 0xa3, 0xcc, - 0xa1, 0xac, 0xdc, 0xa1, 0x07, 0xe5, 0x83, 0x35, 0xff, 0x5f, 0xa9, 0xe7, 0x51, 0x4e, 0x51, 0x56, - 0x3a, 0x4a, 0xbe, 0xe5, 0x60, 0x6d, 0x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 0x00, 0x00, 0xff, 0xff, 0xdf, 0xb5, 0x41, 0x36, 0x1f, 0x0e, 0x00, 0x00, + // 1537 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4d, 0x6f, 0xdb, 0xc8, + 0x19, 0x36, 0xf5, 0x65, 0xe9, 0xd5, 0x87, 0xe9, 0x89, 0x1d, 0xd3, 0x76, 0x2c, 0x3b, 0x6a, 0x10, + 0xb8, 0x6e, 0x22, 0xd5, 0x49, 0xd3, 0x43, 0x52, 0xa0, 0x95, 0x25, 0xa6, 0xa6, 0x61, 0x5b, 0x2a, + 0x45, 0xdb, 0x49, 0x2f, 0x04, 0x6d, 0x4e, 0x64, 0xa2, 0x22, 0x47, 0x25, 0x47, 0x8e, 0xf5, 0x07, + 0x7a, 0x6d, 0x4e, 0x45, 0x4f, 0x45, 0x6f, 0xed, 0x71, 0x0f, 0xc1, 0xfe, 0x86, 0x60, 0x0f, 0x8b, + 0x20, 0xa7, 0xbd, 0x6c, 0x76, 0x91, 0x1c, 0x16, 0xc8, 0xaf, 0x58, 0x70, 0x38, 0x14, 0x25, 0x59, + 0x59, 0xdb, 0xb9, 0xd8, 0xe4, 0xfb, 0x3e, 0xcf, 0x33, 0xef, 0xbc, 0x1f, 0x33, 0x22, 0x2c, 0x9c, + 0x10, 0xcf, 0x26, 0x5e, 0xa5, 0x4d, 0xce, 0x2a, 0x67, 0x9b, 0xfe, 0xbf, 0x72, 0xd7, 0x25, 0x94, + 0xa0, 0x7c, 0xe0, 0x28, 0xfb, 0x96, 0xb3, 0xcd, 0xa5, 0x22, 0xc7, 0x1d, 0x1b, 0x1e, 0xae, 0x9c, + 0x6d, 0x1e, 0x63, 0x6a, 0x6c, 0x56, 0x4e, 0x88, 0xe5, 0x04, 0xf0, 0xa5, 0xb9, 0x36, 0x69, 0x13, + 0xf6, 0x58, 0xf1, 0x9f, 0xb8, 0x75, 0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x1a, 0x1c, 0xd2, 0xac, 0xb6, 0x5a, 0x72, 0x5d, 0x8c, 0x8f, 0xa4, 0x9a, + 0xfb, 0x54, 0x79, 0x47, 0xae, 0xb1, 0x6c, 0x4e, 0x62, 0x3e, 0xad, 0x2a, 0xbb, 0x72, 0x5d, 0x4c, + 0x6e, 0x3d, 0x7a, 0xf3, 0xa1, 0x28, 0xbc, 0xfd, 0x50, 0x14, 0x7e, 0xfc, 0x50, 0x14, 0x5e, 0x7d, + 0x2c, 0x4e, 0xbd, 0xfd, 0x58, 0x9c, 0xfa, 0xee, 0x63, 0x71, 0xea, 0xaf, 0xcb, 0x41, 0x2b, 0x79, + 0xe6, 0xdf, 0xca, 0x16, 0xa9, 0x9c, 0xb3, 0xaf, 0x65, 0xff, 0x67, 0xa2, 0xe7, 0x7f, 0x0a, 0xa7, + 0xd8, 0x90, 0x3f, 0xfc, 0x39, 0x00, 0x00, 0xff, 0xff, 0xce, 0x9c, 0xc7, 0x5e, 0x4b, 0x0f, 0x00, + 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1161,6 +1237,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 +1402,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 +1905,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 +1933,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 +2830,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 +3027,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/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/vote.go b/x/gov/types/v1/vote.go index edadc770756b..705a2274d6bf 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 diff --git a/x/nft/query.pb.go b/x/nft/query.pb.go index e6ef5e297c83..523f9409f732 100644 --- a/x/nft/query.pb.go +++ b/x/nft/query.pb.go @@ -85,6 +85,8 @@ func (m *QueryBalanceRequest) GetOwner() string { } // QueryBalanceByQueryStringRequest is the request type for the Query/Balance RPC method +// +// Since: nft v0.1.1 type QueryBalanceByQueryStringRequest struct { // class_id associated with the nft ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` @@ -186,6 +188,8 @@ func (m *QueryBalanceResponse) GetAmount() uint64 { } // QueryBalanceByQueryStringResponse is the response type for the Query/Balance RPC method +// +// Since: nft v0.1.1 type QueryBalanceByQueryStringResponse struct { // amount is the number of all NFTs of a given class owned by the owner Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` @@ -287,6 +291,8 @@ func (m *QueryOwnerRequest) GetId() string { } // QueryOwnerByQueryStringRequest is the request type for the Query/Owner RPC method +// +// Since: nft v0.1.1 type QueryOwnerByQueryStringRequest struct { // class_id associated with the nft ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` @@ -388,6 +394,8 @@ func (m *QueryOwnerResponse) GetOwner() string { } // QueryOwnerByQueryStringResponse is the response type for the Query/Owner RPC method +// +// Since: nft v0.1.1 type QueryOwnerByQueryStringResponse struct { // owner is the owner address of the nft Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` @@ -480,6 +488,8 @@ func (m *QuerySupplyRequest) GetClassId() string { } // QuerySupplyByQueryStringRequest is the request type for the Query/Supply RPC method +// +// Since: nft v0.1.1 type QuerySupplyByQueryStringRequest struct { // class_id associated with the nft ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` @@ -572,6 +582,8 @@ func (m *QuerySupplyResponse) GetAmount() uint64 { } // QuerySupplyByQueryStringResponse is the response type for the Query/Supply RPC method +// +// Since: nft v0.1.1 type QuerySupplyByQueryStringResponse struct { // amount is the number of all NFTs from the given class Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` @@ -792,6 +804,8 @@ func (m *QueryNFTRequest) GetId() string { } // QueryNFTByQueryStringRequest is the request type for the Query/NFT RPC method +// +// Since: nft v0.1.1 type QueryNFTByQueryStringRequest struct { // class_id associated with the nft ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` @@ -893,6 +907,8 @@ func (m *QueryNFTResponse) GetNft() *NFT { } // QueryNFTByQueryStringResponse is the response type for the Query/NFT RPC method +// +// Since: nft v0.1.1 type QueryNFTByQueryStringResponse struct { // owner is the owner address of the nft Nft *NFT `protobuf:"bytes,1,opt,name=nft,proto3" json:"nft,omitempty"` @@ -985,6 +1001,8 @@ func (m *QueryClassRequest) GetClassId() string { } // QueryClassByQueryStringRequest is the request type for the Query/Class RPC method +// +// Since: nft v0.1.1 type QueryClassByQueryStringRequest struct { // class_id associated with the nft ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` @@ -1077,6 +1095,8 @@ func (m *QueryClassResponse) GetClass() *Class { } // QueryClassByQueryStringResponse is the response type for the Query/Class RPC method +// +// Since: nft v0.1.1 type QueryClassByQueryStringResponse struct { // class defines the class of the nft type. Class *Class `protobuf:"bytes,1,opt,name=class,proto3" json:"class,omitempty"` @@ -1330,14 +1350,20 @@ type QueryClient interface { // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) // BalancebyQueryString queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 + // + // Since: nft v0.1.1 BalanceByQueryString(ctx context.Context, in *QueryBalanceByQueryStringRequest, opts ...grpc.CallOption) (*QueryBalanceByQueryStringResponse, error) // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 Owner(ctx context.Context, in *QueryOwnerRequest, opts ...grpc.CallOption) (*QueryOwnerResponse, error) // OwnerByQueryString queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 + // + // Since: nft v0.1.1 OwnerByQueryString(ctx context.Context, in *QueryOwnerByQueryStringRequest, opts ...grpc.CallOption) (*QueryOwnerByQueryStringResponse, error) // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) // SupplyByQueryString queries the number of NFTs from the given class, same as totalSupply of ERC721. + // + // Since: nft v0.1.1 SupplyByQueryString(ctx context.Context, in *QuerySupplyByQueryStringRequest, opts ...grpc.CallOption) (*QuerySupplyByQueryStringResponse, error) // NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in // ERC721Enumerable @@ -1345,10 +1371,14 @@ type QueryClient interface { // NFT queries an NFT based on its class and id. NFT(ctx context.Context, in *QueryNFTRequest, opts ...grpc.CallOption) (*QueryNFTResponse, error) // NFTByQueryString queries an NFT based on its class and id. + // + // Since: nft v0.1.1 NFTByQueryString(ctx context.Context, in *QueryNFTByQueryStringRequest, opts ...grpc.CallOption) (*QueryNFTByQueryStringResponse, error) // Class queries an NFT class based on its id Class(ctx context.Context, in *QueryClassRequest, opts ...grpc.CallOption) (*QueryClassResponse, error) // Class queries an NFT class based on its id + // + // Since: nft v0.1.1 ClassByQueryString(ctx context.Context, in *QueryClassByQueryStringRequest, opts ...grpc.CallOption) (*QueryClassByQueryStringResponse, error) // Classes queries all NFT classes Classes(ctx context.Context, in *QueryClassesRequest, opts ...grpc.CallOption) (*QueryClassesResponse, error) @@ -1475,14 +1505,20 @@ type QueryServer interface { // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) // BalancebyQueryString queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 + // + // Since: nft v0.1.1 BalanceByQueryString(context.Context, *QueryBalanceByQueryStringRequest) (*QueryBalanceByQueryStringResponse, error) // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 Owner(context.Context, *QueryOwnerRequest) (*QueryOwnerResponse, error) // OwnerByQueryString queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 + // + // Since: nft v0.1.1 OwnerByQueryString(context.Context, *QueryOwnerByQueryStringRequest) (*QueryOwnerByQueryStringResponse, error) // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error) // SupplyByQueryString queries the number of NFTs from the given class, same as totalSupply of ERC721. + // + // Since: nft v0.1.1 SupplyByQueryString(context.Context, *QuerySupplyByQueryStringRequest) (*QuerySupplyByQueryStringResponse, error) // NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in // ERC721Enumerable @@ -1490,10 +1526,14 @@ type QueryServer interface { // NFT queries an NFT based on its class and id. NFT(context.Context, *QueryNFTRequest) (*QueryNFTResponse, error) // NFTByQueryString queries an NFT based on its class and id. + // + // Since: nft v0.1.1 NFTByQueryString(context.Context, *QueryNFTByQueryStringRequest) (*QueryNFTByQueryStringResponse, error) // Class queries an NFT class based on its id Class(context.Context, *QueryClassRequest) (*QueryClassResponse, error) // Class queries an NFT class based on its id + // + // Since: nft v0.1.1 ClassByQueryString(context.Context, *QueryClassByQueryStringRequest) (*QueryClassByQueryStringResponse, error) // Classes queries all NFT classes Classes(context.Context, *QueryClassesRequest) (*QueryClassesResponse, error) From 2a536e8ca9bf1cafbff679507b4f9410b249e60a Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 21 Nov 2023 18:03:03 +0100 Subject: [PATCH 02/17] updates --- x/gov/client/utils/utils.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/x/gov/client/utils/utils.go b/x/gov/client/utils/utils.go index 930fb7c0d788..e6488f8fac13 100644 --- a/x/gov/client/utils/utils.go +++ b/x/gov/client/utils/utils.go @@ -3,6 +3,7 @@ package utils import ( "strings" + v1 "cosmossdk.io/x/gov/types/v1" "cosmossdk.io/x/gov/types/v1beta1" ) @@ -10,16 +11,19 @@ import ( func NormalizeVoteOption(option string) string { switch option { case "Yes", "yes": - return v1beta1.OptionYes.String() + return v1.OptionYes.String() case "Abstain", "abstain": - return v1beta1.OptionAbstain.String() + return v1.OptionAbstain.String() case "No", "no": - return v1beta1.OptionNo.String() + return v1.OptionNo.String() case "NoWithVeto", "no_with_veto", "no-with-veto": - return v1beta1.OptionNoWithVeto.String() + return v1.OptionNoWithVeto.String() + + case "Spam", "spam": + return v1.OptionSpam.String() default: return option From e8da7ac0ea20daa0b4a6bd3887dd180636300945 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 22 Nov 2023 00:53:58 +0100 Subject: [PATCH 03/17] wip --- x/gov/CHANGELOG.md | 9 +++++++++ x/gov/abci_test.go | 6 +++--- x/gov/keeper/deposit_test.go | 6 +++--- x/gov/keeper/grpc_query_test.go | 4 ++-- x/gov/keeper/proposal.go | 7 +++---- x/gov/types/v1/proposal.go | 14 ++++++++++++-- x/gov/types/v1/proposals_test.go | 14 +++++++------- 7 files changed, 39 insertions(+), 21 deletions(-) diff --git a/x/gov/CHANGELOG.md b/x/gov/CHANGELOG.md index 45917d339173..998954c706d9 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -27,4 +27,13 @@ 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 + ### 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. + +### 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/abci_test.go b/x/gov/abci_test.go index 7dc07a51c4fd..edaf8681701b 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -30,7 +30,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) @@ -58,7 +58,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 @@ -404,7 +404,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { _, err := suite.StakingKeeper.EndBlocker(ctx) require.NoError(t, err) msg := banktypes.NewMsgSend(authtypes.NewModuleAddress(types.ModuleName), addrs[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000)))) - proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msg}, "", "title", "summary", proposer, false) + 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))) diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 3def399e811b..9d6ad4c489ae 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -146,7 +146,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 +226,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 @@ -416,7 +416,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/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index efc6c63d5395..7bc894b5749e 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) 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/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..95c902adad90 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,32 @@ 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) - 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) } 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()) From fb281bf2f2a759a723b65fb6d992bdf60c332acc Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 22 Nov 2023 16:13:06 +0100 Subject: [PATCH 04/17] fix tests --- CHANGELOG.md | 1 - tests/integration/gov/genesis_test.go | 4 +- .../integration/gov/keeper/grpc_query_test.go | 4 +- tests/integration/gov/keeper/tally_test.go | 32 ++++---- x/gov/CHANGELOG.md | 1 + x/gov/abci_test.go | 15 ++-- x/gov/keeper/deposit_test.go | 15 ++-- x/gov/keeper/grpc_query_test.go | 22 ++--- x/gov/keeper/hooks_test.go | 4 +- x/gov/keeper/keeper_test.go | 14 ++-- x/gov/keeper/msg_server.go | 8 +- x/gov/keeper/proposal.go | 5 ++ x/gov/keeper/proposal_test.go | 80 ++++++++++--------- x/gov/keeper/tally_test.go | 12 +-- x/gov/keeper/vote_test.go | 2 +- x/gov/simulation/operations_test.go | 8 +- 16 files changed, 124 insertions(+), 103 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6ba42414dff..a152cee88681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -160,7 +160,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/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..12433b4fc2bb 100644 --- a/tests/integration/gov/keeper/grpc_query_test.go +++ b/tests/integration/gov/keeper/grpc_query_test.go @@ -60,7 +60,7 @@ func TestGRPCQueryTally(t *testing.T) { "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() != "") @@ -183,7 +183,7 @@ func TestLegacyGRPCQueryTally(t *testing.T) { "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() != "") 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 998954c706d9..ad96ea99888a 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -33,6 +33,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### 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/17469) in `x/gov/types/v1beta1/vote.go` `NewVote` was removed, constructing the struct is required for this type ### Deprecated diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index edaf8681701b..96f6039465b3 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -319,15 +319,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, }, } @@ -336,7 +337,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 == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens.Mul(math.NewInt(depositMultiplier))) SortAddresses(addrs) @@ -353,7 +354,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))} diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 9d6ad4c489ae..e656bfeca05c 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 diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 7bc894b5749e..cd145ca46dc7 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -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{ 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/msg_server.go b/x/gov/keeper/msg_server.go index 87c5c4c34720..2169c3ec7499 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -84,7 +84,13 @@ 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) + // TODO(@julienrbt): will be modularized in subsequent PRs + proposalType := v1.ProposalType_PROPOSAL_TYPE_STANDARD + if msg.Expedited { + proposalType = v1.ProposalType_PROPOSAL_TYPE_EXPEDITED + } + + proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata, msg.Title, msg.Summary, proposer, proposalType) if err != nil { return nil, err } diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 6d673824f3d4..c3c1ec2c5b24 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -89,6 +89,11 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met submitTime := sdkCtx.HeaderInfo().Time depositPeriod := params.MaxDepositPeriod + // fallback to standard proposal type if not specified + if proposalType == v1.ProposalType_PROPOSAL_TYPE_UNSPECIFIED { + proposalType = v1.ProposalType_PROPOSAL_TYPE_STANDARD + } + 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_test.go b/x/gov/keeper/tally_test.go index 52f599ac25ee..d563829e6585 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -57,7 +57,7 @@ func TestTally(t *testing.T) { ) tests := []struct { name string - expedited bool + proposalType v1.ProposalType setup func(suite) expectedPass bool expectedBurn bool @@ -318,8 +318,8 @@ func TestTally(t *testing.T) { }, }, { - 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_ONE) @@ -340,8 +340,8 @@ func TestTally(t *testing.T) { }, }, { - 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_ONE) @@ -394,7 +394,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/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) From a568dc9f138e7e451de5b49f41b2d944011a6fa8 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 22 Nov 2023 17:29:51 +0100 Subject: [PATCH 05/17] updates --- api/cosmos/gov/v1/tx.pulsar.go | 437 +++++++++++++++++++------------- proto/cosmos/gov/v1/tx.proto | 11 +- x/gov/CHANGELOG.md | 12 +- x/gov/abci_test.go | 26 +- x/gov/client/cli/tx.go | 4 +- x/gov/client/cli/util.go | 32 ++- x/gov/client/cli/util_test.go | 4 +- x/gov/client/utils/utils.go | 25 +- x/gov/keeper/msg_server.go | 6 +- x/gov/keeper/msg_server_test.go | 68 ++--- x/gov/keeper/proposal.go | 5 - x/gov/simulation/operations.go | 7 +- x/gov/types/v1/msgs.go | 4 +- x/gov/types/v1/msgs_test.go | 18 +- x/gov/types/v1/tx.pb.go | 185 +++++++++----- 15 files changed, 496 insertions(+), 348 deletions(-) diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 1f4fd832f946..eedbf573ef1c 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_EXPDITED proposal type instead. + // When this field is set and no proposal_type is set, the proposal_type + // will be set to PROPOSAL_TYPE_EXPDITED 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/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 7519a74d1d9e..45e3911d92be 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_EXPDITED proposal type instead. + // When this field is set and no proposal_type is set, the proposal_type + // will be set to PROPOSAL_TYPE_EXPDITED 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/x/gov/CHANGELOG.md b/x/gov/CHANGELOG.md index ad96ea99888a..7ef77f271faf 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -27,13 +27,17 @@ 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 +* [#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/17469) in `x/gov/types/v1beta1/vote.go` `NewVote` was removed, constructing the struct is required for this type +* [#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/17469) in `x/gov/types/v1beta1/vote.go` `NewVote` was removed, constructing the struct is required for this type. ### Deprecated diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 96f6039465b3..dca647173f03 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -97,7 +97,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) require.NoError(t, err) @@ -142,7 +142,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) require.NoError(t, err) @@ -165,7 +165,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) require.NoError(t, err) @@ -205,7 +205,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) require.NoError(t, err) @@ -234,15 +234,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, }, } @@ -251,7 +251,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 == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens.Mul(math.NewInt(depositMultiplier))) SortAddresses(addrs) @@ -261,7 +261,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) @@ -282,7 +282,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 } @@ -300,7 +300,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 } @@ -494,7 +494,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) 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..5a84fdd14fac 100644 --- a/x/gov/client/cli/util.go +++ b/x/gov/client/cli/util.go @@ -10,6 +10,7 @@ import ( 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 +49,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 proposalType == "Text" || proposalType == "text" { + proposal.Type = v1beta1.ProposalTypeText + } proposal.Deposit, _ = fs.GetString(FlagDeposit) if err := proposal.validate(); err != nil { return nil, err @@ -83,12 +87,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 +111,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 +180,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 e6488f8fac13..c6d83caa1200 100644 --- a/x/gov/client/utils/utils.go +++ b/x/gov/client/utils/utils.go @@ -30,6 +30,20 @@ func NormalizeVoteOption(option string) string { } } +// NormalizeProposalType - normalize user specified proposal type. +func NormalizeProposalType(proposalType string) v1.ProposalType { + switch proposalType { + case "Expidited", "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 v1.ProposalType_PROPOSAL_TYPE_STANDARD + } +} + // NormalizeWeightedVoteOptions - normalize vote options param string func NormalizeWeightedVoteOptions(options string) string { newOptions := []string{} @@ -44,17 +58,6 @@ 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 { diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 2169c3ec7499..d1edde7c58a5 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -84,12 +84,10 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos return nil, err } - // TODO(@julienrbt): will be modularized in subsequent PRs - proposalType := v1.ProposalType_PROPOSAL_TYPE_STANDARD + proposalType := msg.ProposalType if msg.Expedited { proposalType = v1.ProposalType_PROPOSAL_TYPE_EXPEDITED } - proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata, msg.Title, msg.Summary, proposer, proposalType) if err != nil { return nil, err @@ -327,7 +325,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 f42f970661db..4b8f122ba17e 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) @@ -461,7 +461,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -505,7 +505,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -558,7 +558,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -679,7 +679,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -723,7 +723,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { "", "Proposal", "description of proposal", - false, + v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) suite.Require().NoError(err) @@ -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) @@ -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 c3c1ec2c5b24..6d673824f3d4 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -89,11 +89,6 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met submitTime := sdkCtx.HeaderInfo().Time depositPeriod := params.MaxDepositPeriod - // fallback to standard proposal type if not specified - if proposalType == v1.ProposalType_PROPOSAL_TYPE_UNSPECIFIED { - proposalType = v1.ProposalType_PROPOSAL_TYPE_STANDARD - } - 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/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/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 1078bf524641..1350dfa6b904 100644 --- a/x/gov/types/v1/msgs_test.go +++ b/x/gov/types/v1/msgs_test.go @@ -41,19 +41,19 @@ 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, + 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"}}],"summary":"Proposal for a governance vote msg","title":"gov/MsgVote"}}`, }, { @@ -61,14 +61,14 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { []sdk.Msg{banktypes.NewMsgSend(addrs[0], addrs[0], sdk.NewCoins())}, "bank/MsgSend", "Proposal for a bank msg send", - false, + 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"}}],"summary":"Proposal for a bank msg send","title":"bank/MsgSend"}}`, addrs[0], addrs[0]), }, } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - msg, err := v1.NewMsgSubmitProposal(tc.proposal, sdk.NewCoins(), sdk.AccAddress{}.String(), "", tc.title, tc.summary, tc.expedited) + msg, err := v1.NewMsgSubmitProposal(tc.proposal, sdk.NewCoins(), sdk.AccAddress{}.String(), "", 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/tx.pb.go b/x/gov/types/v1/tx.pb.go index 754caf7782ae..0ad266adcdac 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_EXPDITED proposal type instead. + // When this field is set and no proposal_type is set, the proposal_type + // will be set to PROPOSAL_TYPE_EXPDITED 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, 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x01, 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, 0x2f, - 0x0a, 0xde, 0x01, 0x65, 0x8e, 0x0c, 0x2b, 0x0b, 0xac, 0xd1, 0xaf, 0x65, 0x38, 0x88, 0x12, 0x4a, - 0x70, 0x11, 0x79, 0xcc, 0x24, 0xe3, 0xf5, 0x34, 0x19, 0x2f, 0x17, 0x92, 0x11, 0x05, 0xd7, 0xab, - 0xe0, 0x4a, 0x46, 0x14, 0x93, 0xf3, 0x87, 0x04, 0x40, 0x07, 0xbb, 0xd1, 0x54, 0xf8, 0x8f, 0xbc, - 0xdc, 0x04, 0x2b, 0x62, 0xa0, 0xa1, 0x8b, 0xb9, 0x99, 0x9a, 0xca, 0xb7, 0x40, 0xc9, 0xf6, 0xd1, - 0x28, 0x20, 0x82, 0x9e, 0x19, 0x73, 0x70, 0x85, 0xce, 0x41, 0x7e, 0xb3, 0xf0, 0x69, 0xdd, 0x60, - 0xad, 0x12, 0x47, 0xa3, 0x44, 0x28, 0x39, 0x22, 0x04, 0x32, 0xbd, 0x02, 0xe4, 0xe9, 0x29, 0x86, - 0xff, 0x98, 0xbf, 0x8d, 0xcf, 0x43, 0xc7, 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0xde, 0x78, 0x01, 0xa3, 0xf8, - 0x9a, 0x77, 0xc1, 0x22, 0xdb, 0x04, 0x97, 0xf3, 0x4e, 0x54, 0xae, 0x6a, 0xc5, 0xf2, 0xd8, 0xff, - 0x3e, 0x58, 0x4b, 0x8d, 0xd3, 0x73, 0xec, 0x23, 0xbd, 0xfa, 0xea, 0x6c, 0x7d, 0x1c, 0xf7, 0x43, - 0x50, 0x8e, 0x26, 0x51, 0x35, 0xef, 0x22, 0x54, 0xea, 0xb5, 0x73, 0x55, 0xc9, 0x04, 0x53, 0x3d, - 0x5d, 0x90, 0x60, 0x52, 0x5f, 0x94, 0x60, 0x51, 0x5b, 0xd1, 0xea, 0x67, 0x5a, 0xaa, 0xa0, 0xfa, - 0x69, 0x8b, 0xa2, 0xea, 0x17, 0x77, 0x82, 0xba, 0xf4, 0x0d, 0x1d, 0x0b, 0xed, 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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0x90, 0xa4, 0xae, 0xc1, 0x2b, + 0x65, 0xf2, 0x18, 0xbe, 0xfe, 0x3b, 0x80, 0x95, 0x1d, 0xea, 0xde, 0x27, 0x0c, 0xa3, 0xad, 0x12, + 0x2a, 0xda, 0xd5, 0xbf, 0x9e, 0xd5, 0xd2, 0xe2, 0xa8, 0xf7, 0x52, 0x04, 0x21, 0x03, 0xce, 0x0c, + 0x08, 0xc3, 0xbd, 0x28, 0xe7, 0x31, 0x4d, 0x17, 0x99, 0xa1, 0x26, 0x9c, 0x25, 0x21, 0xf3, 0x48, + 0x20, 0xba, 0x74, 0x79, 0x74, 0x54, 0x64, 0xf1, 0x79, 0x2e, 0x9f, 0x0b, 0x03, 0x4b, 0x1a, 0x8e, + 0x6b, 0xd2, 0xd6, 0xab, 0x9c, 0x98, 0x28, 0x34, 0x27, 0xe5, 0x42, 0x81, 0x14, 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, 0xa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e7, 0xc2, 0x1d, 0xa4, 0x36, 0xce, + 0xb3, 0x48, 0xb8, 0xc0, 0x70, 0xb5, 0x78, 0x01, 0x5d, 0x2b, 0xba, 0x17, 0x8c, 0xd4, 0xeb, 0x2f, + 0x60, 0x94, 0x6c, 0xf3, 0x1e, 0x9c, 0x16, 0x37, 0xc1, 0xc5, 0xa2, 0x13, 0x97, 0xab, 0x5a, 0xb9, + 0x3c, 0xf1, 0xbf, 0x0f, 0x17, 0x33, 0xe3, 0xf4, 0x0c, 0xfb, 0x58, 0xaf, 0xbe, 0x36, 0x5e, 0x9f, + 0xc4, 0xfd, 0x18, 0x56, 0xe2, 0x49, 0xb4, 0x56, 0x74, 0x91, 0x2a, 0xf5, 0xea, 0x99, 0xaa, 0x74, + 0x82, 0x99, 0x33, 0x5d, 0x92, 0x60, 0x5a, 0x5f, 0x96, 0x60, 0xd9, 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:]) From 50f101508f98c702034b697ce20ecdfbc14f202c Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 22 Nov 2023 18:03:56 +0100 Subject: [PATCH 06/17] updates --- api/cosmos/gov/v1/tx.pulsar.go | 4 +-- proto/cosmos/gov/v1/tx.proto | 4 +-- x/gov/keeper/grpc_query_test.go | 5 ++++ x/gov/keeper/msg_server.go | 2 +- x/gov/keeper/tally_test.go | 41 +++++++++++++++++++++++++++-- x/gov/migrations/v3/convert_test.go | 14 ++++++++++ x/gov/types/v1/tx.pb.go | 4 +-- x/gov/types/v1/vote.go | 9 ++++--- 8 files changed, 70 insertions(+), 13 deletions(-) diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index eedbf573ef1c..89d043090cbf 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7087,9 +7087,9 @@ type MsgSubmitProposal struct { // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 - // Deprecated: Use the PROPOSAL_TYPE_EXPDITED proposal type instead. + // 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_EXPDITED for backwards compatibility. + // 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"` diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 45e3911d92be..78577d443d21 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -81,9 +81,9 @@ message MsgSubmitProposal { // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 - // Deprecated: Use the PROPOSAL_TYPE_EXPDITED proposal type instead. + // 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_EXPDITED for backwards compatibility. + // will be set to PROPOSAL_TYPE_EXPEDITED for backwards compatibility. bool expedited = 7 [deprecated = true]; // proposal_type defines the type of proposal diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index cd145ca46dc7..e92700dc2a23 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -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/msg_server.go b/x/gov/keeper/msg_server.go index d1edde7c58a5..e99d537b7de6 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -85,7 +85,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos } proposalType := msg.ProposalType - if msg.Expedited { + if msg.Expedited { // checking for backward compatibility proposalType = v1.ProposalType_PROPOSAL_TYPE_EXPEDITED } proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata, msg.Title, msg.Summary, proposer, proposalType) diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index d563829e6585..bde4a1ff77fa 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), "") @@ -76,6 +75,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -90,6 +90,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -105,6 +106,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "1000000", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -120,6 +122,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -140,6 +143,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -161,6 +165,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -182,6 +187,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "999958", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -217,6 +223,7 @@ func TestTally(t *testing.T) { AbstainCount: "1000000", NoCount: "999979", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -235,6 +242,7 @@ func TestTally(t *testing.T) { AbstainCount: "4000000", NoCount: "0", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -256,6 +264,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "0", NoWithVetoCount: "3000000", + SpamCount: "0", }, }, { @@ -274,6 +283,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "2000000", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -295,6 +305,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "2000000", NoWithVetoCount: "1000000", + SpamCount: "0", }, }, { @@ -315,6 +326,7 @@ func TestTally(t *testing.T) { AbstainCount: "3000000", NoCount: "1000000", NoWithVetoCount: "0", + SpamCount: "0", }, }, { @@ -337,6 +349,7 @@ func TestTally(t *testing.T) { AbstainCount: "0", NoCount: "2000000", NoWithVetoCount: "1000000", + SpamCount: "0", }, }, { @@ -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", }, }, } diff --git a/x/gov/migrations/v3/convert_test.go b/x/gov/migrations/v3/convert_test.go index 0c899ba088e4..667066a56677 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,17 @@ func TestConvertToLegacyTallyResult(t *testing.T) { NoCount: tallyResult.NoCount, AbstainCount: tallyResult.AbstainCount, NoWithVetoCount: "invalid", + SpamCount: tallyResult.SpamCount, + }, + expErr: true, + }, + "invalid spam count": { + tallyResult: v1.TallyResult{ + YesCount: tallyResult.YesCount, + NoCount: tallyResult.NoCount, + AbstainCount: tallyResult.AbstainCount, + NoWithVetoCount: tallyResult.NoWithVetoCount, + SpamCount: "invalid", }, expErr: true, }, diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 0ad266adcdac..143df2acc7f1 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -60,9 +60,9 @@ type MsgSubmitProposal struct { // expedited defines if the proposal is expedited or not // // Since: cosmos-sdk 0.50 - // Deprecated: Use the PROPOSAL_TYPE_EXPDITED proposal type instead. + // 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_EXPDITED for backwards compatibility. + // 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 diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index 705a2274d6bf..d4a09bbd3197 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -138,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 From c9dc8c8d45c0db0706febe0432ebb054b7f8a7b1 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 22 Nov 2023 18:38:38 +0100 Subject: [PATCH 07/17] validate previous options --- x/gov/client/utils/utils_test.go | 14 +++++++------- x/gov/keeper/msg_server_test.go | 8 ++++---- x/gov/types/v1/vote.go | 14 +++++++++++++- 3 files changed, 24 insertions(+), 12 deletions(-) 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/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 4b8f122ba17e..a9156f3f8527 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -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 { @@ -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 { diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index d4a09bbd3197..e2ff4445e639 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -107,9 +107,21 @@ func (v WeightedVoteOptions) String() string { // VoteOptionFromString returns a VoteOption from a string. It returns an error // if the string is invalid. func VoteOptionFromString(str string) (VoteOption, error) { + // backward compatibility with old strings + switch str { + case "VOTE_OPTION_YES": + str = OptionOne.String() + case "VOTE_OPTION_ABSTAIN": + str = OptionTwo.String() + case "VOTE_OPTION_NO": + str = OptionThree.String() + case "VOTE_OPTION_NO_WITH_VETO": + str = OptionFour.String() + } + 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 } From 7eed1695cdafd06b9cfb78a0b25ff44649d5d9ca Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 22 Nov 2023 21:21:47 +0100 Subject: [PATCH 08/17] updates --- api/cosmos/gov/v1/gov.pulsar.go | 93 +++++++----- proto/cosmos/gov/v1/gov.proto | 10 ++ tests/integration/bank/app_test.go | 2 +- x/gov/CHANGELOG.md | 2 +- x/gov/README.md | 75 +++++----- x/gov/migrations/v6/store.go | 5 +- x/gov/types/v1/gov.pb.go | 226 ++++++++++++++++------------- x/gov/types/v1/vote.go | 12 -- 8 files changed, 231 insertions(+), 194 deletions(-) diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 120a2dad4f0b..d2a45c71478a 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -7172,12 +7172,20 @@ const ( VoteOption_VOTE_OPTION_UNSPECIFIED VoteOption = 0 // 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_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_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_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 ) @@ -7187,18 +7195,26 @@ var ( VoteOption_name = map[int32]string{ 0: "VOTE_OPTION_UNSPECIFIED", 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_TWO": 2, - "VOTE_OPTION_THREE": 3, - "VOTE_OPTION_FOUR": 4, - "VOTE_OPTION_SPAM": 5, + "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, } ) @@ -8290,39 +8306,46 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x96, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 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, 0x54, 0x57, 0x4f, 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, - 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, - 0x4f, 0x55, 0x52, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x50, 0x41, 0x4d, 0x10, 0x05, 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, 0x44, 0x10, 0x00, 0x12, - 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, - 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, - 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, - 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, - 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, - 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0x99, 0x01, 0x0a, - 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, - 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 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, + 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, 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, + 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, + 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, + 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, + 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, + 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, + 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, + 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, + 0x42, 0x99, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 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 ( diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 1558255a33e2..e270086ab2ae 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -29,16 +29,26 @@ enum ProposalType { // 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_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_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_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_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; } diff --git a/tests/integration/bank/app_test.go b/tests/integration/bank/app_test.go index c9a41f526cf5..a4a16daf79c1 100644 --- a/tests/integration/bank/app_test.go +++ b/tests/integration/bank/app_test.go @@ -386,7 +386,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/x/gov/CHANGELOG.md b/x/gov/CHANGELOG.md index 7ef77f271faf..451b5b386518 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -37,7 +37,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### 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/17469) in `x/gov/types/v1beta1/vote.go` `NewVote` was removed, constructing the struct is required for this type. +* [#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 diff --git a/x/gov/README.md b/x/gov/README.md index d26637ef151c..1b2d9cf95762 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/migrations/v6/store.go b/x/gov/migrations/v6/store.go index dc039ede2f85..f6a25d76b96f 100644 --- a/x/gov/migrations/v6/store.go +++ b/x/gov/migrations/v6/store.go @@ -19,7 +19,10 @@ func MigrateStore(ctx sdk.Context, proposalCollection collections.Map[uint64, v1 } else { proposal.ProposalType = v1.ProposalType_PROPOSAL_TYPE_STANDARD } - proposalCollection.Set(ctx, key, proposal) + + if err := proposalCollection.Set(ctx, key, proposal); err != nil { + return false, err + } return false, nil }); err != nil { diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 6e6cce5e32bf..90f831dc1831 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -81,12 +81,20 @@ const ( VoteOption_VOTE_OPTION_UNSPECIFIED VoteOption = 0 // 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_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_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_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 ) @@ -94,19 +102,27 @@ const ( var VoteOption_name = map[int32]string{ 0: "VOTE_OPTION_UNSPECIFIED", 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_TWO": 2, - "VOTE_OPTION_THREE": 3, - "VOTE_OPTION_FOUR": 4, - "VOTE_OPTION_SPAM": 5, + "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 { @@ -1033,104 +1049,106 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1537 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4d, 0x6f, 0xdb, 0xc8, - 0x19, 0x36, 0xf5, 0x65, 0xe9, 0xd5, 0x87, 0xe9, 0x89, 0x1d, 0xd3, 0x76, 0x2c, 0x3b, 0x6a, 0x10, - 0xb8, 0x6e, 0x22, 0xd5, 0x49, 0xd3, 0x43, 0x52, 0xa0, 0x95, 0x25, 0xa6, 0xa6, 0x61, 0x5b, 0x2a, - 0x45, 0xdb, 0x49, 0x2f, 0x04, 0x6d, 0x4e, 0x64, 0xa2, 0x22, 0x47, 0x25, 0x47, 0x8e, 0xf5, 0x07, - 0x7a, 0x6d, 0x4e, 0x45, 0x4f, 0x45, 0x6f, 0xed, 0x71, 0x0f, 0xc1, 0xfe, 0x86, 0x60, 0x0f, 0x8b, - 0x20, 0xa7, 0xbd, 0x6c, 0x76, 0x91, 0x1c, 0x16, 0xc8, 0xaf, 0x58, 0x70, 0x38, 0x14, 0x25, 0x59, - 0x59, 0xdb, 0xb9, 0xd8, 0xe4, 0xfb, 0x3e, 0xcf, 0x33, 0xef, 0xbc, 0x1f, 0x33,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 0x6a, 0x38, 0x0d, 0x01, 0x02, 0xdd, 0x81, 0x42, 0xb4, 0x98, 0xdf, 0x56, 0xec, 0xd2, - 0x4e, 0xab, 0xb9, 0x70, 0x29, 0xff, 0x76, 0x42, 0x8f, 0x61, 0x76, 0x68, 0x8b, 0xbc, 0x25, 0xc4, - 0x89, 0xb9, 0x9a, 0x89, 0x46, 0x97, 0xb5, 0xc3, 0xc6, 0xff, 0x04, 0xc8, 0x0d, 0xdf, 0xe6, 0x68, - 0x05, 0x16, 0x9b, 0x6a, 0xa3, 0xd9, 0x68, 0x55, 0x77, 0x75, 0xed, 0x79, 0x53, 0xd6, 0x0f, 0xf6, - 0x5b, 0x4d, 0xb9, 0xa6, 0x3c, 0x55, 0xe4, 0xba, 0x38, 0x85, 0x96, 0xe0, 0xe6, 0xa8, 0xbb, 0xa5, - 0x55, 0xf7, 0xeb, 0x55, 0xb5, 0x2e, 0x0a, 0xe8, 0x36, 0xac, 0x8c, 0xfa, 0xf6, 0x0e, 0x76, 0x35, - 0xa5, 0xb9, 0x2b, 0xeb, 0xb5, 0xed, 0x86, 0x52, 0x93, 0xc5, 0x18, 0xba, 0x05, 0xd2, 0x28, 0xa4, - 0xd1, 0xd4, 0x94, 0x3d, 0xa5, 0xa5, 0x29, 0x35, 0x31, 0x8e, 0x96, 0x61, 0x61, 0xd4, 0x2b, 0x3f, - 0x6b, 0xca, 0x75, 0x45, 0x93, 0xeb, 0x62, 0x62, 0xe3, 0x5f, 0x02, 0xc0, 0xd0, 0x27, 0xcb, 0x32, - 0x2c, 0x1c, 0x36, 0xb4, 0x40, 0xa0, 0xb1, 0x3f, 0x16, 0xe5, 0x0d, 0x98, 0x19, 0x76, 0x36, 0xf6, - 0x65, 0x51, 0x18, 0x37, 0x6a, 0x47, 0x0d, 0x31, 0x86, 0xe6, 0x61, 0x76, 0xc4, 0xb8, 0xad, 0xca, - 0xb2, 0x18, 0x47, 0x73, 0x20, 0x0e, 0x9b, 0x9f, 0x36, 0x0e, 0x54, 0x31, 0x31, 0x6e, 0x6d, 0x35, - 0xab, 0x7b, 0x62, 0x72, 0xe3, 0x5b, 0x01, 0x0a, 0xa3, 0xbf, 0xe9, 0xd1, 0x2a, 0x2c, 0x0f, 0x36, - 0xd2, 0xd2, 0xaa, 0xda, 0x41, 0x6b, 0x2c, 0xc0, 0x12, 0x14, 0xc7, 0x01, 0x75, 0xb9, 0xd9, 0x68, - 0x29, 0x9a, 0xde, 0x94, 0x55, 0xa5, 0x31, 0x9e, 0x4e, 0x8e, 0x39, 0x6c, 0x68, 0xca, 0xfe, 0x9f, - 0x43, 0x48, 0x6c, 0xa4, 0x1a, 0x1c, 0xd2, 0xac, 0xb6, 0x5a, 0x72, 0x5d, 0x8c, 0x8f, 0xa4, 0x9a, - 0xfb, 0x54, 0x79, 0x47, 0xae, 0xb1, 0x6c, 0x4e, 0x62, 0x3e, 0xad, 0x2a, 0xbb, 0x72, 0x5d, 0x4c, - 0x6e, 0x3d, 0x7a, 0xf3, 0xa1, 0x28, 0xbc, 0xfd, 0x50, 0x14, 0x7e, 0xfc, 0x50, 0x14, 0x5e, 0x7d, - 0x2c, 0x4e, 0xbd, 0xfd, 0x58, 0x9c, 0xfa, 0xee, 0x63, 0x71, 0xea, 0xaf, 0xcb, 0x41, 0x2b, 0x79, - 0xe6, 0xdf, 0xca, 0x16, 0xa9, 0x9c, 0xb3, 0xaf, 0x65, 0xff, 0x67, 0xa2, 0xe7, 0x7f, 0x0a, 0xa7, - 0xd8, 0x90, 0x3f, 0xfc, 0x39, 0x00, 0x00, 0xff, 0xff, 0xce, 0x9c, 0xc7, 0x5e, 0x4b, 0x0f, 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, 0xb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7, 0x95, 0xa6, 0x2c, 0x26, 0xd0, 0xe7, 0x20, 0x4d, 0x42, + 0xda, 0x1d, 0x4d, 0x39, 0x52, 0xba, 0x9a, 0xd2, 0x14, 0x93, 0x68, 0x03, 0x56, 0x27, 0xbd, 0xf2, + 0x93, 0x8e, 0xdc, 0x52, 0x34, 0xb9, 0x25, 0xa6, 0x76, 0xff, 0x27, 0x00, 0xc4, 0x3e, 0x59, 0x36, + 0x60, 0xf5, 0xb4, 0xad, 0x05, 0x02, 0xed, 0xe3, 0xa9, 0x28, 0x97, 0x60, 0x21, 0xee, 0x6c, 0x1f, + 0xcb, 0xa2, 0x30, 0x6d, 0x7c, 0x2a, 0x77, 0x6f, 0x1a, 0xb5, 0xb3, 0xb6, 0x98, 0x40, 0xab, 0xb0, + 0x14, 0x37, 0xd6, 0x1b, 0x5d, 0xad, 0xae, 0x1c, 0x8b, 0x09, 0xb4, 0x02, 0x8b, 0x13, 0xe8, 0x7d, + 0x55, 0x96, 0xc5, 0x24, 0x42, 0x50, 0x8a, 0x9b, 0x8f, 0xdb, 0x62, 0x12, 0x2d, 0x83, 0x18, 0xb7, + 0x3d, 0x6e, 0x9f, 0xa8, 0x62, 0xca, 0xdf, 0xff, 0x24, 0x52, 0x3f, 0x53, 0xb4, 0x7d, 0xfd, 0x54, + 0xd6, 0xda, 0x62, 0x6a, 0x9a, 0xd3, 0xed, 0xd4, 0x8f, 0xc4, 0xf4, 0x7a, 0x42, 0x14, 0x76, 0xff, + 0x21, 0x40, 0x69, 0xf2, 0xbb, 0x01, 0x6d, 0xc1, 0xc6, 0x38, 0x59, 0x5d, 0xad, 0xae, 0x9d, 0x74, + 0xa7, 0x92, 0x50, 0x81, 0xf2, 0x34, 0xa0, 0x25, 0x77, 0xda, 0x5d, 0x45, 0xd3, 0x3b, 0xb2, 0xaa, + 0xb4, 0xa7, 0x4b, 0xc6, 0x31, 0xa7, 0x6d, 0x4d, 0x39, 0xfe, 0x65, 0x08, 0x49, 0x4c, 0x54, 0x9c, + 0x43, 0x3a, 0xf5, 0x6e, 0x57, 0x6e, 0x89, 0xc9, 0x89, 0x72, 0x72, 0x9f, 0x2a, 0x1f, 0xc8, 0x4d, + 0x56, 0xb1, 0x59, 0xcc, 0xc7, 0x75, 0xe5, 0x50, 0x6e, 0x89, 0xe9, 0xc6, 0xc3, 0x57, 0xef, 0xca, + 0xc2, 0xeb, 0x77, 0x65, 0xe1, 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) { diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index e2ff4445e639..068952d71099 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -107,18 +107,6 @@ func (v WeightedVoteOptions) String() string { // VoteOptionFromString returns a VoteOption from a string. It returns an error // if the string is invalid. func VoteOptionFromString(str string) (VoteOption, error) { - // backward compatibility with old strings - switch str { - case "VOTE_OPTION_YES": - str = OptionOne.String() - case "VOTE_OPTION_ABSTAIN": - str = OptionTwo.String() - case "VOTE_OPTION_NO": - str = OptionThree.String() - case "VOTE_OPTION_NO_WITH_VETO": - str = OptionFour.String() - } - option, ok := VoteOption_value[str] if !ok { 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) From 411378ed3fdb7b473195b6336d3b02f7b244392a Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 22 Nov 2023 22:02:58 +0100 Subject: [PATCH 09/17] proto lint --- proto/buf.yaml | 1 + 1 file changed, 1 insertion(+) 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 From f0464f5b010039c1bae37ba13c22fa98f40e5a28 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 24 Nov 2023 10:07:42 +0100 Subject: [PATCH 10/17] nits --- x/gov/client/cli/util.go | 3 ++- x/gov/client/utils/utils.go | 20 ++++++++++++-------- x/gov/migrations/v6/store.go | 8 ++------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/x/gov/client/cli/util.go b/x/gov/client/cli/util.go index 5a84fdd14fac..760a6344683a 100644 --- a/x/gov/client/cli/util.go +++ b/x/gov/client/cli/util.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "os" + "strings" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -50,7 +51,7 @@ func parseSubmitLegacyProposal(fs *pflag.FlagSet) (*legacyProposal, error) { proposal.Title, _ = fs.GetString(FlagTitle) proposal.Description, _ = fs.GetString(FlagDescription) - if proposalType == "Text" || proposalType == "text" { + if strings.EqualFold(proposalType, "text") { proposal.Type = v1beta1.ProposalTypeText } proposal.Deposit, _ = fs.GetString(FlagDeposit) diff --git a/x/gov/client/utils/utils.go b/x/gov/client/utils/utils.go index c6d83caa1200..4c6edbac4847 100644 --- a/x/gov/client/utils/utils.go +++ b/x/gov/client/utils/utils.go @@ -9,25 +9,29 @@ import ( // NormalizeVoteOption - normalize user specified vote option func NormalizeVoteOption(option string) string { - switch option { - case "Yes", "yes": + switch { + case strings.EqualFold(option, "yes"): return v1.OptionYes.String() - case "Abstain", "abstain": + case strings.EqualFold(option, "abstain"): return v1.OptionAbstain.String() - case "No", "no": + case strings.EqualFold(option, "no"): return v1.OptionNo.String() - case "NoWithVeto", "no_with_veto", "no-with-veto": + case strings.EqualFold(option, "nowithveto"): return v1.OptionNoWithVeto.String() - case "Spam", "spam": + case strings.EqualFold(option, "spam"): return v1.OptionSpam.String() + } - default: - return option + // 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. diff --git a/x/gov/migrations/v6/store.go b/x/gov/migrations/v6/store.go index f6a25d76b96f..0a4a96f77a22 100644 --- a/x/gov/migrations/v6/store.go +++ b/x/gov/migrations/v6/store.go @@ -13,7 +13,7 @@ import ( // 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 - if err := proposalCollection.Walk(ctx, nil, func(key uint64, proposal v1.Proposal) (bool, error) { + return proposalCollection.Walk(ctx, nil, func(key uint64, proposal v1.Proposal) (bool, error) { if proposal.Expedited { proposal.ProposalType = v1.ProposalType_PROPOSAL_TYPE_EXPEDITED } else { @@ -25,9 +25,5 @@ func MigrateStore(ctx sdk.Context, proposalCollection collections.Map[uint64, v1 } return false, nil - }); err != nil { - return err - } - - return nil + }) } From 2e62db19d3bf827f7ac1bd4479346f71c0cad227 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 24 Nov 2023 10:26:21 +0100 Subject: [PATCH 11/17] remove duplicate tests --- .../integration/gov/keeper/grpc_query_test.go | 194 ------------------ 1 file changed, 194 deletions(-) diff --git a/tests/integration/gov/keeper/grpc_query_test.go b/tests/integration/gov/keeper/grpc_query_test.go index 12433b4fc2bb..6e93cda57ad9 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], v1.ProposalType_PROPOSAL_TYPE_STANDARD) - 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,48 +33,6 @@ 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], v1.ProposalType_PROPOSAL_TYPE_STANDARD) - assert.NilError(t, err) - assert.Assert(t, proposal.String() != "") - - req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.Id} - - tallyResult := v1beta1.EmptyTallyResult() - expRes = &v1beta1.QueryTallyResultResponse{ - Tally: tallyResult, - } - }, - true, - "", - }, { "request tally after few votes", func() { @@ -221,23 +57,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 +75,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, - } -} From 2bdf2bc1a5338b10704494a5b00b213c342426c1 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 24 Nov 2023 10:31:46 +0100 Subject: [PATCH 12/17] nits --- x/gov/client/utils/utils.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/x/gov/client/utils/utils.go b/x/gov/client/utils/utils.go index 4c6edbac4847..7ac1c77f2156 100644 --- a/x/gov/client/utils/utils.go +++ b/x/gov/client/utils/utils.go @@ -4,7 +4,6 @@ import ( "strings" v1 "cosmossdk.io/x/gov/types/v1" - "cosmossdk.io/x/gov/types/v1beta1" ) // NormalizeVoteOption - normalize user specified vote option @@ -37,7 +36,7 @@ func NormalizeVoteOption(option string) string { // NormalizeProposalType - normalize user specified proposal type. func NormalizeProposalType(proposalType string) v1.ProposalType { switch proposalType { - case "Expidited", "expedited": + case "Expedited", "expedited": return v1.ProposalType_PROPOSAL_TYPE_EXPEDITED case "MultipleChoice", "multiple_choice", "multiple-choice": return v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE @@ -66,13 +65,13 @@ func NormalizeWeightedVoteOptions(options string) string { 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 } From b000ac0e8ba1d0fe94cacff0f8ca365281d6e2f5 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 1 Dec 2023 11:59:33 +0100 Subject: [PATCH 13/17] feedback --- x/gov/migrations/v6/store_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/gov/migrations/v6/store_test.go b/x/gov/migrations/v6/store_test.go index 41c0ebe310d5..0474fe332d0c 100644 --- a/x/gov/migrations/v6/store_test.go +++ b/x/gov/migrations/v6/store_test.go @@ -1 +1,3 @@ package v6_test + +// TODO(@julienrbrt): Add migration tests when feature complete. From 2d105eec871510077fbb5d49692f71595c4b10ec Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 6 Dec 2023 16:36:22 +0100 Subject: [PATCH 14/17] updates --- x/gov/abci.go | 11 ++++++----- x/gov/abci_test.go | 4 ++-- x/gov/keeper/deposit.go | 7 ++++--- x/gov/keeper/msg_server.go | 11 ++++++----- x/gov/migrations/v3/convert_test.go | 10 ---------- x/gov/types/v1/msgs_test.go | 4 ++-- x/gov/types/v1/proposals_test.go | 2 ++ 7 files changed, 22 insertions(+), 27 deletions(-) diff --git a/x/gov/abci.go b/x/gov/abci.go index b18e7ac84bce..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 { @@ -204,7 +204,8 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { // 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 dca647173f03..9c5487c8a904 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -311,7 +311,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) }) } @@ -559,7 +559,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 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/msg_server.go b/x/gov/keeper/msg_server.go index e99d537b7de6..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,10 +89,6 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos return nil, err } - proposalType := msg.ProposalType - if msg.Expedited { // checking for backward compatibility - proposalType = v1.ProposalType_PROPOSAL_TYPE_EXPEDITED - } proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata, msg.Title, msg.Summary, proposer, proposalType) if err != nil { return nil, err diff --git a/x/gov/migrations/v3/convert_test.go b/x/gov/migrations/v3/convert_test.go index 667066a56677..3b44f9724552 100644 --- a/x/gov/migrations/v3/convert_test.go +++ b/x/gov/migrations/v3/convert_test.go @@ -154,16 +154,6 @@ func TestConvertToLegacyTallyResult(t *testing.T) { }, expErr: true, }, - "invalid spam count": { - tallyResult: v1.TallyResult{ - YesCount: tallyResult.YesCount, - NoCount: tallyResult.NoCount, - AbstainCount: tallyResult.AbstainCount, - NoWithVetoCount: tallyResult.NoWithVetoCount, - SpamCount: "invalid", - }, - expErr: true, - }, } for name, tc := range testCases { tc := tc diff --git a/x/gov/types/v1/msgs_test.go b/x/gov/types/v1/msgs_test.go index 1350dfa6b904..91c4e93f27a7 100644 --- a/x/gov/types/v1/msgs_test.go +++ b/x/gov/types/v1/msgs_test.go @@ -54,7 +54,7 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { "gov/MsgVote", "Proposal for a governance vote msg", 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"}}],"summary":"Proposal for a governance vote msg","title":"gov/MsgVote"}}`, + `{"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", @@ -62,7 +62,7 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { "bank/MsgSend", "Proposal for a bank msg send", 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"}}],"summary":"Proposal for a bank msg send","title":"bank/MsgSend"}}`, addrs[0], addrs[0]), + 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"}}`, addrs[0], addrs[0]), }, } diff --git a/x/gov/types/v1/proposals_test.go b/x/gov/types/v1/proposals_test.go index 95c902adad90..2152a60e1bbb 100644 --- a/x/gov/types/v1/proposals_test.go +++ b/x/gov/types/v1/proposals_test.go @@ -49,10 +49,12 @@ func TestProposalSetExpedited(t *testing.T) { 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"), 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) { From ebd6ab8486f49ae6fa8a60e8d43bd4623cac4b7c Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 6 Dec 2023 21:37:34 +0100 Subject: [PATCH 15/17] updates --- .../integration/gov/keeper/grpc_query_test.go | 18 ++++++++++++++++++ x/gov/abci_test.go | 15 ++++++++------- x/gov/keeper/deposit_test.go | 2 +- x/gov/keeper/export_test.go | 10 +++++++--- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/tests/integration/gov/keeper/grpc_query_test.go b/tests/integration/gov/keeper/grpc_query_test.go index 6e93cda57ad9..1cf5056bbf5e 100644 --- a/tests/integration/gov/keeper/grpc_query_test.go +++ b/tests/integration/gov/keeper/grpc_query_test.go @@ -33,6 +33,24 @@ func TestLegacyGRPCQueryTally(t *testing.T) { expPass bool expErrMsg string }{ + { + "create a proposal and get tally", + func() { + var err error + 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() != "") + + req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.Id} + + tallyResult := v1beta1.EmptyTallyResult() + expRes = &v1beta1.QueryTallyResultResponse{ + Tally: tallyResult, + } + }, + true, + "", + }, { "request tally after few votes", func() { diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 9c5487c8a904..fb21e7780fa7 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -251,7 +251,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { suite := createTestSuite(t) app := suite.App ctx := app.BaseApp.NewContext(false) - depositMultiplier := getDepositMultiplier(tc.proposalType == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) + depositMultiplier := getDepositMultiplier(tc.proposalType) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens.Mul(math.NewInt(depositMultiplier))) SortAddresses(addrs) @@ -337,7 +337,7 @@ func TestProposalPassedEndblocker(t *testing.T) { suite := createTestSuite(t) app := suite.App ctx := app.BaseApp.NewContext(false) - depositMultiplier := getDepositMultiplier(tc.proposalType == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) + depositMultiplier := getDepositMultiplier(tc.proposalType) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens.Mul(math.NewInt(depositMultiplier))) SortAddresses(addrs) @@ -467,7 +467,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) @@ -640,12 +640,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/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index e656bfeca05c..5535b000a0f7 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -344,7 +344,7 @@ func TestValidateInitialDeposit(t *testing.T) { err := govKeeper.Params.Set(ctx, params) require.NoError(t, err) - err = govKeeper.ValidateInitialDeposit(ctx, tc.initialDeposit, tc.expedited) + err = govKeeper.ValidateInitialDeposit(ctx, tc.initialDeposit, v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) if tc.expectError { require.Error(t, err) 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) } From 4d28273ad763c92dca4ae54405f5169b42534e66 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 6 Dec 2023 21:43:56 +0100 Subject: [PATCH 16/17] typo --- x/gov/keeper/deposit_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 5535b000a0f7..79f7efd92742 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -344,7 +344,11 @@ func TestValidateInitialDeposit(t *testing.T) { err := govKeeper.Params.Set(ctx, params) require.NoError(t, err) - err = govKeeper.ValidateInitialDeposit(ctx, tc.initialDeposit, v1.ProposalType_PROPOSAL_TYPE_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) From f08d2f5aa40bed1158d3edfe9ca26b791354919a Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 11 Dec 2023 12:20:55 +0100 Subject: [PATCH 17/17] updates --- x/gov/abci_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 2488b6d39d47..e6106fc1ccfa 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -405,13 +405,13 @@ 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)))) + 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)