From d67504bfcb4d0a110c42f98d62fdd893a46e7643 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 24 Aug 2022 10:07:54 +0530 Subject: [PATCH 01/69] WIP : add the cancel gov proposal proto --- api/cosmos/gov/v1/tx.pulsar.go | 1068 +++++++++++++++++++++++++++++-- api/cosmos/gov/v1/tx_grpc.pb.go | 40 ++ proto/cosmos/gov/v1/tx.proto | 21 + x/gov/keeper/msg_server.go | 19 + x/gov/types/v1/tx.pb.go | 475 ++++++++++++-- 5 files changed, 1510 insertions(+), 113 deletions(-) diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index b8593ef271c..1c5481a28a8 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -5815,6 +5815,830 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } +var ( + md_MsgCancelProposal protoreflect.MessageDescriptor + fd_MsgCancelProposal_proposal_id protoreflect.FieldDescriptor + fd_MsgCancelProposal_proposer protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_gov_v1_tx_proto_init() + md_MsgCancelProposal = File_cosmos_gov_v1_tx_proto.Messages().ByName("MsgCancelProposal") + fd_MsgCancelProposal_proposal_id = md_MsgCancelProposal.Fields().ByName("proposal_id") + fd_MsgCancelProposal_proposer = md_MsgCancelProposal.Fields().ByName("proposer") +} + +var _ protoreflect.Message = (*fastReflection_MsgCancelProposal)(nil) + +type fastReflection_MsgCancelProposal MsgCancelProposal + +func (x *MsgCancelProposal) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCancelProposal)(x) +} + +func (x *MsgCancelProposal) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgCancelProposal_messageType fastReflection_MsgCancelProposal_messageType +var _ protoreflect.MessageType = fastReflection_MsgCancelProposal_messageType{} + +type fastReflection_MsgCancelProposal_messageType struct{} + +func (x fastReflection_MsgCancelProposal_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCancelProposal)(nil) +} +func (x fastReflection_MsgCancelProposal_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCancelProposal) +} +func (x fastReflection_MsgCancelProposal_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelProposal +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCancelProposal) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelProposal +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgCancelProposal) Type() protoreflect.MessageType { + return _fastReflection_MsgCancelProposal_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCancelProposal) New() protoreflect.Message { + return new(fastReflection_MsgCancelProposal) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCancelProposal) Interface() protoreflect.ProtoMessage { + return (*MsgCancelProposal)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgCancelProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ProposalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ProposalId) + if !f(fd_MsgCancelProposal_proposal_id, value) { + return + } + } + if x.Proposer != "" { + value := protoreflect.ValueOfString(x.Proposer) + if !f(fd_MsgCancelProposal_proposer, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgCancelProposal) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.gov.v1.MsgCancelProposal.proposal_id": + return x.ProposalId != uint64(0) + case "cosmos.gov.v1.MsgCancelProposal.proposer": + return x.Proposer != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposal does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelProposal) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.gov.v1.MsgCancelProposal.proposal_id": + x.ProposalId = uint64(0) + case "cosmos.gov.v1.MsgCancelProposal.proposer": + x.Proposer = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposal does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgCancelProposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.gov.v1.MsgCancelProposal.proposal_id": + value := x.ProposalId + return protoreflect.ValueOfUint64(value) + case "cosmos.gov.v1.MsgCancelProposal.proposer": + value := x.Proposer + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposal does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelProposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.gov.v1.MsgCancelProposal.proposal_id": + x.ProposalId = value.Uint() + case "cosmos.gov.v1.MsgCancelProposal.proposer": + x.Proposer = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposal does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelProposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.MsgCancelProposal.proposal_id": + panic(fmt.Errorf("field proposal_id of message cosmos.gov.v1.MsgCancelProposal is not mutable")) + case "cosmos.gov.v1.MsgCancelProposal.proposer": + panic(fmt.Errorf("field proposer of message cosmos.gov.v1.MsgCancelProposal is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposal does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgCancelProposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.MsgCancelProposal.proposal_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.gov.v1.MsgCancelProposal.proposer": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposal does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgCancelProposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1.MsgCancelProposal", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgCancelProposal) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelProposal) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgCancelProposal) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgCancelProposal) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCancelProposal) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.ProposalId != 0 { + n += 1 + runtime.Sov(uint64(x.ProposalId)) + } + l = len(x.Proposer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgCancelProposal) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Proposer) > 0 { + i -= len(x.Proposer) + copy(dAtA[i:], x.Proposer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Proposer))) + i-- + dAtA[i] = 0x12 + } + if x.ProposalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ProposalId)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgCancelProposal) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + x.ProposalId = 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.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Proposer", 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.Proposer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgCancelProposalResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_gov_v1_tx_proto_init() + md_MsgCancelProposalResponse = File_cosmos_gov_v1_tx_proto.Messages().ByName("MsgCancelProposalResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgCancelProposalResponse)(nil) + +type fastReflection_MsgCancelProposalResponse MsgCancelProposalResponse + +func (x *MsgCancelProposalResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCancelProposalResponse)(x) +} + +func (x *MsgCancelProposalResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgCancelProposalResponse_messageType fastReflection_MsgCancelProposalResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCancelProposalResponse_messageType{} + +type fastReflection_MsgCancelProposalResponse_messageType struct{} + +func (x fastReflection_MsgCancelProposalResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCancelProposalResponse)(nil) +} +func (x fastReflection_MsgCancelProposalResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCancelProposalResponse) +} +func (x fastReflection_MsgCancelProposalResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelProposalResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCancelProposalResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelProposalResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgCancelProposalResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCancelProposalResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCancelProposalResponse) New() protoreflect.Message { + return new(fastReflection_MsgCancelProposalResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCancelProposalResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCancelProposalResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgCancelProposalResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgCancelProposalResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposalResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelProposalResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposalResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgCancelProposalResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposalResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelProposalResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposalResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelProposalResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposalResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgCancelProposalResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgCancelProposalResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgCancelProposalResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1.MsgCancelProposalResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgCancelProposalResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgCancelProposalResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgCancelProposalResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgCancelProposalResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCancelProposalResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgCancelProposalResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgCancelProposalResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Since: cosmos-sdk 0.46 // Code generated by protoc-gen-go. DO NOT EDIT. @@ -6335,6 +7159,81 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_cosmos_gov_v1_tx_proto_rawDescGZIP(), []int{11} } +// MsgCancelProposal is the Msg/CancelProposal request type. +// Since: cosmos-sdk 0.47 +type MsgCancelProposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` +} + +func (x *MsgCancelProposal) Reset() { + *x = MsgCancelProposal{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCancelProposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCancelProposal) ProtoMessage() {} + +// Deprecated: Use MsgCancelProposal.ProtoReflect.Descriptor instead. +func (*MsgCancelProposal) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1_tx_proto_rawDescGZIP(), []int{12} +} + +func (x *MsgCancelProposal) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +func (x *MsgCancelProposal) GetProposer() string { + if x != nil { + return x.Proposer + } + return "" +} + +// MsgCancelProposalResponse defines the response structure for executing a +// MsgCancelProposal message. +// +// Since: cosmos-sdk 0.47 +type MsgCancelProposalResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgCancelProposalResponse) Reset() { + *x = MsgCancelProposalResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCancelProposalResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCancelProposalResponse) ProtoMessage() {} + +// Deprecated: Use MsgCancelProposalResponse.ProtoReflect.Descriptor instead. +func (*MsgCancelProposalResponse) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1_tx_proto_rawDescGZIP(), []int{13} +} + var File_cosmos_gov_v1_tx_proto protoreflect.FileDescriptor var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ @@ -6433,49 +7332,66 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 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, - 0x32, 0x83, 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, 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, + 0x22, 0x8b, 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, 0x0e, + 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x22, 0x1b, + 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, 0x32, 0xe1, 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, 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, - 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, + 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, 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, 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, + 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, 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, 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 ( @@ -6490,7 +7406,7 @@ func file_cosmos_gov_v1_tx_proto_rawDescGZIP() []byte { return file_cosmos_gov_v1_tx_proto_rawDescData } -var file_cosmos_gov_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_cosmos_gov_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_cosmos_gov_v1_tx_proto_goTypes = []interface{}{ (*MsgSubmitProposal)(nil), // 0: cosmos.gov.v1.MsgSubmitProposal (*MsgSubmitProposalResponse)(nil), // 1: cosmos.gov.v1.MsgSubmitProposalResponse @@ -6504,34 +7420,38 @@ var file_cosmos_gov_v1_tx_proto_goTypes = []interface{}{ (*MsgDepositResponse)(nil), // 9: cosmos.gov.v1.MsgDepositResponse (*MsgUpdateParams)(nil), // 10: cosmos.gov.v1.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 11: cosmos.gov.v1.MsgUpdateParamsResponse - (*anypb.Any)(nil), // 12: google.protobuf.Any - (*v1beta1.Coin)(nil), // 13: cosmos.base.v1beta1.Coin - (VoteOption)(0), // 14: cosmos.gov.v1.VoteOption - (*WeightedVoteOption)(nil), // 15: cosmos.gov.v1.WeightedVoteOption - (*Params)(nil), // 16: cosmos.gov.v1.Params + (*MsgCancelProposal)(nil), // 12: cosmos.gov.v1.MsgCancelProposal + (*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 } var file_cosmos_gov_v1_tx_proto_depIdxs = []int32{ - 12, // 0: cosmos.gov.v1.MsgSubmitProposal.messages:type_name -> google.protobuf.Any - 13, // 1: cosmos.gov.v1.MsgSubmitProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin - 12, // 2: cosmos.gov.v1.MsgExecLegacyContent.content:type_name -> google.protobuf.Any - 14, // 3: cosmos.gov.v1.MsgVote.option:type_name -> cosmos.gov.v1.VoteOption - 15, // 4: cosmos.gov.v1.MsgVoteWeighted.options:type_name -> cosmos.gov.v1.WeightedVoteOption - 13, // 5: cosmos.gov.v1.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin - 16, // 6: cosmos.gov.v1.MsgUpdateParams.params:type_name -> cosmos.gov.v1.Params + 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 0, // 7: cosmos.gov.v1.Msg.SubmitProposal:input_type -> cosmos.gov.v1.MsgSubmitProposal 2, // 8: cosmos.gov.v1.Msg.ExecLegacyContent:input_type -> cosmos.gov.v1.MsgExecLegacyContent 4, // 9: cosmos.gov.v1.Msg.Vote:input_type -> cosmos.gov.v1.MsgVote 6, // 10: cosmos.gov.v1.Msg.VoteWeighted:input_type -> cosmos.gov.v1.MsgVoteWeighted 8, // 11: cosmos.gov.v1.Msg.Deposit:input_type -> cosmos.gov.v1.MsgDeposit 10, // 12: cosmos.gov.v1.Msg.UpdateParams:input_type -> cosmos.gov.v1.MsgUpdateParams - 1, // 13: cosmos.gov.v1.Msg.SubmitProposal:output_type -> cosmos.gov.v1.MsgSubmitProposalResponse - 3, // 14: cosmos.gov.v1.Msg.ExecLegacyContent:output_type -> cosmos.gov.v1.MsgExecLegacyContentResponse - 5, // 15: cosmos.gov.v1.Msg.Vote:output_type -> cosmos.gov.v1.MsgVoteResponse - 7, // 16: cosmos.gov.v1.Msg.VoteWeighted:output_type -> cosmos.gov.v1.MsgVoteWeightedResponse - 9, // 17: cosmos.gov.v1.Msg.Deposit:output_type -> cosmos.gov.v1.MsgDepositResponse - 11, // 18: cosmos.gov.v1.Msg.UpdateParams:output_type -> cosmos.gov.v1.MsgUpdateParamsResponse - 13, // [13:19] is the sub-list for method output_type - 7, // [7:13] is the sub-list for method input_type + 12, // 13: cosmos.gov.v1.Msg.CancelProposal:input_type -> cosmos.gov.v1.MsgCancelProposal + 1, // 14: cosmos.gov.v1.Msg.SubmitProposal:output_type -> cosmos.gov.v1.MsgSubmitProposalResponse + 3, // 15: cosmos.gov.v1.Msg.ExecLegacyContent:output_type -> cosmos.gov.v1.MsgExecLegacyContentResponse + 5, // 16: cosmos.gov.v1.Msg.Vote:output_type -> cosmos.gov.v1.MsgVoteResponse + 7, // 17: cosmos.gov.v1.Msg.VoteWeighted:output_type -> cosmos.gov.v1.MsgVoteWeightedResponse + 9, // 18: cosmos.gov.v1.Msg.Deposit:output_type -> cosmos.gov.v1.MsgDepositResponse + 11, // 19: cosmos.gov.v1.Msg.UpdateParams:output_type -> cosmos.gov.v1.MsgUpdateParamsResponse + 13, // 20: cosmos.gov.v1.Msg.CancelProposal:output_type -> cosmos.gov.v1.MsgCancelProposalResponse + 14, // [14:21] is the sub-list for method output_type + 7, // [7:14] is the sub-list for method input_type 7, // [7:7] is the sub-list for extension type_name 7, // [7:7] is the sub-list for extension extendee 0, // [0:7] is the sub-list for field type_name @@ -6688,6 +7608,30 @@ func file_cosmos_gov_v1_tx_proto_init() { return nil } } + file_cosmos_gov_v1_tx_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCancelProposal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_gov_v1_tx_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCancelProposalResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -6695,7 +7639,7 @@ func file_cosmos_gov_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_gov_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 14, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/gov/v1/tx_grpc.pb.go b/api/cosmos/gov/v1/tx_grpc.pb.go index 05b1f592e04..d80e5f72b82 100644 --- a/api/cosmos/gov/v1/tx_grpc.pb.go +++ b/api/cosmos/gov/v1/tx_grpc.pb.go @@ -38,6 +38,9 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // CancelProposal defines a + // Since: cosmos-sdk 0.47 + CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) } type msgClient struct { @@ -102,6 +105,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) { + out := new(MsgCancelProposalResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/CancelProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -122,6 +134,9 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // CancelProposal defines a + // Since: cosmos-sdk 0.47 + CancelProposal(context.Context, *MsgCancelProposal) (*MsgCancelProposalResponse, error) mustEmbedUnimplementedMsgServer() } @@ -147,6 +162,9 @@ func (UnimplementedMsgServer) Deposit(context.Context, *MsgDeposit) (*MsgDeposit func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (UnimplementedMsgServer) CancelProposal(context.Context, *MsgCancelProposal) (*MsgCancelProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelProposal not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -268,6 +286,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_CancelProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CancelProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/CancelProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CancelProposal(ctx, req.(*MsgCancelProposal)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -299,6 +335,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "CancelProposal", + Handler: _Msg_CancelProposal_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/gov/v1/tx.proto", diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index df6b15f1763..090a8de5522 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -34,6 +34,11 @@ service Msg { // // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // CancelProposal defines a method to cancel governance proposal + // + // Since: cosmos-sdk 0.47 + rpc CancelProposal(MsgCancelProposal) returns (MsgCancelProposalResponse); } // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -125,3 +130,19 @@ message MsgUpdateParams { // // Since: cosmos-sdk 0.47 message MsgUpdateParamsResponse {} + +// MsgCancelProposal is the Msg/CancelProposal request type. +// +// Since: cosmos-sdk 0.47 +message MsgCancelProposal{ + option (cosmos.msg.v1.signer) = "depositor"; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgCancelProposalResponse defines the response structure for executing a +// MsgCancelProposal message. +// +// Since: cosmos-sdk 0.47 +message MsgCancelProposalResponse{} diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index c5ef57ddef4..14a8f6e3bf6 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -86,6 +86,25 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos }, nil } +// CancelProposal implements v1.MsgServer +func (msgServer) CancelProposal(goCtx context.Context, msg *v1.MsgCancelProposal) (*v1.MsgCancelProposalResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + _, err := sdk.AccAddressFromBech32(msg.Proposer) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, govtypes.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Proposer), + ), + ) + + return &v1.MsgCancelProposalResponse{}, nil +} + func (k msgServer) ExecLegacyContent(goCtx context.Context, msg *v1.MsgExecLegacyContent) (*v1.MsgExecLegacyContentResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 42864efee94..7444965caf5 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -650,6 +650,100 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// MsgCancelProposal is the Msg/CancelProposal request type. +// Since: cosmos-sdk 0.47 +type MsgCancelProposal struct { + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` +} + +func (m *MsgCancelProposal) Reset() { *m = MsgCancelProposal{} } +func (m *MsgCancelProposal) String() string { return proto.CompactTextString(m) } +func (*MsgCancelProposal) ProtoMessage() {} +func (*MsgCancelProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{12} +} +func (m *MsgCancelProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCancelProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelProposal.Merge(m, src) +} +func (m *MsgCancelProposal) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelProposal proto.InternalMessageInfo + +func (m *MsgCancelProposal) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *MsgCancelProposal) GetProposer() string { + if m != nil { + return m.Proposer + } + return "" +} + +// MsgCancelProposalResponse defines the response structure for executing a +// MsgCancelProposal message. +// +// Since: cosmos-sdk 0.47 +type MsgCancelProposalResponse struct { +} + +func (m *MsgCancelProposalResponse) Reset() { *m = MsgCancelProposalResponse{} } +func (m *MsgCancelProposalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCancelProposalResponse) ProtoMessage() {} +func (*MsgCancelProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{13} +} +func (m *MsgCancelProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelProposalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCancelProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelProposalResponse.Merge(m, src) +} +func (m *MsgCancelProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelProposalResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1.MsgSubmitProposal") proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1.MsgSubmitProposalResponse") @@ -663,62 +757,67 @@ func init() { proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1.MsgDepositResponse") proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.gov.v1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.gov.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgCancelProposal)(nil), "cosmos.gov.v1.MsgCancelProposal") + proto.RegisterType((*MsgCancelProposalResponse)(nil), "cosmos.gov.v1.MsgCancelProposalResponse") } func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 797 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x4f, 0xe3, 0x46, - 0x14, 0x8e, 0x49, 0x9a, 0xc0, 0x4b, 0x09, 0xc2, 0x4a, 0xc1, 0xb1, 0x90, 0x09, 0xa9, 0x54, 0x45, - 0x45, 0xd8, 0x04, 0xaa, 0x56, 0x82, 0xaa, 0x12, 0xa1, 0xa8, 0xad, 0xd4, 0xa8, 0xc8, 0xa8, 0x54, - 0xaa, 0x56, 0x42, 0x4e, 0x3c, 0x3b, 0x58, 0x8b, 0x3d, 0x96, 0x67, 0x12, 0x91, 0xe3, 0xee, 0xde, - 0x57, 0xfb, 0x53, 0xf6, 0xc0, 0x7d, 0x6f, 0x2b, 0xb4, 0x27, 0xb4, 0x27, 0x4e, 0x68, 0x05, 0x87, - 0x95, 0xf6, 0xb4, 0x3f, 0x61, 0x65, 0xcf, 0xd8, 0x09, 0x71, 0x20, 0xec, 0x65, 0x4f, 0xb1, 0xdf, - 0xfb, 0xbe, 0x37, 0xdf, 0xe7, 0x37, 0x6f, 0x26, 0xb0, 0xd0, 0x21, 0xd4, 0x25, 0xd4, 0xc0, 0xa4, - 0x67, 0xf4, 0x1a, 0x06, 0x3b, 0xd5, 0xfd, 0x80, 0x30, 0x22, 0xcf, 0xf2, 0xb8, 0x8e, 0x49, 0x4f, - 0xef, 0x35, 0x54, 0x4d, 0xc0, 0xda, 0x16, 0x45, 0x46, 0xaf, 0xd1, 0x46, 0xcc, 0x6a, 0x18, 0x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 0xe0, 0x1d, 0xf8, 0x38, 0xaf, 0xfe, 0x70, 0x7f, 0x3e, 0xa9, 0xfb, 0x07, 0x14, 0xe2, - 0x4d, 0x5e, 0x49, 0x53, 0x44, 0x4a, 0x5d, 0xb9, 0x33, 0x35, 0x2c, 0xf0, 0xd6, 0xae, 0x1a, 0x23, - 0x70, 0x38, 0x3f, 0x4e, 0xe0, 0xb8, 0x5d, 0xd0, 0xdc, 0x3b, 0xbf, 0xd6, 0xa4, 0x8b, 0x6b, 0x4d, - 0x7a, 0x7f, 0xad, 0x49, 0x2f, 0x6f, 0xb4, 0xcc, 0xc5, 0x8d, 0x96, 0xb9, 0xbc, 0xd1, 0x32, 0xff, - 0xaf, 0x62, 0x87, 0x1d, 0x77, 0xdb, 0x7a, 0x87, 0xb8, 0xe2, 0x5e, 0x16, 0x3f, 0x6b, 0xd4, 0x7e, - 0x62, 0x9c, 0x46, 0x17, 0x3c, 0xeb, 0xfb, 0x88, 0x86, 0xff, 0x02, 0xf2, 0xd1, 0xa5, 0xb0, 0xf9, - 0x39, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x33, 0x01, 0xac, 0x45, 0x08, 0x00, 0x00, + // 843 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x6b, 0xe3, 0x46, + 0x14, 0xb6, 0x62, 0xd7, 0x4e, 0xc6, 0x8d, 0x43, 0x84, 0x9b, 0xc8, 0x6a, 0x50, 0x1c, 0x17, 0x8a, + 0x69, 0x88, 0x14, 0x27, 0xa5, 0x85, 0xa4, 0x14, 0xe2, 0x34, 0xb4, 0x85, 0x9a, 0x06, 0x85, 0xa6, + 0x50, 0x0a, 0x61, 0x6c, 0x4d, 0x27, 0xa2, 0x96, 0x46, 0x68, 0xc6, 0x26, 0x3e, 0xb6, 0xd7, 0x42, + 0xe9, 0x4f, 0xe9, 0x21, 0xf7, 0xde, 0x4a, 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, 0x47, 0x1c, 0xf1, 0x40, 0x11, 0x3f, 0x5b, 0xd4, 0xfa, 0xd5, 0xb8, 0x08, + 0x5f, 0x3a, 0x6c, 0xe4, 0x21, 0x1a, 0x3c, 0x87, 0x8a, 0xe1, 0xbf, 0xe3, 0xee, 0xdb, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x68, 0x59, 0xf8, 0xdf, 0x4e, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -749,6 +848,9 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // CancelProposal defines a + // Since: cosmos-sdk 0.47 + CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) } type msgClient struct { @@ -813,6 +915,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) { + out := new(MsgCancelProposalResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/CancelProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // SubmitProposal defines a method to create new proposal given a content. @@ -831,6 +942,9 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // CancelProposal defines a + // Since: cosmos-sdk 0.47 + CancelProposal(context.Context, *MsgCancelProposal) (*MsgCancelProposalResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -855,6 +969,9 @@ func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*M func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) CancelProposal(ctx context.Context, req *MsgCancelProposal) (*MsgCancelProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelProposal not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -968,6 +1085,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_CancelProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CancelProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/CancelProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CancelProposal(ctx, req.(*MsgCancelProposal)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.gov.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -996,6 +1131,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "CancelProposal", + Handler: _Msg_CancelProposal_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/gov/v1/tx.proto", @@ -1443,6 +1582,64 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgCancelProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCancelProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Proposer) > 0 { + i -= len(m.Proposer) + copy(dAtA[i:], m.Proposer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgCancelProposalResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCancelProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1643,6 +1840,31 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } +func (m *MsgCancelProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + l = len(m.Proposer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCancelProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2837,6 +3059,157 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgCancelProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCancelProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCancelProposalResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCancelProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 9c2deb8f074b15ed879865520bf74e098d7be00e Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 24 Aug 2022 17:12:38 +0530 Subject: [PATCH 02/69] WIP: add cancel-proposal tx to cli --- api/cosmos/gov/v1/gov.pulsar.go | 315 ++++++++++++++++++++------------ api/cosmos/gov/v1/tx.pulsar.go | 1 + api/cosmos/gov/v1/tx_grpc.pb.go | 6 +- proto/cosmos/gov/v1/gov.proto | 6 + x/gov/abci.go | 8 + x/gov/client/cli/tx.go | 35 ++++ x/gov/keeper/keeper.go | 39 ++++ x/gov/keeper/msg_server.go | 15 +- x/gov/keeper/proposal.go | 41 ++++- x/gov/types/errors.go | 2 + x/gov/types/keys.go | 6 + x/gov/types/v1/gov.pb.go | 211 +++++++++++++-------- x/gov/types/v1/msgs.go | 38 +++- x/gov/types/v1/proposal.go | 4 +- x/gov/types/v1/tx.pb.go | 7 +- 15 files changed, 530 insertions(+), 204 deletions(-) diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 24304f121a5..18a07b1b0d2 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -1206,6 +1206,7 @@ var ( fd_Proposal_voting_start_time protoreflect.FieldDescriptor fd_Proposal_voting_end_time protoreflect.FieldDescriptor fd_Proposal_metadata protoreflect.FieldDescriptor + fd_Proposal_proposer protoreflect.FieldDescriptor ) func init() { @@ -1221,6 +1222,7 @@ func init() { fd_Proposal_voting_start_time = md_Proposal.Fields().ByName("voting_start_time") fd_Proposal_voting_end_time = md_Proposal.Fields().ByName("voting_end_time") fd_Proposal_metadata = md_Proposal.Fields().ByName("metadata") + fd_Proposal_proposer = md_Proposal.Fields().ByName("proposer") } var _ protoreflect.Message = (*fastReflection_Proposal)(nil) @@ -1348,6 +1350,12 @@ func (x *fastReflection_Proposal) Range(f func(protoreflect.FieldDescriptor, pro return } } + if x.Proposer != "" { + value := protoreflect.ValueOfString(x.Proposer) + if !f(fd_Proposal_proposer, value) { + return + } + } } // Has reports whether a field is populated. @@ -1383,6 +1391,8 @@ func (x *fastReflection_Proposal) Has(fd protoreflect.FieldDescriptor) bool { return x.VotingEndTime != nil case "cosmos.gov.v1.Proposal.metadata": return x.Metadata != "" + case "cosmos.gov.v1.Proposal.proposer": + return x.Proposer != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1419,6 +1429,8 @@ func (x *fastReflection_Proposal) Clear(fd protoreflect.FieldDescriptor) { x.VotingEndTime = nil case "cosmos.gov.v1.Proposal.metadata": x.Metadata = "" + case "cosmos.gov.v1.Proposal.proposer": + x.Proposer = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1471,6 +1483,9 @@ func (x *fastReflection_Proposal) Get(descriptor protoreflect.FieldDescriptor) p case "cosmos.gov.v1.Proposal.metadata": value := x.Metadata return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Proposal.proposer": + value := x.Proposer + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1515,6 +1530,8 @@ func (x *fastReflection_Proposal) Set(fd protoreflect.FieldDescriptor, value pro x.VotingEndTime = value.Message().Interface().(*timestamppb.Timestamp) case "cosmos.gov.v1.Proposal.metadata": x.Metadata = value.Interface().(string) + case "cosmos.gov.v1.Proposal.proposer": + x.Proposer = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1578,6 +1595,8 @@ func (x *fastReflection_Proposal) Mutable(fd protoreflect.FieldDescriptor) proto panic(fmt.Errorf("field status of message cosmos.gov.v1.Proposal is not mutable")) case "cosmos.gov.v1.Proposal.metadata": panic(fmt.Errorf("field metadata of message cosmos.gov.v1.Proposal is not mutable")) + case "cosmos.gov.v1.Proposal.proposer": + panic(fmt.Errorf("field proposer 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")) @@ -1618,6 +1637,8 @@ func (x *fastReflection_Proposal) NewField(fd protoreflect.FieldDescriptor) prot return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.gov.v1.Proposal.metadata": return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Proposal.proposer": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1729,6 +1750,10 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.Proposer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1758,6 +1783,13 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Proposer) > 0 { + i -= len(x.Proposer) + copy(dAtA[i:], x.Proposer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Proposer))) + i-- + dAtA[i] = 0x5a + } if len(x.Metadata) > 0 { i -= len(x.Metadata) copy(dAtA[i:], x.Metadata) @@ -2244,6 +2276,38 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { } x.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Proposer", 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.Proposer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -6122,6 +6186,9 @@ const ( // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 + // PROPOSAL_STATUS_CANCELED defines a proposal status of a proposal that has + // canceled. + ProposalStatus_PROPOSAL_STATUS_CANCELED ProposalStatus = 6 ) // Enum value maps for ProposalStatus. @@ -6133,6 +6200,7 @@ var ( 3: "PROPOSAL_STATUS_PASSED", 4: "PROPOSAL_STATUS_REJECTED", 5: "PROPOSAL_STATUS_FAILED", + 6: "PROPOSAL_STATUS_CANCELED", } ProposalStatus_value = map[string]int32{ "PROPOSAL_STATUS_UNSPECIFIED": 0, @@ -6141,6 +6209,7 @@ var ( "PROPOSAL_STATUS_PASSED": 3, "PROPOSAL_STATUS_REJECTED": 4, "PROPOSAL_STATUS_FAILED": 5, + "PROPOSAL_STATUS_CANCELED": 6, } ) @@ -6288,6 +6357,8 @@ type Proposal struct { VotingEndTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` + // proposer defines an address of creater of the proposal. + Proposer string `protobuf:"bytes,11,opt,name=proposer,proto3" json:"proposer,omitempty"` } func (x *Proposal) Reset() { @@ -6380,6 +6451,13 @@ func (x *Proposal) GetMetadata() string { return "" } +func (x *Proposal) GetProposer() string { + if x != nil { + return x.Proposer + } + return "" +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { state protoimpl.MessageState @@ -6772,7 +6850,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xd6, 0x04, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x8c, 0x05, 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, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, @@ -6809,126 +6887,131 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, 0xd9, 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, 0x22, 0x54, 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, 0x22, 0xe1, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x22, 0xea, 0xde, 0x1f, 0x10, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x2c, 0x6f, - 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x43, - 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x25, 0xea, 0xde, 0x1f, 0x13, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 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, 0x51, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2a, 0xea, 0xde, 0x1f, - 0x18, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, - 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 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, 0x22, 0xb7, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x40, 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, 0x04, 0xc8, 0xde, 0x1f, 0x00, 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, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x34, 0x0a, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x0b, 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, 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, 0xd9, 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, 0x04, 0x98, 0xdf, 0x1f, 0x01, + 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, 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, + 0x6f, 0x64, 0x22, 0x54, 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, 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, - 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, + 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0xe1, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, + 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xea, 0xde, 0x1f, 0x10, 0x71, 0x75, + 0x6f, 0x72, 0x75, 0x6d, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0xd2, 0xb4, + 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, + 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x43, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xea, 0xde, 0x1f, 0x13, 0x74, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, + 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, 0x51, 0x0a, 0x0e, 0x76, 0x65, 0x74, + 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x2a, 0xea, 0xde, 0x1f, 0x18, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 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, 0x22, 0xb7, 0x03, 0x0a, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 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, 0x04, 0xc8, 0xde, 0x1f, 0x00, 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, 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, 0xec, 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, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x45, 0x44, 0x10, + 0x06, 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/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 1c5481a28a8..3593cccea68 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7160,6 +7160,7 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { } // MsgCancelProposal is the Msg/CancelProposal request type. +// // Since: cosmos-sdk 0.47 type MsgCancelProposal struct { state protoimpl.MessageState diff --git a/api/cosmos/gov/v1/tx_grpc.pb.go b/api/cosmos/gov/v1/tx_grpc.pb.go index d80e5f72b82..3d0df1eddd3 100644 --- a/api/cosmos/gov/v1/tx_grpc.pb.go +++ b/api/cosmos/gov/v1/tx_grpc.pb.go @@ -38,7 +38,8 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - // CancelProposal defines a + // CancelProposal defines a method to cancel governance proposal + // // Since: cosmos-sdk 0.47 CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) } @@ -134,7 +135,8 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - // CancelProposal defines a + // CancelProposal defines a method to cancel governance proposal + // // Since: cosmos-sdk 0.47 CancelProposal(context.Context, *MsgCancelProposal) (*MsgCancelProposalResponse, error) mustEmbedUnimplementedMsgServer() diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index f9fea5dff9b..93849ae3b30 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -56,6 +56,9 @@ message Proposal { // metadata is any arbitrary metadata attached to the proposal. string metadata = 10; + + // proposer defines an address of creater of the proposal. + string proposer = 11 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // ProposalStatus enumerates the valid statuses of a proposal. @@ -77,6 +80,9 @@ enum ProposalStatus { // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. PROPOSAL_STATUS_FAILED = 5; + // PROPOSAL_STATUS_CANCELED defines a proposal status of a proposal that has + // canceled. + PROPOSAL_STATUS_CANCELED = 6; } // TallyResult defines a standard tally for a governance proposal. diff --git a/x/gov/abci.go b/x/gov/abci.go index a4edadc6888..6f8c9968413 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -17,6 +17,14 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { logger := keeper.Logger(ctx) + // delete the canceled proposals from store and returns theirs deposits. + keeper.IterateCanceledProposalQueue(ctx, func(proposal v1.Proposal) (stop bool) { + keeper.DeleteProposal(ctx, proposal.Id) + // send min deposit to community pool + keeper.RefundAndDeleteDeposits(ctx, proposal.Id) // refund deposit if proposal got removed without getting 100% of the proposal + return false + }) + // delete dead proposals from store and returns theirs deposits. // A proposal is dead when it's inactive and didn't get enough deposit on time to get into voting phase. keeper.IterateInactiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal v1.Proposal) bool { diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index 85e821ddebe..845e1a9d4e9 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -70,6 +70,7 @@ func NewTxCmd(legacyPropCmds []*cobra.Command) *cobra.Command { NewCmdVote(), NewCmdWeightedVote(), NewCmdSubmitProposal(), + NewCmdCancelProposal(), // Deprecated cmdSubmitLegacyProp, @@ -135,6 +136,40 @@ Where proposal.json contains: return cmd } +// NewCmdCancelProposal implements submitting a cancel proposal transaction command. +func NewCmdCancelProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "cancel-proposal [proposal-id]", + Short: "Cancel governance proposal by proposal before the voting period ends.", + Args: cobra.ExactArgs(1), + Example: fmt.Sprintf(` + $ %s tx gov cancel-proposal 1 --from mykey + `, version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + // validate that the proposal id is a uint + proposalID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return fmt.Errorf("proposal-id %s not a valid uint, please input a valid proposal-id", args[0]) + } + + // Get depositor address + from := clientCtx.GetFromAddress() + + msg := v1.NewMsgCancelProposal(from, proposalID) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + // NewCmdSubmitLegacyProposal implements submitting a proposal transaction command. // Deprecated: please use NewCmdSubmitProposal instead. func NewCmdSubmitLegacyProposal() *cobra.Command { diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 307152f9633..1f72809ce07 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -146,6 +146,19 @@ func (keeper Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, proposalID u store.Delete(types.ActiveProposalQueueKey(proposalID, endTime)) } +// InsertCanceledProposalQueue inserts a ProposalID into the cancel proposal queue +func (Keeper Keeper) InsertCanceledProposalQueue(ctx sdk.Context, proposalID uint64) { + store := ctx.KVStore(Keeper.storeKey) + bz := types.GetProposalIDBytes(proposalID) + store.Set(types.CanceledProposalQueueKey(proposalID), bz) +} + +// RemoveFromCanceledProposalQueue remove a proposalID from the Canceled Proposal Queue +func (keeper Keeper) RemoveFromCanceledProposalQueue(ctx sdk.Context, proposalID uint64) { + store := ctx.KVStore(keeper.storeKey) + store.Delete(types.CanceledProposalQueueKey(proposalID)) +} + // InsertInactiveProposalQueue Inserts a ProposalID into the inactive proposal queue at endTime func (keeper Keeper) InsertInactiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time) { store := ctx.KVStore(keeper.storeKey) @@ -199,6 +212,26 @@ func (keeper Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time } } +// IterateCanceledProposalQueue iterates over the proposal in the canceled proposal queue +// and performs a callback function +func (keeper Keeper) IterateCanceledProposalQueue(ctx sdk.Context, cb func(proposal v1.Proposal) (stop bool)) { + store := ctx.KVStore(keeper.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.CanceledProposalQueuePrefix) + + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + proposalID := types.GetProposalIDFromBytes(iterator.Key()[1:]) + proposal, found := keeper.GetProposal(ctx, proposalID) + if !found { + panic(fmt.Sprintf("proposal %d does not exist", proposalID)) + } + + if cb(proposal) { + break + } + } +} + // ActiveProposalQueueIterator returns an sdk.Iterator for all the proposals in the Active Queue that expire by endTime func (keeper Keeper) ActiveProposalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator { store := ctx.KVStore(keeper.storeKey) @@ -211,6 +244,12 @@ func (keeper Keeper) InactiveProposalQueueIterator(ctx sdk.Context, endTime time return store.Iterator(types.InactiveProposalQueuePrefix, sdk.PrefixEndBytes(types.InactiveProposalByTimeKey(endTime))) } +// InactiveProposalQueueIterator returns an sdk.Iterator for all the proposals in the Inactive Queue that expire by endTime +func (keeper Keeper) CanceledProposalQueueIterator(ctx sdk.Context) sdk.Iterator { + store := ctx.KVStore(keeper.storeKey) + return store.Iterator(types.CanceledProposalQueuePrefix, nil) +} + // assertMetadataLength returns an error if given metadata length // is greater than a pre-defined maxMetadataLen. func (keeper Keeper) assertMetadataLength(metadata string) error { diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 14a8f6e3bf6..61f0e4dd04e 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -37,11 +37,17 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos return nil, err } + proposer, err := sdk.AccAddressFromBech32(msg.GetProposer()) + if err != nil { + return nil, err + } + proposalMsgs, err := msg.GetMsgs() if err != nil { return nil, err } - proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata) + + proposal, err := k.Keeper.SubmitProposal(ctx, proposer, proposalMsgs, msg.Metadata) if err != nil { return nil, err } @@ -59,7 +65,6 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos defer telemetry.IncrCounter(1, govtypes.ModuleName, "proposal") - proposer, _ := sdk.AccAddressFromBech32(msg.GetProposer()) votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.Id, proposer, msg.GetInitialDeposit()) if err != nil { return nil, err @@ -87,13 +92,17 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos } // CancelProposal implements v1.MsgServer -func (msgServer) CancelProposal(goCtx context.Context, msg *v1.MsgCancelProposal) (*v1.MsgCancelProposalResponse, error) { +func (k msgServer) CancelProposal(goCtx context.Context, msg *v1.MsgCancelProposal) (*v1.MsgCancelProposalResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) _, err := sdk.AccAddressFromBech32(msg.Proposer) if err != nil { return nil, err } + if err := k.Keeper.CancelProposal(ctx, msg.ProposalId, msg.Proposer); err != nil { + return nil, err + } + ctx.EventManager().EmitEvent( sdk.NewEvent( sdk.EventTypeMessage, diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 59d7bd65392..7a7761a2bfc 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -11,7 +11,7 @@ import ( ) // SubmitProposal creates a new proposal given an array of messages -func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadata string) (v1.Proposal, error) { +func (keeper Keeper) SubmitProposal(ctx sdk.Context, proposer sdk.AccAddress, messages []sdk.Msg, metadata string) (v1.Proposal, error) { err := keeper.assertMetadataLength(metadata) if err != nil { return v1.Proposal{}, err @@ -68,7 +68,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadat submitTime := ctx.BlockHeader().Time depositPeriod := keeper.GetParams(ctx).MaxDepositPeriod - proposal, err := v1.NewProposal(messages, proposalID, metadata, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1.NewProposal(messages, proposer, proposalID, metadata, submitTime, submitTime.Add(*depositPeriod)) if err != nil { return v1.Proposal{}, err } @@ -91,6 +91,40 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadat return proposal, nil } +// CancelProposal will cancel proposal before the voting period ends +func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer string) error { + proposal, ok := keeper.GetProposal(ctx, proposalID) + if !ok { + return sdkerrors.Wrapf(types.ErrProposalNotFound, "proposal is not found with % id", proposalID) + } + + // Check creator of the proposal + if proposal.Proposer != proposer { + return sdkerrors.Wrapf(types.ErrInvalidProposer, "invalid proposer %s", proposer) + } + + // Check if proposal is active or not + if (proposal.Status != v1.StatusDepositPeriod) && (proposal.Status != v1.StatusVotingPeriod) { + return sdkerrors.Wrapf(types.ErrInactiveProposal, "%d", proposalID) + } + + // Check proposal voting period is ended. + if proposal.VotingEndTime != nil && proposal.VotingEndTime.Before(ctx.BlockTime()) { + // return sdkerrors.Wrap(errors.New("voting period is already ended for this proposal")) + // TODO: create error + return sdkerrors.Wrapf(types.ErrInactiveProposal, "voting period is already ended for this proposal %d", proposalID) + } + + // update the status to StatusCanceled + proposal.Status = v1.StatusCanceled + // set to store + keeper.SetProposal(ctx, proposal) + // insert the proposal into cancel proposal queue + keeper.InsertCanceledProposalQueue(ctx, proposalID) + + return nil +} + // GetProposal gets a proposal from store by ProposalID. // Panics if can't unmarshal the proposal. func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (v1.Proposal, bool) { @@ -136,6 +170,9 @@ func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64) { if proposal.VotingEndTime != nil { keeper.RemoveFromActiveProposalQueue(ctx, proposalID, *proposal.VotingEndTime) } + if proposal.Status == v1.StatusCanceled { + keeper.RemoveFromCanceledProposalQueue(ctx, proposalID) + } store.Delete(types.ProposalKey(proposalID)) } diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index eb14067caa1..3c79ba2f45d 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -22,4 +22,6 @@ var ( ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 14, "signal message is invalid") ErrMetadataTooLong = sdkerrors.Register(ModuleName, 15, "metadata too long") ErrMinDepositTooSmall = sdkerrors.Register(ModuleName, 16, "minimum deposit is too small") + ErrProposalNotFound = sdkerrors.Register(ModuleName, 17, "proposal is not found") + ErrInvalidProposer = sdkerrors.Register(ModuleName, 18, "invalid proposer") ) diff --git a/x/gov/types/keys.go b/x/gov/types/keys.go index dd1fb906335..c330e2c4aa6 100644 --- a/x/gov/types/keys.go +++ b/x/gov/types/keys.go @@ -41,6 +41,7 @@ var ( ActiveProposalQueuePrefix = []byte{0x01} InactiveProposalQueuePrefix = []byte{0x02} ProposalIDKey = []byte{0x03} + CanceledProposalQueuePrefix = []byte{0x04} DepositsKeyPrefix = []byte{0x10} @@ -79,6 +80,11 @@ func ActiveProposalQueueKey(proposalID uint64, endTime time.Time) []byte { return append(ActiveProposalByTimeKey(endTime), GetProposalIDBytes(proposalID)...) } +// CanceledProposalQueueKey returns the key for a proposalID in the canceledProposalQueue +func CanceledProposalQueueKey(proposalID uint64) []byte { + return append(CanceledProposalQueuePrefix, GetProposalIDBytes(proposalID)...) +} + // InactiveProposalByTimeKey gets the inactive proposal queue key by endTime func InactiveProposalByTimeKey(endTime time.Time) []byte { return append(InactiveProposalQueuePrefix, sdk.FormatTimeBytes(endTime)...) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index d5576baa57e..4696800df02 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -92,6 +92,9 @@ const ( // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 + // PROPOSAL_STATUS_CANCELED defines a proposal status of a proposal that has + // canceled. + ProposalStatus_PROPOSAL_STATUS_CANCELED ProposalStatus = 6 ) var ProposalStatus_name = map[int32]string{ @@ -101,6 +104,7 @@ var ProposalStatus_name = map[int32]string{ 3: "PROPOSAL_STATUS_PASSED", 4: "PROPOSAL_STATUS_REJECTED", 5: "PROPOSAL_STATUS_FAILED", + 6: "PROPOSAL_STATUS_CANCELED", } var ProposalStatus_value = map[string]int32{ @@ -110,6 +114,7 @@ var ProposalStatus_value = map[string]int32{ "PROPOSAL_STATUS_PASSED": 3, "PROPOSAL_STATUS_REJECTED": 4, "PROPOSAL_STATUS_FAILED": 5, + "PROPOSAL_STATUS_CANCELED": 6, } func (x ProposalStatus) String() string { @@ -251,6 +256,8 @@ type Proposal struct { VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` + // proposer defines an address of creater of the proposal. + Proposer string `protobuf:"bytes,11,opt,name=proposer,proto3" json:"proposer,omitempty"` } func (m *Proposal) Reset() { *m = Proposal{} } @@ -356,6 +363,13 @@ func (m *Proposal) GetMetadata() string { return "" } +func (m *Proposal) GetProposer() string { + if m != nil { + return m.Proposer + } + return "" +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { YesCount string `protobuf:"bytes,1,opt,name=yes_count,json=yesCount,proto3" json:"yes_count,omitempty"` @@ -786,82 +800,84 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1193 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x73, 0xd3, 0x46, - 0x14, 0x8f, 0x6c, 0xc5, 0x49, 0x5e, 0x62, 0xa3, 0x2e, 0x14, 0x94, 0x00, 0x76, 0xf0, 0xb4, 0x9d, - 0x94, 0x3f, 0x76, 0x03, 0x43, 0x3b, 0x53, 0x2e, 0xb5, 0x63, 0x51, 0xc4, 0xd0, 0xd8, 0x95, 0x84, - 0x19, 0x7a, 0xd1, 0xc8, 0x91, 0xb0, 0x77, 0x6a, 0x69, 0x5d, 0xed, 0xda, 0xe0, 0x8f, 0xd0, 0x1b, - 0xc7, 0xce, 0xf4, 0x6b, 0x30, 0xed, 0x57, 0xe0, 0xd4, 0x61, 0x38, 0xf4, 0xcf, 0xc5, 0x6d, 0xe1, - 0x96, 0x4f, 0xd1, 0xd1, 0x6a, 0x15, 0xdb, 0x8a, 0x99, 0xa4, 0x9c, 0x24, 0xbd, 0xf7, 0xfb, 0xbd, - 0xf7, 0xf6, 0xbd, 0x9f, 0x76, 0x17, 0x2e, 0x1c, 0x10, 0xea, 0x13, 0x5a, 0xed, 0x92, 0x51, 0x75, - 0xb4, 0x1b, 0x3d, 0x2a, 0x83, 0x90, 0x30, 0x82, 0xf2, 0xb1, 0xa3, 0x12, 0x59, 0x46, 0xbb, 0x5b, - 0x45, 0x81, 0xeb, 0x38, 0xd4, 0xab, 0x8e, 0x76, 0x3b, 0x1e, 0x73, 0x76, 0xab, 0x07, 0x04, 0x07, - 0x31, 0x7c, 0xeb, 0x5c, 0x97, 0x74, 0x09, 0x7f, 0xad, 0x46, 0x6f, 0xc2, 0x5a, 0xea, 0x12, 0xd2, - 0xed, 0x7b, 0x55, 0xfe, 0xd5, 0x19, 0x3e, 0xa9, 0x32, 0xec, 0x7b, 0x94, 0x39, 0xfe, 0x40, 0x00, - 0x36, 0xd3, 0x00, 0x27, 0x18, 0x0b, 0x57, 0x31, 0xed, 0x72, 0x87, 0xa1, 0xc3, 0x30, 0x49, 0x32, - 0x6e, 0xc6, 0x15, 0xd9, 0x71, 0x52, 0x51, 0x2d, 0xff, 0x28, 0x13, 0x40, 0x8f, 0x3c, 0xdc, 0xed, - 0x31, 0xcf, 0x6d, 0x13, 0xe6, 0x35, 0x07, 0x11, 0x0d, 0xed, 0x42, 0x8e, 0xf0, 0x37, 0x55, 0xda, - 0x96, 0x76, 0x0a, 0x37, 0x37, 0x2b, 0x73, 0x4b, 0xac, 0x4c, 0xa1, 0x86, 0x00, 0xa2, 0x4f, 0x20, - 0xf7, 0x94, 0x07, 0x52, 0x33, 0xdb, 0xd2, 0xce, 0x5a, 0xbd, 0xf0, 0xfa, 0xc5, 0x0d, 0x10, 0xac, - 0x86, 0x77, 0x60, 0x08, 0x6f, 0xf9, 0x67, 0x09, 0x56, 0x1a, 0xde, 0x80, 0x50, 0xcc, 0x50, 0x09, - 0xd6, 0x07, 0x21, 0x19, 0x10, 0xea, 0xf4, 0x6d, 0xec, 0xf2, 0x5c, 0xb2, 0x01, 0x89, 0x49, 0x77, - 0xd1, 0xe7, 0xb0, 0xe6, 0xc6, 0x58, 0x12, 0x8a, 0xb8, 0xea, 0xeb, 0x17, 0x37, 0xce, 0x89, 0xb8, - 0x35, 0xd7, 0x0d, 0x3d, 0x4a, 0x4d, 0x16, 0xe2, 0xa0, 0x6b, 0x4c, 0xa1, 0xe8, 0x0b, 0xc8, 0x39, - 0x3e, 0x19, 0x06, 0x4c, 0xcd, 0x6e, 0x67, 0x77, 0xd6, 0xa7, 0xf5, 0x47, 0x33, 0xa9, 0x88, 0x99, - 0x54, 0xf6, 0x08, 0x0e, 0xea, 0xf2, 0xcb, 0x49, 0x69, 0xc9, 0x10, 0xf0, 0xf2, 0xef, 0x32, 0xac, - 0xb6, 0x44, 0x7e, 0x54, 0x80, 0xcc, 0x51, 0x55, 0x19, 0xec, 0xa2, 0xcf, 0x60, 0xd5, 0xf7, 0x28, - 0x75, 0xba, 0x1e, 0x55, 0x33, 0x3c, 0xee, 0xb9, 0x4a, 0xdc, 0xf9, 0x4a, 0xd2, 0xf9, 0x4a, 0x2d, - 0x18, 0x1b, 0x47, 0x28, 0x74, 0x1b, 0x72, 0x94, 0x39, 0x6c, 0x48, 0xd5, 0x2c, 0xef, 0xe3, 0xe5, - 0x54, 0x1f, 0x93, 0x54, 0x26, 0x07, 0x19, 0x02, 0x8c, 0xee, 0x01, 0x7a, 0x82, 0x03, 0xa7, 0x6f, - 0x33, 0xa7, 0xdf, 0x1f, 0xdb, 0xa1, 0x47, 0x87, 0x7d, 0xa6, 0xca, 0xdb, 0xd2, 0xce, 0xfa, 0xcd, - 0xad, 0x54, 0x08, 0x2b, 0x82, 0x18, 0x1c, 0x61, 0x28, 0x9c, 0x35, 0x63, 0x41, 0x35, 0x58, 0xa7, - 0xc3, 0x8e, 0x8f, 0x99, 0x1d, 0xc9, 0x49, 0x5d, 0x16, 0x21, 0xd2, 0x55, 0x5b, 0x89, 0xd6, 0xea, - 0xf2, 0xf3, 0xbf, 0x4b, 0x92, 0x01, 0x31, 0x29, 0x32, 0xa3, 0xfb, 0xa0, 0x88, 0xc6, 0xda, 0x5e, - 0xe0, 0xc6, 0x71, 0x72, 0xa7, 0x8c, 0x53, 0x10, 0x4c, 0x2d, 0x70, 0x79, 0xac, 0x06, 0xe4, 0x19, - 0x61, 0x4e, 0xdf, 0x16, 0x76, 0x75, 0xe5, 0x74, 0xe3, 0xd9, 0xe0, 0xac, 0x44, 0x36, 0x0f, 0xe0, - 0x83, 0x11, 0x61, 0x38, 0xe8, 0xda, 0x94, 0x39, 0xa1, 0x58, 0xda, 0xea, 0x29, 0x4b, 0x3a, 0x13, - 0x53, 0xcd, 0x88, 0xc9, 0x6b, 0xba, 0x07, 0xc2, 0x34, 0x5d, 0xde, 0xda, 0x29, 0x63, 0xe5, 0x63, - 0x62, 0xb2, 0xba, 0xad, 0x48, 0x1f, 0xcc, 0x71, 0x1d, 0xe6, 0xa8, 0x10, 0x89, 0xd5, 0x38, 0xfa, - 0x2e, 0xff, 0x21, 0xc1, 0xfa, 0xec, 0x60, 0xae, 0xc1, 0xda, 0xd8, 0xa3, 0xf6, 0x01, 0x17, 0xa9, - 0x74, 0xec, 0x8f, 0xd1, 0x03, 0x66, 0xac, 0x8e, 0x3d, 0xba, 0x17, 0xf9, 0xd1, 0x2d, 0xc8, 0x3b, - 0x1d, 0xca, 0x1c, 0x1c, 0x08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 0x5c, 0x9b, 0x62, 0x65, - 0x0d, 0x10, 0x5a, 0x4d, 0x32, 0x4b, 0x27, 0x65, 0x96, 0x79, 0xe4, 0x8d, 0x98, 0x25, 0xa2, 0xfe, - 0x9b, 0x88, 0x58, 0x44, 0xfd, 0x12, 0x72, 0x3f, 0x0c, 0x49, 0x38, 0xf4, 0x85, 0x82, 0xcb, 0x87, - 0x93, 0x92, 0x12, 0x5b, 0xa6, 0x15, 0xa6, 0xcf, 0x81, 0xd8, 0x8f, 0xf6, 0x60, 0x8d, 0xf5, 0x42, - 0x8f, 0xf6, 0x48, 0xdf, 0x15, 0x82, 0xf8, 0xf8, 0x70, 0x52, 0x3a, 0x7b, 0x64, 0x7c, 0x67, 0x84, - 0x29, 0x0f, 0x7d, 0x0b, 0x05, 0x2e, 0xd8, 0x69, 0xa4, 0x58, 0xe9, 0x57, 0x0f, 0x27, 0x25, 0x75, - 0xde, 0xf3, 0xce, 0x70, 0xf9, 0x08, 0x67, 0x25, 0xb0, 0xf2, 0xaf, 0x59, 0xc8, 0x89, 0xe5, 0x7d, - 0xf5, 0x3f, 0xe5, 0x10, 0xef, 0x55, 0xb3, 0x53, 0xff, 0xe6, 0xfd, 0xa6, 0x2e, 0x2f, 0x9e, 0xea, - 0xf1, 0x29, 0x66, 0xdf, 0x63, 0x8a, 0xd1, 0x49, 0x2d, 0xa6, 0x26, 0x2f, 0x3e, 0xa9, 0xc5, 0x84, - 0xae, 0xcf, 0x4e, 0x68, 0x79, 0x21, 0x74, 0x66, 0x14, 0xb7, 0x8f, 0x8d, 0x22, 0xb7, 0x90, 0x32, - 0xdf, 0x6e, 0xa4, 0xc3, 0x66, 0xd4, 0x63, 0x1c, 0x60, 0x86, 0xa7, 0xe7, 0x82, 0xcd, 0xcb, 0x57, - 0x57, 0x16, 0x46, 0x38, 0xef, 0xe3, 0x40, 0x8f, 0xf1, 0xa2, 0x3d, 0x46, 0x84, 0xbe, 0xfa, 0xa3, - 0x04, 0x30, 0x73, 0x87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0x71, 0xe9, 0xbb, 0x6b, 0x5d, 0xcc, 0x7a, 0xc3, - 0x4e, 0xe5, 0x80, 0xf8, 0xe2, 0x6a, 0x29, 0x1e, 0x37, 0xa8, 0xfb, 0x7d, 0xf5, 0x19, 0xbf, 0x2e, - 0xb3, 0xf1, 0xc0, 0xa3, 0xd1, 0x5d, 0x38, 0xc7, 0x25, 0x7a, 0xeb, 0xbf, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xde, 0xdf, 0xa6, 0x05, 0x4c, 0x0b, 0x00, 0x00, + // 1218 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x6e, 0xdb, 0xc6, + 0x13, 0x36, 0x25, 0x5a, 0x96, 0x47, 0xb6, 0xc2, 0xdf, 0x26, 0xbf, 0x84, 0x76, 0x12, 0xc9, 0x11, + 0xda, 0xc2, 0xcd, 0x1f, 0xa9, 0x4e, 0x9a, 0x16, 0x68, 0x2e, 0x95, 0x25, 0xa6, 0x61, 0x90, 0x5a, + 0x2a, 0xc5, 0x38, 0x48, 0x2f, 0x04, 0x6d, 0x6e, 0xe4, 0x45, 0x45, 0xae, 0xca, 0x5d, 0x29, 0xd1, + 0x23, 0x14, 0xe8, 0x21, 0xc7, 0x02, 0x7d, 0x8d, 0xa0, 0x7d, 0x85, 0x1c, 0x83, 0x5c, 0xda, 0x5e, + 0xdc, 0x36, 0xb9, 0x19, 0x7d, 0x88, 0x82, 0xcb, 0xa5, 0xfe, 0xd0, 0x0a, 0xec, 0xe6, 0x44, 0x72, + 0xe6, 0xfb, 0x66, 0x66, 0x67, 0x3e, 0xee, 0x2e, 0x5c, 0xd8, 0xa7, 0xcc, 0xa7, 0xac, 0xd6, 0xa5, + 0xc3, 0xda, 0x70, 0x2b, 0x7a, 0x54, 0xfb, 0x21, 0xe5, 0x14, 0xad, 0xc6, 0x8e, 0x6a, 0x64, 0x19, + 0x6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0x58, 0x87, 0x87, 0x24, 0xe8, 0x5a, 0x13, 0x28, 0xfa, 0x1c, + 0x72, 0xae, 0x4f, 0x07, 0x01, 0xd7, 0xb3, 0x1b, 0xd9, 0xcd, 0xc2, 0xa4, 0xfe, 0x68, 0x26, 0x55, + 0x39, 0x93, 0x6a, 0x83, 0x92, 0x60, 0x5b, 0x7d, 0x79, 0x58, 0x5e, 0xb0, 0x24, 0xbc, 0xf2, 0xe3, + 0x22, 0xe4, 0xdb, 0x32, 0x3f, 0x2a, 0x42, 0x66, 0x5c, 0x55, 0x86, 0x78, 0xe8, 0x13, 0xc8, 0xfb, + 0x98, 0x31, 0xb7, 0x8b, 0x99, 0x9e, 0x11, 0x71, 0xcf, 0x55, 0xe3, 0xce, 0x57, 0x93, 0xce, 0x57, + 0xeb, 0xc1, 0xc8, 0x1a, 0xa3, 0xd0, 0x6d, 0xc8, 0x31, 0xee, 0xf2, 0x01, 0xd3, 0xb3, 0xa2, 0x8f, + 0x97, 0x53, 0x7d, 0x4c, 0x52, 0x75, 0x04, 0xc8, 0x92, 0x60, 0x74, 0x0f, 0xd0, 0x13, 0x12, 0xb8, + 0x3d, 0x87, 0xbb, 0xbd, 0xde, 0xc8, 0x09, 0x31, 0x1b, 0xf4, 0xb8, 0xae, 0x6e, 0x28, 0x9b, 0x85, + 0x9b, 0xeb, 0xa9, 0x10, 0x76, 0x04, 0xb1, 0x04, 0xc2, 0xd2, 0x04, 0x6b, 0xca, 0x82, 0xea, 0x50, + 0x60, 0x83, 0x3d, 0x9f, 0x70, 0x27, 0x92, 0x93, 0xbe, 0x28, 0x43, 0xa4, 0xab, 0xb6, 0x13, 0xad, + 0x6d, 0xab, 0xcf, 0xff, 0x2c, 0x2b, 0x16, 0xc4, 0xa4, 0xc8, 0x8c, 0xee, 0x83, 0x26, 0x1b, 0xeb, + 0xe0, 0xc0, 0x8b, 0xe3, 0xe4, 0x4e, 0x19, 0xa7, 0x28, 0x99, 0x46, 0xe0, 0x89, 0x58, 0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eightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -968,6 +984,13 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Proposer) > 0 { + i -= len(m.Proposer) + copy(dAtA[i:], m.Proposer) + i = encodeVarintGov(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0x5a + } if len(m.Metadata) > 0 { i -= len(m.Metadata) copy(dAtA[i:], m.Metadata) @@ -1481,6 +1504,10 @@ func (m *Proposal) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } + l = len(m.Proposer) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -2216,6 +2243,38 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } m.Metadata = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", 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.Proposer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index ed1aa782096..29225c490c8 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -13,8 +13,8 @@ import ( ) var ( - _, _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgExecLegacyContent{}, &MsgUpdateParams{} - _, _ codectypes.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgExecLegacyContent{} + _, _, _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgExecLegacyContent{}, &MsgUpdateParams{}, &MsgCancelProposal{} + _, _ codectypes.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgExecLegacyContent{} ) // NewMsgSubmitProposal creates a new MsgSubmitProposal. @@ -292,3 +292,37 @@ func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { authority, _ := sdk.AccAddressFromBech32(msg.Authority) return []sdk.AccAddress{authority} } + +// NewMsgCancelProposal creates a new MsgCancelProposal instance +// +//nolint:interfacer +func NewMsgCancelProposal(proposer sdk.AccAddress, proposalID uint64) *MsgCancelProposal { + return &MsgCancelProposal{proposalID, proposer.String()} +} + +// Route implements Msg +func (msg MsgCancelProposal) Route() string { return types.RouterKey } + +// Type implements Msg +func (msg MsgCancelProposal) Type() string { return sdk.MsgTypeURL(&msg) } + +// ValidateBasic implements Msg +func (msg MsgCancelProposal) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Proposer); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid depositor address: %s", err) + } + + return nil +} + +// GetSignBytes implements Msg +func (msg MsgCancelProposal) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners implements Msg +func (msg MsgCancelProposal) GetSigners() []sdk.AccAddress { + proposer, _ := sdk.AccAddressFromBech32(msg.Proposer) + return []sdk.AccAddress{proposer} +} diff --git a/x/gov/types/v1/proposal.go b/x/gov/types/v1/proposal.go index cb04be0d45a..e732558f588 100644 --- a/x/gov/types/v1/proposal.go +++ b/x/gov/types/v1/proposal.go @@ -20,10 +20,11 @@ const ( StatusPassed = ProposalStatus_PROPOSAL_STATUS_PASSED StatusRejected = ProposalStatus_PROPOSAL_STATUS_REJECTED StatusFailed = ProposalStatus_PROPOSAL_STATUS_FAILED + StatusCanceled = ProposalStatus_PROPOSAL_STATUS_CANCELED ) // NewProposal creates a new Proposal instance -func NewProposal(messages []sdk.Msg, id uint64, metadata string, submitTime, depositEndTime time.Time) (Proposal, error) { +func NewProposal(messages []sdk.Msg, proposer sdk.AccAddress, id uint64, metadata string, submitTime, depositEndTime time.Time) (Proposal, error) { msgs, err := sdktx.SetMsgs(messages) if err != nil { return Proposal{}, err @@ -39,6 +40,7 @@ func NewProposal(messages []sdk.Msg, id uint64, metadata string, submitTime, dep FinalTallyResult: &tally, SubmitTime: &submitTime, DepositEndTime: &depositEndTime, + Proposer: proposer.String(), } return p, nil diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 7444965caf5..0bc245db567 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -651,6 +651,7 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // MsgCancelProposal is the Msg/CancelProposal request type. +// // Since: cosmos-sdk 0.47 type MsgCancelProposal struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` @@ -848,7 +849,8 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - // CancelProposal defines a + // CancelProposal defines a method to cancel governance proposal + // // Since: cosmos-sdk 0.47 CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) } @@ -942,7 +944,8 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - // CancelProposal defines a + // CancelProposal defines a method to cancel governance proposal + // // Since: cosmos-sdk 0.47 CancelProposal(context.Context, *MsgCancelProposal) (*MsgCancelProposalResponse, error) } From 25b2f2cfdd9b56440ce02873d46fae6be8fd947b Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 25 Aug 2022 17:25:29 +0530 Subject: [PATCH 03/69] feat: add minDeposits of proposal to community pool --- x/gov/abci.go | 2 + x/gov/abci_test.go | 90 ++++++++++++++++++++++++++++++++- x/gov/genesis_test.go | 5 +- x/gov/keeper/deposit.go | 46 +++++++++++++++++ x/gov/keeper/deposit_test.go | 4 +- x/gov/keeper/keeper.go | 10 ++-- x/gov/migrations/v4/store.go | 25 +++++++++ x/gov/module.go | 8 +-- x/gov/types/expected_keepers.go | 5 ++ 9 files changed, 182 insertions(+), 13 deletions(-) diff --git a/x/gov/abci.go b/x/gov/abci.go index 6f8c9968413..86ce61264e8 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -18,8 +18,10 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { logger := keeper.Logger(ctx) // delete the canceled proposals from store and returns theirs deposits. + // move the initial deposit of proposer to community pool and refund remaining deposits. keeper.IterateCanceledProposalQueue(ctx, func(proposal v1.Proposal) (stop bool) { keeper.DeleteProposal(ctx, proposal.Id) + keeper.SendMinDepositsOfProposalToCommunityPool(ctx, proposal.Id, proposal.Proposer) // send min deposit to community pool keeper.RefundAndDeleteDeposits(ctx, proposal.Id) // refund deposit if proposal got removed without getting 100% of the proposal return false diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 248c82a94ad..4d8a89fde94 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -286,6 +286,7 @@ func TestProposalPassedEndblocker(t *testing.T) { app.BeginBlock(abci.RequestBeginBlock{Header: header}) valAddr := sdk.ValAddress(addrs[0]) + proposer := addrs[0] createValidators(t, stakingMsgSvr, ctx, []sdk.ValAddress{valAddr}, []int64{10}) staking.EndBlocker(ctx, app.StakingKeeper) @@ -294,7 +295,7 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NotNil(t, macc) initialModuleAccCoins := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))} @@ -337,6 +338,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { app.BeginBlock(abci.RequestBeginBlock{Header: header}) valAddr := sdk.ValAddress(addrs[0]) + proposer := addrs[0] createValidators(t, stakingMsgSvr, ctx, []sdk.ValAddress{valAddr}, []int64{10}) staking.EndBlocker(ctx, app.StakingKeeper) @@ -344,7 +346,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { // Create a proposal where the handler will pass for the test proposal // because the value of contextKeyBadProposal is true. ctx = ctx.WithValue(contextKeyBadProposal, true) - proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))) @@ -370,6 +372,90 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { gov.EndBlocker(ctx, app.GovKeeper) } +func TestProposalCanceledEndblocker(t *testing.T) { + app := simapp.Setup(t, false) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + addrs := simapp.AddTestAddrs(app, ctx, 10, valTokens) + + SortAddresses(addrs) + + govMsgSvr := keeper.NewMsgServerImpl(app.GovKeeper) + stakingMsgSvr := stakingkeeper.NewMsgServerImpl(app.StakingKeeper) + + header := tmproto.Header{Height: app.LastBlockHeight() + 1} + app.BeginBlock(abci.RequestBeginBlock{Header: header}) + + valAddr := sdk.ValAddress(addrs[0]) + proposer := addrs[0] + depositer := addrs[1] + + createValidators(t, stakingMsgSvr, ctx, []sdk.ValAddress{valAddr}, []int64{10}) + staking.EndBlocker(ctx, app.StakingKeeper) + + macc := app.GovKeeper.GetGovernanceAccount(ctx) + require.NotNil(t, macc) + initialModuleAccCoins := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) + intitalProposerBalance := app.BankKeeper.GetAllBalances(ctx, proposer) + depositerBalance := app.BankKeeper.GetAllBalances(ctx, depositer) + + proposal, err := app.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") + require.NoError(t, err) + + proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))} + newDepositMsg := v1.NewMsgDeposit(addrs[0], proposal.Id, proposalCoins) + + res, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) + require.NoError(t, err) + require.NotNil(t, res) + + newDepositMsg = v1.NewMsgDeposit(addrs[1], proposal.Id, proposalCoins) + res, err = govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) + require.NoError(t, err) + require.NotNil(t, res) + + // check the balances of depositer and proposer + require.True(t, app.BankKeeper.GetAllBalances(ctx, depositer).IsEqual(depositerBalance.Sub(proposalCoins...))) + require.True(t, app.BankKeeper.GetAllBalances(ctx, proposer).IsEqual(intitalProposerBalance.Sub(proposalCoins...))) + + canceledProposalQueue := app.GovKeeper.CanceledProposalQueueIterator(ctx) + require.False(t, canceledProposalQueue.Valid()) + canceledProposalQueue.Close() + + macc = app.GovKeeper.GetGovernanceAccount(ctx) + require.NotNil(t, macc) + moduleAccCoins := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) + + deposits := initialModuleAccCoins.Add(proposal.TotalDeposit...).Add(proposalCoins...).Add(proposalCoins...) + require.True(t, moduleAccCoins.IsEqual(deposits)) + + err = app.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1.NewNonSplitVoteOption(v1.OptionYes), "") + require.NoError(t, err) + + minDepositsForProposal, err := app.GovKeeper.GetMinDepositsForProposal(ctx) + minDepositsForProposalInDec := sdk.NewDecCoinsFromCoins(minDepositsForProposal...) + require.NoError(t, err) + + // get the community pool funds + beforeCommunityFund := app.DistrKeeper.GetFeePoolCommunityCoins(ctx) + // cancel the gov proposal + err = app.GovKeeper.CancelProposal(ctx, proposal.Id, addrs[0].String()) + require.NoError(t, err) + + canceledProposalQueue = app.GovKeeper.CanceledProposalQueueIterator(ctx) + require.True(t, canceledProposalQueue.Valid()) + canceledProposalQueue.Close() + + gov.EndBlocker(ctx, app.GovKeeper) + afterCommunityFund := app.DistrKeeper.GetFeePoolCommunityCoins(ctx) + + macc = app.GovKeeper.GetGovernanceAccount(ctx) + require.NotNil(t, macc) + require.Equal(t, beforeCommunityFund.Add(minDepositsForProposalInDec...), afterCommunityFund) + require.True(t, app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()).IsEqual(initialModuleAccCoins)) + require.True(t, app.BankKeeper.GetAllBalances(ctx, proposer).IsEqual(intitalProposerBalance.Sub(minDepositsForProposal...))) + require.True(t, app.BankKeeper.GetAllBalances(ctx, depositer).IsEqual(depositerBalance)) +} + func createValidators(t *testing.T, stakingMsgSvr stakingtypes.MsgServer, ctx sdk.Context, addrs []sdk.ValAddress, powerAmt []int64) { require.True(t, len(addrs) <= len(pubkeys), "Not enough pubkeys specified at top of file.") diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index d7c0c6b677e..0a7ffa6e536 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -34,11 +34,12 @@ func TestImportExportQueues(t *testing.T) { ctx = app.BaseApp.NewContext(false, tmproto.Header{}) // Create two proposals, put the second into the voting period - proposal1, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") + proposer := addrs[0] + proposal1, err := app.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalID1 := proposal1.Id - proposal2, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") + proposal2, err := app.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalID2 := proposal2.Id diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 51de86003aa..61f1ee16aa5 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -162,6 +162,52 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd return activatedVotingPeriod, nil } +// SendMinDepositsOfProposalToCommunityPool will sends the min deposits of proposal to community pool +// from proposer deposits and updated the deposit store with updated deposit amount. +func (keeper Keeper) SendMinDepositsOfProposalToCommunityPool(ctx sdk.Context, proposalID uint64, proAddr string) error { + proposerAddr := sdk.MustAccAddressFromBech32(proAddr) + + deposit, found := keeper.GetDeposit(ctx, proposalID, proposerAddr) + if !found { + return nil + } + + minDepositeAmount, err := keeper.GetMinDepositsForProposal(ctx) + if err != nil { + return err + } + + // send minDepositeAmount to community pool from proposal deposits (gov module) + err = keeper.dk.FundCommunityPool(ctx, minDepositeAmount, keeper.authKeeper.GetModuleAddress(types.ModuleName)) + if err != nil { + return err + } + + deposit.Amount = sdk.NewCoins(deposit.Amount...).Sub(minDepositeAmount...) + // reset the deposit to store with updated amount + keeper.SetDeposit(ctx, deposit) + return nil +} + +// GetMinDepositsForProposal will returns minimum deposit amount required for creating the proposal. +func (keeper Keeper) GetMinDepositsForProposal(ctx sdk.Context) ([]sdk.Coin, error) { + params := keeper.GetParams(ctx) + + minInitialDepositRatio, err := sdk.NewDecFromStr(params.MinInitialDepositRatio) + if err != nil { + return nil, err + } + if minInitialDepositRatio.IsZero() { + return nil, nil + } + minDepositCoins := params.MinDeposit + for i := range minDepositCoins { + minDepositCoins[i].Amount = sdk.NewDecFromInt(minDepositCoins[i].Amount).Mul(minInitialDepositRatio).RoundInt() + } + + return minDepositCoins, nil +} + // RefundAndDeleteDeposits refunds and deletes all the deposits on a specific proposal. func (keeper Keeper) RefundAndDeleteDeposits(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(keeper.storeKey) diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 158756ca978..e3b5c8c70d1 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -23,7 +23,7 @@ func TestDeposits(t *testing.T) { TestAddrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, TestAddrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id @@ -107,7 +107,7 @@ func TestDeposits(t *testing.T) { require.Equal(t, addr1Initial, app.BankKeeper.GetAllBalances(ctx, TestAddrs[1])) // Test delete and burn deposits - proposal, err = app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestAddrs[0], tp, "") require.NoError(t, err) proposalID = proposal.Id _, err = app.GovKeeper.AddDeposit(ctx, proposalID, TestAddrs[0], fourStake) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 1f72809ce07..dd19b5462d4 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -23,6 +23,8 @@ type Keeper struct { authKeeper types.AccountKeeper bankKeeper types.BankKeeper + // Distribution Keeper + dk types.DistributionKeeper // The reference to the DelegationSet and ValidatorSet to get information about validators and delegators sk types.StakingKeeper @@ -63,7 +65,7 @@ func (k Keeper) GetAuthority() string { // CONTRACT: the parameter Subspace must have the param key table already initialized func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, authKeeper types.AccountKeeper, - bankKeeper types.BankKeeper, sk types.StakingKeeper, + bankKeeper types.BankKeeper, sk types.StakingKeeper, dk types.DistributionKeeper, router *baseapp.MsgServiceRouter, config types.Config, authority string, ) *Keeper { // ensure governance module account is set @@ -84,6 +86,7 @@ func NewKeeper( storeKey: key, authKeeper: authKeeper, bankKeeper: bankKeeper, + dk: dk, sk: sk, cdc: cdc, router: router, @@ -215,8 +218,7 @@ func (keeper Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time // IterateCanceledProposalQueue iterates over the proposal in the canceled proposal queue // and performs a callback function func (keeper Keeper) IterateCanceledProposalQueue(ctx sdk.Context, cb func(proposal v1.Proposal) (stop bool)) { - store := ctx.KVStore(keeper.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.CanceledProposalQueuePrefix) + iterator := keeper.CanceledProposalQueueIterator(ctx) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -247,7 +249,7 @@ func (keeper Keeper) InactiveProposalQueueIterator(ctx sdk.Context, endTime time // InactiveProposalQueueIterator returns an sdk.Iterator for all the proposals in the Inactive Queue that expire by endTime func (keeper Keeper) CanceledProposalQueueIterator(ctx sdk.Context) sdk.Iterator { store := ctx.KVStore(keeper.storeKey) - return store.Iterator(types.CanceledProposalQueuePrefix, nil) + return sdk.KVStorePrefixIterator(store, types.CanceledProposalQueuePrefix) } // assertMetadataLength returns an error if given metadata length diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go index 5047b3cc019..836719bd6df 100644 --- a/x/gov/migrations/v4/store.go +++ b/x/gov/migrations/v4/store.go @@ -5,6 +5,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/exported" + types "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) @@ -38,6 +39,30 @@ func migrateParams(ctx sdk.Context, storeKey storetypes.StoreKey, legacySubspace return nil } +// AddProposerAddressToProposal will add proposer to proposal +// and set to the store +func AddProposerAddressToProposal(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, proposals map[uint64]string) error { + store := ctx.KVStore(storeKey) + for proposerID, proposer := range proposals { + bz := store.Get(types.ProposalKey(proposerID)) + var proposal govv1.Proposal + if err := cdc.Unmarshal(bz, &proposal); err != nil { + panic(err) + } + + proposal.Proposer = proposer + + // set the new proposal with proposer + bz, err := cdc.Marshal(&proposal) + if err != nil { + panic(err) + } + store.Set(types.ProposalKey(proposal.Id), bz) + } + + return nil +} + // MigrateStore performs in-place store migrations from v3 (v0.46) to v4 (v0.47). The // migration includes: // diff --git a/x/gov/module.go b/x/gov/module.go index c984611f224..b733d5612c6 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -168,9 +168,10 @@ type govInputs struct { MsgServiceRouter *baseapp.MsgServiceRouter Authority map[string]sdk.AccAddress `optional:"true"` - AccountKeeper govtypes.AccountKeeper - BankKeeper govtypes.BankKeeper - StakingKeeper govtypes.StakingKeeper + AccountKeeper govtypes.AccountKeeper + BankKeeper govtypes.BankKeeper + StakingKeeper govtypes.StakingKeeper + DistributionKeeper govtypes.DistributionKeeper // LegacySubspace is used solely for migration of x/params managed parameters LegacySubspace govtypes.ParamSubspace @@ -201,6 +202,7 @@ func provideModule(in govInputs) govOutputs { in.AccountKeeper, in.BankKeeper, in.StakingKeeper, + in.DistributionKeeper, in.MsgServiceRouter, kConfig, authority.String(), diff --git a/x/gov/types/expected_keepers.go b/x/gov/types/expected_keepers.go index 70f0e5fbe99..de2f3e645ff 100644 --- a/x/gov/types/expected_keepers.go +++ b/x/gov/types/expected_keepers.go @@ -27,6 +27,11 @@ type StakingKeeper interface { ) } +// DistributionKeeper defines the expected distribution keeper (noalias) +type DistributionKeeper interface { + FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error +} + // AccountKeeper defines the expected account keeper (noalias) type AccountKeeper interface { GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI From 146e4cfd9e26f5fb2a17d0a244d7852580a1ee7a Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 25 Aug 2022 22:43:29 +0530 Subject: [PATCH 04/69] chore: sort the proposal ids --- x/gov/keeper/keeper.go | 4 ++-- x/gov/migrations/v4/store.go | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index dd19b5462d4..6cdfefeb4bd 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -150,8 +150,8 @@ func (keeper Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, proposalID u } // InsertCanceledProposalQueue inserts a ProposalID into the cancel proposal queue -func (Keeper Keeper) InsertCanceledProposalQueue(ctx sdk.Context, proposalID uint64) { - store := ctx.KVStore(Keeper.storeKey) +func (keeper Keeper) InsertCanceledProposalQueue(ctx sdk.Context, proposalID uint64) { + store := ctx.KVStore(keeper.storeKey) bz := types.GetProposalIDBytes(proposalID) store.Set(types.CanceledProposalQueueKey(proposalID), bz) } diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go index 836719bd6df..e38686d38e5 100644 --- a/x/gov/migrations/v4/store.go +++ b/x/gov/migrations/v4/store.go @@ -1,6 +1,8 @@ package v4 import ( + "sort" + "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -42,15 +44,24 @@ func migrateParams(ctx sdk.Context, storeKey storetypes.StoreKey, legacySubspace // AddProposerAddressToProposal will add proposer to proposal // and set to the store func AddProposerAddressToProposal(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, proposals map[uint64]string) error { + proposalIDS := make([]uint64, 0, len(proposals)) + + for proposerID := range proposals { + proposalIDS = append(proposalIDS, proposerID) + } + // sort the proposalIDS + sort.Slice(proposalIDS, func(i, j int) bool { return proposalIDS[i] < proposalIDS[j] }) + store := ctx.KVStore(storeKey) - for proposerID, proposer := range proposals { + + for _, proposerID := range proposalIDS { bz := store.Get(types.ProposalKey(proposerID)) var proposal govv1.Proposal if err := cdc.Unmarshal(bz, &proposal); err != nil { panic(err) } - proposal.Proposer = proposer + proposal.Proposer = proposals[proposerID] // set the new proposal with proposer bz, err := cdc.Marshal(&proposal) From 2b9c9165b2bd215d0e6f2067c82687d33784f39b Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 26 Aug 2022 10:50:12 +0530 Subject: [PATCH 05/69] test: fix the test cases in gov submit proposal --- x/gov/keeper/common_test.go | 4 ++- x/gov/keeper/deposit_test.go | 4 +-- x/gov/keeper/grpc_query_test.go | 30 +++++++++---------- x/gov/keeper/hooks_test.go | 4 +-- x/gov/keeper/keeper_test.go | 14 ++++----- x/gov/keeper/proposal_test.go | 8 ++--- x/gov/keeper/vote_test.go | 2 +- x/gov/simulation/operations_test.go | 9 ++++-- x/gov/testutil/expected_keepers.go | 4 +++ x/gov/testutil/expected_keepers_mocks.go | 37 ++++++++++++++++++++++++ 10 files changed, 81 insertions(+), 35 deletions(-) diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index c4e82bee647..b7969a9bc45 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -68,6 +68,8 @@ func setupGovKeeper(t *testing.T) ( acctKeeper := govtestutil.NewMockAccountKeeper(ctrl) bankKeeper := govtestutil.NewMockBankKeeper(ctrl) stakingKeeper := govtestutil.NewMockStakingKeeper(ctrl) + distributionKeeper := govtestutil.NewMockDistributionKeeper(ctrl) + acctKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(govAcct).AnyTimes() acctKeeper.EXPECT().GetModuleAccount(gomock.Any(), types.ModuleName).Return(authtypes.NewEmptyModuleAccount(types.ModuleName)).AnyTimes() trackMockBalances(bankKeeper) @@ -80,7 +82,7 @@ func setupGovKeeper(t *testing.T) ( stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()).Return(math.NewInt(10000000)).AnyTimes() // Gov keeper initializations - govKeeper := keeper.NewKeeper(encCfg.Codec, key, acctKeeper, bankKeeper, stakingKeeper, msr, types.DefaultConfig(), govAcct.String()) + govKeeper := keeper.NewKeeper(encCfg.Codec, key, acctKeeper, bankKeeper, stakingKeeper, distributionKeeper, msr, types.DefaultConfig(), govAcct.String()) govKeeper.SetProposalID(ctx, 1) govRouter := v1beta1.NewRouter() // Also register legacy gov handlers to test them too. govRouter.AddRoute(types.RouterKey, v1beta1.ProposalHandler) diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 03c77a3e076..e8ff5a5f7c1 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -21,7 +21,7 @@ func TestDeposits(t *testing.T) { TestAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "") + proposal, err := govKeeper.SubmitProposal(ctx, TestAddrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id @@ -105,7 +105,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, "") + proposal, err = govKeeper.SubmitProposal(ctx, TestAddrs[0], tp, "") require.NoError(t, err) proposalID = proposal.Id _, err = govKeeper.AddDeposit(ctx, proposalID, TestAddrs[0], fourStake) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index de9711dfff9..a4efadc38d3 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -16,7 +16,7 @@ import ( func (suite *KeeperTestSuite) TestGRPCQueryProposal() { suite.reset() - ctx, queryClient := suite.ctx, suite.queryClient + ctx, queryClient, addrs := suite.ctx, suite.queryClient, suite.addrs var ( req *v1.QueryProposalRequest @@ -56,7 +56,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}, "") + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, addrs[0], []sdk.Msg{msgContent}, "") suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -91,7 +91,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { suite.reset() - ctx, queryClient := suite.ctx, suite.legacyQueryClient + ctx, queryClient, addrs := suite.ctx, suite.legacyQueryClient, suite.addrs var ( req *v1beta1.QueryProposalRequest @@ -131,7 +131,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}, "") + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, addrs[0], []sdk.Msg{msgContent}, "") suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -197,7 +197,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { testProposal := []sdk.Msg{ v1.NewMsgVote(govAddress, uint64(i), v1.OptionYes, ""), } - proposal, err := suite.govKeeper.SubmitProposal(ctx, testProposal, "") + proposal, err := suite.govKeeper.SubmitProposal(ctx, addrs[0], testProposal, "") suite.Require().NotEmpty(proposal) suite.Require().NoError(err) testProposals = append(testProposals, &proposal) @@ -319,7 +319,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposals() { suite.reset() - ctx, queryClient := suite.ctx, suite.legacyQueryClient + ctx, queryClient, addrs := suite.ctx, suite.legacyQueryClient, suite.addrs var req *v1beta1.QueryProposalsRequest @@ -335,7 +335,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}, "") + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, addrs[0], []sdk.Msg{msgContent}, "") suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) }, @@ -416,7 +416,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") suite.Require().NoError(err) req = &v1.QueryVoteRequest{ @@ -530,7 +530,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") suite.Require().NoError(err) req = &v1beta1.QueryVoteRequest{ @@ -636,7 +636,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") suite.Require().NoError(err) req = &v1.QueryVotesRequest{ @@ -738,7 +738,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") suite.Require().NoError(err) req = &v1beta1.QueryVotesRequest{ @@ -1023,7 +1023,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -1124,7 +1124,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -1214,7 +1214,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") suite.Require().NoError(err) req = &v1.QueryDepositsRequest{ @@ -1308,7 +1308,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") suite.Require().NoError(err) req = &v1beta1.QueryDepositsRequest{ diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index 6df5c3088c9..3fc2b8678a3 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -63,7 +63,7 @@ func TestHooks(t *testing.T) { require.False(t, govHooksReceiver.AfterProposalVotingPeriodEndedValid) tp := TestProposal - _, err := govKeeper.SubmitProposal(ctx, tp, "") + _, err := govKeeper.SubmitProposal(ctx, addrs[0], tp, "") require.NoError(t, err) require.True(t, govHooksReceiver.AfterProposalSubmissionValid) @@ -74,7 +74,7 @@ func TestHooks(t *testing.T) { require.True(t, govHooksReceiver.AfterProposalFailedMinDepositValid) - p2, err := govKeeper.SubmitProposal(ctx, tp, "") + p2, err := govKeeper.SubmitProposal(ctx, addrs[0], tp, "") 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 c064e3abd61..876bc68a0e0 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -74,17 +74,17 @@ func TestIncrementProposalNumber(t *testing.T) { govKeeper, _, _, _, _, ctx := setupGovKeeper(t) tp := TestProposal - _, err := govKeeper.SubmitProposal(ctx, tp, "") + _, err := govKeeper.SubmitProposal(ctx, addr, tp, "") require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "") + _, err = govKeeper.SubmitProposal(ctx, addr, tp, "") require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "") + _, err = govKeeper.SubmitProposal(ctx, addr, tp, "") require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "") + _, err = govKeeper.SubmitProposal(ctx, addr, tp, "") require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "") + _, err = govKeeper.SubmitProposal(ctx, addr, tp, "") require.NoError(t, err) - proposal6, err := govKeeper.SubmitProposal(ctx, tp, "") + proposal6, err := govKeeper.SubmitProposal(ctx, addr, tp, "") require.NoError(t, err) require.Equal(t, uint64(6), proposal6.Id) @@ -95,7 +95,7 @@ func TestProposalQueues(t *testing.T) { // create test proposals tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "") + proposal, err := govKeeper.SubmitProposal(ctx, addr, tp, "") require.NoError(t, err) inactiveIterator := govKeeper.InactiveProposalQueueIterator(ctx, *proposal.DepositEndTime) diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index ce655d4aed2..edabc97516c 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -18,7 +18,7 @@ import ( func (suite *KeeperTestSuite) TestGetSetProposal() { tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "") + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[0], tp, "") suite.Require().NoError(err) proposalID := proposal.Id suite.govKeeper.SetProposal(suite.ctx, proposal) @@ -30,7 +30,7 @@ func (suite *KeeperTestSuite) TestGetSetProposal() { func (suite *KeeperTestSuite) TestActivateVotingPeriod() { tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "") + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[0], tp, "") suite.Require().NoError(err) suite.Require().Nil(proposal.VotingStartTime) @@ -81,7 +81,7 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { 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) + _, err = suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[0], []sdk.Msg{prop}, tc.metadata) suite.Require().True(errors.Is(tc.expectedErr, err), "tc #%d; got: %v, expected: %v", i, err, tc.expectedErr) } } @@ -94,7 +94,7 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { for _, s := range status { for i := 0; i < 50; i++ { - p, err := v1.NewProposal(TestProposal, proposalID, "", time.Now(), time.Now()) + p, err := v1.NewProposal(TestProposal, suite.addrs[0], proposalID, "", time.Now(), time.Now()) suite.Require().NoError(err) p.Status = s diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 10720045dc7..a3857e41c60 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -15,7 +15,7 @@ func TestVotes(t *testing.T) { addrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "") + proposal, err := govKeeper.SubmitProposal(ctx, addrs[0], tp, "") 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 4f1a6e331f1..cd238c7f16c 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -140,6 +140,7 @@ func TestSimulateMsgDeposit(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) accounts := getTestingAccounts(t, r, app, ctx, 3) + proposer := accounts[0].Address // setup a proposal content := v1beta1.NewTextProposal("Test", "description") @@ -149,7 +150,7 @@ func TestSimulateMsgDeposit(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetParams(ctx).MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, "", submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, proposer, 1, "", submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.SetProposal(ctx, proposal) @@ -186,6 +187,7 @@ func TestSimulateMsgVote(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) accounts := getTestingAccounts(t, r, app, ctx, 3) + proposer := accounts[0].Address // setup a proposal govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() @@ -195,7 +197,7 @@ func TestSimulateMsgVote(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetParams(ctx).MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, "", submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, proposer, 1, "", submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -230,6 +232,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) accounts := getTestingAccounts(t, r, app, ctx, 3) + proposer := accounts[0].Address // setup a proposal govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() @@ -238,7 +241,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetParams(ctx).MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, "", submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, proposer, 1, "", submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) diff --git a/x/gov/testutil/expected_keepers.go b/x/gov/testutil/expected_keepers.go index 669dbc010b2..0cb1d6558d5 100644 --- a/x/gov/testutil/expected_keepers.go +++ b/x/gov/testutil/expected_keepers.go @@ -33,3 +33,7 @@ type StakingKeeper interface { BondDenom(ctx sdk.Context) string TokensFromConsensusPower(ctx sdk.Context, power int64) math.Int } + +type DistributionKeeper interface { + types.DistributionKeeper +} diff --git a/x/gov/testutil/expected_keepers_mocks.go b/x/gov/testutil/expected_keepers_mocks.go index 9fc3d2769f2..22c09205486 100644 --- a/x/gov/testutil/expected_keepers_mocks.go +++ b/x/gov/testutil/expected_keepers_mocks.go @@ -1001,3 +1001,40 @@ func (mr *MockStakingKeeperMockRecorder) TotalBondedTokens(arg0 interface{}) *go mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TotalBondedTokens", reflect.TypeOf((*MockStakingKeeper)(nil).TotalBondedTokens), arg0) } + +// MockDistributionKeeper is a mock of DistributionKeeper interface. +type MockDistributionKeeper struct { + ctrl *gomock.Controller + recorder *MockDistributionKeeperMockRecorder +} + +// MockDistributionKeeperMockRecorder is the mock recorder for MockDistributionKeeper. +type MockDistributionKeeperMockRecorder struct { + mock *MockDistributionKeeper +} + +// NewMockDistributionKeeper creates a new mock instance. +func NewMockDistributionKeeper(ctrl *gomock.Controller) *MockDistributionKeeper { + mock := &MockDistributionKeeper{ctrl: ctrl} + mock.recorder = &MockDistributionKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDistributionKeeper) EXPECT() *MockDistributionKeeperMockRecorder { + return m.recorder +} + +// FundCommunityPool mocks base method. +func (m *MockDistributionKeeper) FundCommunityPool(ctx types.Context, amount types.Coins, sender types.AccAddress) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FundCommunityPool", ctx, amount, sender) + ret0, _ := ret[0].(error) + return ret0 +} + +// FundCommunityPool indicates an expected call of FundCommunityPool. +func (mr *MockDistributionKeeperMockRecorder) FundCommunityPool(ctx, amount, sender interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FundCommunityPool", reflect.TypeOf((*MockDistributionKeeper)(nil).FundCommunityPool), ctx, amount, sender) +} From 6b60745b811dd0db27709eb4b5cbc204deee5f41 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 26 Aug 2022 11:14:48 +0530 Subject: [PATCH 06/69] test: fix++ --- .../integration/gov/keeper/grpc_query_test.go | 4 +-- tests/integration/gov/keeper/tally_test.go | 32 +++++++++---------- x/gov/types/v1/proposals_test.go | 5 +-- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/tests/integration/gov/keeper/grpc_query_test.go b/tests/integration/gov/keeper/grpc_query_test.go index 0fd64e2a0ce..1f44a66a3f2 100644 --- a/tests/integration/gov/keeper/grpc_query_test.go +++ b/tests/integration/gov/keeper/grpc_query_test.go @@ -50,7 +50,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { "create a proposal and get tally", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "") + proposal, err = app.GovKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -161,7 +161,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTally() { "create a proposal and get tally", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "") + proposal, err = app.GovKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") suite.Require().NoError(err) suite.Require().NotNil(proposal) diff --git a/tests/integration/gov/keeper/tally_test.go b/tests/integration/gov/keeper/tally_test.go index adb0d5a4160..eb9f8232d47 100644 --- a/tests/integration/gov/keeper/tally_test.go +++ b/tests/integration/gov/keeper/tally_test.go @@ -17,10 +17,10 @@ func TestTallyNoOneVotes(t *testing.T) { app := simapp.Setup(t, false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - createValidators(t, ctx, app, []int64{5, 5, 5}) + addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -44,7 +44,7 @@ func TestTallyNoQuorum(t *testing.T) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -67,7 +67,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -93,7 +93,7 @@ func TestTallyOnlyValidators51No(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -117,7 +117,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -142,7 +142,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -168,7 +168,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -194,7 +194,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -221,7 +221,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { valAccAddr1, valAccAddr2 := valAccAddrs[0], valAccAddrs[1] tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -255,7 +255,7 @@ func TestTallyDelgatorOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -291,7 +291,7 @@ func TestTallyDelgatorInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -330,7 +330,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -372,7 +372,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -415,7 +415,7 @@ func TestTallyJailedValidator(t *testing.T) { app.StakingKeeper.Jail(ctx, sdk.ConsAddress(consAddr.Bytes())) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -448,7 +448,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { require.NoError(t, err) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod diff --git a/x/gov/types/v1/proposals_test.go b/x/gov/types/v1/proposals_test.go index 1f808bdefba..191a71dad02 100644 --- a/x/gov/types/v1/proposals_test.go +++ b/x/gov/types/v1/proposals_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -36,8 +36,9 @@ func TestNestedAnys(t *testing.T) { t.Skip() testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, "cosmos1govacct") + proposerAddr := sdk.AccAddress("proposer") require.NoError(t, err) - proposal, err := v1.NewProposal([]sdk.Msg{msgContent}, 1, "", time.Now(), time.Now()) + proposal, err := v1.NewProposal([]sdk.Msg{msgContent}, proposerAddr, 1, "", time.Now(), time.Now()) require.NoError(t, err) require.Equal(t, "TODO Fix panic here", proposal.String()) From 7b587eeb26e67c310000eb6b10540b1cd62233a2 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 1 Sep 2022 13:04:50 +0530 Subject: [PATCH 07/69] test: add test for cli tx cancel proposal --- x/gov/client/testutil/tx.go | 84 +++++++++++++++++++++++++++++++- x/gov/keeper/proposal.go | 2 +- x/gov/keeper/proposal_test.go | 46 +++++++++++++++++ x/gov/migrations/v3/json_test.go | 1 + 4 files changed, 131 insertions(+), 2 deletions(-) diff --git a/x/gov/client/testutil/tx.go b/x/gov/client/testutil/tx.go index 66959895ce4..c2aee15e767 100644 --- a/x/gov/client/testutil/tx.go +++ b/x/gov/client/testutil/tx.go @@ -70,6 +70,14 @@ func (s *IntegrationTestSuite) SetupSuite() { _, err = s.network.WaitForHeight(1) s.Require().NoError(err) + // create a proposal4 with deposit for check the cancel proposal cli tx + _, err = MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), + "Text Proposal 4", "Where is the title!?", v1beta1.ProposalTypeText, + fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens).String())) + s.Require().NoError(err) + _, err = s.network.WaitForHeight(1) + s.Require().NoError(err) + // vote for proposal3 as val _, err = MsgVote(val.ClientCtx, val.Address.String(), "3", "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05") s.Require().NoError(err) @@ -255,6 +263,80 @@ func (s *IntegrationTestSuite) TestNewCmdSubmitLegacyProposal() { } } +func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { + val := s.network.Validators[0] + + testCases := []struct { + name string + args []string + expectErr bool + expectedCode uint32 + }{ + { + "without proposal id", + []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + true, 0, + }, + { + "invalid proposal id", + []string{ + "asdasd", + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + true, 0, + }, + { + "valid proposer", + []string{ + "4", + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + false, 0, + }, + { + "proposal not exists after cancel", + []string{ + "4", + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + false, 17, + }, + } + + for _, tc := range testCases { + var resp sdk.TxResponse + + s.Run(tc.name, func() { + cmd := cli.NewCmdCancelProposal() + clientCtx := val.ClientCtx + + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) + s.Require().Equal(tc.expectedCode, resp.Code, out.String()) + } + }) + } +} + func (s *IntegrationTestSuite) TestNewCmdDeposit() { val := s.network.Validators[0] @@ -299,7 +381,7 @@ func (s *IntegrationTestSuite) TestNewCmdDeposit() { false, 2, }, { - "deposit on non existing proposal", + "deposit on existing proposal", []string{ "1", sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)).String(), // 10stake diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 8fcc0ab337e..ff74a40680e 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -99,7 +99,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, proposer sdk.AccAddress, me func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer string) error { proposal, ok := keeper.GetProposal(ctx, proposalID) if !ok { - return sdkerrors.Wrapf(types.ErrProposalNotFound, "proposal is not found with % id", proposalID) + return sdkerrors.Wrapf(types.ErrProposalNotFound, "proposal is not found with %d id", proposalID) } // Check creator of the proposal diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index edabc97516c..0a1774685ab 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -143,6 +143,52 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { } } +func (suite *KeeperTestSuite) TestCancelProposal() { + govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress().String() + tp := v1beta1.TextProposal{Title: "title", Description: "description"} + prop, err := v1.NewLegacyContent(&tp, govAcct) + suite.Require().NoError(err) + proposalResp, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[0], []sdk.Msg{prop}, "") + proposalID := proposalResp.Id + + testCases := []struct { + name string + proposalID uint64 + proposer string + expectedErr bool + }{ + { + name: "invalid proposal id", + proposalID: 1, + proposer: string(suite.addrs[0]), + expectedErr: true, + }, + { + name: "valid proposalID but invalid proposer", + proposalID: proposalID, + proposer: suite.addrs[1].String(), + expectedErr: true, + }, + { + name: "valid proposer and proposal id", + proposalID: proposalID, + proposer: suite.addrs[0].String(), + expectedErr: false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err = suite.govKeeper.CancelProposal(suite.ctx, tc.proposalID, tc.proposer) + if tc.expectedErr { + suite.Require().Error(err) + } else { + suite.Require().NoError(err) + } + }) + } +} + func TestMigrateProposalMessages(t *testing.T) { content := v1beta1.NewTextProposal("Test", "description") contentMsg, err := v1.NewLegacyContent(content, sdk.AccAddress("test1").String()) diff --git a/x/gov/migrations/v3/json_test.go b/x/gov/migrations/v3/json_test.go index 7cc1ccd93dc..e26c2820c24 100644 --- a/x/gov/migrations/v3/json_test.go +++ b/x/gov/migrations/v3/json_test.go @@ -107,6 +107,7 @@ func TestMigrateJSON(t *testing.T) { } ], "metadata": "", + "proposer": "", "status": "PROPOSAL_STATUS_DEPOSIT_PERIOD", "submit_time": "2001-09-09T01:46:40Z", "total_deposit": [ From 3f1885637e711332fa131447e8c37d0080343114 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 1 Sep 2022 14:54:59 +0530 Subject: [PATCH 08/69] chore: update the changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2748296fb4..06ee15c4778 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (client) [#12936](https://github.com/cosmos/cosmos-sdk/pull/12936) Add capability to preprocess transactions before broadcasting from a higher level chain. * (x/authz) [#13047](https://github.com/cosmos/cosmos-sdk/pull/13047) Add a GetAuthorization function to the keeper. * (cli) [#12742](https://github.com/cosmos/cosmos-sdk/pull/12742) Add the `prune` CLI cmd to manually prune app store history versions based on the pruning options. +* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Add the `cancel-proposal` feature to proposers. Now proposers can cancel the proposal before voting period finished. ### Improvements @@ -90,6 +91,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/bank) [#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Move the SendEnabled information out of the Params and into the state store directly. * (x/gov) [#12771](https://github.com/cosmos/cosmos-sdk/pull/12771) Initial deposit requirement for proposals at submission time. * (x/staking) [#12967](https://github.com/cosmos/cosmos-sdk/pull/12967) `unbond` now creates only one unbonding delegation entry when multiple unbondings exist at a single height (e.g. through multiple messages in a transaction). +* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) `submit-proposal` gov cli tx will add `proposer` field to proposal. ### API Breaking Changes From d5974bb45f507610d21db880bee33a6338b18542 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 1 Sep 2022 15:25:30 +0530 Subject: [PATCH 09/69] chore: fix the small issues --- api/cosmos/gov/v1/tx.pulsar.go | 108 +++++++++++++------------- proto/cosmos/gov/v1/tx.proto | 2 +- simapp/app_legacy.go | 2 +- tests/integration/gov/genesis_test.go | 5 +- x/gov/abci.go | 7 +- x/gov/keeper/msg_server.go | 1 - x/gov/types/v1/msgs.go | 2 +- x/gov/types/v1/tx.pb.go | 108 +++++++++++++------------- 8 files changed, 118 insertions(+), 117 deletions(-) diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 3593cccea68..850973ad578 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7333,66 +7333,66 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 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, 0x8b, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, + 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, 0x0e, - 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x22, 0x1b, - 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, 0x32, 0xe1, 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, 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, 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, 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, + 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, 0x1b, 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, 0x32, 0xe1, 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, 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, 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, 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 ( diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 090a8de5522..839b6c3e5e9 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -135,7 +135,7 @@ message MsgUpdateParamsResponse {} // // Since: cosmos-sdk 0.47 message MsgCancelProposal{ - option (cosmos.msg.v1.signer) = "depositor"; + option (cosmos.msg.v1.signer) = "proposer"; uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/simapp/app_legacy.go b/simapp/app_legacy.go index e4fed7bca94..a15b06d7ba6 100644 --- a/simapp/app_legacy.go +++ b/simapp/app_legacy.go @@ -328,7 +328,7 @@ func NewSimApp( */ govKeeper := govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - app.StakingKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + app.StakingKeeper,app.DistrKeeper app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.GovKeeper = *govKeeper.SetHooks( diff --git a/tests/integration/gov/genesis_test.go b/tests/integration/gov/genesis_test.go index ef8ecf93f42..80b6fe16c1a 100644 --- a/tests/integration/gov/genesis_test.go +++ b/tests/integration/gov/genesis_test.go @@ -67,16 +67,17 @@ func TestImportExportQueues(t *testing.T) { ctx := s1.app.BaseApp.NewContext(false, tmproto.Header{}) addrs := simtestutil.AddTestAddrs(s1.BankKeeper, s1.StakingKeeper, ctx, 1, valTokens) + proposer := addrs[0] header := tmproto.Header{Height: s1.app.LastBlockHeight() + 1} s1.app.BeginBlock(abci.RequestBeginBlock{Header: header}) ctx = s1.app.BaseApp.NewContext(false, tmproto.Header{}) // Create two proposals, put the second into the voting period - proposal1, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") + proposal1, err := s1.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalID1 := proposal1.Id - proposal2, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") + proposal2, err := s1.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalID2 := proposal2.Id diff --git a/x/gov/abci.go b/x/gov/abci.go index 86ce61264e8..e29f193623f 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -18,12 +18,13 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { logger := keeper.Logger(ctx) // delete the canceled proposals from store and returns theirs deposits. - // move the initial deposit of proposer to community pool and refund remaining deposits. + // move the min deposit of proposal to community pool and refund remaining deposits. keeper.IterateCanceledProposalQueue(ctx, func(proposal v1.Proposal) (stop bool) { keeper.DeleteProposal(ctx, proposal.Id) + // send min deposit to community pool from proposer deposits keeper.SendMinDepositsOfProposalToCommunityPool(ctx, proposal.Id, proposal.Proposer) - // send min deposit to community pool - keeper.RefundAndDeleteDeposits(ctx, proposal.Id) // refund deposit if proposal got removed without getting 100% of the proposal + // refund deposits of proposal to depositors + keeper.RefundAndDeleteDeposits(ctx, proposal.Id) return false }) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 61f0e4dd04e..435b140b7c8 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -91,7 +91,6 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos }, nil } -// CancelProposal implements v1.MsgServer func (k msgServer) CancelProposal(goCtx context.Context, msg *v1.MsgCancelProposal) (*v1.MsgCancelProposalResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) _, err := sdk.AccAddressFromBech32(msg.Proposer) diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 29225c490c8..f73fb2334a5 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -309,7 +309,7 @@ func (msg MsgCancelProposal) Type() string { return sdk.MsgTypeURL(&msg) } // ValidateBasic implements Msg func (msg MsgCancelProposal) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Proposer); err != nil { - return sdkerrors.ErrInvalidAddress.Wrapf("invalid depositor address: %s", err) + return sdkerrors.ErrInvalidAddress.Wrapf("invalid proposer address: %s", err) } return nil diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 0bc245db567..837970c71c4 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -765,60 +765,60 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 843 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x6b, 0xe3, 0x46, - 0x14, 0xb6, 0x62, 0xd7, 0x4e, 0xc6, 0x8d, 0x43, 0x84, 0x9b, 0xc8, 0x6a, 0x50, 0x1c, 0x17, 0x8a, - 0x69, 0x88, 0x14, 0x27, 0xa5, 0x85, 0xa4, 0x14, 0xe2, 0x34, 0xb4, 0x85, 0x9a, 0x06, 0x85, 0xa6, - 0x50, 0x0a, 0x61, 0x6c, 0x4d, 0x27, 0xa2, 0x96, 0x46, 0x68, 0xc6, 0x26, 0x3e, 0xb6, 0xd7, 0x42, - 0xe9, 0x4f, 0xe9, 0x21, 0xf7, 0xde, 0x4a, 0xe8, 0x29, 0xf4, 0x94, 0x53, 0xd8, 0x4d, 0x0e, 0x0b, - 0x7b, 0xda, 0x9f, 0xb0, 0x48, 0x33, 0x92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xae, 0xe7, - 0xcc, 0x8a, 0x88, 0xfb, 0x8a, 0x87, 0xc9, 0x9f, 0x82, 0x79, 0x2f, 0xe4, 0x81, 0x7c, 0x25, 0x5f, - 0x97, 0x9a, 0x0b, 0x6d, 0xe5, 0xff, 0xcb, 0xad, 0xaa, 0xc8, 0x72, 0x60, 0x59, 0x3e, 0xa2, 0xf4, - 0x84, 0xf9, 0xb6, 0x8b, 0xcd, 0x18, 0x29, 0xab, 0x01, 0x63, 0x06, 0x2d, 0xc8, 0xa0, 0x52, 0x08, - 0xa2, 0xcc, 0x78, 0xbd, 0xb7, 0xf8, 0xfb, 0xab, 0xbf, 0x3f, 0x89, 0xa1, 0x8d, 0x2f, 0x40, 0x2d, - 0xa5, 0xd8, 0x44, 0xd4, 0x23, 0x2e, 0x45, 0xf2, 0x3a, 0x28, 0x7b, 0xc2, 0x76, 0x66, 0x5b, 0x8a, - 0x54, 0x97, 0x9a, 0x05, 0x13, 0x44, 0xa6, 0x6f, 0xad, 0xc6, 0x6f, 0x12, 0xa8, 0x76, 0x28, 0x3e, - 0xba, 0x40, 0xbd, 0xef, 0x10, 0x86, 0xbd, 0xd1, 0x21, 0x71, 0x19, 0x72, 0x99, 0xbc, 0x0f, 0x4a, - 0x3d, 0xfe, 0x19, 0x46, 0x3d, 0x70, 0x64, 0xed, 0xf2, 0x7f, 0x97, 0x5b, 0x25, 0x11, 0x63, 0x46, - 0x11, 0xf2, 0x1a, 0x58, 0x80, 0x03, 0x76, 0x4e, 0x7c, 0x9b, 0x8d, 0x94, 0xb9, 0x90, 0xff, 0xd8, - 0xb0, 0x57, 0x09, 0x04, 0x8c, 0xd7, 0x0d, 0x0d, 0xac, 0x65, 0x51, 0x88, 0x44, 0x34, 0xfe, 0x95, - 0x40, 0xa9, 0x43, 0xf1, 0x29, 0x61, 0x48, 0xde, 0xce, 0x10, 0xd4, 0x5e, 0x7a, 0x7d, 0xbb, 0x9e, - 0x34, 0x27, 0x15, 0xca, 0x3a, 0x78, 0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 0xe4, 0x21, 0x1a, 0x3c, 0x87, 0x8a, 0xe1, 0xbf, 0xe3, 0xee, 0xdb, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x68, 0x59, 0xf8, 0xdf, 0x4e, 0x09, 0x00, 0x00, + // 841 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xd1, 0x4f, 0xfb, 0x54, + 0x14, 0x5e, 0xd9, 0xdc, 0x7e, 0xdc, 0xc9, 0x08, 0xcd, 0x84, 0xae, 0x92, 0x32, 0x66, 0x62, 0x16, + 0x09, 0x2d, 0x03, 0xa3, 0x09, 0x18, 0x13, 0x86, 0x44, 0x4d, 0x5c, 0x24, 0x25, 0x62, 0x62, 0x4c, + 0xc8, 0xdd, 0x7a, 0xbd, 0x34, 0xae, 0xbd, 0x4d, 0xef, 0xdd, 0xc2, 0x1e, 0xf5, 0xd1, 0x07, 0xe3, + 0x9f, 0xe2, 0x03, 0xef, 0xbe, 0x19, 0xe2, 0x13, 0xf1, 0x89, 0x27, 0xa2, 0xf0, 0x60, 0xe2, 0x93, + 0x7f, 0x82, 0x69, 0xef, 0x6d, 0xd7, 0xb5, 0x85, 0xc1, 0xcb, 0xef, 0x69, 0xed, 0x39, 0xdf, 0x77, + 0xfa, 0x7d, 0x3d, 0xf7, 0x9c, 0x15, 0xac, 0x0e, 0x08, 0x75, 0x08, 0x35, 0x30, 0x19, 0x1b, 0xe3, + 0x8e, 0xc1, 0x2e, 0x75, 0xcf, 0x27, 0x8c, 0xc8, 0x4b, 0x3c, 0xae, 0x63, 0x32, 0xd6, 0xc7, 0x1d, + 0x55, 0x13, 0xb0, 0x3e, 0xa4, 0xc8, 0x18, 0x77, 0xfa, 0x88, 0xc1, 0x8e, 0x31, 0x20, 0xb6, 0xcb, + 0xe1, 0xea, 0xda, 0x6c, 0x99, 0x80, 0xc5, 0x13, 0x75, 0x4c, 0x30, 0x09, 0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0xbd, 0x99, 0x32, 0x19, 0x69, 0x49, 0x98, 0x8d, + 0x18, 0xcf, 0x76, 0xdb, 0x00, 0x6b, 0x29, 0x67, 0xb1, 0xeb, 0xdf, 0x24, 0x00, 0x7a, 0x14, 0x47, + 0x33, 0xf2, 0x72, 0xc3, 0x1f, 0x80, 0x45, 0x31, 0x97, 0x64, 0xbe, 0xe9, 0x29, 0x54, 0xfe, 0x10, + 0x94, 0xa1, 0x43, 0x46, 0x2e, 0x13, 0xbe, 0xe7, 0x8e, 0xb3, 0x80, 0x8b, 0x33, 0x1b, 0x17, 0x6a, + 0xd5, 0x81, 0x3c, 0x35, 0x10, 0xfb, 0xfa, 0x99, 0x77, 0xf3, 0x2b, 0xcf, 0x82, 0x0c, 0x9d, 0x40, + 0x1f, 0x3a, 0x34, 0x90, 0x3a, 0x9d, 0x05, 0x69, 0x9e, 0xd4, 0x18, 0x2a, 0xef, 0x81, 0xb2, 0x17, + 0x56, 0x08, 0xfd, 0x55, 0x77, 0xdf, 0x4a, 0xb5, 0x88, 0x97, 0x8f, 0x64, 0x72, 0x68, 0x66, 0xb4, + 0x78, 0x0f, 0x92, 0x7a, 0x62, 0xad, 0x3f, 0xf1, 0x55, 0x79, 0x04, 0xdd, 0x01, 0x1a, 0x26, 0x56, + 0xe5, 0x4b, 0x5b, 0x91, 0x5c, 0x70, 0x0b, 0xcf, 0x5d, 0x70, 0xe9, 0x25, 0xf6, 0x76, 0xb8, 0xc4, + 0x66, 0xb5, 0x44, 0x4a, 0x77, 0xff, 0x2e, 0x81, 0x62, 0x8f, 0x62, 0xf9, 0x5b, 0x50, 0x4b, 0x2d, + 0xf6, 0x66, 0xea, 0x9d, 0x64, 0x16, 0xa1, 0xda, 0x9e, 0x87, 0x88, 0x57, 0x25, 0x02, 0x2b, 0xd9, + 0x2d, 0xf8, 0x4e, 0x96, 0x9e, 0x01, 0xa9, 0x5b, 0xcf, 0x00, 0xc5, 0x8f, 0xf9, 0x18, 0x94, 0xc2, + 0x45, 0xb6, 0x9a, 0x25, 0x05, 0x71, 0x55, 0xcb, 0x8f, 0xc7, 0xfc, 0x33, 0xf0, 0xe6, 0xcc, 0xb2, + 0x78, 0x04, 0x1f, 0xe5, 0xd5, 0x77, 0x9f, 0xce, 0xc7, 0x75, 0x3f, 0x05, 0x95, 0x68, 0x1c, 0x1b, + 0x59, 0x8a, 0x48, 0xa9, 0x9b, 0x8f, 0xa6, 0x92, 0x02, 0x67, 0xce, 0x7f, 0x8e, 0xc0, 0x64, 0x3e, + 0x4f, 0x60, 0xde, 0x79, 0x0d, 0xba, 0x9f, 0x3a, 0xab, 0x39, 0xdd, 0x9f, 0x45, 0xe4, 0x75, 0x3f, + 0xff, 0x8c, 0x75, 0x8f, 0xaf, 0xef, 0x35, 0xe9, 0xe6, 0x5e, 0x93, 0xfe, 0xba, 0xd7, 0xa4, 0x5f, + 0x1e, 0xb4, 0xc2, 0xcd, 0x83, 0x56, 0xb8, 0x7d, 0xd0, 0x0a, 0xdf, 0x6c, 0x61, 0x9b, 0x5d, 0x8c, + 0xfa, 0xfa, 0x80, 0x38, 0xe2, 0xfb, 0x44, 0xfc, 0x6c, 0x53, 0xeb, 0x7b, 0xe3, 0x32, 0xfc, 0xd0, + 0x61, 0x13, 0x0f, 0xd1, 0xe0, 0x6b, 0xa8, 0x1c, 0xfe, 0x39, 0xee, 0xfd, 0x1f, 0x00, 0x00, 0xff, + 0xff, 0x31, 0x98, 0xcd, 0x8e, 0x4d, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 02586b91f4568b5a819501bfd6068e7cbe0901c3 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 1 Sep 2022 17:07:08 +0530 Subject: [PATCH 10/69] test: fix the tests and legacy build issue --- simapp/app_legacy.go | 2 +- x/gov/simulation/operations.go | 83 +++++++++++++++++++++++++---- x/gov/simulation/operations_test.go | 67 ++++++++++++++++++++--- 3 files changed, 133 insertions(+), 19 deletions(-) diff --git a/simapp/app_legacy.go b/simapp/app_legacy.go index a15b06d7ba6..f28fa933ea0 100644 --- a/simapp/app_legacy.go +++ b/simapp/app_legacy.go @@ -328,7 +328,7 @@ func NewSimApp( */ govKeeper := govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - app.StakingKeeper,app.DistrKeeper app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + app.StakingKeeper, app.DistrKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.GovKeeper = *govKeeper.SetHooks( diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 4d6b5e6fd27..2fc7b3f8962 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -25,28 +25,32 @@ var ( TypeMsgVote = sdk.MsgTypeURL(&v1.MsgVote{}) TypeMsgVoteWeighted = sdk.MsgTypeURL(&v1.MsgVoteWeighted{}) TypeMsgSubmitProposal = sdk.MsgTypeURL(&v1.MsgSubmitProposal{}) + TypeMsgCancelProposal = sdk.MsgTypeURL(&v1.MsgCancelProposal{}) ) // Simulation operation weights constants // //nolint:gosec // these are not hard-coded credentials. const ( - OpWeightMsgDeposit = "op_weight_msg_deposit" - OpWeightMsgVote = "op_weight_msg_vote" - OpWeightMsgVoteWeighted = "op_weight_msg_weighted_vote" - - DefaultWeightMsgDeposit = 100 - DefaultWeightMsgVote = 67 - DefaultWeightMsgVoteWeighted = 33 - DefaultWeightTextProposal = 5 + OpWeightMsgDeposit = "op_weight_msg_deposit" + OpWeightMsgVote = "op_weight_msg_vote" + OpWeightMsgVoteWeighted = "op_weight_msg_weighted_vote" + OpWeightMsgCancelProposal = "op_weight_msg_cancel_proposal" + + DefaultWeightMsgDeposit = 100 + DefaultWeightMsgVote = 67 + DefaultWeightMsgVoteWeighted = 33 + DefaultWeightTextProposal = 5 + DefaultWeightMsgCancelProposal = 5 ) // WeightedOperations returns all the operations from the module with their respective weights func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, wContents []simtypes.WeightedProposalContent) simulation.WeightedOperations { var ( - weightMsgDeposit int - weightMsgVote int - weightMsgVoteWeighted int + weightMsgDeposit int + weightMsgVote int + weightMsgVoteWeighted int + weightMsgCancelProposal int ) appParams.GetOrGenerate(cdc, OpWeightMsgDeposit, &weightMsgDeposit, nil, @@ -67,6 +71,12 @@ func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, ak ty }, ) + appParams.GetOrGenerate(cdc, OpWeightMsgCancelProposal, &weightMsgCancelProposal, nil, + func(_ *rand.Rand) { + weightMsgCancelProposal = DefaultWeightMsgCancelProposal + }, + ) + // generate the weighted operations for the proposal contents var wProposalOps simulation.WeightedOperations @@ -98,6 +108,10 @@ func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, ak ty weightMsgVoteWeighted, SimulateMsgVoteWeighted(ak, bk, k), ), + simulation.NewWeightedOperation( + weightMsgCancelProposal, + SimulateMsgCancelProposal(ak, bk, k), + ), } return append(wProposalOps, wGovOps...) @@ -379,6 +393,46 @@ func operationSimulateMsgVoteWeighted(ak types.AccountKeeper, bk types.BankKeepe } } +// SimulateMsgCancelProposal generates a MsgCancelProposal. +func SimulateMsgCancelProposal(ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, + accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount := accs[0] + proposal := randomProposal(r, k, ctx) + if proposal.SubmitTime == nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgCancelProposal, "no proposals found"), nil, nil + } + + if proposal.Proposer != simAccount.Address.String() { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgCancelProposal, "invalid proposer"), nil, nil + } + + account := ak.GetAccount(ctx, simAccount.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + msg := v1.NewMsgCancelProposal(account.GetAddress(), proposal.Id) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: moduletestutil.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + // Pick a random deposit with a random denomination with a // deposit amount between (0, min(balance, minDepositAmount)) // This is to simulate multiple users depositing to get the @@ -434,6 +488,13 @@ func randomDeposit( return sdk.Coins{sdk.NewCoin(denom, amount)}, false, nil } +// randomProposal +func randomProposal(r *rand.Rand, k *keeper.Keeper, ctx sdk.Context) v1.Proposal { + proposals := k.GetProposals(ctx) + randomIndex := r.Intn(len(proposals)) + return *proposals[randomIndex] +} + // Pick a random proposal ID between the initial proposal ID // (defined in gov GenesisState) and the latest proposal ID // that matches a given Status. diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 1974486422a..88e4bf42b76 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -22,6 +22,8 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/testutil" + _ "github.com/cosmos/cosmos-sdk/x/distribution" + dk "github.com/cosmos/cosmos-sdk/x/distribution/keeper" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -93,6 +95,7 @@ func TestWeightedOperations(t *testing.T) { {simulation.DefaultWeightMsgDeposit, types.ModuleName, simulation.TypeMsgDeposit}, {simulation.DefaultWeightMsgVote, types.ModuleName, simulation.TypeMsgVote}, {simulation.DefaultWeightMsgVoteWeighted, types.ModuleName, simulation.TypeMsgVoteWeighted}, + {simulation.DefaultWeightMsgCancelProposal, types.ModuleName, simulation.TypeMsgCancelProposal}, } for i, w := range weightesOps { @@ -141,6 +144,51 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { require.Equal(t, simulation.TypeMsgSubmitProposal, msg.Type()) } +// TestSimulateMsgCancelProposal tests the normal scenario of a valid message of type TypeMsgCancelProposal. +// Abnormal scenarios, where errors occur, are not tested here. +func TestSimulateMsgCancelProposal(t *testing.T) { + suite, ctx := createTestSuite(t, false) + app := suite.App + blockTime := time.Now().UTC() + ctx = ctx.WithBlockTime(blockTime) + + // setup 3 accounts + s := rand.NewSource(1) + r := rand.New(s) + accounts := getTestingAccounts(t, r, suite.AccountKeeper, suite.BankKeeper, suite.StakingKeeper, ctx, 3) + // setup a proposal + proposer := accounts[0].Address + content := v1beta1.NewTextProposal("Test", "description") + contentMsg, err := v1.NewLegacyContent(content, suite.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String()) + require.NoError(t, err) + + submitTime := ctx.BlockHeader().Time + depositPeriod := suite.GovKeeper.GetParams(ctx).MaxDepositPeriod + + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, proposer, 1, "", submitTime, submitTime.Add(*depositPeriod)) + require.NoError(t, err) + + suite.GovKeeper.SetProposal(ctx, proposal) + + // begin a new block + app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) + + // execute operation + op := simulation.SimulateMsgCancelProposal(suite.AccountKeeper, suite.BankKeeper, suite.GovKeeper) + operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") + require.NoError(t, err) + + var msg v1.MsgCancelProposal + err = v1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + require.NoError(t, err) + + require.True(t, operationMsg.OK) + require.Equal(t, uint64(1), msg.ProposalId) + require.Equal(t, proposer.String(), msg.Proposer) + require.Equal(t, "gov", msg.Route()) + require.Equal(t, simulation.TypeMsgCancelProposal, msg.Type()) +} + // TestSimulateMsgDeposit tests the normal scenario of a valid message of type TypeMsgDeposit. // Abnormal scenarios, where errors occur, are not tested here. func TestSimulateMsgDeposit(t *testing.T) { @@ -155,6 +203,7 @@ func TestSimulateMsgDeposit(t *testing.T) { accounts := getTestingAccounts(t, r, suite.AccountKeeper, suite.BankKeeper, suite.StakingKeeper, ctx, 3) // setup a proposal + proposer := accounts[0].Address content := v1beta1.NewTextProposal("Test", "description") contentMsg, err := v1.NewLegacyContent(content, suite.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String()) require.NoError(t, err) @@ -202,6 +251,7 @@ func TestSimulateMsgVote(t *testing.T) { accounts := getTestingAccounts(t, r, suite.AccountKeeper, suite.BankKeeper, suite.StakingKeeper, ctx, 3) // setup a proposal + proposer := accounts[0].Address govAcc := suite.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() contentMsg, err := v1.NewLegacyContent(v1beta1.NewTextProposal("Test", "description"), govAcc) require.NoError(t, err) @@ -247,6 +297,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { accounts := getTestingAccounts(t, r, suite.AccountKeeper, suite.BankKeeper, suite.StakingKeeper, ctx, 3) // setup a proposal + proposer := accounts[0].Address govAcc := suite.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() contentMsg, err := v1.NewLegacyContent(v1beta1.NewTextProposal("Test", "description"), govAcc) require.NoError(t, err) @@ -278,12 +329,13 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { } type suite struct { - cdc codec.Codec - AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper - GovKeeper *keeper.Keeper - StakingKeeper *stakingkeeper.Keeper - App *runtime.App + cdc codec.Codec + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + GovKeeper *keeper.Keeper + StakingKeeper *stakingkeeper.Keeper + DistributionKeeper dk.Keeper + App *runtime.App } // returns context and an app with updated mint keeper @@ -296,8 +348,9 @@ func createTestSuite(t *testing.T, isCheckTx bool) (suite, sdk.Context) { configurator.ParamsModule(), configurator.BankModule(), configurator.StakingModule(), + configurator.DistributionModule(), configurator.GovModule(), - ), &res.AccountKeeper, &res.BankKeeper, &res.GovKeeper, &res.StakingKeeper, &res.cdc) + ), &res.AccountKeeper, &res.BankKeeper, &res.GovKeeper, &res.StakingKeeper, &res.DistributionKeeper, &res.cdc) require.NoError(t, err) ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) From b1f0712aef3914104ebfaecb53ff6bfeb9e438cc Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 1 Sep 2022 17:33:30 +0530 Subject: [PATCH 11/69] fix: fix++ --- x/gov/abci_test.go | 89 +++++++++++++++++++++++++++++++++- x/gov/client/testutil/grpc.go | 2 +- x/gov/client/testutil/query.go | 2 +- x/gov/common_test.go | 16 +++--- 4 files changed, 99 insertions(+), 10 deletions(-) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index cc8824709df..ec065fd3137 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -300,7 +300,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)}, "") + proposal, err := suite.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10))} @@ -331,6 +331,91 @@ func TestProposalPassedEndblocker(t *testing.T) { require.True(t, suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()).IsEqual(initialModuleAccCoins)) } +func TestProposalCanceledEndblocker(t *testing.T) { + suite := createTestSuite(t) + app := suite.App + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) + + SortAddresses(addrs) + + govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) + stakingMsgSvr := stakingkeeper.NewMsgServerImpl(suite.StakingKeeper) + + header := tmproto.Header{Height: app.LastBlockHeight() + 1} + app.BeginBlock(abci.RequestBeginBlock{Header: header}) + + valAddr := sdk.ValAddress(addrs[0]) + proposer := addrs[0] + depositer := addrs[1] + + createValidators(t, stakingMsgSvr, ctx, []sdk.ValAddress{valAddr}, []int64{10}) + staking.EndBlocker(ctx, suite.StakingKeeper) + + macc := suite.GovKeeper.GetGovernanceAccount(ctx) + require.NotNil(t, macc) + initialModuleAccCoins := suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) + intitalProposerBalance := suite.BankKeeper.GetAllBalances(ctx, proposer) + depositerBalance := suite.BankKeeper.GetAllBalances(ctx, depositer) + + proposal, err := suite.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") + require.NoError(t, err) + + proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10))} + newDepositMsg := v1.NewMsgDeposit(addrs[0], proposal.Id, proposalCoins) + + res, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) + require.NoError(t, err) + require.NotNil(t, res) + + newDepositMsg = v1.NewMsgDeposit(addrs[1], proposal.Id, proposalCoins) + res, err = govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) + require.NoError(t, err) + require.NotNil(t, res) + + // check the balances of depositer and proposer + require.True(t, suite.BankKeeper.GetAllBalances(ctx, depositer).IsEqual(depositerBalance.Sub(proposalCoins...))) + require.True(t, suite.BankKeeper.GetAllBalances(ctx, proposer).IsEqual(intitalProposerBalance.Sub(proposalCoins...))) + + canceledProposalQueue := suite.GovKeeper.CanceledProposalQueueIterator(ctx) + require.False(t, canceledProposalQueue.Valid()) + canceledProposalQueue.Close() + + macc = suite.GovKeeper.GetGovernanceAccount(ctx) + require.NotNil(t, macc) + moduleAccCoins := suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) + + deposits := initialModuleAccCoins.Add(proposal.TotalDeposit...).Add(proposalCoins...).Add(proposalCoins...) + require.True(t, moduleAccCoins.IsEqual(deposits)) + + err = suite.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1.NewNonSplitVoteOption(v1.OptionYes), "") + require.NoError(t, err) + + minDepositsForProposal, err := suite.GovKeeper.GetMinDepositsForProposal(ctx) + minDepositsForProposalInDec := sdk.NewDecCoinsFromCoins(minDepositsForProposal...) + require.NoError(t, err) + + // get the community pool funds + beforeCommunityFund := suite.DistributionKeeper.GetFeePoolCommunityCoins(ctx) + // cancel the gov proposal + err = suite.GovKeeper.CancelProposal(ctx, proposal.Id, addrs[0].String()) + require.NoError(t, err) + + canceledProposalQueue = suite.GovKeeper.CanceledProposalQueueIterator(ctx) + require.True(t, canceledProposalQueue.Valid()) + canceledProposalQueue.Close() + + gov.EndBlocker(ctx, suite.GovKeeper) + afterCommunityFund := suite.DistributionKeeper.GetFeePoolCommunityCoins(ctx) + + macc = suite.GovKeeper.GetGovernanceAccount(ctx) + require.NotNil(t, macc) + require.Equal(t, beforeCommunityFund.Add(minDepositsForProposalInDec...), afterCommunityFund) + require.True(t, suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()).IsEqual(initialModuleAccCoins)) + require.True(t, suite.BankKeeper.GetAllBalances(ctx, proposer).IsEqual(intitalProposerBalance.Sub(minDepositsForProposal...))) + require.True(t, suite.BankKeeper.GetAllBalances(ctx, depositer).IsEqual(depositerBalance)) +} + func TestEndBlockerProposalHandlerFailed(t *testing.T) { suite := createTestSuite(t) app := suite.App @@ -352,7 +437,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { // Create a proposal where the handler will pass for the test proposal // because the value of contextKeyBadProposal is true. ctx = ctx.WithValue(contextKeyBadProposal, true) - proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "") + proposal, err := suite.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10))) diff --git a/x/gov/client/testutil/grpc.go b/x/gov/client/testutil/grpc.go index aef5abd0221..71f1bbad09f 100644 --- a/x/gov/client/testutil/grpc.go +++ b/x/gov/client/testutil/grpc.go @@ -78,7 +78,7 @@ func (s *IntegrationTestSuite) TestGetProposalsGRPC() { "valid request", fmt.Sprintf("%s/cosmos/gov/v1/proposals", val.APIAddress), map[string]string{}, - 3, + 4, false, }, { diff --git a/x/gov/client/testutil/query.go b/x/gov/client/testutil/query.go index 3cf65d03aca..a9f8888f925 100644 --- a/x/gov/client/testutil/query.go +++ b/x/gov/client/testutil/query.go @@ -307,7 +307,7 @@ func (s *IntegrationTestSuite) TestCmdGetProposals() { var proposals v1.QueryProposalsResponse s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposals), out.String()) - s.Require().Len(proposals.Proposals, 3) + s.Require().Len(proposals.Proposals, 4) } }) } diff --git a/x/gov/common_test.go b/x/gov/common_test.go index 2c9212eaaa6..c83be54e35a 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -18,6 +18,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" _ "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + _ "github.com/cosmos/cosmos-sdk/x/distribution" + dk "github.com/cosmos/cosmos-sdk/x/distribution/keeper" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -99,11 +101,12 @@ var pubkeys = []cryptotypes.PubKey{ } type suite struct { - AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper - GovKeeper *keeper.Keeper - StakingKeeper *stakingkeeper.Keeper - App *runtime.App + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + GovKeeper *keeper.Keeper + StakingKeeper *stakingkeeper.Keeper + DistributionKeeper dk.Keeper + App *runtime.App } func createTestSuite(t *testing.T) suite { @@ -116,9 +119,10 @@ func createTestSuite(t *testing.T) suite { configurator.StakingModule(), configurator.BankModule(), configurator.GovModule(), + configurator.DistributionModule(), ), simtestutil.DefaultStartUpConfig(), - &res.AccountKeeper, &res.BankKeeper, &res.GovKeeper, &res.StakingKeeper, + &res.AccountKeeper, &res.BankKeeper, &res.GovKeeper, &res.DistributionKeeper, &res.StakingKeeper, ) require.NoError(t, err) From b829a1f0be179f5d05a953f3a4f1e04615d70215 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 1 Sep 2022 18:16:52 +0530 Subject: [PATCH 12/69] fix: fix the tests --- tests/e2e/client/grpc/tmservice/service_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/client/grpc/tmservice/service_test.go b/tests/e2e/client/grpc/tmservice/service_test.go index 5ab389ae311..e1ecfcf1c29 100644 --- a/tests/e2e/client/grpc/tmservice/service_test.go +++ b/tests/e2e/client/grpc/tmservice/service_test.go @@ -19,6 +19,7 @@ import ( "github.com/cosmos/cosmos-sdk/types" qtypes "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/version" + _ "github.com/cosmos/cosmos-sdk/x/distribution" _ "github.com/cosmos/cosmos-sdk/x/gov" ) @@ -44,6 +45,7 @@ func (s *IntegrationTestSuite) SetupSuite() { configurator.GenutilModule(), configurator.StakingModule(), configurator.GovModule(), + configurator.DistributionModule(), configurator.TxModule()) cfg, err := network.DefaultConfigWithAppConfig(appConfig) From 0e7552dbfd18a12bd70a7106e3861f4945c12a5f Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 2 Sep 2022 11:16:21 +0530 Subject: [PATCH 13/69] chore: address the pr comments --- CHANGELOG.md | 4 ++-- api/cosmos/gov/v1/gov.pulsar.go | 2 +- proto/cosmos/gov/v1/gov.proto | 2 +- x/gov/abci.go | 8 ++++---- x/gov/client/cli/tx.go | 12 +++++------- x/gov/keeper/deposit.go | 8 ++++---- x/gov/types/errors.go | 1 + x/gov/types/v1/gov.pb.go | 2 +- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1aa22eae54..ae13e3d8936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,7 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (client) [#12936](https://github.com/cosmos/cosmos-sdk/pull/12936) Add capability to preprocess transactions before broadcasting from a higher level chain. * (x/authz) [#13047](https://github.com/cosmos/cosmos-sdk/pull/13047) Add a GetAuthorization function to the keeper. * (cli) [#12742](https://github.com/cosmos/cosmos-sdk/pull/12742) Add the `prune` CLI cmd to manually prune app store history versions based on the pruning options. -* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Add the `cancel-proposal` feature to proposers. Now proposers can cancel the proposal before voting period finished. +* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Add `cancel-proposal` feature to proposals. Now proposers can cancel the proposal prior to the voting-period-end-time. ### Improvements @@ -91,7 +91,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/bank) [#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Move the SendEnabled information out of the Params and into the state store directly. * (x/gov) [#12771](https://github.com/cosmos/cosmos-sdk/pull/12771) Initial deposit requirement for proposals at submission time. * (x/staking) [#12967](https://github.com/cosmos/cosmos-sdk/pull/12967) `unbond` now creates only one unbonding delegation entry when multiple unbondings exist at a single height (e.g. through multiple messages in a transaction). -* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) `submit-proposal` gov cli tx will add `proposer` field to proposal. +* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) `submit-proposal` gov cli tx adds `proposer` field to proposal. ### API Breaking Changes diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 18a07b1b0d2..ccf4d2b032e 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -6357,7 +6357,7 @@ type Proposal struct { VotingEndTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` - // proposer defines an address of creater of the proposal. + // proposer defines the address of the proposal's proposer. Proposer string `protobuf:"bytes,11,opt,name=proposer,proto3" json:"proposer,omitempty"` } diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 93849ae3b30..d127d7ab24e 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -57,7 +57,7 @@ message Proposal { // metadata is any arbitrary metadata attached to the proposal. string metadata = 10; - // proposer defines an address of creater of the proposal. + // proposer defines the address of the proposal's proposer. string proposer = 11 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/x/gov/abci.go b/x/gov/abci.go index 57ffca4946b..d45c92e8c3f 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -17,12 +17,12 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { logger := keeper.Logger(ctx) - // delete the canceled proposals from store and returns theirs deposits. - // move the min deposit of proposal to community pool and refund remaining deposits. + // delete the canceled proposals from store. + // move the min initial deposit of the proposal to community-pool and refund remaining deposits. keeper.IterateCanceledProposalQueue(ctx, func(proposal v1.Proposal) (stop bool) { keeper.DeleteProposal(ctx, proposal.Id) - // send min deposit to community pool from proposer deposits - keeper.SendMinDepositsOfProposalToCommunityPool(ctx, proposal.Id, proposal.Proposer) + // send min proposal deposit amount to the community-pool from proposer deposit. + keeper.SendProposalMinDepositToCommunityPool(ctx, proposal.Id, proposal.Proposer) // refund deposits of proposal to depositors keeper.RefundAndDeleteDeposits(ctx, proposal.Id) return false diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index 845e1a9d4e9..084e27e29e5 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -139,12 +139,10 @@ Where proposal.json contains: // NewCmdCancelProposal implements submitting a cancel proposal transaction command. func NewCmdCancelProposal() *cobra.Command { cmd := &cobra.Command{ - Use: "cancel-proposal [proposal-id]", - Short: "Cancel governance proposal by proposal before the voting period ends.", - Args: cobra.ExactArgs(1), - Example: fmt.Sprintf(` - $ %s tx gov cancel-proposal 1 --from mykey - `, version.AppName), + Use: "cancel-proposal [proposal-id]", + Short: "Cancel governance proposal by proposal before the voting period ends.", + Args: cobra.ExactArgs(1), + Example: fmt.Sprintf(`$ %s tx gov cancel-proposal 1 --from mykey`, version.AppName), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -157,7 +155,7 @@ func NewCmdCancelProposal() *cobra.Command { return fmt.Errorf("proposal-id %s not a valid uint, please input a valid proposal-id", args[0]) } - // Get depositor address + // Get proposer address from := clientCtx.GetFromAddress() msg := v1.NewMsgCancelProposal(from, proposalID) diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 61f1ee16aa5..988d9f57be0 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -162,14 +162,14 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd return activatedVotingPeriod, nil } -// SendMinDepositsOfProposalToCommunityPool will sends the min deposits of proposal to community pool +// SendProposalMinDepositToCommunityPool will sends the min deposits of proposal to community pool // from proposer deposits and updated the deposit store with updated deposit amount. -func (keeper Keeper) SendMinDepositsOfProposalToCommunityPool(ctx sdk.Context, proposalID uint64, proAddr string) error { +func (keeper Keeper) SendProposalMinDepositToCommunityPool(ctx sdk.Context, proposalID uint64, proAddr string) error { proposerAddr := sdk.MustAccAddressFromBech32(proAddr) deposit, found := keeper.GetDeposit(ctx, proposalID, proposerAddr) if !found { - return nil + return sdkerrors.Wrapf(types.ErrNoDeposits, "proposer %s doesn't deposited to proposal %d", proAddr, proposalID) } minDepositeAmount, err := keeper.GetMinDepositsForProposal(ctx) @@ -189,7 +189,7 @@ func (keeper Keeper) SendMinDepositsOfProposalToCommunityPool(ctx sdk.Context, p return nil } -// GetMinDepositsForProposal will returns minimum deposit amount required for creating the proposal. +// GetMinDepositsForProposal returns minimum deposit amount required for creating the proposal. func (keeper Keeper) GetMinDepositsForProposal(ctx sdk.Context) ([]sdk.Coin, error) { params := keeper.GetParams(ctx) diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 3c79ba2f45d..14a132ec6e5 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -24,4 +24,5 @@ var ( ErrMinDepositTooSmall = sdkerrors.Register(ModuleName, 16, "minimum deposit is too small") ErrProposalNotFound = sdkerrors.Register(ModuleName, 17, "proposal is not found") ErrInvalidProposer = sdkerrors.Register(ModuleName, 18, "invalid proposer") + ErrNoDeposits = sdkerrors.Register(ModuleName, 19, "no deposits found") ) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 4696800df02..c62092b8cf8 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -256,7 +256,7 @@ type Proposal struct { VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` - // proposer defines an address of creater of the proposal. + // proposer defines the address of the proposal's proposer. Proposer string `protobuf:"bytes,11,opt,name=proposer,proto3" json:"proposer,omitempty"` } From 77a353467fe1d0dd86d9aa1e72f27b3237d14315 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 2 Sep 2022 22:13:20 +0530 Subject: [PATCH 14/69] chore: address the comment and done proto pretty --- api/cosmos/gov/v1/tx.pulsar.go | 537 ++++++++++++------ .../distribution/v1beta1/distribution.proto | 47 +- proto/cosmos/distribution/v1beta1/tx.proto | 45 +- proto/cosmos/gov/v1/tx.proto | 23 +- testutil/testdata/testdata.proto | 2 +- tx/textual/internal/testpb/1.proto | 20 +- x/gov/client/cli/tx.go | 4 +- x/gov/keeper/msg_server.go | 7 +- x/gov/keeper/proposal.go | 2 - x/gov/simulation/operations.go | 2 +- x/gov/types/v1/msgs.go | 2 +- x/gov/types/v1/tx.pb.go | 239 ++++++-- 12 files changed, 630 insertions(+), 300 deletions(-) diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 850973ad578..628387c4a57 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -12,6 +12,7 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" sync "sync" @@ -6284,12 +6285,18 @@ func (x *fastReflection_MsgCancelProposal) ProtoMethods() *protoiface.Methods { } var ( - md_MsgCancelProposalResponse protoreflect.MessageDescriptor + md_MsgCancelProposalResponse protoreflect.MessageDescriptor + fd_MsgCancelProposalResponse_proposal_id protoreflect.FieldDescriptor + fd_MsgCancelProposalResponse_canceled_time protoreflect.FieldDescriptor + fd_MsgCancelProposalResponse_canceled_height protoreflect.FieldDescriptor ) func init() { file_cosmos_gov_v1_tx_proto_init() md_MsgCancelProposalResponse = File_cosmos_gov_v1_tx_proto.Messages().ByName("MsgCancelProposalResponse") + fd_MsgCancelProposalResponse_proposal_id = md_MsgCancelProposalResponse.Fields().ByName("proposal_id") + fd_MsgCancelProposalResponse_canceled_time = md_MsgCancelProposalResponse.Fields().ByName("canceled_time") + fd_MsgCancelProposalResponse_canceled_height = md_MsgCancelProposalResponse.Fields().ByName("canceled_height") } var _ protoreflect.Message = (*fastReflection_MsgCancelProposalResponse)(nil) @@ -6357,6 +6364,24 @@ func (x *fastReflection_MsgCancelProposalResponse) Interface() protoreflect.Prot // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgCancelProposalResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ProposalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ProposalId) + if !f(fd_MsgCancelProposalResponse_proposal_id, value) { + return + } + } + if x.CanceledTime != nil { + value := protoreflect.ValueOfMessage(x.CanceledTime.ProtoReflect()) + if !f(fd_MsgCancelProposalResponse_canceled_time, value) { + return + } + } + if x.CanceledHeight != uint64(0) { + value := protoreflect.ValueOfUint64(x.CanceledHeight) + if !f(fd_MsgCancelProposalResponse_canceled_height, value) { + return + } + } } // Has reports whether a field is populated. @@ -6372,6 +6397,12 @@ func (x *fastReflection_MsgCancelProposalResponse) Range(f func(protoreflect.Fie // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgCancelProposalResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cosmos.gov.v1.MsgCancelProposalResponse.proposal_id": + return x.ProposalId != uint64(0) + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_time": + return x.CanceledTime != nil + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_height": + return x.CanceledHeight != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) @@ -6388,6 +6419,12 @@ func (x *fastReflection_MsgCancelProposalResponse) Has(fd protoreflect.FieldDesc // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgCancelProposalResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cosmos.gov.v1.MsgCancelProposalResponse.proposal_id": + x.ProposalId = uint64(0) + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_time": + x.CanceledTime = nil + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_height": + x.CanceledHeight = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) @@ -6404,6 +6441,15 @@ func (x *fastReflection_MsgCancelProposalResponse) Clear(fd protoreflect.FieldDe // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgCancelProposalResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cosmos.gov.v1.MsgCancelProposalResponse.proposal_id": + value := x.ProposalId + return protoreflect.ValueOfUint64(value) + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_time": + value := x.CanceledTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_height": + value := x.CanceledHeight + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) @@ -6424,6 +6470,12 @@ func (x *fastReflection_MsgCancelProposalResponse) Get(descriptor protoreflect.F // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgCancelProposalResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cosmos.gov.v1.MsgCancelProposalResponse.proposal_id": + x.ProposalId = value.Uint() + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_time": + x.CanceledTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_height": + x.CanceledHeight = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) @@ -6444,6 +6496,15 @@ func (x *fastReflection_MsgCancelProposalResponse) Set(fd protoreflect.FieldDesc // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgCancelProposalResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_time": + if x.CanceledTime == nil { + x.CanceledTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.CanceledTime.ProtoReflect()) + case "cosmos.gov.v1.MsgCancelProposalResponse.proposal_id": + panic(fmt.Errorf("field proposal_id of message cosmos.gov.v1.MsgCancelProposalResponse is not mutable")) + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_height": + panic(fmt.Errorf("field canceled_height of message cosmos.gov.v1.MsgCancelProposalResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) @@ -6457,6 +6518,13 @@ func (x *fastReflection_MsgCancelProposalResponse) Mutable(fd protoreflect.Field // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgCancelProposalResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.gov.v1.MsgCancelProposalResponse.proposal_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.gov.v1.MsgCancelProposalResponse.canceled_height": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgCancelProposalResponse")) @@ -6526,6 +6594,16 @@ func (x *fastReflection_MsgCancelProposalResponse) ProtoMethods() *protoiface.Me var n int var l int _ = l + if x.ProposalId != 0 { + n += 1 + runtime.Sov(uint64(x.ProposalId)) + } + if x.CanceledTime != nil { + l = options.Size(x.CanceledTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.CanceledHeight != 0 { + n += 1 + runtime.Sov(uint64(x.CanceledHeight)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -6555,6 +6633,30 @@ func (x *fastReflection_MsgCancelProposalResponse) ProtoMethods() *protoiface.Me i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.CanceledHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CanceledHeight)) + i-- + dAtA[i] = 0x18 + } + if x.CanceledTime != nil { + encoded, err := options.Marshal(x.CanceledTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.ProposalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ProposalId)) + i-- + dAtA[i] = 0x8 + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -6604,6 +6706,80 @@ func (x *fastReflection_MsgCancelProposalResponse) ProtoMethods() *protoiface.Me return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + x.ProposalId = 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.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CanceledTime", wireType) + } + var msglen int + 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++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + 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 + } + if x.CanceledTime == nil { + x.CanceledTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CanceledTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CanceledHeight", wireType) + } + x.CanceledHeight = 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.CanceledHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -7213,6 +7389,12 @@ type MsgCancelProposalResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // canceled_time is the time when proposal is canceled. + CanceledTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=canceled_time,json=canceledTime,proto3" json:"canceled_time,omitempty"` + // canceled_height defines the block height at which the proposal is cancel. + CanceledHeight uint64 `protobuf:"varint,3,opt,name=canceled_height,json=canceledHeight,proto3" json:"canceled_height,omitempty"` } func (x *MsgCancelProposalResponse) Reset() { @@ -7235,6 +7417,27 @@ func (*MsgCancelProposalResponse) Descriptor() ([]byte, []int) { return file_cosmos_gov_v1_tx_proto_rawDescGZIP(), []int{13} } +func (x *MsgCancelProposalResponse) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +func (x *MsgCancelProposalResponse) GetCanceledTime() *timestamppb.Timestamp { + if x != nil { + return x.CanceledTime + } + return nil +} + +func (x *MsgCancelProposalResponse) GetCanceledHeight() uint64 { + if x != nil { + return x.CanceledHeight + } + return 0 +} + var File_cosmos_gov_v1_tx_proto protoreflect.FileDescriptor var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ @@ -7250,149 +7453,161 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf0, 0x01, 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, 0x62, 0x75, 0x66, 0x2e, - 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x48, 0x0a, - 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x18, 0x02, 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, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x72, 0x18, 0x03, 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, 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, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, 0x08, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 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, 0x81, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, - 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, - 0x3b, 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, 0x0b, 0xca, 0xb4, 0x2d, 0x07, 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, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 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, 0xc6, 0x01, 0x0a, 0x07, 0x4d, - 0x73, 0x67, 0x56, 0x6f, 0x74, 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, 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, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x76, 0x6f, - 0x74, 0x65, 0x72, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd8, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, 0x6f, - 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 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, 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, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x76, 0x6f, 0x74, 0x65, - 0x72, 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, 0xbf, 0x01, 0x0a, - 0x0a, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x30, 0x0a, 0x0b, 0x70, + 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, 0xf0, 0x01, 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, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x48, + 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x18, 0x02, 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, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x72, 0x18, 0x03, 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, 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, 0x0d, 0x82, 0xe7, 0xb0, 0x2a, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 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, 0x81, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, + 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x12, 0x3b, 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, 0x0b, 0xca, 0xb4, 0x2d, 0x07, 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, 0x0e, 0x82, 0xe7, 0xb0, + 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 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, 0xc6, 0x01, 0x0a, 0x07, + 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 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, 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, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x76, + 0x6f, 0x74, 0x65, 0x72, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd8, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, + 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 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, 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, 0x37, 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, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x0e, - 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x22, 0x14, - 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8e, 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, + 0x64, 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, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x76, 0x6f, 0x74, + 0x65, 0x72, 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, 0xbf, 0x01, + 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 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, 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, 0x37, 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, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, + 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x22, + 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8e, 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, 0x33, 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, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 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, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x12, 0x33, 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, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 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, 0x1b, 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, 0x32, 0xe1, 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, 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, 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, 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, + 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, 0xe1, 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, 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, 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, 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 ( @@ -7428,6 +7643,7 @@ var file_cosmos_gov_v1_tx_proto_goTypes = []interface{}{ (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 } var file_cosmos_gov_v1_tx_proto_depIdxs = []int32{ 14, // 0: cosmos.gov.v1.MsgSubmitProposal.messages:type_name -> google.protobuf.Any @@ -7437,25 +7653,26 @@ var file_cosmos_gov_v1_tx_proto_depIdxs = []int32{ 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 - 0, // 7: cosmos.gov.v1.Msg.SubmitProposal:input_type -> cosmos.gov.v1.MsgSubmitProposal - 2, // 8: cosmos.gov.v1.Msg.ExecLegacyContent:input_type -> cosmos.gov.v1.MsgExecLegacyContent - 4, // 9: cosmos.gov.v1.Msg.Vote:input_type -> cosmos.gov.v1.MsgVote - 6, // 10: cosmos.gov.v1.Msg.VoteWeighted:input_type -> cosmos.gov.v1.MsgVoteWeighted - 8, // 11: cosmos.gov.v1.Msg.Deposit:input_type -> cosmos.gov.v1.MsgDeposit - 10, // 12: cosmos.gov.v1.Msg.UpdateParams:input_type -> cosmos.gov.v1.MsgUpdateParams - 12, // 13: cosmos.gov.v1.Msg.CancelProposal:input_type -> cosmos.gov.v1.MsgCancelProposal - 1, // 14: cosmos.gov.v1.Msg.SubmitProposal:output_type -> cosmos.gov.v1.MsgSubmitProposalResponse - 3, // 15: cosmos.gov.v1.Msg.ExecLegacyContent:output_type -> cosmos.gov.v1.MsgExecLegacyContentResponse - 5, // 16: cosmos.gov.v1.Msg.Vote:output_type -> cosmos.gov.v1.MsgVoteResponse - 7, // 17: cosmos.gov.v1.Msg.VoteWeighted:output_type -> cosmos.gov.v1.MsgVoteWeightedResponse - 9, // 18: cosmos.gov.v1.Msg.Deposit:output_type -> cosmos.gov.v1.MsgDepositResponse - 11, // 19: cosmos.gov.v1.Msg.UpdateParams:output_type -> cosmos.gov.v1.MsgUpdateParamsResponse - 13, // 20: cosmos.gov.v1.Msg.CancelProposal:output_type -> cosmos.gov.v1.MsgCancelProposalResponse - 14, // [14:21] is the sub-list for method output_type - 7, // [7:14] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 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 } func init() { file_cosmos_gov_v1_tx_proto_init() } diff --git a/proto/cosmos/distribution/v1beta1/distribution.proto b/proto/cosmos/distribution/v1beta1/distribution.proto index 7e7b98eaa06..6c346d08fab 100644 --- a/proto/cosmos/distribution/v1beta1/distribution.proto +++ b/proto/cosmos/distribution/v1beta1/distribution.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package cosmos.distribution.v1beta1; -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; @@ -48,10 +48,8 @@ message Params { // read that record) // + one per validator for the zeroeth period, set on initialization message ValidatorHistoricalRewards { - repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; + repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; uint32 reference_count = 2; } @@ -59,29 +57,23 @@ message ValidatorHistoricalRewards { // period for a validator kept as a running counter and incremented // each block as long as the validator's tokens remain constant. message ValidatorCurrentRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; uint64 period = 2; } // ValidatorAccumulatedCommission represents accumulated commission // for a validator kept as a running counter, can be withdrawn at any time. message ValidatorAccumulatedCommission { - repeated cosmos.base.v1beta1.DecCoin commission = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; + repeated cosmos.base.v1beta1.DecCoin commission = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; } // ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards // for a validator inexpensive to track, allows simple sanity checks. message ValidatorOutstandingRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; + repeated cosmos.base.v1beta1.DecCoin rewards = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; } // ValidatorSlashEvent represents a validator slash event. @@ -100,16 +92,13 @@ message ValidatorSlashEvent { // ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. message ValidatorSlashEvents { option (gogoproto.goproto_stringer) = false; - repeated ValidatorSlashEvent validator_slash_events = 1 - [(gogoproto.nullable) = false]; + repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false]; } // FeePool is the global fee pool for distribution. message FeePool { - repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" - ]; + repeated cosmos.base.v1beta1.DecCoin community_pool = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; } // CommunityPoolSpendProposal details a proposal for use of community funds, @@ -130,10 +119,8 @@ message CommunityPoolSpendProposal { string title = 1; string description = 2; string recipient = 3; - repeated cosmos.base.v1beta1.Coin amount = 4 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + repeated cosmos.base.v1beta1.Coin amount = 4 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } // DelegatorStartingInfo represents the starting info for a delegator reward @@ -160,10 +147,8 @@ message DelegationDelegatorReward { string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.DecCoin reward = 2 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; + repeated cosmos.base.v1beta1.DecCoin reward = 2 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; } // CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto index 9bcfe18d646..0c5fba1cf65 100644 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package cosmos.distribution.v1beta1; -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; @@ -14,23 +14,19 @@ import "cosmos/distribution/v1beta1/distribution.proto"; service Msg { // SetWithdrawAddress defines a method to change the withdraw address // for a delegator (or validator self-delegation). - rpc SetWithdrawAddress(MsgSetWithdrawAddress) - returns (MsgSetWithdrawAddressResponse); + rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); // WithdrawDelegatorReward defines a method to withdraw rewards of delegator // from a single validator. - rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) - returns (MsgWithdrawDelegatorRewardResponse); + rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); // WithdrawValidatorCommission defines a method to withdraw the // full commission to the validator address. - rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) - returns (MsgWithdrawValidatorCommissionResponse); + rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); // FundCommunityPool defines a method to allow an account to directly // fund the community pool. - rpc FundCommunityPool(MsgFundCommunityPool) - returns (MsgFundCommunityPoolResponse); + rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); // UpdateParams defines a governance operation for updating the x/distribution // module parameters. The authority is defined in the keeper. @@ -44,8 +40,7 @@ service Msg { // keeper. // // Since: cosmos-sdk 0.47 - rpc CommunityPoolSpend(MsgCommunityPoolSpend) - returns (MsgCommunityPoolSpendResponse); + rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); } // MsgSetWithdrawAddress sets the withdraw address for @@ -80,10 +75,8 @@ message MsgWithdrawDelegatorReward { // response type. message MsgWithdrawDelegatorRewardResponse { // Since: cosmos-sdk 0.46 - repeated cosmos.base.v1beta1.Coin amount = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } // MsgWithdrawValidatorCommission withdraws the full commission to the validator @@ -101,10 +94,8 @@ message MsgWithdrawValidatorCommission { // Msg/WithdrawValidatorCommission response type. message MsgWithdrawValidatorCommissionResponse { // Since: cosmos-sdk 0.46 - repeated cosmos.base.v1beta1.Coin amount = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } // MsgFundCommunityPool allows an account to directly @@ -115,10 +106,8 @@ message MsgFundCommunityPool { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - repeated cosmos.base.v1beta1.Coin amount = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } @@ -155,12 +144,10 @@ message MsgCommunityPoolSpend { option (cosmos.msg.v1.signer) = "authority"; // authority is the address of the governance account. - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string recipient = 2; - repeated cosmos.base.v1beta1.Coin amount = 3 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string recipient = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } // MsgCommunityPoolSpendResponse defines the response to executing a diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 839b6c3e5e9..3091b660a72 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -8,6 +8,7 @@ import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/any.proto"; import "cosmos/msg/v1/msg.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; @@ -35,9 +36,9 @@ service Msg { // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // CancelProposal defines a method to cancel governance proposal + // CancelProposal defines a method to cancel governance proposal // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.47 rpc CancelProposal(MsgCancelProposal) returns (MsgCancelProposalResponse); } @@ -133,16 +134,22 @@ message MsgUpdateParamsResponse {} // MsgCancelProposal is the Msg/CancelProposal request type. // -// Since: cosmos-sdk 0.47 -message MsgCancelProposal{ +// Since: cosmos-sdk 0.47 +message MsgCancelProposal { option (cosmos.msg.v1.signer) = "proposer"; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; - string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgCancelProposalResponse defines the response structure for executing a // MsgCancelProposal message. // // Since: cosmos-sdk 0.47 -message MsgCancelProposalResponse{} +message MsgCancelProposalResponse { + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + // canceled_time is the time when proposal is canceled. + google.protobuf.Timestamp canceled_time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // canceled_height defines the block height at which the proposal is cancel. + uint64 canceled_height = 3; +} diff --git a/testutil/testdata/testdata.proto b/testutil/testdata/testdata.proto index 61479710fb5..22503ef61d7 100644 --- a/testutil/testdata/testdata.proto +++ b/testutil/testdata/testdata.proto @@ -18,7 +18,7 @@ message Cat { message Bird { string species = 1; - int32 color = 2; + int32 color = 2; } message HasAnimal { diff --git a/tx/textual/internal/testpb/1.proto b/tx/textual/internal/testpb/1.proto index 930b730c7c7..bc6030e45d8 100644 --- a/tx/textual/internal/testpb/1.proto +++ b/tx/textual/internal/testpb/1.proto @@ -14,16 +14,16 @@ enum Enumeration { // A contains fields that are parseable by SIGN_MODE_TEXTUAL. message A { - uint32 UINT32 = 1; - uint64 UINT64 = 2; - int32 INT32 = 3; - int64 INT64 = 4; - string SDKINT = 5 [(cosmos_proto.scalar) = "cosmos.Int"]; - string SDKDEC = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; - cosmos.base.v1beta1.Coin COIN = 7; - repeated cosmos.base.v1beta1.Coin COINS = 8; - bytes BYTES = 9; - google.protobuf.Timestamp TIMESTAMP = 10; + uint32 UINT32 = 1; + uint64 UINT64 = 2; + int32 INT32 = 3; + int64 INT64 = 4; + string SDKINT = 5 [(cosmos_proto.scalar) = "cosmos.Int"]; + string SDKDEC = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; + cosmos.base.v1beta1.Coin COIN = 7; + repeated cosmos.base.v1beta1.Coin COINS = 8; + bytes BYTES = 9; + google.protobuf.Timestamp TIMESTAMP = 10; } // B contains fields that are not parseable by SIGN_MODE_TEXTUAL, some fields diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index 084e27e29e5..c3b00aad585 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -140,7 +140,7 @@ Where proposal.json contains: func NewCmdCancelProposal() *cobra.Command { cmd := &cobra.Command{ Use: "cancel-proposal [proposal-id]", - Short: "Cancel governance proposal by proposal before the voting period ends.", + Short: "Cancel governance proposal before the voting period ends.", Args: cobra.ExactArgs(1), Example: fmt.Sprintf(`$ %s tx gov cancel-proposal 1 --from mykey`, version.AppName), RunE: func(cmd *cobra.Command, args []string) error { @@ -158,7 +158,7 @@ func NewCmdCancelProposal() *cobra.Command { // Get proposer address from := clientCtx.GetFromAddress() - msg := v1.NewMsgCancelProposal(from, proposalID) + msg := v1.NewMsgCancelProposal(proposalID, from) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 435b140b7c8..7b4a0038fbf 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -107,10 +107,15 @@ func (k msgServer) CancelProposal(goCtx context.Context, msg *v1.MsgCancelPropos sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyModule, govtypes.AttributeValueCategory), sdk.NewAttribute(sdk.AttributeKeySender, msg.Proposer), + sdk.NewAttribute(govtypes.AttributeKeyProposalID, fmt.Sprint(msg.ProposalId)), ), ) - return &v1.MsgCancelProposalResponse{}, nil + return &v1.MsgCancelProposalResponse{ + ProposalId: msg.ProposalId, + CanceledTime: ctx.BlockTime(), + CanceledHeight: uint64(ctx.BlockHeight()), + }, nil } func (k msgServer) ExecLegacyContent(goCtx context.Context, msg *v1.MsgExecLegacyContent) (*v1.MsgExecLegacyContentResponse, error) { diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index ff74a40680e..6647e83c85a 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -114,8 +114,6 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer // Check proposal voting period is ended. if proposal.VotingEndTime != nil && proposal.VotingEndTime.Before(ctx.BlockTime()) { - // return sdkerrors.Wrap(errors.New("voting period is already ended for this proposal")) - // TODO: create error return sdkerrors.Wrapf(types.ErrInactiveProposal, "voting period is already ended for this proposal %d", proposalID) } diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 2fc7b3f8962..544759c748f 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -412,7 +412,7 @@ func SimulateMsgCancelProposal(ak types.AccountKeeper, bk types.BankKeeper, k *k account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) - msg := v1.NewMsgCancelProposal(account.GetAddress(), proposal.Id) + msg := v1.NewMsgCancelProposal(proposal.Id, account.GetAddress()) txCtx := simulation.OperationInput{ R: r, diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index f73fb2334a5..e8984e55b3c 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -296,7 +296,7 @@ func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { // NewMsgCancelProposal creates a new MsgCancelProposal instance // //nolint:interfacer -func NewMsgCancelProposal(proposer sdk.AccAddress, proposalID uint64) *MsgCancelProposal { +func NewMsgCancelProposal(proposalID uint64, proposer sdk.AccAddress) *MsgCancelProposal { return &MsgCancelProposal{proposalID, proposer.String()} } diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 837970c71c4..7b6ec0ad347 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -13,18 +13,22 @@ import ( _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -710,6 +714,11 @@ func (m *MsgCancelProposal) GetProposer() string { // // Since: cosmos-sdk 0.47 type MsgCancelProposalResponse struct { + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + // canceled_time is the time when proposal is canceled. + CanceledTime time.Time `protobuf:"bytes,2,opt,name=canceled_time,json=canceledTime,proto3,stdtime" json:"canceled_time"` + // canceled_height defines the block height at which the proposal is cancel. + CanceledHeight uint64 `protobuf:"varint,3,opt,name=canceled_height,json=canceledHeight,proto3" json:"canceled_height,omitempty"` } func (m *MsgCancelProposalResponse) Reset() { *m = MsgCancelProposalResponse{} } @@ -745,6 +754,27 @@ func (m *MsgCancelProposalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCancelProposalResponse proto.InternalMessageInfo +func (m *MsgCancelProposalResponse) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *MsgCancelProposalResponse) GetCanceledTime() time.Time { + if m != nil { + return m.CanceledTime + } + return time.Time{} +} + +func (m *MsgCancelProposalResponse) GetCanceledHeight() uint64 { + if m != nil { + return m.CanceledHeight + } + return 0 +} + func init() { proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1.MsgSubmitProposal") proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1.MsgSubmitProposalResponse") @@ -765,60 +795,64 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 841 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xd1, 0x4f, 0xfb, 0x54, - 0x14, 0x5e, 0xd9, 0xdc, 0x7e, 0xdc, 0xc9, 0x08, 0xcd, 0x84, 0xae, 0x92, 0x32, 0x66, 0x62, 0x16, - 0x09, 0x2d, 0x03, 0xa3, 0x09, 0x18, 0x13, 0x86, 0x44, 0x4d, 0x5c, 0x24, 0x25, 0x62, 0x62, 0x4c, - 0xc8, 0xdd, 0x7a, 0xbd, 0x34, 0xae, 0xbd, 0x4d, 0xef, 0xdd, 0xc2, 0x1e, 0xf5, 0xd1, 0x07, 0xe3, - 0x9f, 0xe2, 0x03, 0xef, 0xbe, 0x19, 0xe2, 0x13, 0xf1, 0x89, 0x27, 0xa2, 0xf0, 0x60, 0xe2, 0x93, - 0x7f, 0x82, 0x69, 0xef, 0x6d, 0xd7, 0xb5, 0x85, 0xc1, 0xcb, 0xef, 0x69, 0xed, 0x39, 0xdf, 0x77, - 0xfa, 0x7d, 0x3d, 0xf7, 0x9c, 0x15, 0xac, 0x0e, 0x08, 0x75, 0x08, 0x35, 0x30, 0x19, 0x1b, 0xe3, - 0x8e, 0xc1, 0x2e, 0x75, 0xcf, 0x27, 0x8c, 0xc8, 0x4b, 0x3c, 0xae, 0x63, 0x32, 0xd6, 0xc7, 0x1d, - 0x55, 0x13, 0xb0, 0x3e, 0xa4, 0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88, 0xbd, 0xdd, 0x4a, 0x71, 0xec, 0x6b, 0x64, 0xe3, 0x0b, 0x86, 0xac, 0xd7, 0xe0, 0xf1, - 0x00, 0x54, 0xb8, 0x74, 0xaa, 0x14, 0xc3, 0x63, 0xbd, 0x99, 0x32, 0x19, 0x69, 0x49, 0x98, 0x8d, - 0x18, 0xcf, 0x76, 0xdb, 0x00, 0x6b, 0x29, 0x67, 0xb1, 0xeb, 0xdf, 0x24, 0x00, 0x7a, 0x14, 0x47, - 0x33, 0xf2, 0x72, 0xc3, 0x1f, 0x80, 0x45, 0x31, 0x97, 0x64, 0xbe, 0xe9, 0x29, 0x54, 0xfe, 0x10, - 0x94, 0xa1, 0x43, 0x46, 0x2e, 0x13, 0xbe, 0xe7, 0x8e, 0xb3, 0x80, 0x8b, 0x33, 0x1b, 0x17, 0x6a, - 0xd5, 0x81, 0x3c, 0x35, 0x10, 0xfb, 0xfa, 0x99, 0x77, 0xf3, 0x2b, 0xcf, 0x82, 0x0c, 0x9d, 0x40, - 0x1f, 0x3a, 0x34, 0x90, 0x3a, 0x9d, 0x05, 0x69, 0x9e, 0xd4, 0x18, 0x2a, 0xef, 0x81, 0xb2, 0x17, - 0x56, 0x08, 0xfd, 0x55, 0x77, 0xdf, 0x4a, 0xb5, 0x88, 0x97, 0x8f, 0x64, 0x72, 0x68, 0x66, 0xb4, - 0x78, 0x0f, 0x92, 0x7a, 0x62, 0xad, 0x3f, 0xf1, 0x55, 0x79, 0x04, 0xdd, 0x01, 0x1a, 0x26, 0x56, - 0xe5, 0x4b, 0x5b, 0x91, 0x5c, 0x70, 0x0b, 0xcf, 0x5d, 0x70, 0xe9, 0x25, 0xf6, 0x76, 0xb8, 0xc4, - 0x66, 0xb5, 0x44, 0x4a, 0x77, 0xff, 0x2e, 0x81, 0x62, 0x8f, 0x62, 0xf9, 0x5b, 0x50, 0x4b, 0x2d, - 0xf6, 0x66, 0xea, 0x9d, 0x64, 0x16, 0xa1, 0xda, 0x9e, 0x87, 0x88, 0x57, 0x25, 0x02, 0x2b, 0xd9, - 0x2d, 0xf8, 0x4e, 0x96, 0x9e, 0x01, 0xa9, 0x5b, 0xcf, 0x00, 0xc5, 0x8f, 0xf9, 0x18, 0x94, 0xc2, - 0x45, 0xb6, 0x9a, 0x25, 0x05, 0x71, 0x55, 0xcb, 0x8f, 0xc7, 0xfc, 0x33, 0xf0, 0xe6, 0xcc, 0xb2, - 0x78, 0x04, 0x1f, 0xe5, 0xd5, 0x77, 0x9f, 0xce, 0xc7, 0x75, 0x3f, 0x05, 0x95, 0x68, 0x1c, 0x1b, - 0x59, 0x8a, 0x48, 0xa9, 0x9b, 0x8f, 0xa6, 0x92, 0x02, 0x67, 0xce, 0x7f, 0x8e, 0xc0, 0x64, 0x3e, - 0x4f, 0x60, 0xde, 0x79, 0x0d, 0xba, 0x9f, 0x3a, 0xab, 0x39, 0xdd, 0x9f, 0x45, 0xe4, 0x75, 0x3f, - 0xff, 0x8c, 0x75, 0x8f, 0xaf, 0xef, 0x35, 0xe9, 0xe6, 0x5e, 0x93, 0xfe, 0xba, 0xd7, 0xa4, 0x5f, - 0x1e, 0xb4, 0xc2, 0xcd, 0x83, 0x56, 0xb8, 0x7d, 0xd0, 0x0a, 0xdf, 0x6c, 0x61, 0x9b, 0x5d, 0x8c, - 0xfa, 0xfa, 0x80, 0x38, 0xe2, 0xfb, 0x44, 0xfc, 0x6c, 0x53, 0xeb, 0x7b, 0xe3, 0x32, 0xfc, 0xd0, - 0x61, 0x13, 0x0f, 0xd1, 0xe0, 0x6b, 0xa8, 0x1c, 0xfe, 0x39, 0xee, 0xfd, 0x1f, 0x00, 0x00, 0xff, - 0xff, 0x31, 0x98, 0xcd, 0x8e, 0x4d, 0x09, 0x00, 0x00, + // 911 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x26, 0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, 0x7d, 0xed, 0x6c, 0x5f, 0x84, + 0x30, 0x67, 0x81, 0x61, 0xb3, 0xb8, 0xac, 0xdf, 0x2a, 0xd2, 0x0b, 0x20, 0xe7, 0xf6, 0x25, 0x40, + 0xe6, 0x36, 0x1f, 0x41, 0x45, 0xee, 0xdb, 0xeb, 0x45, 0x92, 0x88, 0x3b, 0x6e, 0x79, 0xdc, 0xf0, + 0x9f, 0xc1, 0xb5, 0xb9, 0x9d, 0x76, 0x06, 0x3e, 0xcb, 0x3b, 0x6f, 0x9f, 0x9f, 0x37, 0x75, 0x3f, + 0x81, 0x6a, 0xb6, 0x35, 0x9a, 0x45, 0x8a, 0x4e, 0x39, 0xb7, 0xce, 0x4c, 0xcd, 0x0a, 0x9c, 0x1b, + 0xd3, 0x12, 0x81, 0xb3, 0xf9, 0x32, 0x81, 0x65, 0x63, 0x25, 0xba, 0x9f, 0x1b, 0xa9, 0x92, 0xee, + 0xcf, 0x23, 0xca, 0xba, 0x5f, 0x3e, 0x09, 0xdd, 0x87, 0x2f, 0x4f, 0x5c, 0xeb, 0xd5, 0x89, 0x6b, + 0xfd, 0x79, 0xe2, 0x5a, 0xcf, 0x4f, 0xdd, 0x85, 0x57, 0xa7, 0xee, 0xc2, 0xeb, 0x53, 0x77, 0xe1, + 0xab, 0xdb, 0x24, 0xe2, 0x07, 0xa3, 0xbe, 0x37, 0xa0, 0xb1, 0xfe, 0xce, 0xd2, 0x3f, 0x3b, 0x2c, + 0xfc, 0xd6, 0x3f, 0x92, 0x1f, 0x6c, 0x7c, 0x92, 0x62, 0x26, 0xbe, 0xea, 0x96, 0xe5, 0xf3, 0x7f, + 0xf7, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x33, 0x98, 0xba, 0xe2, 0x15, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1640,6 +1674,24 @@ func (m *MsgCancelProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l + if m.CanceledHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CanceledHeight)) + i-- + dAtA[i] = 0x18 + } + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CanceledTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CanceledTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintTx(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x12 + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -1865,6 +1917,14 @@ func (m *MsgCancelProposalResponse) Size() (n int) { } var l int _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CanceledTime) + n += 1 + l + sovTx(uint64(l)) + if m.CanceledHeight != 0 { + n += 1 + sovTx(uint64(m.CanceledHeight)) + } return n } @@ -3192,6 +3252,77 @@ func (m *MsgCancelProposalResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgCancelProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CanceledTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CanceledTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CanceledHeight", wireType) + } + m.CanceledHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CanceledHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From cfaf9462c29603223943ba8f48c0bc1e0f4d8c2a Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 5 Sep 2022 22:29:58 +0530 Subject: [PATCH 15/69] chore: address the pr comments --- x/gov/abci.go | 5 +++-- x/gov/keeper/deposit.go | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/x/gov/abci.go b/x/gov/abci.go index d45c92e8c3f..65fc8bfba10 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -20,11 +20,12 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { // delete the canceled proposals from store. // move the min initial deposit of the proposal to community-pool and refund remaining deposits. keeper.IterateCanceledProposalQueue(ctx, func(proposal v1.Proposal) (stop bool) { - keeper.DeleteProposal(ctx, proposal.Id) // send min proposal deposit amount to the community-pool from proposer deposit. keeper.SendProposalMinDepositToCommunityPool(ctx, proposal.Id, proposal.Proposer) - // refund deposits of proposal to depositors + // refund deposits of proposal to depositors. keeper.RefundAndDeleteDeposits(ctx, proposal.Id) + // delete the proposal. + keeper.DeleteProposal(ctx, proposal.Id) return false }) diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 988d9f57be0..24dff00483e 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -162,8 +162,8 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd return activatedVotingPeriod, nil } -// SendProposalMinDepositToCommunityPool will sends the min deposits of proposal to community pool -// from proposer deposits and updated the deposit store with updated deposit amount. +// SendProposalMinDepositToCommunityPool sends the min deposits of the proposal to community pool +// from proposer deposits and updates the deposit store with updated deposit amount. func (keeper Keeper) SendProposalMinDepositToCommunityPool(ctx sdk.Context, proposalID uint64, proAddr string) error { proposerAddr := sdk.MustAccAddressFromBech32(proAddr) @@ -172,7 +172,7 @@ func (keeper Keeper) SendProposalMinDepositToCommunityPool(ctx sdk.Context, prop return sdkerrors.Wrapf(types.ErrNoDeposits, "proposer %s doesn't deposited to proposal %d", proAddr, proposalID) } - minDepositeAmount, err := keeper.GetMinDepositsForProposal(ctx) + minDepositeAmount, err := keeper.GetProposalMinDeposit(ctx) if err != nil { return err } @@ -189,8 +189,8 @@ func (keeper Keeper) SendProposalMinDepositToCommunityPool(ctx sdk.Context, prop return nil } -// GetMinDepositsForProposal returns minimum deposit amount required for creating the proposal. -func (keeper Keeper) GetMinDepositsForProposal(ctx sdk.Context) ([]sdk.Coin, error) { +// GetProposalMinDeposit returns minimum deposit amount required for creating the proposal. +func (keeper Keeper) GetProposalMinDeposit(ctx sdk.Context) ([]sdk.Coin, error) { params := keeper.GetParams(ctx) minInitialDepositRatio, err := sdk.NewDecFromStr(params.MinInitialDepositRatio) @@ -200,6 +200,7 @@ func (keeper Keeper) GetMinDepositsForProposal(ctx sdk.Context) ([]sdk.Coin, err if minInitialDepositRatio.IsZero() { return nil, nil } + minDepositCoins := params.MinDeposit for i := range minDepositCoins { minDepositCoins[i].Amount = sdk.NewDecFromInt(minDepositCoins[i].Amount).Mul(minInitialDepositRatio).RoundInt() From e7ce012c7e4021f9170f49fd035dc67a4c42bd16 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 5 Sep 2022 22:44:17 +0530 Subject: [PATCH 16/69] chore: small fix for test --- x/gov/abci_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index ec065fd3137..efbe4bbe462 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -391,7 +391,7 @@ func TestProposalCanceledEndblocker(t *testing.T) { err = suite.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1.NewNonSplitVoteOption(v1.OptionYes), "") require.NoError(t, err) - minDepositsForProposal, err := suite.GovKeeper.GetMinDepositsForProposal(ctx) + minDepositsForProposal, err := suite.GovKeeper.GetProposalMinDeposit(ctx) minDepositsForProposalInDec := sdk.NewDecCoinsFromCoins(minDepositsForProposal...) require.NoError(t, err) From 8ee3a5b2c11eac1602af30af3e5ebb10dcd529ea Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 22 Sep 2022 11:51:12 +0530 Subject: [PATCH 17/69] fix: fix the build issue --- api/cosmos/gov/v1/tx.pulsar.go | 27 +++++--- x/gov/types/v1/msgs.go | 2 +- x/gov/types/v1/tx.pb.go | 118 ++++++++++++++++++--------------- 3 files changed, 80 insertions(+), 67 deletions(-) diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 989f7bab45e..f590293bda4 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7545,17 +7545,22 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 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, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x12, 0x33, 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, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 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, - 0x32, 0x8a, 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, + 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, diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 6b17a6f4c6b..851ee5a528c 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -318,7 +318,7 @@ func (msg MsgCancelProposal) ValidateBasic() error { // GetSignBytes implements Msg func (msg MsgCancelProposal) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := codec.ModuleCdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 5e9e6c3772c..03b164dfad1 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -13,6 +13,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -794,58 +795,65 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 804 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x4f, 0xe3, 0x46, - 0x14, 0x8e, 0x49, 0x48, 0xe0, 0xa5, 0x04, 0x61, 0xa5, 0xe0, 0x58, 0xc8, 0x84, 0x54, 0xaa, 0x22, - 0x10, 0x36, 0x81, 0xaa, 0x95, 0xa0, 0xaa, 0x44, 0x28, 0x6a, 0x2b, 0x35, 0x2a, 0x32, 0x2a, 0x95, - 0xaa, 0x4a, 0xc8, 0x89, 0xa7, 0x83, 0x55, 0xec, 0xb1, 0x3c, 0x93, 0x88, 0xdc, 0xda, 0x1e, 0x7b, - 0xa8, 0xfa, 0x53, 0x38, 0x70, 0xef, 0xad, 0x42, 0x3d, 0xa1, 0x3d, 0x71, 0x42, 0x2b, 0x38, 0x20, - 0xed, 0x69, 0x7f, 0xc2, 0xca, 0x9e, 0xb1, 0x13, 0xe2, 0x40, 0xd8, 0xcb, 0x9e, 0x62, 0xbf, 0xf7, - 0x7d, 0x6f, 0xbe, 0xcf, 0x6f, 0xde, 0x4c, 0x60, 0xb1, 0x43, 0xa8, 0x4b, 0xa8, 0x81, 0x49, 0xcf, - 0xe8, 0x35, 0x0c, 0x76, 0xae, 0xfb, 0x01, 0x61, 0x44, 0x9e, 0xe3, 0x71, 0x1d, 0x93, 0x9e, 0xde, - 0x6b, 0xa8, 0x9a, 0x80, 0xb5, 0x2d, 0x8a, 0x8c, 0x5e, 0xa3, 0x8d, 0x98, 0xd5, 0x30, 0x3a, 0xc4, - 0xf1, 0x38, 0x5c, 0x5d,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xcf, 0xe7, 0x93, 0xba, 0xdf, 0x40, 0x21, 0xde, - 0xe4, 0x95, 0x34, 0x45, 0xa4, 0xd4, 0xd5, 0x27, 0x53, 0xc3, 0x02, 0x1f, 0xed, 0xaa, 0x31, 0x02, - 0x87, 0xf3, 0xe3, 0x04, 0x8e, 0xdb, 0x05, 0xea, 0xf4, 0xef, 0x0f, 0x17, 0x6b, 0x52, 0xf3, 0xe0, - 0xea, 0x4e, 0x93, 0xae, 0xef, 0x34, 0xe9, 0xf5, 0x9d, 0x26, 0xfd, 0x73, 0xaf, 0x65, 0xae, 0xef, - 0xb5, 0xcc, 0xcd, 0xbd, 0x96, 0xf9, 0x79, 0x1d, 0x3b, 0xec, 0xb4, 0xdb, 0xd6, 0x3b, 0xc4, 0x15, - 0xd7, 0xb3, 0xf8, 0xd9, 0xa0, 0xf6, 0x6f, 0xc6, 0x79, 0x74, 0xcf, 0xb3, 0xbe, 0x8f, 0x68, 0xf8, - 0x67, 0x20, 0x1f, 0xdd, 0x0d, 0xdb, 0xef, 0x02, 0x00, 0x00, 0xff, 0xff, 0xdd, 0x35, 0x98, 0xfc, - 0x4c, 0x08, 0x00, 0x00, + // 919 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x6f, 0xdc, 0x44, + 0x14, 0x8e, 0x93, 0x6d, 0x36, 0x79, 0x69, 0x36, 0x8a, 0xb5, 0xb4, 0xbb, 0x56, 0xe5, 0x4d, 0x17, + 0x09, 0xa2, 0x56, 0xb1, 0xbb, 0x29, 0x02, 0xa9, 0x45, 0x48, 0xdd, 0x50, 0xd1, 0x4a, 0xac, 0xa8, + 0x5c, 0x28, 0x12, 0x42, 0x8a, 0x66, 0xd7, 0xc3, 0xc4, 0x22, 0xf6, 0x58, 0x3b, 0xb3, 0xab, 0xec, + 0x0d, 0x38, 0x72, 0x40, 0xfd, 0x29, 0x3d, 0xf4, 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f7, 0x33, 0xa8, 0xa6, 0x5b, 0xa3, 0x59, 0xa4, 0xa8, 0x94, 0x75, 0xfd, 0xd4, 0x54, 0x56, 0xe0, + 0xcc, 0x98, 0x96, 0x08, 0xcc, 0xe6, 0xcb, 0x04, 0x96, 0x8d, 0x55, 0xd2, 0xfd, 0xdc, 0x48, 0x95, + 0x74, 0x7f, 0x16, 0x51, 0xd6, 0xfd, 0xf2, 0x49, 0xb0, 0x2e, 0xfd, 0xf0, 0xe6, 0xd9, 0x0d, 0xa3, + 0x7b, 0xff, 0xc5, 0xb1, 0x6d, 0xbc, 0x3c, 0xb6, 0x8d, 0xbf, 0x8f, 0x6d, 0xe3, 0xe9, 0x89, 0xbd, + 0xf0, 0xf2, 0xc4, 0x5e, 0x78, 0x75, 0x62, 0x2f, 0x7c, 0x73, 0x93, 0x04, 0xfc, 0x60, 0xd4, 0x77, + 0x06, 0x34, 0x54, 0x9f, 0x5b, 0xea, 0x67, 0x87, 0xf9, 0xdf, 0xbb, 0x47, 0xe2, 0xbb, 0x8d, 0x4f, + 0x62, 0xcc, 0x92, 0x8f, 0xbb, 0x65, 0x31, 0x06, 0xb7, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x67, + 0x6e, 0x02, 0x81, 0x1c, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1672,7 +1680,7 @@ func (m *MsgCancelProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro i-- dAtA[i] = 0x18 } - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CanceledTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CanceledTime):]) + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CanceledTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CanceledTime):]) if err3 != nil { return 0, err3 } @@ -1913,7 +1921,7 @@ func (m *MsgCancelProposalResponse) Size() (n int) { if m.ProposalId != 0 { n += 1 + sovTx(uint64(m.ProposalId)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CanceledTime) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CanceledTime) n += 1 + l + sovTx(uint64(l)) if m.CanceledHeight != 0 { n += 1 + sovTx(uint64(m.CanceledHeight)) @@ -3293,7 +3301,7 @@ func (m *MsgCancelProposalResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CanceledTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.CanceledTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From fb7ccdd56fa273e1d5d029f69daf921493c3af4c Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Sat, 1 Oct 2022 22:07:07 +0530 Subject: [PATCH 18/69] refactor: add `burn rate` of deposits for cancel proposal 1. (deposits * burn_rate) amount will be burned 2. (deposits * (1-burn_rate)) amount will move to the community pool --- .../distribution/v1beta1/query_grpc.pb.go | 4 +- api/cosmos/gov/v1/gov.pulsar.go | 149 ++++++++++--- api/cosmos/group/v1/types.pulsar.go | 16 +- client/grpc/tmservice/query.pb.go | 2 +- proto/cosmos/gov/v1/gov.proto | 3 + store/types/commit_info.pb.go | 2 +- x/distribution/types/genesis.pb.go | 4 +- x/distribution/types/query.pb.go | 8 +- x/gov/abci.go | 8 +- x/gov/client/testutil/query.go | 3 +- x/gov/client/testutil/tx.go | 11 +- x/gov/keeper/deposit.go | 69 +++--- x/gov/migrations/v4/json.go | 1 + x/gov/migrations/v4/json_test.go | 1 + x/gov/migrations/v4/store.go | 1 + x/gov/simulation/genesis.go | 14 +- x/gov/types/v1/gov.pb.go | 209 +++++++++++------- x/gov/types/v1/params.go | 27 ++- x/gov/types/v1beta1/genesis.pb.go | 6 +- x/group/types.pb.go | 2 +- 20 files changed, 352 insertions(+), 188 deletions(-) diff --git a/api/cosmos/distribution/v1beta1/query_grpc.pb.go b/api/cosmos/distribution/v1beta1/query_grpc.pb.go index f360bf19213..edff38fb877 100644 --- a/api/cosmos/distribution/v1beta1/query_grpc.pb.go +++ b/api/cosmos/distribution/v1beta1/query_grpc.pb.go @@ -24,7 +24,7 @@ const _ = grpc.SupportPackageIsVersion7 type QueryClient interface { // Params queries params of the distribution module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // ValidatorDistributionInfo queries validator commision and self-delegation rewards for validator + // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator ValidatorDistributionInfo(ctx context.Context, in *QueryValidatorDistributionInfoRequest, opts ...grpc.CallOption) (*QueryValidatorDistributionInfoResponse, error) // ValidatorOutstandingRewards queries rewards of a validator address. ValidatorOutstandingRewards(ctx context.Context, in *QueryValidatorOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryValidatorOutstandingRewardsResponse, error) @@ -149,7 +149,7 @@ func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolR type QueryServer interface { // Params queries params of the distribution module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // ValidatorDistributionInfo queries validator commision and self-delegation rewards for validator + // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator ValidatorDistributionInfo(context.Context, *QueryValidatorDistributionInfoRequest) (*QueryValidatorDistributionInfoResponse, error) // ValidatorOutstandingRewards queries rewards of a validator address. ValidatorOutstandingRewards(context.Context, *QueryValidatorOutstandingRewardsRequest) (*QueryValidatorOutstandingRewardsResponse, error) diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index b54f570b69d..d31d23a31cb 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -5241,6 +5241,7 @@ var ( fd_Params_threshold protoreflect.FieldDescriptor fd_Params_veto_threshold protoreflect.FieldDescriptor fd_Params_min_initial_deposit_ratio protoreflect.FieldDescriptor + fd_Params_proposal_cancel_burn_rate protoreflect.FieldDescriptor ) func init() { @@ -5253,6 +5254,7 @@ func init() { fd_Params_threshold = md_Params.Fields().ByName("threshold") fd_Params_veto_threshold = md_Params.Fields().ByName("veto_threshold") fd_Params_min_initial_deposit_ratio = md_Params.Fields().ByName("min_initial_deposit_ratio") + fd_Params_proposal_cancel_burn_rate = md_Params.Fields().ByName("proposal_cancel_burn_rate") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -5362,6 +5364,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.ProposalCancelBurnRate != "" { + value := protoreflect.ValueOfString(x.ProposalCancelBurnRate) + if !f(fd_Params_proposal_cancel_burn_rate, value) { + return + } + } } // Has reports whether a field is populated. @@ -5391,6 +5399,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.VetoThreshold != "" case "cosmos.gov.v1.Params.min_initial_deposit_ratio": return x.MinInitialDepositRatio != "" + case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": + return x.ProposalCancelBurnRate != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5421,6 +5431,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.VetoThreshold = "" case "cosmos.gov.v1.Params.min_initial_deposit_ratio": x.MinInitialDepositRatio = "" + case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": + x.ProposalCancelBurnRate = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5461,6 +5473,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.gov.v1.Params.min_initial_deposit_ratio": value := x.MinInitialDepositRatio return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": + value := x.ProposalCancelBurnRate + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5497,6 +5512,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.VetoThreshold = value.Interface().(string) case "cosmos.gov.v1.Params.min_initial_deposit_ratio": x.MinInitialDepositRatio = value.Interface().(string) + case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": + x.ProposalCancelBurnRate = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5541,6 +5558,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field veto_threshold of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.min_initial_deposit_ratio": panic(fmt.Errorf("field min_initial_deposit_ratio of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": + panic(fmt.Errorf("field proposal_cancel_burn_rate of message cosmos.gov.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5571,6 +5590,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "cosmos.gov.v1.Params.min_initial_deposit_ratio": return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5670,6 +5691,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.ProposalCancelBurnRate) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -5699,6 +5724,13 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.ProposalCancelBurnRate) > 0 { + i -= len(x.ProposalCancelBurnRate) + copy(dAtA[i:], x.ProposalCancelBurnRate) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposalCancelBurnRate))) + i-- + dAtA[i] = 0x42 + } if len(x.MinInitialDepositRatio) > 0 { i -= len(x.MinInitialDepositRatio) copy(dAtA[i:], x.MinInitialDepositRatio) @@ -6054,6 +6086,38 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.MinInitialDepositRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelBurnRate", 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.ProposalCancelBurnRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -6746,6 +6810,8 @@ type Params struct { VetoThreshold string `protobuf:"bytes,6,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` // The ratio representing the proportion of the deposit value that must be paid at proposal submission. MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` + // The burn rate of deposits when cancel the proposal + ProposalCancelBurnRate string `protobuf:"bytes,8,opt,name=proposal_cancel_burn_rate,json=proposalCancelBurnRate,proto3" json:"proposal_cancel_burn_rate,omitempty"` } func (x *Params) Reset() { @@ -6817,6 +6883,13 @@ func (x *Params) GetMinInitialDepositRatio() string { return "" } +func (x *Params) GetProposalCancelBurnRate() string { + if x != nil { + return x.ProposalCancelBurnRate + } + return "" +} + var File_cosmos_gov_v1_gov_proto protoreflect.FileDescriptor var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ @@ -6949,7 +7022,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x09, 0x42, 0x2a, 0xea, 0xde, 0x1f, 0x18, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 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, 0x22, 0xb7, 0x03, 0x0a, + 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0x82, 0x04, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 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, @@ -6977,41 +7050,45 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 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, 0xec, 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, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x45, 0x44, 0x10, - 0x06, 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, + 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x49, 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x72, + 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x61, 0x74, + 0x65, 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, 0xec, 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, 0x12, 0x1c, + 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x45, 0x44, 0x10, 0x06, 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/api/cosmos/group/v1/types.pulsar.go b/api/cosmos/group/v1/types.pulsar.go index a33c437d9c4..ed118238896 100644 --- a/api/cosmos/group/v1/types.pulsar.go +++ b/api/cosmos/group/v1/types.pulsar.go @@ -7533,10 +7533,10 @@ func (x *MemberRequest) GetMetadata() string { // ThresholdDecisionPolicy is a decision policy where a proposal passes when it // satisfies the two following conditions: -// 1. The sum of all `YES` voters' weights is greater or equal than the defined -// `threshold`. -// 2. The voting and execution periods of the proposal respect the parameters -// given by `windows`. +// 1. The sum of all `YES` voters' weights is greater or equal than the defined +// `threshold`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. type ThresholdDecisionPolicy struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -7585,10 +7585,10 @@ func (x *ThresholdDecisionPolicy) GetWindows() *DecisionPolicyWindows { // PercentageDecisionPolicy is a decision policy where a proposal passes when // it satisfies the two following conditions: -// 1. The percentage of all `YES` voters' weights out of the total group weight -// is greater or equal than the given `percentage`. -// 2. The voting and execution periods of the proposal respect the parameters -// given by `windows`. +// 1. The percentage of all `YES` voters' weights out of the total group weight +// is greater or equal than the given `percentage`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. type PercentageDecisionPolicy struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/client/grpc/tmservice/query.pb.go b/client/grpc/tmservice/query.pb.go index 91a57bd07e2..e177d553f4c 100644 --- a/client/grpc/tmservice/query.pb.go +++ b/client/grpc/tmservice/query.pb.go @@ -1055,7 +1055,7 @@ func (m *ABCIQueryResponse) GetCodespace() string { } // ProofOp defines an operation used for calculating Merkle root. The data could -// be arbitrary format, providing nessecary data for example neighbouring node +// be arbitrary format, providing necessary data for example neighbouring node // hash. // // Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index d127d7ab24e..4eafcdc6f7a 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -164,4 +164,7 @@ message Params { // The ratio representing the proportion of the deposit value that must be paid at proposal submission. string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // The burn rate of deposits when cancel the proposal + string proposal_cancel_burn_rate = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; } diff --git a/store/types/commit_info.pb.go b/store/types/commit_info.pb.go index d18987954ef..eb91c1a87a1 100644 --- a/store/types/commit_info.pb.go +++ b/store/types/commit_info.pb.go @@ -131,7 +131,7 @@ func (m *StoreInfo) GetCommitId() CommitID { return CommitID{} } -// CommitID defines the committment information when a specific store is +// CommitID defines the commitment information when a specific store is // committed. type CommitID struct { Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` diff --git a/x/distribution/types/genesis.pb.go b/x/distribution/types/genesis.pb.go index 49955de6d0f..a37c3c6b0c9 100644 --- a/x/distribution/types/genesis.pb.go +++ b/x/distribution/types/genesis.pb.go @@ -73,7 +73,7 @@ var xxx_messageInfo_DelegatorWithdrawInfo proto.InternalMessageInfo type ValidatorOutstandingRewardsRecord struct { // validator_address is the address of the validator. ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - // outstanding_rewards represents the oustanding rewards of a validator. + // outstanding_rewards represents the outstanding rewards of a validator. OutstandingRewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=outstanding_rewards,json=outstandingRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"outstanding_rewards"` } @@ -284,7 +284,7 @@ var xxx_messageInfo_DelegatorStartingInfoRecord proto.InternalMessageInfo type ValidatorSlashEventRecord struct { // validator_address is the address of the validator. ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - // height defines the block height at which the slash event occured. + // height defines the block height at which the slash event occurred. Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // period is the period of the slash event. Period uint64 `protobuf:"varint,3,opt,name=period,proto3" json:"period,omitempty"` diff --git a/x/distribution/types/query.pb.go b/x/distribution/types/query.pb.go index b0e010abffd..ffa6250b5e1 100644 --- a/x/distribution/types/query.pb.go +++ b/x/distribution/types/query.pb.go @@ -168,7 +168,7 @@ type QueryValidatorDistributionInfoResponse struct { OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` // self_bond_rewards defines the self delegations rewards. SelfBondRewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=self_bond_rewards,json=selfBondRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"self_bond_rewards"` - // commission defines the commision the validator received. + // commission defines the commission the validator received. Commission github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,3,rep,name=commission,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"commission"` } @@ -375,7 +375,7 @@ func (m *QueryValidatorCommissionRequest) GetValidatorAddress() string { // QueryValidatorCommissionResponse is the response type for the // Query/ValidatorCommission RPC method type QueryValidatorCommissionResponse struct { - // commission defines the commision the validator received. + // commission defines the commission the validator received. Commission ValidatorAccumulatedCommission `protobuf:"bytes,1,opt,name=commission,proto3" json:"commission"` } @@ -1073,7 +1073,7 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Params queries params of the distribution module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // ValidatorDistributionInfo queries validator commision and self-delegation rewards for validator + // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator ValidatorDistributionInfo(ctx context.Context, in *QueryValidatorDistributionInfoRequest, opts ...grpc.CallOption) (*QueryValidatorDistributionInfoResponse, error) // ValidatorOutstandingRewards queries rewards of a validator address. ValidatorOutstandingRewards(ctx context.Context, in *QueryValidatorOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryValidatorOutstandingRewardsResponse, error) @@ -1196,7 +1196,7 @@ func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolR type QueryServer interface { // Params queries params of the distribution module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // ValidatorDistributionInfo queries validator commision and self-delegation rewards for validator + // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator ValidatorDistributionInfo(context.Context, *QueryValidatorDistributionInfoRequest) (*QueryValidatorDistributionInfoResponse, error) // ValidatorOutstandingRewards queries rewards of a validator address. ValidatorOutstandingRewards(context.Context, *QueryValidatorOutstandingRewardsRequest) (*QueryValidatorOutstandingRewardsResponse, error) diff --git a/x/gov/abci.go b/x/gov/abci.go index 551a5d26f65..483508d830b 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -18,12 +18,10 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { logger := keeper.Logger(ctx) // delete the canceled proposals from store. - // move the min initial deposit of the proposal to community-pool and refund remaining deposits. keeper.IterateCanceledProposalQueue(ctx, func(proposal v1.Proposal) (stop bool) { - // send min proposal deposit amount to the community-pool from proposer deposit. - keeper.SendProposalMinDepositToCommunityPool(ctx, proposal.Id, proposal.Proposer) - // refund deposits of proposal to depositors. - keeper.RefundAndDeleteDeposits(ctx, proposal.Id) + // burn the (deposits * proposal_cancel_burn_rate) amount. + // and deposits * (1 - proposal_cancel_burn_rate) will be move to community pool. + keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id) // delete the proposal. keeper.DeleteProposal(ctx, proposal.Id) return false diff --git a/x/gov/client/testutil/query.go b/x/gov/client/testutil/query.go index a9f8888f925..3204f71c95c 100644 --- a/x/gov/client/testutil/query.go +++ b/x/gov/client/testutil/query.go @@ -24,7 +24,7 @@ func (s *IntegrationTestSuite) TestCmdParams() { { "json output", []string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, - `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000"}}`, + `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_burn_rate":"0.000000000000000000"}}`, }, { "text output", @@ -41,6 +41,7 @@ params: - amount: "10000000" denom: stake min_initial_deposit_ratio: "0.000000000000000000" + proposal_cancel_burn_rate: "0.000000000000000000" quorum: "0.334000000000000000" threshold: "0.500000000000000000" veto_threshold: "0.334000000000000000" diff --git a/x/gov/client/testutil/tx.go b/x/gov/client/testutil/tx.go index 4e63de20a5a..dcf2751141a 100644 --- a/x/gov/client/testutil/tx.go +++ b/x/gov/client/testutil/tx.go @@ -71,8 +71,7 @@ func (s *IntegrationTestSuite) SetupSuite() { "Text Proposal 4", "Where is the title!?", v1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens).String())) s.Require().NoError(err) - _, err = s.network.WaitForHeight(1) - s.Require().NoError(err) + s.Require().NoError(s.network.WaitForNextBlock()) // vote for proposal3 as val _, err = MsgVote(val.ClientCtx, val.Address.String(), "3", "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05") @@ -274,7 +273,7 @@ func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, true, 0, @@ -285,7 +284,7 @@ func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { "asdasd", fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, true, 0, @@ -296,7 +295,7 @@ func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { "4", fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, false, 0, @@ -307,7 +306,7 @@ func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { "4", fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, false, 17, diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 1bf0498518c..d27c902a0f6 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -162,51 +162,44 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd return activatedVotingPeriod, nil } -// SendProposalMinDepositToCommunityPool sends the min deposits of the proposal to community pool -// from proposer deposits and updates the deposit store with updated deposit amount. -func (keeper Keeper) SendProposalMinDepositToCommunityPool(ctx sdk.Context, proposalID uint64, proAddr string) error { - proposerAddr := sdk.MustAccAddressFromBech32(proAddr) - - deposit, found := keeper.GetDeposit(ctx, proposalID, proposerAddr) - if !found { - return sdkerrors.Wrapf(types.ErrNoDeposits, "proposer %s doesn't deposited to proposal %d", proAddr, proposalID) - } +// BurnAndSendDepositsToCommunityPool will burn the (deposits * prposal_cancel_burn_rate) amount of proposal deposits +// and send remaining deposits of the proposal to community pool. +func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64) error { + store := ctx.KVStore(keeper.storeKey) - minDepositeAmount, err := keeper.GetProposalMinDeposit(ctx) - if err != nil { - return err - } + proposalCancelBurnRate := keeper.GetParams(ctx).ProposalCancelBurnRate - // send minDepositeAmount to community pool from proposal deposits (gov module) - err = keeper.dk.FundCommunityPool(ctx, minDepositeAmount, keeper.authKeeper.GetModuleAddress(types.ModuleName)) - if err != nil { - return err - } + keeper.IterateDeposits(ctx, proposalID, func(deposit v1.Deposit) bool { + depositor := sdk.MustAccAddressFromBech32(deposit.Depositor) - deposit.Amount = sdk.NewCoins(deposit.Amount...).Sub(minDepositeAmount...) - // reset the deposit to store with updated amount - keeper.SetDeposit(ctx, deposit) - return nil -} + // burn the deposits * proposal_cancel_burn_rate amount from proposal deposits (gov module) + burnRate := sdk.MustNewDecFromStr(proposalCancelBurnRate) + var burnDepositAmount sdk.Coins + for i := range deposit.Amount { + burnAmount := sdk.NewCoin( + deposit.Amount[i].Denom, + sdk.NewDecFromInt(deposit.Amount[i].Amount).Mul(burnRate).RoundInt(), + ) + burnDepositAmount = append(burnDepositAmount, burnAmount) + } -// GetProposalMinDeposit returns minimum deposit amount required for creating the proposal. -func (keeper Keeper) GetProposalMinDeposit(ctx sdk.Context) ([]sdk.Coin, error) { - params := keeper.GetParams(ctx) + err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, burnDepositAmount) + if err != nil { + panic(err) + } - minInitialDepositRatio, err := sdk.NewDecFromStr(params.MinInitialDepositRatio) - if err != nil { - return nil, err - } - if minInitialDepositRatio.IsZero() { - return nil, nil - } + // send (deposits - burnAmount) to community pool from proposal deposits (gov module) + communityPoolAmount := sdk.NewCoins(deposit.Amount...).Sub(burnDepositAmount...) + err = keeper.dk.FundCommunityPool(ctx, communityPoolAmount, keeper.authKeeper.GetModuleAddress(types.ModuleName)) + if err != nil { + panic(err) + } - minDepositCoins := params.MinDeposit - for i := range minDepositCoins { - minDepositCoins[i].Amount = sdk.NewDecFromInt(minDepositCoins[i].Amount).Mul(minInitialDepositRatio).RoundInt() - } + store.Delete(types.DepositKey(proposalID, depositor)) + return false + }) - return minDepositCoins, nil + return nil } // RefundAndDeleteDeposits refunds and deletes all the deposits on a specific proposal. diff --git a/x/gov/migrations/v4/json.go b/x/gov/migrations/v4/json.go index f633167aec3..0f37496ab5f 100644 --- a/x/gov/migrations/v4/json.go +++ b/x/gov/migrations/v4/json.go @@ -13,6 +13,7 @@ func MigrateJSON(oldState *v1.GenesisState) (*v1.GenesisState, error) { oldState.TallyParams.Threshold, oldState.TallyParams.VetoThreshold, v1.DefaultParams().MinInitialDepositRatio, + v1.DefaultParams().ProposalCancelBurnRate, ) return &v1.GenesisState{ diff --git a/x/gov/migrations/v4/json_test.go b/x/gov/migrations/v4/json_test.go index 0b58e63d760..851936eb174 100644 --- a/x/gov/migrations/v4/json_test.go +++ b/x/gov/migrations/v4/json_test.go @@ -48,6 +48,7 @@ func TestMigrateJSON(t *testing.T) { } ], "min_initial_deposit_ratio": "0.000000000000000000", + "proposal_cancel_burn_rate": "0.000000000000000000", "quorum": "0.334000000000000000", "threshold": "0.500000000000000000", "veto_threshold": "0.334000000000000000", diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go index e38686d38e5..2b082370275 100644 --- a/x/gov/migrations/v4/store.go +++ b/x/gov/migrations/v4/store.go @@ -29,6 +29,7 @@ func migrateParams(ctx sdk.Context, storeKey storetypes.StoreKey, legacySubspace tp.Threshold, tp.VetoThreshold, sdk.ZeroDec().String(), + sdk.ZeroDec().String(), ) bz, err := cdc.Marshal(¶ms) diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 20b4b244d5a..d03ea833294 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -25,6 +25,7 @@ const ( TallyParamsQuorum = "tally_params_quorum" TallyParamsThreshold = "tally_params_threshold" TallyParamsVeto = "tally_params_veto" + ProposalCancelBurnRate = "proposal_cancel_burn_rate" ) // GenDepositParamsDepositPeriod randomized DepositParamsDepositPeriod @@ -42,6 +43,11 @@ func GenDepositMinInitialDepositRatio(r *rand.Rand) sdk.Dec { return sdk.NewDec(int64(simulation.RandIntBetween(r, 0, 99))).Quo(sdk.NewDec(100)) } +// GenProposalCancelBurnRate randomized ProposalCancelBurnRate +func GenProposalCancelBurnRate(r *rand.Rand) sdk.Dec { + return sdk.NewDec(int64(simulation.RandIntBetween(r, 0, 99))).Quo(sdk.NewDec(100)) +} + // GenVotingParamsVotingPeriod randomized VotingParamsVotingPeriod func GenVotingParamsVotingPeriod(r *rand.Rand) time.Duration { return time.Duration(simulation.RandIntBetween(r, 1, 2*60*60*24*2)) * time.Second @@ -84,6 +90,12 @@ func RandomizedGenState(simState *module.SimulationState) { func(r *rand.Rand) { minInitialDepositRatio = GenDepositMinInitialDepositRatio(r) }, ) + var proposalCancelBurnRate sdk.Dec + simState.AppParams.GetOrGenerate( + simState.Cdc, ProposalCancelBurnRate, &proposalCancelBurnRate, simState.Rand, + func(r *rand.Rand) { proposalCancelBurnRate = GenProposalCancelBurnRate(r) }, + ) + var votingPeriod time.Duration simState.AppParams.GetOrGenerate( simState.Cdc, VotingParamsVotingPeriod, &votingPeriod, simState.Rand, @@ -110,7 +122,7 @@ func RandomizedGenState(simState *module.SimulationState) { govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String()), + v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelBurnRate.String()), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index cad533757fc..27fb4e967c5 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -699,6 +699,8 @@ type Params struct { VetoThreshold string `protobuf:"bytes,6,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` // The ratio representing the proportion of the deposit value that must be paid at proposal submission. MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` + // The burn rate of deposits when cancel the proposal + ProposalCancelBurnRate string `protobuf:"bytes,8,opt,name=proposal_cancel_burn_rate,json=proposalCancelBurnRate,proto3" json:"proposal_cancel_burn_rate,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -783,6 +785,13 @@ func (m *Params) GetMinInitialDepositRatio() string { return "" } +func (m *Params) GetProposalCancelBurnRate() string { + if m != nil { + return m.ProposalCancelBurnRate + } + return "" +} + func init() { proto.RegisterEnum("cosmos.gov.v1.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) @@ -800,84 +809,85 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1218 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x6e, 0xdb, 0xc6, - 0x13, 0x36, 0x25, 0x5a, 0x96, 0x47, 0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, 0x2e, 0x3a, 0xed, 0xb3, 0x8c, - 0xfb, 0x46, 0xc3, 0x36, 0x9a, 0x9a, 0x3a, 0x8f, 0x79, 0xb7, 0x6e, 0x3e, 0x30, 0x9a, 0xda, 0xe2, - 0x3c, 0x66, 0xa3, 0xbe, 0xd3, 0x30, 0x22, 0x6f, 0x6e, 0xdb, 0x78, 0xf9, 0xa6, 0xa4, 0xbc, 0x7a, - 0x53, 0x52, 0xfe, 0x7a, 0x53, 0x52, 0x9e, 0xbf, 0x2d, 0x2d, 0xbc, 0x7a, 0x5b, 0x5a, 0xf8, 0xfd, - 0x6d, 0x69, 0xe1, 0xdb, 0x6b, 0x5d, 0xc2, 0x0f, 0x06, 0x7b, 0xd5, 0x7d, 0xea, 0xcb, 0xeb, 0xaa, - 0x7c, 0xdc, 0x60, 0xde, 0x77, 0xb5, 0x67, 0xe2, 0x0a, 0xce, 0x47, 0x7d, 0xcc, 0xa2, 0xfb, 0x75, - 0x4e, 0x08, 0xf8, 0xd6, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x04, 0x1d, 0xdd, 0x43, 0xa0, 0x0b, - 0x00, 0x00, + // 1248 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0xdb, 0x46, + 0x17, 0x35, 0x25, 0x5a, 0x96, 0xaf, 0x6c, 0x85, 0xdf, 0x24, 0x5f, 0x42, 0x3b, 0x89, 0xe4, 0x08, + 0x6d, 0xe1, 0xe6, 0x47, 0xaa, 0x93, 0xa6, 0x05, 0x9a, 0x4d, 0xf5, 0xc3, 0x34, 0x0c, 0x52, 0x4b, + 0xa5, 0x18, 0x07, 0xe9, 0x86, 0xa0, 0xc4, 0x89, 0x4c, 0x54, 0xe4, 0xa8, 0xe4, 0x48, 0x89, 0xb6, + 0xdd, 0x15, 0xe8, 0x22, 0xcb, 0x02, 0x7d, 0x8d, 0xa0, 0xcf, 0x90, 0x65, 0x90, 0x4d, 0xdb, 0x8d, + 0xda, 0x26, 0x3b, 0xa3, 0x0f, 0x51, 0x70, 0x66, 0xa8, 0x1f, 0x5a, 0x81, 0xdd, 0xac, 0x48, 0xde, + 0x7b, 0xce, 0x99, 0x3b, 0x73, 0x0f, 0x67, 0x06, 0x2e, 0x74, 0x49, 0xe8, 0x91, 0xb0, 0xd2, 0x23, + 0xa3, 0xca, 0x68, 0x2f, 0x7a, 0x94, 0x07, 0x01, 0xa1, 0x04, 0x6d, 0xf2, 0x44, 0x39, 0x8a, 0x8c, + 0xf6, 0xb6, 0x0b, 0x02, 0xd7, 0xb1, 0x43, 0x5c, 0x19, 0xed, 0x75, 0x30, 0xb5, 0xf7, 0x2a, 0x5d, + 0xe2, 0xfa, 0x1c, 0xbe, 0x7d, 0xae, 0x47, 0x7a, 0x84, 0xbd, 0x56, 0xa2, 0x37, 0x11, 0x2d, 0xf6, + 0x08, 0xe9, 0xf5, 0x71, 0x85, 0x7d, 0x75, 0x86, 0x4f, 0x2a, 0xd4, 0xf5, 0x70, 0x48, 0x6d, 0x6f, + 0x20, 0x00, 0x5b, 0x49, 0x80, 0xed, 0x8f, 0x45, 0xaa, 0x90, 0x4c, 0x39, 0xc3, 0xc0, 0xa6, 0x2e, + 0x89, 0x47, 0xdc, 0xe2, 0x15, 0x59, 0x7c, 0x50, 0x51, 0x2d, 0xfb, 0x28, 0x11, 0x40, 0x8f, 0xb0, + 0xdb, 0x3b, 0xa4, 0xd8, 0x39, 0x20, 0x14, 0x37, 0x07, 0x11, 0x0d, 0xed, 0x41, 0x86, 0xb0, 0x37, + 0x55, 0xda, 0x91, 0x76, 0xf3, 0x37, 0xb7, 0xca, 0x0b, 0x53, 0x2c, 0xcf, 0xa0, 0x86, 0x00, 0xa2, + 0x8f, 0x20, 0xf3, 0x94, 0x09, 0xa9, 0xa9, 0x1d, 0x69, 0x77, 0xbd, 0x96, 0x7f, 0xfd, 0xe2, 0x06, + 0x08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xfb, 0x75, 0x2d, 0xca, 0x66, 0x6a, 0xda, 0xcb, 0x37, 0x05, 0xe9, 0xd5, 0x9b, 0x82, 0xf4, + 0xd7, 0x9b, 0x82, 0xf4, 0xfc, 0x6d, 0x61, 0xe5, 0xd5, 0xdb, 0xc2, 0xca, 0xef, 0x6f, 0x0b, 0x2b, + 0xdf, 0x5e, 0xeb, 0xb9, 0xf4, 0x70, 0xd8, 0x29, 0x77, 0x89, 0x27, 0x6e, 0xbe, 0xe2, 0x71, 0x23, + 0x74, 0xbe, 0xab, 0x3c, 0x63, 0xb7, 0x79, 0x3a, 0x1e, 0xe0, 0x30, 0xba, 0xaa, 0x67, 0xd8, 0xbf, + 0x70, 0xeb, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x18, 0x96, 0x40, 0xd3, 0xeb, 0x0b, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1342,6 +1352,13 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ProposalCancelBurnRate) > 0 { + i -= len(m.ProposalCancelBurnRate) + copy(dAtA[i:], m.ProposalCancelBurnRate) + i = encodeVarintGov(dAtA, i, uint64(len(m.ProposalCancelBurnRate))) + i-- + dAtA[i] = 0x42 + } if len(m.MinInitialDepositRatio) > 0 { i -= len(m.MinInitialDepositRatio) copy(dAtA[i:], m.MinInitialDepositRatio) @@ -1651,6 +1668,10 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } + l = len(m.ProposalCancelBurnRate) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -3256,6 +3277,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.MinInitialDepositRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelBurnRate", 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.ProposalCancelBurnRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 6722d49bded..a3ef765f95d 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -20,6 +20,7 @@ var ( DefaultThreshold = sdk.NewDecWithPrec(5, 1) DefaultVetoThreshold = sdk.NewDecWithPrec(334, 3) DefaultMinInitialDepositRatio = sdk.ZeroDec() + DefaultProposalCancelBurnRate = sdk.ZeroDec() ) // Deprecated: NewDepositParams creates a new DepositParams object @@ -48,7 +49,7 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { func NewParams( minDeposit sdk.Coins, maxDepositPeriod time.Duration, votingPeriod time.Duration, - quorum string, threshold string, vetoThreshold string, minInitialDepositRatio string, + quorum, threshold, vetoThreshold, minInitialDepositRatio, proposalCancelBurnRate string, ) Params { return Params{ MinDeposit: minDeposit, @@ -58,6 +59,7 @@ func NewParams( Threshold: threshold, VetoThreshold: vetoThreshold, MinInitialDepositRatio: minInitialDepositRatio, + ProposalCancelBurnRate: proposalCancelBurnRate, } } @@ -71,6 +73,7 @@ func DefaultParams() Params { DefaultThreshold.String(), DefaultVetoThreshold.String(), DefaultMinInitialDepositRatio.String(), + DefaultProposalCancelBurnRate.String(), ) } @@ -128,5 +131,27 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("voting period must be positive: %s", p.VotingPeriod) } + minInitialDepositRatio, err := sdk.NewDecFromStr(p.MinInitialDepositRatio) + if err != nil { + return fmt.Errorf("invalid mininum initial deposit ratio of proposal: %w", err) + } + if minInitialDepositRatio.IsNegative() { + return fmt.Errorf("mininum initial deposit ratio of proposal must be positive: %s", minInitialDepositRatio) + } + if minInitialDepositRatio.GT(math.LegacyOneDec()) { + return fmt.Errorf("mininum initial deposit ratio of proposal is too large: %s", minInitialDepositRatio) + } + + proposalCancelBurnRate, err := sdk.NewDecFromStr(p.ProposalCancelBurnRate) + if err != nil { + return fmt.Errorf("invalid burn rate of cancel proposal: %w", err) + } + if proposalCancelBurnRate.IsNegative() { + return fmt.Errorf("burn rate of cancel proposal must be positive: %s", proposalCancelBurnRate) + } + if proposalCancelBurnRate.GT(math.LegacyOneDec()) { + return fmt.Errorf("burn rate of cancel proposal is too large: %s", proposalCancelBurnRate) + } + return nil } diff --git a/x/gov/types/v1beta1/genesis.pb.go b/x/gov/types/v1beta1/genesis.pb.go index 804b3a8ce04..da127cbabf3 100644 --- a/x/gov/types/v1beta1/genesis.pb.go +++ b/x/gov/types/v1beta1/genesis.pb.go @@ -33,11 +33,11 @@ type GenesisState struct { Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"` // proposals defines all the proposals present at genesis. Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` - // params defines all the paramaters of related to deposit. + // params defines all the parameters of related to deposit. DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` - // params defines all the paramaters of related to voting. + // params defines all the parameters of related to voting. VotingParams VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` - // params defines all the paramaters of related to tally. + // params defines all the parameters of related to tally. TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` } diff --git a/x/group/types.pb.go b/x/group/types.pb.go index 7cbc0857009..83436ac8e8e 100644 --- a/x/group/types.pb.go +++ b/x/group/types.pb.go @@ -715,7 +715,7 @@ type Proposal struct { // whichever happens first. FinalTallyResult TallyResult `protobuf:"bytes,9,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result"` // voting_period_end is the timestamp before which voting must be done. - // Unless a successfull MsgExec is called before (to execute a proposal whose + // Unless a successful MsgExec is called before (to execute a proposal whose // tally is successful before the voting period ends), tallying will be done // at this point, and the `final_tally_result`and `status` fields will be // accordingly updated. From 845bc11efae9ddb045b0173a70bc7265f0203ed7 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 3 Oct 2022 13:05:41 +0530 Subject: [PATCH 19/69] test: fix the test on cancel gov proposal --- x/gov/client/testutil/query.go | 2 +- x/gov/client/testutil/tx.go | 34 +++++++++++++++++++++------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/x/gov/client/testutil/query.go b/x/gov/client/testutil/query.go index 3204f71c95c..88cf318fd07 100644 --- a/x/gov/client/testutil/query.go +++ b/x/gov/client/testutil/query.go @@ -308,7 +308,7 @@ func (s *IntegrationTestSuite) TestCmdGetProposals() { var proposals v1.QueryProposalsResponse s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposals), out.String()) - s.Require().Len(proposals.Proposals, 4) + s.Require().Greater(len(proposals.Proposals), 0) } }) } diff --git a/x/gov/client/testutil/tx.go b/x/gov/client/testutil/tx.go index dcf2751141a..65b62ff7129 100644 --- a/x/gov/client/testutil/tx.go +++ b/x/gov/client/testutil/tx.go @@ -40,43 +40,51 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(s.network.WaitForNextBlock()) val := s.network.Validators[0] + clientCtx := val.ClientCtx + var resp sdk.TxResponse // create a proposal with deposit - _, err = MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), + out, err := MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), "Text Proposal 1", "Where is the title!?", v1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens).String())) s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) + s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) // vote for proposal - _, err = MsgVote(val.ClientCtx, val.Address.String(), "1", "yes") + out, err = MsgVote(val.ClientCtx, val.Address.String(), "1", "yes") s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) + s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) // create a proposal without deposit - _, err = MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), + out, err = MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), "Text Proposal 2", "Where is the title!?", v1beta1.ProposalTypeText) s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) + s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) // create a proposal3 with deposit - _, err = MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), + out, err = MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), "Text Proposal 3", "Where is the title!?", v1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens).String())) s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) + s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) // create a proposal4 with deposit for check the cancel proposal cli tx - _, err = MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), + out, err = MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), "Text Proposal 4", "Where is the title!?", v1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens).String())) s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) + s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) // vote for proposal3 as val - _, err = MsgVote(val.ClientCtx, val.Address.String(), "3", "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05") + out, err = MsgVote(val.ClientCtx, val.Address.String(), "3", "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05") s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) + s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) } func (s *IntegrationTestSuite) TearDownSuite() { @@ -327,7 +335,7 @@ func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { s.Require().NoError(err) s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) - s.Require().Equal(tc.expectedCode, resp.Code, out.String()) + s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, tc.expectedCode)) } }) } From c0b215f18b82d0ac5051729d50b9d6ad0ba299ec Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Sun, 16 Oct 2022 21:27:42 +0530 Subject: [PATCH 20/69] fix: fix the burn the deposits of proposal --- x/gov/abci.go | 2 +- x/gov/abci_test.go | 21 +++++++++++++------ x/gov/keeper/deposit.go | 46 ++++++++++++++++++++--------------------- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/x/gov/abci.go b/x/gov/abci.go index 483508d830b..e9d8fe7fd5c 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -21,7 +21,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { keeper.IterateCanceledProposalQueue(ctx, func(proposal v1.Proposal) (stop bool) { // burn the (deposits * proposal_cancel_burn_rate) amount. // and deposits * (1 - proposal_cancel_burn_rate) will be move to community pool. - keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id) + keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id, proposal.TotalDeposit) // delete the proposal. keeper.DeleteProposal(ctx, proposal.Id) return false diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index efbe4bbe462..23033caa21a 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -391,9 +391,20 @@ func TestProposalCanceledEndblocker(t *testing.T) { err = suite.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1.NewNonSplitVoteOption(v1.OptionYes), "") require.NoError(t, err) - minDepositsForProposal, err := suite.GovKeeper.GetProposalMinDeposit(ctx) - minDepositsForProposalInDec := sdk.NewDecCoinsFromCoins(minDepositsForProposal...) - require.NoError(t, err) + params := suite.GovKeeper.GetParams(ctx) + cancelProposalBurnRate := params.ProposalCancelBurnRate + burnRate := sdk.MustNewDecFromStr(cancelProposalBurnRate) + + var burnDepositAmount sdk.Coins + for _, deposit := range deposits { + burnAmount := sdk.NewCoin( + deposit.Denom, + sdk.NewDecFromInt(deposit.Amount).Mul(burnRate).RoundInt(), + ) + burnDepositAmount = append(burnDepositAmount, burnAmount) + } + + communityFund := deposits.Sub(burnDepositAmount...) // get the community pool funds beforeCommunityFund := suite.DistributionKeeper.GetFeePoolCommunityCoins(ctx) @@ -410,10 +421,8 @@ func TestProposalCanceledEndblocker(t *testing.T) { macc = suite.GovKeeper.GetGovernanceAccount(ctx) require.NotNil(t, macc) - require.Equal(t, beforeCommunityFund.Add(minDepositsForProposalInDec...), afterCommunityFund) + require.Equal(t, beforeCommunityFund.Add(sdk.NewDecCoinsFromCoins(communityFund...)...), afterCommunityFund) require.True(t, suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()).IsEqual(initialModuleAccCoins)) - require.True(t, suite.BankKeeper.GetAllBalances(ctx, proposer).IsEqual(intitalProposerBalance.Sub(minDepositsForProposal...))) - require.True(t, suite.BankKeeper.GetAllBalances(ctx, depositer).IsEqual(depositerBalance)) } func TestEndBlockerProposalHandlerFailed(t *testing.T) { diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index d27c902a0f6..bc11cd308b4 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -164,40 +164,38 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd // BurnAndSendDepositsToCommunityPool will burn the (deposits * prposal_cancel_burn_rate) amount of proposal deposits // and send remaining deposits of the proposal to community pool. -func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64) error { +func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64, totalDeposits []sdk.Coin) error { store := ctx.KVStore(keeper.storeKey) proposalCancelBurnRate := keeper.GetParams(ctx).ProposalCancelBurnRate + // burn the deposits * proposal_cancel_burn_rate amount from proposal deposits (gov module) + burnRate := sdk.MustNewDecFromStr(proposalCancelBurnRate) + + var burnDepositAmount sdk.Coins + for _, deposit := range totalDeposits { + burnAmount := sdk.NewCoin( + deposit.Denom, + sdk.NewDecFromInt(deposit.Amount).Mul(burnRate).RoundInt(), + ) + burnDepositAmount = append(burnDepositAmount, burnAmount) + } - keeper.IterateDeposits(ctx, proposalID, func(deposit v1.Deposit) bool { - depositor := sdk.MustAccAddressFromBech32(deposit.Depositor) - - // burn the deposits * proposal_cancel_burn_rate amount from proposal deposits (gov module) - burnRate := sdk.MustNewDecFromStr(proposalCancelBurnRate) - var burnDepositAmount sdk.Coins - for i := range deposit.Amount { - burnAmount := sdk.NewCoin( - deposit.Amount[i].Denom, - sdk.NewDecFromInt(deposit.Amount[i].Amount).Mul(burnRate).RoundInt(), - ) - burnDepositAmount = append(burnDepositAmount, burnAmount) - } - + // burn the deposits + if !burnRate.IsZero() { err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, burnDepositAmount) if err != nil { panic(err) } + } - // send (deposits - burnAmount) to community pool from proposal deposits (gov module) - communityPoolAmount := sdk.NewCoins(deposit.Amount...).Sub(burnDepositAmount...) - err = keeper.dk.FundCommunityPool(ctx, communityPoolAmount, keeper.authKeeper.GetModuleAddress(types.ModuleName)) - if err != nil { - panic(err) - } + // send (deposits - burnAmount) to community pool from proposal deposits (gov module) + communityPoolAmount := sdk.NewCoins(totalDeposits...).Sub(burnDepositAmount...) + err := keeper.dk.FundCommunityPool(ctx, communityPoolAmount, keeper.authKeeper.GetModuleAddress(types.ModuleName)) + if err != nil { + panic(err) + } - store.Delete(types.DepositKey(proposalID, depositor)) - return false - }) + store.Delete(types.DepositsKey(proposalID)) return nil } From 81f3c4c4aaf018a434140260792116532a98ad4d Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Sun, 16 Oct 2022 22:08:03 +0530 Subject: [PATCH 21/69] fix: fix the bank tests --- x/bank/app_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/x/bank/app_test.go b/x/bank/app_test.go index fc4a3a6d674..d23422a8027 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -22,6 +22,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/cosmos-sdk/x/consensus" + _ "github.com/cosmos/cosmos-sdk/x/distribution" + dk "github.com/cosmos/cosmos-sdk/x/distribution/keeper" _ "github.com/cosmos/cosmos-sdk/x/gov" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" _ "github.com/cosmos/cosmos-sdk/x/params" @@ -89,9 +91,10 @@ var ( ) type suite struct { - BankKeeper bankkeeper.Keeper - AccountKeeper types.AccountKeeper - App *runtime.App + BankKeeper bankkeeper.Keeper + AccountKeeper types.AccountKeeper + DistributionKeeper dk.Keeper + App *runtime.App } func createTestSuite(t *testing.T, genesisAccounts []authtypes.GenesisAccount) suite { @@ -113,8 +116,9 @@ func createTestSuite(t *testing.T, genesisAccounts []authtypes.GenesisAccount) s configurator.ConsensusModule(), configurator.BankModule(), configurator.GovModule(), + configurator.DistributionModule(), ), - startupCfg, &res.BankKeeper, &res.AccountKeeper) + startupCfg, &res.BankKeeper, &res.AccountKeeper, &res.DistributionKeeper) res.App = app From ee0785bd4a940857e6e2398fafab44c0da2aa9a9 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 17 Oct 2022 20:34:38 +0530 Subject: [PATCH 22/69] docs: update the UPGRADING.md --- UPGRADING.md | 34 ++++++++++++++++++++++++++++++++++ x/gov/README.md | 29 +++++++++++++++++++++++++++-- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index b8043b81271..97a15d11a14 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -94,6 +94,40 @@ By default, the new `MinInitialDepositRatio` parameter is set to zero during mig feature is disabled. If chains wish to utilize the minimum proposal deposits at time of submission, the migration logic needs to be modified to set the new parameter to the desired value. +##### Proposer field to Proposal +The `Proposal` state has been updated with proposer field. For proposal state migraton +developers should ensure to call `v4.AddProposerAddressToProposal` in their upgrade handler. + +```go +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +func (app SimApp) RegisterUpgradeHandlers() { + app.UpgradeKeeper.SetUpgradeHandler(UpgradeName, + func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // add proposal ids with proposers + proposals := make(map[uint64]string) + // proposals[1] = "cosmos1luyncewxk4lm24k6gqy8y5dxkj0klr4tu0lmnj" ... + v4.AddProposerAddressToProposal(ctx, sdk.NewKVStoreKey(v4.ModuleName), app.appCodec, proposals) + return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) + }) +} + +``` +##### Proposal Cancel Burn Rate param +The `gov` module has been updated to support the cancel the goverance proposal. When proposal is cancel all the deposits of proposal either burned or send to community pool. the deposits burn rate will be determinted by a new parameter called `ProposalCancelBurnRate` parameter. + +```go + 1. deposits * proposal_cancel_burn_rate will be burned + 2. deposits * (1 - proposal_cancel_burn_rate) will be send to community pool +``` + +By default, the new `ProposalCancelBurnRate` parameter is set to zero during migration. + #### `x/consensus` Introducing a new `x/consensus` module to handle managing Tendermint consensus diff --git a/x/gov/README.md b/x/gov/README.md index 757cc25c43d..9921a5f9c29 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -95,6 +95,7 @@ staking token of the chain. * [draft-proposal](#draft-proposal) * [submit-proposal](#submit-proposal) * [submit-legacy-proposal](#submit-legacy-proposal) + * [cancel-proposal](#cancel-proposal) * [vote](#vote-3) * [weighted-vote](#weighted-vote) * [gRPC](#grpc) @@ -428,6 +429,7 @@ const ( StatusPassed ProposalStatus = 0x03 // Proposal passed and successfully executed StatusRejected ProposalStatus = 0x04 // Proposal has been rejected StatusFailed ProposalStatus = 0x05 // Proposal passed but failed execution + StatusCanceled ProposalStatus = 0x06 // Proposal is canceled before the voting period ends ) ``` @@ -953,16 +955,27 @@ Example Output: ```bash deposit_params: - max_deposit_period: "172800000000000" + max_deposit_period: 172800s min_deposit: - amount: "10000000" denom: stake +params: + max_deposit_period: 172800s + min_deposit: + - amount: "10000000" + denom: stake + min_initial_deposit_ratio: "0.000000000000000000" + proposal_cancel_burn_rate: "0.000000000000000000" + quorum: "0.334000000000000000" + threshold: "0.500000000000000000" + veto_threshold: "0.334000000000000000" + voting_period: 172800s tally_params: quorum: "0.334000000000000000" threshold: "0.500000000000000000" veto_threshold: "0.334000000000000000" voting_params: - voting_period: "172800000000000" + voting_period: 172800s ``` #### proposal @@ -1298,6 +1311,18 @@ Example (`software-upgrade`): simd tx gov submit-legacy-proposal software-upgrade v2 --title="Test Proposal" --description="testing, testing, 1, 2, 3" --upgrade-height 1000000 --from cosmos1.. ``` +#### cancel-proposal +The `cancel-proposal` command allows the proposer to cancel the goverance proposal before voting period ends. + +```bash +simd tx gov cancel-proposal [proposal-id] [flags] +``` + +Example: +```bash +simd tx gov cancel-proposal 1 --from cosmos1... +``` + #### vote The `vote` command allows users to submit a vote for a given governance proposal. From 166596ac15b041e081fc929808ef92300b26cefd Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Tue, 18 Oct 2022 21:32:26 +0530 Subject: [PATCH 23/69] chore: address the pr comments --- CHANGELOG.md | 2 +- UPGRADING.md | 7 ++++--- x/bank/app_test.go | 4 ++-- x/gov/README.md | 1 + x/gov/abci.go | 5 ++++- x/gov/abci_test.go | 2 +- x/gov/common_test.go | 4 ++-- x/gov/keeper/deposit.go | 4 ++-- x/gov/keeper/keeper.go | 27 ++++++++++++++++----------- x/gov/keeper/msg_server.go | 1 - 10 files changed, 33 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba5d00b8666..e165f365cc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,7 +54,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/auth) [#13210](https://github.com/cosmos/cosmos-sdk/pull/13210) Add `Query/AccountInfo` endpoint for simplified access to basic account info. * (cli) [#13147](https://github.com/cosmos/cosmos-sdk/pull/13147) Add the `--append` flag to the `sign-batch` CLI cmd to combine the messages and sign those txs which are created with `--generate-only`. * (x/consensus) [#12905](https://github.com/cosmos/cosmos-sdk/pull/12905) Create a new `x/consensus` module that is now responsible for maintaining Tendermint consensus parameters instead of `x/param`. Legacy types remain in order to facilitate parameter migration from the deprecated `x/params`. App developers should ensure that they execute `baseapp.MigrateParams` during their chain upgrade. These legacy types will be removed in a future release. -* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Add `cancel-proposal` feature to proposals. Now proposers can cancel the proposal prior to the voting-period-end-time. +* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Add `cancel-proposal` feature to proposals. Now proposers can cancel the proposal prior to the proposal's voting period end time. * (cli) [#13454](https://github.com/cosmos/cosmos-sdk/pull/13454) `sign-batch` CLI can now read multiple transaction files. ### Improvements diff --git a/UPGRADING.md b/UPGRADING.md index 97a15d11a14..5dbbfd97aaa 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -94,7 +94,8 @@ By default, the new `MinInitialDepositRatio` parameter is set to zero during mig feature is disabled. If chains wish to utilize the minimum proposal deposits at time of submission, the migration logic needs to be modified to set the new parameter to the desired value. -##### Proposer field to Proposal +##### Proposer field to Proposal + The `Proposal` state has been updated with proposer field. For proposal state migraton developers should ensure to call `v4.AddProposerAddressToProposal` in their upgrade handler. @@ -118,8 +119,8 @@ func (app SimApp) RegisterUpgradeHandlers() { } ``` -##### Proposal Cancel Burn Rate param -The `gov` module has been updated to support the cancel the goverance proposal. When proposal is cancel all the deposits of proposal either burned or send to community pool. the deposits burn rate will be determinted by a new parameter called `ProposalCancelBurnRate` parameter. +##### Proposal Cancel Burn Rate Param +The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to community pool. The deposits burn rate will be determined by a new parameter called `ProposalCancelBurnRate` parameter. ```go 1. deposits * proposal_cancel_burn_rate will be burned diff --git a/x/bank/app_test.go b/x/bank/app_test.go index d23422a8027..6c1ba65d454 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -23,7 +23,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/distribution" - dk "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" _ "github.com/cosmos/cosmos-sdk/x/gov" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" _ "github.com/cosmos/cosmos-sdk/x/params" @@ -93,7 +93,7 @@ var ( type suite struct { BankKeeper bankkeeper.Keeper AccountKeeper types.AccountKeeper - DistributionKeeper dk.Keeper + DistributionKeeper distrkeeper.Keeper App *runtime.App } diff --git a/x/gov/README.md b/x/gov/README.md index 9921a5f9c29..02bfc93a7e9 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -1312,6 +1312,7 @@ simd tx gov submit-legacy-proposal software-upgrade v2 --title="Test Proposal" - ``` #### cancel-proposal + The `cancel-proposal` command allows the proposer to cancel the goverance proposal before voting period ends. ```bash diff --git a/x/gov/abci.go b/x/gov/abci.go index e9d8fe7fd5c..614d70640cb 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -21,7 +21,10 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { keeper.IterateCanceledProposalQueue(ctx, func(proposal v1.Proposal) (stop bool) { // burn the (deposits * proposal_cancel_burn_rate) amount. // and deposits * (1 - proposal_cancel_burn_rate) will be move to community pool. - keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id, proposal.TotalDeposit) + err := keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id, proposal.TotalDeposit) + if err != nil { + panic(err) + } // delete the proposal. keeper.DeleteProposal(ctx, proposal.Id) return false diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 23033caa21a..46390747bea 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -401,7 +401,7 @@ func TestProposalCanceledEndblocker(t *testing.T) { deposit.Denom, sdk.NewDecFromInt(deposit.Amount).Mul(burnRate).RoundInt(), ) - burnDepositAmount = append(burnDepositAmount, burnAmount) + burnDepositAmount = burnDepositAmount.Add(burnAmount) } communityFund := deposits.Sub(burnDepositAmount...) diff --git a/x/gov/common_test.go b/x/gov/common_test.go index cb048cdbe1e..fda342064d8 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -20,7 +20,7 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/distribution" - dk "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" @@ -106,7 +106,7 @@ type suite struct { BankKeeper bankkeeper.Keeper GovKeeper *keeper.Keeper StakingKeeper *stakingkeeper.Keeper - DistributionKeeper dk.Keeper + DistributionKeeper distrkeeper.Keeper App *runtime.App } diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index bc11cd308b4..a5c74158492 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -177,7 +177,7 @@ func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposa deposit.Denom, sdk.NewDecFromInt(deposit.Amount).Mul(burnRate).RoundInt(), ) - burnDepositAmount = append(burnDepositAmount, burnAmount) + burnDepositAmount = burnDepositAmount.Add(burnAmount) } // burn the deposits @@ -190,7 +190,7 @@ func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposa // send (deposits - burnAmount) to community pool from proposal deposits (gov module) communityPoolAmount := sdk.NewCoins(totalDeposits...).Sub(burnDepositAmount...) - err := keeper.dk.FundCommunityPool(ctx, communityPoolAmount, keeper.authKeeper.GetModuleAddress(types.ModuleName)) + err := keeper.distrkeeper.FundCommunityPool(ctx, communityPoolAmount, keeper.ModuleAccountAddress()) if err != nil { panic(err) } diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 2e2f9948170..ec676c100fb 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -24,7 +24,7 @@ type Keeper struct { authKeeper types.AccountKeeper bankKeeper types.BankKeeper // Distribution Keeper - dk types.DistributionKeeper + distrkeeper types.DistributionKeeper // The reference to the DelegationSet and ValidatorSet to get information about validators and delegators sk types.StakingKeeper @@ -65,7 +65,7 @@ func (k Keeper) GetAuthority() string { // CONTRACT: the parameter Subspace must have the param key table already initialized func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, authKeeper types.AccountKeeper, - bankKeeper types.BankKeeper, sk types.StakingKeeper, dk types.DistributionKeeper, + bankKeeper types.BankKeeper, sk types.StakingKeeper, distrkeeper types.DistributionKeeper, router *baseapp.MsgServiceRouter, config types.Config, authority string, ) *Keeper { // ensure governance module account is set @@ -83,15 +83,15 @@ func NewKeeper( } return &Keeper{ - storeKey: key, - authKeeper: authKeeper, - bankKeeper: bankKeeper, - dk: dk, - sk: sk, - cdc: cdc, - router: router, - config: config, - authority: authority, + storeKey: key, + authKeeper: authKeeper, + bankKeeper: bankKeeper, + distrkeeper: distrkeeper, + sk: sk, + cdc: cdc, + router: router, + config: config, + authority: authority, } } @@ -262,6 +262,11 @@ func (keeper Keeper) CanceledProposalQueueIterator(ctx sdk.Context) sdk.Iterator return sdk.KVStorePrefixIterator(store, types.CanceledProposalQueuePrefix) } +// ModuleAccountAddress returns gov module account address +func (keeper Keeper) ModuleAccountAddress() sdk.AccAddress { + return keeper.authKeeper.GetModuleAddress(types.ModuleName) +} + // assertMetadataLength returns an error if given metadata length // is greater than a pre-defined maxMetadataLen. func (keeper Keeper) assertMetadataLength(metadata string) error { diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 99ad1b2dd5a..a8d69ebbf97 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -97,7 +97,6 @@ func (k msgServer) CancelProposal(goCtx context.Context, msg *v1.MsgCancelPropos ctx.EventManager().EmitEvent( sdk.NewEvent( sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, govtypes.AttributeValueCategory), sdk.NewAttribute(sdk.AttributeKeySender, msg.Proposer), sdk.NewAttribute(govtypes.AttributeKeyProposalID, fmt.Sprint(msg.ProposalId)), ), From 9ce6bcd2d478f9c749836233142ef12a59a8ef24 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 19 Oct 2022 19:26:59 +0530 Subject: [PATCH 24/69] chore: address the pr comments --- UPGRADING.md | 5 +++-- x/gov/keeper/deposit.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 5dbbfd97aaa..35cf5908de0 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -119,12 +119,13 @@ func (app SimApp) RegisterUpgradeHandlers() { } ``` + ##### Proposal Cancel Burn Rate Param The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to community pool. The deposits burn rate will be determined by a new parameter called `ProposalCancelBurnRate` parameter. -```go +``` 1. deposits * proposal_cancel_burn_rate will be burned - 2. deposits * (1 - proposal_cancel_burn_rate) will be send to community pool + 2. deposits * (1 - proposal_cancel_burn_rate) will be sent to community pool ``` By default, the new `ProposalCancelBurnRate` parameter is set to zero during migration. diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index a5c74158492..e7c84211201 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -172,6 +172,7 @@ func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposa burnRate := sdk.MustNewDecFromStr(proposalCancelBurnRate) var burnDepositAmount sdk.Coins + for _, deposit := range totalDeposits { burnAmount := sdk.NewCoin( deposit.Denom, @@ -181,7 +182,7 @@ func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposa } // burn the deposits - if !burnRate.IsZero() { + if !burnDepositAmount.IsZero() { err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, burnDepositAmount) if err != nil { panic(err) From 657779d5878cf338d019b6432e55e08b5ea25f60 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 20 Oct 2022 11:19:33 +0530 Subject: [PATCH 25/69] chore: address the pr comments --- CHANGELOG.md | 1 + UPGRADING.md | 1 + api/cosmos/gov/v1/gov.pulsar.go | 2 ++ proto/cosmos/gov/v1/gov.proto | 2 ++ x/gov/README.md | 2 +- x/gov/keeper/deposit.go | 14 ++++++++------ x/gov/keeper/keeper.go | 9 ++++----- x/gov/testutil/expected_keepers.go | 3 ++- x/gov/types/v1/gov.pb.go | 2 ++ 9 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a1d7fb2db5..1a3650abf20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -159,6 +159,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [#13430](https://github.com/cosmos/cosmos-sdk/pull/13430) Remove unused code `ResponseCheckTx` and `ResponseDeliverTx` * (auth) [#13460](https://github.com/cosmos/cosmos-sdk/pull/13460) The `q auth address-by-id` CLI command has been renamed to `q auth address-by-acc-num` to be more explicit. However, the old `address-by-id` version is still kept as an alias, for backwards compatibility. * (store) [#13529](https://github.com/cosmos/cosmos-sdk/pull/13529) Add method `LatestVersion` to `MultiStore` interface, add method `SetQueryMultiStore` to baesapp to support alternative `MultiStore` implementation for query service. +* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Add `proposer` parameter to `NewProposal` method. ### CLI Breaking Changes diff --git a/UPGRADING.md b/UPGRADING.md index 35cf5908de0..edf49c58cc7 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -121,6 +121,7 @@ func (app SimApp) RegisterUpgradeHandlers() { ``` ##### Proposal Cancel Burn Rate Param + The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to community pool. The deposits burn rate will be determined by a new parameter called `ProposalCancelBurnRate` parameter. ``` diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index dd21bcee459..dbc1fa5d642 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -6250,6 +6250,7 @@ const ( // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 + // Since: cosmos-sdk 0.47 // PROPOSAL_STATUS_CANCELED defines a proposal status of a proposal that has // canceled. ProposalStatus_PROPOSAL_STATUS_CANCELED ProposalStatus = 6 @@ -6421,6 +6422,7 @@ type Proposal struct { VotingEndTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Since: cosmos-sdk 0.47 // proposer defines the address of the proposal's proposer. Proposer string `protobuf:"bytes,11,opt,name=proposer,proto3" json:"proposer,omitempty"` } diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 9e24b091432..51330245c56 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -57,6 +57,7 @@ message Proposal { // metadata is any arbitrary metadata attached to the proposal. string metadata = 10; + // Since: cosmos-sdk 0.47 // proposer defines the address of the proposal's proposer. string proposer = 11 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } @@ -80,6 +81,7 @@ enum ProposalStatus { // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. PROPOSAL_STATUS_FAILED = 5; + // Since: cosmos-sdk 0.47 // PROPOSAL_STATUS_CANCELED defines a proposal status of a proposal that has // canceled. PROPOSAL_STATUS_CANCELED = 6; diff --git a/x/gov/README.md b/x/gov/README.md index 02bfc93a7e9..740c470458b 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -429,7 +429,7 @@ const ( StatusPassed ProposalStatus = 0x03 // Proposal passed and successfully executed StatusRejected ProposalStatus = 0x04 // Proposal has been rejected StatusFailed ProposalStatus = 0x05 // Proposal passed but failed execution - StatusCanceled ProposalStatus = 0x06 // Proposal is canceled before the voting period ends + StatusCanceled ProposalStatus = 0x06 // Proposal has been canceled before the voting period ended ) ``` diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index e7c84211201..d5409f068ca 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -173,12 +173,14 @@ func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposa var burnDepositAmount sdk.Coins - for _, deposit := range totalDeposits { - burnAmount := sdk.NewCoin( - deposit.Denom, - sdk.NewDecFromInt(deposit.Amount).Mul(burnRate).RoundInt(), - ) - burnDepositAmount = burnDepositAmount.Add(burnAmount) + if burnRate.IsPositive() { + for _, deposit := range totalDeposits { + burnAmount := sdk.NewCoin( + deposit.Denom, + sdk.NewDecFromInt(deposit.Amount).Mul(burnRate).RoundInt(), + ) + burnDepositAmount = burnDepositAmount.Add(burnAmount) + } } // burn the deposits diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index ec676c100fb..53751867a95 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -21,9 +21,8 @@ type Keeper struct { // The reference to the Paramstore to get and set gov specific params paramSpace types.ParamSubspace //nolint:unused - authKeeper types.AccountKeeper - bankKeeper types.BankKeeper - // Distribution Keeper + authKeeper types.AccountKeeper + bankKeeper types.BankKeeper distrkeeper types.DistributionKeeper // The reference to the DelegationSet and ValidatorSet to get information about validators and delegators @@ -159,14 +158,14 @@ func (keeper Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, proposalID u store.Delete(types.ActiveProposalQueueKey(proposalID, endTime)) } -// InsertCanceledProposalQueue inserts a ProposalID into the cancel proposal queue +// InsertCanceledProposalQueue inserts a ProposalID into the Canceled Proposal Queue. func (keeper Keeper) InsertCanceledProposalQueue(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(keeper.storeKey) bz := types.GetProposalIDBytes(proposalID) store.Set(types.CanceledProposalQueueKey(proposalID), bz) } -// RemoveFromCanceledProposalQueue remove a proposalID from the Canceled Proposal Queue +// RemoveFromCanceledProposalQueue removes a proposalID from the Canceled Proposal Queue. func (keeper Keeper) RemoveFromCanceledProposalQueue(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(keeper.storeKey) store.Delete(types.CanceledProposalQueueKey(proposalID)) diff --git a/x/gov/testutil/expected_keepers.go b/x/gov/testutil/expected_keepers.go index 0cb1d6558d5..36c7b8eb8f4 100644 --- a/x/gov/testutil/expected_keepers.go +++ b/x/gov/testutil/expected_keepers.go @@ -34,6 +34,7 @@ type StakingKeeper interface { TokensFromConsensusPower(ctx sdk.Context, power int64) math.Int } +// DistributionKeeper defines the expected distribution keeper type DistributionKeeper interface { - types.DistributionKeeper + FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error } diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 8995c5b7dba..a50b42e4a60 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -92,6 +92,7 @@ const ( // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 + // Since: cosmos-sdk 0.47 // PROPOSAL_STATUS_CANCELED defines a proposal status of a proposal that has // canceled. ProposalStatus_PROPOSAL_STATUS_CANCELED ProposalStatus = 6 @@ -256,6 +257,7 @@ type Proposal struct { VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Since: cosmos-sdk 0.47 // proposer defines the address of the proposal's proposer. Proposer string `protobuf:"bytes,11,opt,name=proposer,proto3" json:"proposer,omitempty"` } From c094141187bcfdd085087039ee0f23ca161b306b Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 20 Oct 2022 17:06:12 -0400 Subject: [PATCH 26/69] Update UPGRADING.md --- UPGRADING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/UPGRADING.md b/UPGRADING.md index edf49c58cc7..b5ab25d113e 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -122,6 +122,7 @@ func (app SimApp) RegisterUpgradeHandlers() { ##### Proposal Cancel Burn Rate Param + The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to community pool. The deposits burn rate will be determined by a new parameter called `ProposalCancelBurnRate` parameter. ``` From 341ed7b43c1b0e3bf0874d02532d46db81446726 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 20 Oct 2022 17:06:29 -0400 Subject: [PATCH 27/69] Update UPGRADING.md --- UPGRADING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/UPGRADING.md b/UPGRADING.md index b5ab25d113e..edf49c58cc7 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -122,7 +122,6 @@ func (app SimApp) RegisterUpgradeHandlers() { ##### Proposal Cancel Burn Rate Param - The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to community pool. The deposits burn rate will be determined by a new parameter called `ProposalCancelBurnRate` parameter. ``` From aa097fa382621cb14682f80b31ec09d4b918124d Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 20 Oct 2022 17:07:39 -0400 Subject: [PATCH 28/69] Update proto/cosmos/gov/v1/gov.proto Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> --- proto/cosmos/gov/v1/gov.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 51330245c56..fd69f38bb64 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -168,5 +168,7 @@ message Params { string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec"]; // The burn rate of deposits when cancel the proposal + // + // Since: cosmos-sdk 0.47 string proposal_cancel_burn_rate = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; } From e5a97eeaa61931756d8dac6d3885676abc0a9c7b Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 20 Oct 2022 17:10:07 -0400 Subject: [PATCH 29/69] Update proto/cosmos/gov/v1/gov.proto --- proto/cosmos/gov/v1/gov.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index fd69f38bb64..a70e8a22a3d 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -57,8 +57,9 @@ message Proposal { // metadata is any arbitrary metadata attached to the proposal. string metadata = 10; - // Since: cosmos-sdk 0.47 // proposer defines the address of the proposal's proposer. + // + // Since: cosmos-sdk 0.47 string proposer = 11 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } From b21c2ce6c585e2cc61da501a1f7dcd42cd742652 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 20 Oct 2022 17:10:56 -0400 Subject: [PATCH 30/69] Update proto/cosmos/gov/v1/gov.proto --- proto/cosmos/gov/v1/gov.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index a70e8a22a3d..3c502226cfb 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -82,9 +82,10 @@ enum ProposalStatus { // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. PROPOSAL_STATUS_FAILED = 5; - // Since: cosmos-sdk 0.47 // PROPOSAL_STATUS_CANCELED defines a proposal status of a proposal that has // canceled. + // + // Since: cosmos-sdk 0.47 PROPOSAL_STATUS_CANCELED = 6; } From 26be9f767731420e7e708e3b5770ea0c7b68dd54 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 21 Oct 2022 12:34:23 +0530 Subject: [PATCH 31/69] chore : address the pr comments and add delete votes for cancel-proposal --- proto/cosmos/gov/v1/tx.proto | 2 +- tests/e2e/gov/cli_test.go | 2 +- x/gov/abci.go | 21 +++++++++++++++++++++ x/gov/client/testutil/tx.go | 12 ++++++++++++ x/gov/keeper/msg_server.go | 2 +- x/gov/keeper/proposal.go | 4 ++-- x/gov/keeper/vote.go | 6 ++++++ x/gov/types/errors.go | 2 ++ x/gov/types/events.go | 9 ++++++--- x/gov/types/v1/proposal.go | 3 ++- 10 files changed, 54 insertions(+), 9 deletions(-) diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index a878e4973f4..27808b1881d 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -152,6 +152,6 @@ message MsgCancelProposalResponse { uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; // canceled_time is the time when proposal is canceled. google.protobuf.Timestamp canceled_time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - // canceled_height defines the block height at which the proposal is cancel. + // canceled_height defines the block height at which the proposal is canceled. uint64 canceled_height = 3; } diff --git a/tests/e2e/gov/cli_test.go b/tests/e2e/gov/cli_test.go index ffea40b2351..75822aa6041 100644 --- a/tests/e2e/gov/cli_test.go +++ b/tests/e2e/gov/cli_test.go @@ -18,7 +18,7 @@ import ( func TestIntegrationTestSuite(t *testing.T) { cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) - cfg.NumValidators = 1 + cfg.NumValidators = 2 suite.Run(t, testutil.NewIntegrationTestSuite(cfg)) } diff --git a/x/gov/abci.go b/x/gov/abci.go index 614d70640cb..5968b35c41f 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -25,8 +25,29 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { if err != nil { panic(err) } + + // delete the votes + if proposal.VotingStartTime != nil { + keeper.DeleteVotes(ctx, proposal.Id) + } + // delete the proposal. keeper.DeleteProposal(ctx, proposal.Id) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeCancelProposal, + sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposal.Id)), + sdk.NewAttribute(types.AttributeKeyProposalResult, types.AttributeValueProposalCanceled), + ), + ) + + logger.Info( + "proposal is canceled by proposer", + "proposal", proposal.Id, + "proposer", proposal.Proposer, + ) + return false }) diff --git a/x/gov/client/testutil/tx.go b/x/gov/client/testutil/tx.go index 0bb752947a4..c970820fb72 100644 --- a/x/gov/client/testutil/tx.go +++ b/x/gov/client/testutil/tx.go @@ -274,6 +274,7 @@ func (s *IntegrationTestSuite) TestNewCmdSubmitLegacyProposal() { func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { val := s.network.Validators[0] + val2 := s.network.Validators[1] testCases := []struct { name string @@ -302,6 +303,17 @@ func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { }, true, 0, }, + { + "valid proposal-id but invalid proposer", + []string{ + "4", + fmt.Sprintf("--%s=%s", flags.FlagFrom, val2.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + true, 0, + }, { "valid proposer", []string{ diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index e95fe580b1f..2c67fe50ba1 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -96,7 +96,7 @@ func (k msgServer) CancelProposal(goCtx context.Context, msg *v1.MsgCancelPropos ctx.EventManager().EmitEvent( sdk.NewEvent( - sdk.EventTypeMessage, + govtypes.EventTypeCancelProposal, sdk.NewAttribute(sdk.AttributeKeySender, msg.Proposer), sdk.NewAttribute(govtypes.AttributeKeyProposalID, fmt.Sprint(msg.ProposalId)), ), diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 9f53dfe0bea..f87c237e600 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -109,12 +109,12 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer // Check if proposal is active or not if (proposal.Status != v1.StatusDepositPeriod) && (proposal.Status != v1.StatusVotingPeriod) { - return sdkerrors.Wrapf(types.ErrInactiveProposal, "%d", proposalID) + return sdkerrors.Wrap(types.ErrInvalidProposal, "proposal should be in the deposit or voting period") } // Check proposal voting period is ended. if proposal.VotingEndTime != nil && proposal.VotingEndTime.Before(ctx.BlockTime()) { - return sdkerrors.Wrapf(types.ErrInactiveProposal, "voting period is already ended for this proposal %d", proposalID) + return sdkerrors.Wrapf(types.ErrVotingPeriodEnded, "voting period is already ended for this proposal %d", proposalID) } // update the status to StatusCanceled diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 038310a916a..57c5f3d1179 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -118,6 +118,12 @@ func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vo } } +// DeleteVotes deletes all the votes from a given proposalID. +func (keeper Keeper) DeleteVotes(ctx sdk.Context, proposalID uint64) { + store := ctx.KVStore(keeper.storeKey) + store.Delete(types.VotesKey(proposalID)) +} + // deleteVote deletes a vote from a given proposalID and voter from the store func (keeper Keeper) deleteVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) { store := ctx.KVStore(keeper.storeKey) diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 14a132ec6e5..d89a7a5e3f0 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -25,4 +25,6 @@ var ( ErrProposalNotFound = sdkerrors.Register(ModuleName, 17, "proposal is not found") ErrInvalidProposer = sdkerrors.Register(ModuleName, 18, "invalid proposer") ErrNoDeposits = sdkerrors.Register(ModuleName, 19, "no deposits found") + ErrVotingPeriodEnded = sdkerrors.Register(ModuleName, 20, "voting period already ended") + ErrInvalidProposal = sdkerrors.Register(ModuleName, 21, "proposal is already processed") ) diff --git a/x/gov/types/events.go b/x/gov/types/events.go index 76927591af8..148d698b212 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -8,6 +8,7 @@ const ( EventTypeInactiveProposal = "inactive_proposal" EventTypeActiveProposal = "active_proposal" EventTypeSignalProposal = "signal_proposal" + EventTypeCancelProposal = "cancel_proposal" AttributeKeyProposalResult = "proposal_result" AttributeKeyOption = "option" @@ -18,7 +19,9 @@ const ( AttributeValueProposalPassed = "proposal_passed" // met vote quorum AttributeValueProposalRejected = "proposal_rejected" // didn't meet vote quorum AttributeValueProposalFailed = "proposal_failed" // error on proposal handler - AttributeKeyProposalType = "proposal_type" - AttributeSignalTitle = "signal_title" - AttributeSignalDescription = "signal_description" + AttributeValueProposalCanceled = "proposal_canceled" // error on proposal handler + + AttributeKeyProposalType = "proposal_type" + AttributeSignalTitle = "signal_title" + AttributeSignalDescription = "signal_description" ) diff --git a/x/gov/types/v1/proposal.go b/x/gov/types/v1/proposal.go index 3beaa44ea32..35e65babfef 100644 --- a/x/gov/types/v1/proposal.go +++ b/x/gov/types/v1/proposal.go @@ -115,7 +115,8 @@ func ValidProposalStatus(status ProposalStatus) bool { status == StatusVotingPeriod || status == StatusPassed || status == StatusRejected || - status == StatusFailed { + status == StatusFailed || + status == StatusCanceled { return true } return false From def73abd1454309667f88efea7dcfc64855d2889 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Sat, 22 Oct 2022 09:13:07 +0530 Subject: [PATCH 32/69] chore: address the pr comments --- x/gov/abci.go | 2 -- x/gov/migrations/v4/store.go | 26 ++++++++++++++++++-------- x/gov/types/v1/msgs.go | 5 ++++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/x/gov/abci.go b/x/gov/abci.go index 5968b35c41f..0b1a010594c 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -26,12 +26,10 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { panic(err) } - // delete the votes if proposal.VotingStartTime != nil { keeper.DeleteVotes(ctx, proposal.Id) } - // delete the proposal. keeper.DeleteProposal(ctx, proposal.Id) ctx.EventManager().EmitEvent( diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go index 2b082370275..f9a5ee043dc 100644 --- a/x/gov/migrations/v4/store.go +++ b/x/gov/migrations/v4/store.go @@ -1,6 +1,7 @@ package v4 import ( + "fmt" "sort" "github.com/cosmos/cosmos-sdk/codec" @@ -45,24 +46,33 @@ func migrateParams(ctx sdk.Context, storeKey storetypes.StoreKey, legacySubspace // AddProposerAddressToProposal will add proposer to proposal // and set to the store func AddProposerAddressToProposal(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, proposals map[uint64]string) error { - proposalIDS := make([]uint64, 0, len(proposals)) + proposalIDs := make([]uint64, 0, len(proposals)) - for proposerID := range proposals { - proposalIDS = append(proposalIDS, proposerID) + for proposalID := range proposals { + proposalIDs = append(proposalIDs, proposalID) } - // sort the proposalIDS - sort.Slice(proposalIDS, func(i, j int) bool { return proposalIDS[i] < proposalIDS[j] }) + + // sort the proposalIDs + sort.Slice(proposalIDs, func(i, j int) bool { return proposalIDs[i] < proposalIDs[j] }) store := ctx.KVStore(storeKey) - for _, proposerID := range proposalIDS { - bz := store.Get(types.ProposalKey(proposerID)) + for _, proposalID := range proposalIDs { + if len(proposals[proposalID]) == 0 { + return fmt.Errorf("found missing proposer for proposal ID: %d", proposalID) + } + + if _, err := sdk.AccAddressFromBech32(proposals[proposalID]); err != nil { + return fmt.Errorf("invalid proposer address : %s", proposals[proposalID]) + } + + bz := store.Get(types.ProposalKey(proposalID)) var proposal govv1.Proposal if err := cdc.Unmarshal(bz, &proposal); err != nil { panic(err) } - proposal.Proposer = proposals[proposerID] + proposal.Proposer = proposals[proposalID] // set the new proposal with proposer bz, err := cdc.Marshal(&proposal) diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 851ee5a528c..6268a8df3eb 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -298,7 +298,10 @@ func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { // //nolint:interfacer func NewMsgCancelProposal(proposalID uint64, proposer sdk.AccAddress) *MsgCancelProposal { - return &MsgCancelProposal{proposalID, proposer.String()} + return &MsgCancelProposal{ + ProposalId: proposalID, + Proposer: proposer.String(), + } } // Route implements Msg From 23f1b96a5ba6a885b700a93a1cced4c6738da977 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 24 Oct 2022 22:44:56 +0530 Subject: [PATCH 33/69] remove the cancelProposalQueue for cancel proposal --- api/cosmos/gov/v1/gov.pulsar.go | 37 ++++---- api/cosmos/gov/v1/tx.pulsar.go | 2 +- proto/cosmos/gov/v1/gov.proto | 5 -- x/gov/abci.go | 35 +------- x/gov/abci_test.go | 94 -------------------- x/gov/keeper/deposit.go | 4 +- x/gov/keeper/keeper.go | 38 -------- x/gov/keeper/proposal.go | 27 ++++-- x/gov/types/keys.go | 6 -- x/gov/types/v1/gov.pb.go | 152 ++++++++++++++++---------------- x/gov/types/v1/proposal.go | 4 +- x/gov/types/v1/tx.pb.go | 2 +- 12 files changed, 114 insertions(+), 292 deletions(-) diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index dbc1fa5d642..7e6d2f99e56 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -6250,10 +6250,6 @@ const ( // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 - // Since: cosmos-sdk 0.47 - // PROPOSAL_STATUS_CANCELED defines a proposal status of a proposal that has - // canceled. - ProposalStatus_PROPOSAL_STATUS_CANCELED ProposalStatus = 6 ) // Enum value maps for ProposalStatus. @@ -6265,7 +6261,6 @@ var ( 3: "PROPOSAL_STATUS_PASSED", 4: "PROPOSAL_STATUS_REJECTED", 5: "PROPOSAL_STATUS_FAILED", - 6: "PROPOSAL_STATUS_CANCELED", } ProposalStatus_value = map[string]int32{ "PROPOSAL_STATUS_UNSPECIFIED": 0, @@ -6274,7 +6269,6 @@ var ( "PROPOSAL_STATUS_PASSED": 3, "PROPOSAL_STATUS_REJECTED": 4, "PROPOSAL_STATUS_FAILED": 5, - "PROPOSAL_STATUS_CANCELED": 6, } ) @@ -6422,8 +6416,9 @@ type Proposal struct { VotingEndTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` - // Since: cosmos-sdk 0.47 // proposer defines the address of the proposal's proposer. + // + // Since: cosmos-sdk 0.47 Proposer string `protobuf:"bytes,11,opt,name=proposer,proto3" json:"proposer,omitempty"` } @@ -6813,6 +6808,8 @@ type Params struct { // The ratio representing the proportion of the deposit value that must be paid at proposal submission. MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` // The burn rate of deposits when cancel the proposal + // + // Since: cosmos-sdk 0.47 ProposalCancelBurnRate string `protobuf:"bytes,8,opt,name=proposal_cancel_burn_rate,json=proposalCancelBurnRate,proto3" json:"proposal_cancel_burn_rate,omitempty"` } @@ -7061,7 +7058,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0xec, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 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, @@ -7074,19 +7071,17 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, - 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, - 0x4c, 0x45, 0x44, 0x10, 0x06, 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, + 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/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index f590293bda4..cce1e21c969 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7393,7 +7393,7 @@ type MsgCancelProposalResponse struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` // canceled_time is the time when proposal is canceled. CanceledTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=canceled_time,json=canceledTime,proto3" json:"canceled_time,omitempty"` - // canceled_height defines the block height at which the proposal is cancel. + // canceled_height defines the block height at which the proposal is canceled. CanceledHeight uint64 `protobuf:"varint,3,opt,name=canceled_height,json=canceledHeight,proto3" json:"canceled_height,omitempty"` } diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 3c502226cfb..d6d0eaaf008 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -82,11 +82,6 @@ enum ProposalStatus { // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. PROPOSAL_STATUS_FAILED = 5; - // PROPOSAL_STATUS_CANCELED defines a proposal status of a proposal that has - // canceled. - // - // Since: cosmos-sdk 0.47 - PROPOSAL_STATUS_CANCELED = 6; } // TallyResult defines a standard tally for a governance proposal. diff --git a/x/gov/abci.go b/x/gov/abci.go index 0b1a010594c..3f79d446c17 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -15,40 +15,7 @@ import ( func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) - logger := keeper.Logger(ctx) - - // delete the canceled proposals from store. - keeper.IterateCanceledProposalQueue(ctx, func(proposal v1.Proposal) (stop bool) { - // burn the (deposits * proposal_cancel_burn_rate) amount. - // and deposits * (1 - proposal_cancel_burn_rate) will be move to community pool. - err := keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id, proposal.TotalDeposit) - if err != nil { - panic(err) - } - - if proposal.VotingStartTime != nil { - keeper.DeleteVotes(ctx, proposal.Id) - } - - keeper.DeleteProposal(ctx, proposal.Id) - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeCancelProposal, - sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposal.Id)), - sdk.NewAttribute(types.AttributeKeyProposalResult, types.AttributeValueProposalCanceled), - ), - ) - - logger.Info( - "proposal is canceled by proposer", - "proposal", proposal.Id, - "proposer", proposal.Proposer, - ) - - return false - }) - + logger := ctx.Logger().With("module", "x/"+types.ModuleName) // delete dead proposals from store and returns theirs deposits. // A proposal is dead when it's inactive and didn't get enough deposit on time to get into voting phase. keeper.IterateInactiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal v1.Proposal) bool { diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 46390747bea..0254641e05f 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -331,100 +331,6 @@ func TestProposalPassedEndblocker(t *testing.T) { require.True(t, suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()).IsEqual(initialModuleAccCoins)) } -func TestProposalCanceledEndblocker(t *testing.T) { - suite := createTestSuite(t) - app := suite.App - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) - - SortAddresses(addrs) - - govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) - stakingMsgSvr := stakingkeeper.NewMsgServerImpl(suite.StakingKeeper) - - header := tmproto.Header{Height: app.LastBlockHeight() + 1} - app.BeginBlock(abci.RequestBeginBlock{Header: header}) - - valAddr := sdk.ValAddress(addrs[0]) - proposer := addrs[0] - depositer := addrs[1] - - createValidators(t, stakingMsgSvr, ctx, []sdk.ValAddress{valAddr}, []int64{10}) - staking.EndBlocker(ctx, suite.StakingKeeper) - - macc := suite.GovKeeper.GetGovernanceAccount(ctx) - require.NotNil(t, macc) - initialModuleAccCoins := suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - intitalProposerBalance := suite.BankKeeper.GetAllBalances(ctx, proposer) - depositerBalance := suite.BankKeeper.GetAllBalances(ctx, depositer) - - proposal, err := suite.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") - require.NoError(t, err) - - proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10))} - newDepositMsg := v1.NewMsgDeposit(addrs[0], proposal.Id, proposalCoins) - - res, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) - require.NoError(t, err) - require.NotNil(t, res) - - newDepositMsg = v1.NewMsgDeposit(addrs[1], proposal.Id, proposalCoins) - res, err = govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) - require.NoError(t, err) - require.NotNil(t, res) - - // check the balances of depositer and proposer - require.True(t, suite.BankKeeper.GetAllBalances(ctx, depositer).IsEqual(depositerBalance.Sub(proposalCoins...))) - require.True(t, suite.BankKeeper.GetAllBalances(ctx, proposer).IsEqual(intitalProposerBalance.Sub(proposalCoins...))) - - canceledProposalQueue := suite.GovKeeper.CanceledProposalQueueIterator(ctx) - require.False(t, canceledProposalQueue.Valid()) - canceledProposalQueue.Close() - - macc = suite.GovKeeper.GetGovernanceAccount(ctx) - require.NotNil(t, macc) - moduleAccCoins := suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - - deposits := initialModuleAccCoins.Add(proposal.TotalDeposit...).Add(proposalCoins...).Add(proposalCoins...) - require.True(t, moduleAccCoins.IsEqual(deposits)) - - err = suite.GovKeeper.AddVote(ctx, proposal.Id, addrs[0], v1.NewNonSplitVoteOption(v1.OptionYes), "") - require.NoError(t, err) - - params := suite.GovKeeper.GetParams(ctx) - cancelProposalBurnRate := params.ProposalCancelBurnRate - burnRate := sdk.MustNewDecFromStr(cancelProposalBurnRate) - - var burnDepositAmount sdk.Coins - for _, deposit := range deposits { - burnAmount := sdk.NewCoin( - deposit.Denom, - sdk.NewDecFromInt(deposit.Amount).Mul(burnRate).RoundInt(), - ) - burnDepositAmount = burnDepositAmount.Add(burnAmount) - } - - communityFund := deposits.Sub(burnDepositAmount...) - - // get the community pool funds - beforeCommunityFund := suite.DistributionKeeper.GetFeePoolCommunityCoins(ctx) - // cancel the gov proposal - err = suite.GovKeeper.CancelProposal(ctx, proposal.Id, addrs[0].String()) - require.NoError(t, err) - - canceledProposalQueue = suite.GovKeeper.CanceledProposalQueueIterator(ctx) - require.True(t, canceledProposalQueue.Valid()) - canceledProposalQueue.Close() - - gov.EndBlocker(ctx, suite.GovKeeper) - afterCommunityFund := suite.DistributionKeeper.GetFeePoolCommunityCoins(ctx) - - macc = suite.GovKeeper.GetGovernanceAccount(ctx) - require.NotNil(t, macc) - require.Equal(t, beforeCommunityFund.Add(sdk.NewDecCoinsFromCoins(communityFund...)...), afterCommunityFund) - require.True(t, suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()).IsEqual(initialModuleAccCoins)) -} - func TestEndBlockerProposalHandlerFailed(t *testing.T) { suite := createTestSuite(t) app := suite.App diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index d5409f068ca..e27b4c5a2e1 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -187,7 +187,7 @@ func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposa if !burnDepositAmount.IsZero() { err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, burnDepositAmount) if err != nil { - panic(err) + return err } } @@ -195,7 +195,7 @@ func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposa communityPoolAmount := sdk.NewCoins(totalDeposits...).Sub(burnDepositAmount...) err := keeper.distrkeeper.FundCommunityPool(ctx, communityPoolAmount, keeper.ModuleAccountAddress()) if err != nil { - panic(err) + return err } store.Delete(types.DepositsKey(proposalID)) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 53751867a95..0e6be6662c5 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -158,19 +158,6 @@ func (keeper Keeper) RemoveFromActiveProposalQueue(ctx sdk.Context, proposalID u store.Delete(types.ActiveProposalQueueKey(proposalID, endTime)) } -// InsertCanceledProposalQueue inserts a ProposalID into the Canceled Proposal Queue. -func (keeper Keeper) InsertCanceledProposalQueue(ctx sdk.Context, proposalID uint64) { - store := ctx.KVStore(keeper.storeKey) - bz := types.GetProposalIDBytes(proposalID) - store.Set(types.CanceledProposalQueueKey(proposalID), bz) -} - -// RemoveFromCanceledProposalQueue removes a proposalID from the Canceled Proposal Queue. -func (keeper Keeper) RemoveFromCanceledProposalQueue(ctx sdk.Context, proposalID uint64) { - store := ctx.KVStore(keeper.storeKey) - store.Delete(types.CanceledProposalQueueKey(proposalID)) -} - // InsertInactiveProposalQueue Inserts a ProposalID into the inactive proposal queue at endTime func (keeper Keeper) InsertInactiveProposalQueue(ctx sdk.Context, proposalID uint64, endTime time.Time) { store := ctx.KVStore(keeper.storeKey) @@ -224,25 +211,6 @@ func (keeper Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time } } -// IterateCanceledProposalQueue iterates over the proposal in the canceled proposal queue -// and performs a callback function -func (keeper Keeper) IterateCanceledProposalQueue(ctx sdk.Context, cb func(proposal v1.Proposal) (stop bool)) { - iterator := keeper.CanceledProposalQueueIterator(ctx) - - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - proposalID := types.GetProposalIDFromBytes(iterator.Key()[1:]) - proposal, found := keeper.GetProposal(ctx, proposalID) - if !found { - panic(fmt.Sprintf("proposal %d does not exist", proposalID)) - } - - if cb(proposal) { - break - } - } -} - // ActiveProposalQueueIterator returns an sdk.Iterator for all the proposals in the Active Queue that expire by endTime func (keeper Keeper) ActiveProposalQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator { store := ctx.KVStore(keeper.storeKey) @@ -255,12 +223,6 @@ func (keeper Keeper) InactiveProposalQueueIterator(ctx sdk.Context, endTime time return store.Iterator(types.InactiveProposalQueuePrefix, sdk.PrefixEndBytes(types.InactiveProposalByTimeKey(endTime))) } -// InactiveProposalQueueIterator returns an sdk.Iterator for all the proposals in the Inactive Queue that expire by endTime -func (keeper Keeper) CanceledProposalQueueIterator(ctx sdk.Context) sdk.Iterator { - store := ctx.KVStore(keeper.storeKey) - return sdk.KVStorePrefixIterator(store, types.CanceledProposalQueuePrefix) -} - // ModuleAccountAddress returns gov module account address func (keeper Keeper) ModuleAccountAddress() sdk.AccAddress { return keeper.authKeeper.GetModuleAddress(types.ModuleName) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index f87c237e600..923eae287c0 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -117,12 +117,24 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer return sdkerrors.Wrapf(types.ErrVotingPeriodEnded, "voting period is already ended for this proposal %d", proposalID) } - // update the status to StatusCanceled - proposal.Status = v1.StatusCanceled - // set to store - keeper.SetProposal(ctx, proposal) - // insert the proposal into cancel proposal queue - keeper.InsertCanceledProposalQueue(ctx, proposalID) + // burn the (deposits * proposal_cancel_burn_rate) amount. + // and deposits * (1 - proposal_cancel_burn_rate) will be move to community pool. + err := keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id, proposal.TotalDeposit) + if err != nil { + return err + } + + if proposal.VotingStartTime != nil { + keeper.DeleteVotes(ctx, proposal.Id) + } + + keeper.DeleteProposal(ctx, proposal.Id) + + keeper.Logger(ctx).Info( + "proposal is canceled by proposer", + "proposal", proposal.Id, + "proposer", proposal.Proposer, + ) return nil } @@ -172,9 +184,6 @@ func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64) { if proposal.VotingEndTime != nil { keeper.RemoveFromActiveProposalQueue(ctx, proposalID, *proposal.VotingEndTime) } - if proposal.Status == v1.StatusCanceled { - keeper.RemoveFromCanceledProposalQueue(ctx, proposalID) - } store.Delete(types.ProposalKey(proposalID)) } diff --git a/x/gov/types/keys.go b/x/gov/types/keys.go index c330e2c4aa6..dd1fb906335 100644 --- a/x/gov/types/keys.go +++ b/x/gov/types/keys.go @@ -41,7 +41,6 @@ var ( ActiveProposalQueuePrefix = []byte{0x01} InactiveProposalQueuePrefix = []byte{0x02} ProposalIDKey = []byte{0x03} - CanceledProposalQueuePrefix = []byte{0x04} DepositsKeyPrefix = []byte{0x10} @@ -80,11 +79,6 @@ func ActiveProposalQueueKey(proposalID uint64, endTime time.Time) []byte { return append(ActiveProposalByTimeKey(endTime), GetProposalIDBytes(proposalID)...) } -// CanceledProposalQueueKey returns the key for a proposalID in the canceledProposalQueue -func CanceledProposalQueueKey(proposalID uint64) []byte { - return append(CanceledProposalQueuePrefix, GetProposalIDBytes(proposalID)...) -} - // InactiveProposalByTimeKey gets the inactive proposal queue key by endTime func InactiveProposalByTimeKey(endTime time.Time) []byte { return append(InactiveProposalQueuePrefix, sdk.FormatTimeBytes(endTime)...) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index a50b42e4a60..91658dff056 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -92,10 +92,6 @@ const ( // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has // failed. ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 - // Since: cosmos-sdk 0.47 - // PROPOSAL_STATUS_CANCELED defines a proposal status of a proposal that has - // canceled. - ProposalStatus_PROPOSAL_STATUS_CANCELED ProposalStatus = 6 ) var ProposalStatus_name = map[int32]string{ @@ -105,7 +101,6 @@ var ProposalStatus_name = map[int32]string{ 3: "PROPOSAL_STATUS_PASSED", 4: "PROPOSAL_STATUS_REJECTED", 5: "PROPOSAL_STATUS_FAILED", - 6: "PROPOSAL_STATUS_CANCELED", } var ProposalStatus_value = map[string]int32{ @@ -115,7 +110,6 @@ var ProposalStatus_value = map[string]int32{ "PROPOSAL_STATUS_PASSED": 3, "PROPOSAL_STATUS_REJECTED": 4, "PROPOSAL_STATUS_FAILED": 5, - "PROPOSAL_STATUS_CANCELED": 6, } func (x ProposalStatus) String() string { @@ -257,8 +251,9 @@ type Proposal struct { VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` - // Since: cosmos-sdk 0.47 // proposer defines the address of the proposal's proposer. + // + // Since: cosmos-sdk 0.47 Proposer string `protobuf:"bytes,11,opt,name=proposer,proto3" json:"proposer,omitempty"` } @@ -702,6 +697,8 @@ type Params struct { // The ratio representing the proportion of the deposit value that must be paid at proposal submission. MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` // The burn rate of deposits when cancel the proposal + // + // Since: cosmos-sdk 0.47 ProposalCancelBurnRate string `protobuf:"bytes,8,opt,name=proposal_cancel_burn_rate,json=proposalCancelBurnRate,proto3" json:"proposal_cancel_burn_rate,omitempty"` } @@ -811,83 +808,82 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1208 bytes of a gzipped FileDescriptorProto + // 1198 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x73, 0xd3, 0xc6, 0x17, 0x8f, 0x6c, 0xc5, 0x71, 0x9e, 0x13, 0xe3, 0xef, 0xc2, 0x17, 0x94, 0x00, 0x76, 0xf0, 0x74, - 0x98, 0x94, 0x1f, 0x76, 0x03, 0xa5, 0x3d, 0x70, 0xa9, 0x7f, 0x88, 0x22, 0x86, 0xc6, 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a2, 0xa3, 0xd5, 0x2a, 0x76, 0x1c, 0x77, 0x62, 0x38, 0x49, 0x7a, 0xef, + 0xf3, 0x79, 0xef, 0xed, 0x7b, 0x1f, 0xed, 0x2e, 0x5c, 0xe8, 0x32, 0xee, 0x33, 0x5e, 0xed, 0xb1, + 0x51, 0x75, 0xb4, 0x13, 0x3d, 0x2a, 0x83, 0x90, 0x09, 0x86, 0xd6, 0x63, 0x47, 0x25, 0xb2, 0x8c, + 0x76, 0x36, 0x8b, 0x0a, 0xd7, 0xc1, 0x9c, 0x54, 0x47, 0x3b, 0x1d, 0x22, 0xf0, 0x4e, 0xb5, 0xcb, + 0x68, 0x10, 0xc3, 0x37, 0xcf, 0xf5, 0x58, 0x8f, 0xc9, 0xd7, 0x6a, 0xf4, 0xa6, 0xac, 0xa5, 0x1e, + 0x63, 0xbd, 0x3e, 0xa9, 0xca, 0xaf, 0xce, 0xf0, 0x69, 0x55, 0x50, 0x9f, 0x70, 0x81, 0xfd, 0x81, + 0x02, 0x6c, 0xcc, 0x02, 0x70, 0x30, 0x56, 0xae, 0xe2, 0xac, 0xcb, 0x1b, 0x86, 0x58, 0x50, 0x96, 0x64, 0xdc, 0x88, 0x2b, 0x72, 0xe3, 0xa4, 0xaa, 0x5a, 0xf9, 0x51, 0x66, 0x80, 0x1e, 0x13, 0xda, - 0xdf, 0x17, 0xc4, 0xdb, 0x63, 0x82, 0xb4, 0x86, 0x11, 0x0d, 0xed, 0x40, 0x86, 0xc9, 0x37, 0x43, - 0xdb, 0xd2, 0xb6, 0xf3, 0xb7, 0x36, 0x2a, 0x47, 0x96, 0x58, 0x99, 0x42, 0x6d, 0x05, 0x44, 0x57, + 0x3b, 0x10, 0xc4, 0xdb, 0x67, 0x82, 0x34, 0x07, 0x11, 0x0d, 0xed, 0x40, 0x86, 0xc9, 0x37, 0x43, + 0xdb, 0xd2, 0xb6, 0xf3, 0xb7, 0x36, 0x2a, 0xc7, 0x96, 0x58, 0x99, 0x40, 0x6d, 0x05, 0x44, 0x57, 0x21, 0xf3, 0x4c, 0x06, 0x32, 0x52, 0x5b, 0xda, 0xf6, 0x6a, 0x3d, 0xff, 0xe6, 0xe5, 0x4d, 0x50, - 0xac, 0x26, 0xe9, 0xd9, 0xca, 0x5b, 0xfe, 0x55, 0x83, 0x95, 0x26, 0x19, 0x32, 0x4e, 0x05, 0x2a, - 0x41, 0x6e, 0x18, 0xb2, 0x21, 0xe3, 0x78, 0xe0, 0x52, 0x4f, 0xe6, 0xd2, 0x6d, 0x48, 0x4c, 0x96, + 0xac, 0x06, 0xe9, 0xda, 0xca, 0x5b, 0xfe, 0x55, 0x83, 0x95, 0x06, 0x19, 0x30, 0x4e, 0x05, 0x2a, + 0x41, 0x6e, 0x10, 0xb2, 0x01, 0xe3, 0xb8, 0xef, 0x52, 0x4f, 0xe6, 0xd2, 0x6d, 0x48, 0x4c, 0x96, 0x87, 0xbe, 0x80, 0x55, 0x2f, 0xc6, 0xb2, 0x50, 0xc5, 0x35, 0xde, 0xbc, 0xbc, 0x79, 0x4e, 0xc5, - 0xad, 0x79, 0x5e, 0x48, 0x38, 0xef, 0x88, 0x90, 0x06, 0x7d, 0x7b, 0x0a, 0x45, 0x5f, 0x42, 0x06, - 0xfb, 0x6c, 0x14, 0x08, 0x23, 0xbd, 0x95, 0xde, 0xce, 0x4d, 0xeb, 0x8f, 0x66, 0x52, 0x51, 0x33, - 0xa9, 0x34, 0x18, 0x0d, 0xea, 0xfa, 0xab, 0xb7, 0xa5, 0x25, 0x5b, 0xc1, 0xcb, 0x3f, 0x2d, 0x43, - 0xb6, 0xad, 0xf2, 0xa3, 0x3c, 0xa4, 0x0e, 0xab, 0x4a, 0x51, 0x0f, 0x7d, 0x06, 0x59, 0x9f, 0x70, - 0x8e, 0xfb, 0x84, 0x1b, 0x29, 0x19, 0xf7, 0x5c, 0x25, 0xee, 0x7c, 0x25, 0xe9, 0x7c, 0xa5, 0x16, - 0x4c, 0xec, 0x43, 0x14, 0xba, 0x03, 0x19, 0x2e, 0xb0, 0x18, 0x71, 0x23, 0x2d, 0xfb, 0x78, 0x79, - 0xae, 0x8f, 0x49, 0xaa, 0x8e, 0x04, 0xd9, 0x0a, 0x8c, 0xee, 0x03, 0x7a, 0x4a, 0x03, 0x3c, 0x70, - 0x05, 0x1e, 0x0c, 0x26, 0x6e, 0x48, 0xf8, 0x68, 0x20, 0x0c, 0x7d, 0x4b, 0xdb, 0xce, 0xdd, 0xda, - 0x9c, 0x0b, 0xe1, 0x44, 0x10, 0x5b, 0x22, 0xec, 0x82, 0x64, 0xcd, 0x58, 0x50, 0x0d, 0x72, 0x7c, - 0xd4, 0xf5, 0xa9, 0x70, 0x23, 0x39, 0x19, 0xcb, 0x2a, 0xc4, 0x7c, 0xd5, 0x4e, 0xa2, 0xb5, 0xba, - 0xfe, 0xe2, 0xaf, 0x92, 0x66, 0x43, 0x4c, 0x8a, 0xcc, 0xe8, 0x01, 0x14, 0x54, 0x63, 0x5d, 0x12, - 0x78, 0x71, 0x9c, 0xcc, 0x29, 0xe3, 0xe4, 0x15, 0xd3, 0x0c, 0x3c, 0x19, 0xab, 0x09, 0xeb, 0x82, - 0x09, 0x3c, 0x70, 0x95, 0xdd, 0x58, 0x39, 0xdd, 0x78, 0xd6, 0x24, 0x2b, 0x91, 0xcd, 0x43, 0xf8, - 0xdf, 0x98, 0x09, 0x1a, 0xf4, 0x5d, 0x2e, 0x70, 0xa8, 0x96, 0x96, 0x3d, 0x65, 0x49, 0x67, 0x62, - 0x6a, 0x27, 0x62, 0xca, 0x9a, 0xee, 0x83, 0x32, 0x4d, 0x97, 0xb7, 0x7a, 0xca, 0x58, 0xeb, 0x31, - 0x31, 0x59, 0xdd, 0x66, 0xa4, 0x0f, 0x81, 0x3d, 0x2c, 0xb0, 0x01, 0x91, 0x58, 0xed, 0xc3, 0x6f, - 0xf4, 0x39, 0x64, 0x63, 0x5d, 0x93, 0xd0, 0xc8, 0x9d, 0x20, 0xe4, 0x43, 0x64, 0xf9, 0x77, 0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4c, 0xb8, 0xdb, 0x95, 0xd2, 0xd6, 0x4e, 0xfc, 0x67, 0x56, + 0x20, 0xec, 0xec, 0x98, 0xf0, 0xdd, 0xc8, 0x8f, 0x6e, 0xc3, 0x3a, 0xee, 0x70, 0x81, 0x69, 0xa0, + 0x08, 0xa9, 0xb9, 0x84, 0x35, 0x05, 0x8a, 0x49, 0x9f, 0x42, 0x36, 0x60, 0x0a, 0x9f, 0x9e, 0x8b, + 0x5f, 0x09, 0x58, 0x0c, 0xbd, 0x0b, 0x28, 0x60, 0xee, 0x33, 0x2a, 0x0e, 0xdc, 0x11, 0x11, 0x09, + 0x49, 0x9f, 0x4b, 0x3a, 0x13, 0xb0, 0xc7, 0x54, 0x1c, 0xec, 0x13, 0x11, 0x93, 0xcb, 0xbf, 0x69, + 0xa0, 0x47, 0xbb, 0xc8, 0xe9, 0x7b, 0x40, 0x05, 0x96, 0x47, 0x4c, 0x90, 0xd3, 0xff, 0xff, 0x18, + 0x86, 0xee, 0xc2, 0x4a, 0xbc, 0x25, 0x71, 0x43, 0x97, 0xea, 0xba, 0x32, 0xf3, 0xc7, 0x9c, 0xdc, + 0xef, 0xec, 0x84, 0x71, 0x6c, 0x84, 0xcb, 0xc7, 0x47, 0xf8, 0x40, 0xcf, 0xa6, 0x0b, 0x7a, 0xf9, + 0x2f, 0x0d, 0xd6, 0x95, 0x10, 0x5b, 0x38, 0xc4, 0x3e, 0x47, 0x4f, 0x20, 0xe7, 0xd3, 0xe0, 0x48, + 0xd2, 0xda, 0x69, 0x92, 0xbe, 0x1c, 0x49, 0xfa, 0xfd, 0xdb, 0xd2, 0xff, 0xa7, 0x58, 0x37, 0x98, + 0x4f, 0x05, 0xf1, 0x07, 0x62, 0x6c, 0x83, 0x4f, 0x83, 0x44, 0xe9, 0x3e, 0x20, 0x1f, 0x3f, 0x4f, + 0x40, 0xee, 0x80, 0x84, 0x94, 0x79, 0xb2, 0x11, 0x51, 0x86, 0x59, 0x79, 0x36, 0xd4, 0xae, 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 0xea, 0x5d, 0x51, 0x7b, 0xfd, 0xae, 0xa8, 0xfd, + 0xf3, 0xae, 0xa8, 0xbd, 0x38, 0x2c, 0x2e, 0xbd, 0x3e, 0x2c, 0x2e, 0xfd, 0x79, 0x58, 0x5c, 0xfa, + 0xf6, 0x7a, 0x8f, 0x8a, 0x83, 0x61, 0xa7, 0xd2, 0x65, 0xbe, 0xba, 0x94, 0xaa, 0xc7, 0x4d, 0xee, + 0x7d, 0x57, 0x7d, 0x2e, 0x2f, 0xda, 0x62, 0x3c, 0x20, 0x3c, 0xba, 0x45, 0x67, 0xa4, 0xda, 0x6f, + 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x15, 0x25, 0x6f, 0x13, 0x86, 0x0b, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { diff --git a/x/gov/types/v1/proposal.go b/x/gov/types/v1/proposal.go index 35e65babfef..76d046574ee 100644 --- a/x/gov/types/v1/proposal.go +++ b/x/gov/types/v1/proposal.go @@ -20,7 +20,6 @@ const ( StatusPassed = ProposalStatus_PROPOSAL_STATUS_PASSED StatusRejected = ProposalStatus_PROPOSAL_STATUS_REJECTED StatusFailed = ProposalStatus_PROPOSAL_STATUS_FAILED - StatusCanceled = ProposalStatus_PROPOSAL_STATUS_CANCELED ) // NewProposal creates a new Proposal instance @@ -115,8 +114,7 @@ func ValidProposalStatus(status ProposalStatus) bool { status == StatusVotingPeriod || status == StatusPassed || status == StatusRejected || - status == StatusFailed || - status == StatusCanceled { + status == StatusFailed { return true } return false diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 03b164dfad1..8dcad178345 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -717,7 +717,7 @@ type MsgCancelProposalResponse struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` // canceled_time is the time when proposal is canceled. CanceledTime time.Time `protobuf:"bytes,2,opt,name=canceled_time,json=canceledTime,proto3,stdtime" json:"canceled_time"` - // canceled_height defines the block height at which the proposal is cancel. + // canceled_height defines the block height at which the proposal is canceled. CanceledHeight uint64 `protobuf:"varint,3,opt,name=canceled_height,json=canceledHeight,proto3" json:"canceled_height,omitempty"` } From 8058f677bf67d1fe25ff862e6f6224001868338c Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 24 Oct 2022 22:47:56 +0530 Subject: [PATCH 34/69] chore: typo fix --- x/gov/keeper/proposal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 923eae287c0..2fc8465a89c 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -99,7 +99,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, proposer sdk.AccAddress, me func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer string) error { proposal, ok := keeper.GetProposal(ctx, proposalID) if !ok { - return sdkerrors.Wrapf(types.ErrProposalNotFound, "proposal is not found with %d id", proposalID) + return sdkerrors.Wrapf(types.ErrProposalNotFound, "proposal not found with %d id", proposalID) } // Check creator of the proposal From 3d502060ab29d200d21a8af29a467b43a2c638b0 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 26 Oct 2022 11:22:16 +0530 Subject: [PATCH 35/69] chore: allow only action proposals for migration --- x/gov/keeper/proposal.go | 4 ++++ x/gov/migrations/v4/store.go | 6 ++++++ x/gov/types/errors.go | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 2fc8465a89c..3232d4a16ed 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -102,6 +102,10 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer return sdkerrors.Wrapf(types.ErrProposalNotFound, "proposal not found with %d id", proposalID) } + if proposal.Proposer == "" { + return sdkerrors.Wrapf(types.ErrInvalidProposal, "proposal %d does n't have proposer %s, so cannot be canceled", proposalID, proposer) + } + // Check creator of the proposal if proposal.Proposer != proposer { return sdkerrors.Wrapf(types.ErrInvalidProposer, "invalid proposer %s", proposer) diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go index f9a5ee043dc..4a95b122113 100644 --- a/x/gov/migrations/v4/store.go +++ b/x/gov/migrations/v4/store.go @@ -72,6 +72,12 @@ func AddProposerAddressToProposal(ctx sdk.Context, storeKey storetypes.StoreKey, panic(err) } + // Check if proposal is active + if proposal.Status != govv1.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD && + proposal.Status != govv1.ProposalStatus_PROPOSAL_STATUS_DEPOSIT_PERIOD { + return fmt.Errorf("invalid proposal : %s, proposal not active", proposals[proposalID]) + } + proposal.Proposer = proposals[proposalID] // set the new proposal with proposer diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index d89a7a5e3f0..b7496b59f21 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -26,5 +26,5 @@ var ( ErrInvalidProposer = sdkerrors.Register(ModuleName, 18, "invalid proposer") ErrNoDeposits = sdkerrors.Register(ModuleName, 19, "no deposits found") ErrVotingPeriodEnded = sdkerrors.Register(ModuleName, 20, "voting period already ended") - ErrInvalidProposal = sdkerrors.Register(ModuleName, 21, "proposal is already processed") + ErrInvalidProposal = sdkerrors.Register(ModuleName, 21, "invalid proposal") ) From d9eb5974217f33d250e7c263113eeaa9b8384c46 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 26 Oct 2022 11:47:55 +0530 Subject: [PATCH 36/69] test: fix the keeper test of cancel proposal --- x/gov/keeper/common_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index b7969a9bc45..c70f0dff347 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -80,6 +80,7 @@ func setupGovKeeper(t *testing.T) ( stakingKeeper.EXPECT().IterateBondedValidatorsByPower(gomock.Any(), gomock.Any()).AnyTimes() stakingKeeper.EXPECT().IterateDelegations(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()).Return(math.NewInt(10000000)).AnyTimes() + distributionKeeper.EXPECT().FundCommunityPool(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() // Gov keeper initializations govKeeper := keeper.NewKeeper(encCfg.Codec, key, acctKeeper, bankKeeper, stakingKeeper, distributionKeeper, msr, types.DefaultConfig(), govAcct.String()) From 0a7a79805b909973752599aac95819539f1a4298 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 26 Oct 2022 12:58:52 +0530 Subject: [PATCH 37/69] chore: address the pr comments --- CHANGELOG.md | 2 +- UPGRADING.md | 5 ++++- x/gov/README.md | 2 +- x/gov/keeper/deposit.go | 2 +- x/gov/keeper/proposal.go | 4 +++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b884d1e60a6..34381d3813d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -157,7 +157,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [#13430](https://github.com/cosmos/cosmos-sdk/pull/13430) Remove unused code `ResponseCheckTx` and `ResponseDeliverTx` * (store) [#13529](https://github.com/cosmos/cosmos-sdk/pull/13529) Add method `LatestVersion` to `MultiStore` interface, add method `SetQueryMultiStore` to baesapp to support alternative `MultiStore` implementation for query service. * (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Add `proposer` parameter to `NewProposal` method. -* (pruning) [#13609]](https://github.com/cosmos/cosmos-sdk/pull/13609) Move pruning pacakge to be under store pacakge. +* (pruning) [#13609](https://github.com/cosmos/cosmos-sdk/pull/13609) Move pruning pacakge to be under store pacakge. ### CLI Breaking Changes diff --git a/UPGRADING.md b/UPGRADING.md index edf49c58cc7..d6cb2bae14d 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -96,9 +96,12 @@ modified to set the new parameter to the desired value. ##### Proposer field to Proposal + The `Proposal` state has been updated with proposer field. For proposal state migraton developers should ensure to call `v4.AddProposerAddressToProposal` in their upgrade handler. +> This migration is optional, if chain wants to cancel previous proposals which are active (deposit or voting period) they can do this proposals state migration. + ```go import ( sdk "github.com/cosmos/cosmos-sdk/types" @@ -110,7 +113,7 @@ import ( func (app SimApp) RegisterUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler(UpgradeName, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - // add proposal ids with proposers + // add proposal ids with proposers which are active (deposit or voting period) proposals := make(map[uint64]string) // proposals[1] = "cosmos1luyncewxk4lm24k6gqy8y5dxkj0klr4tu0lmnj" ... v4.AddProposerAddressToProposal(ctx, sdk.NewKVStoreKey(v4.ModuleName), app.appCodec, proposals) diff --git a/x/gov/README.md b/x/gov/README.md index d1020bb40f7..6eee7f7d932 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -429,7 +429,6 @@ const ( StatusPassed ProposalStatus = 0x03 // Proposal passed and successfully executed StatusRejected ProposalStatus = 0x04 // Proposal has been rejected StatusFailed ProposalStatus = 0x05 // Proposal passed but failed execution - StatusCanceled ProposalStatus = 0x06 // Proposal has been canceled before the voting period ended ) ``` @@ -1314,6 +1313,7 @@ simd tx gov submit-legacy-proposal software-upgrade v2 --title="Test Proposal" - #### cancel-proposal The `cancel-proposal` command allows the proposer to cancel the goverance proposal before voting period ends. +Once proposal is canceled, from the deposits of proposal `proposal_cancel_burn_rate * deposits` will be sent to community pool and `remaining deposits` will be burned. ```bash simd tx gov cancel-proposal [proposal-id] [flags] diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index e27b4c5a2e1..1b1630a4c69 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -162,7 +162,7 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd return activatedVotingPeriod, nil } -// BurnAndSendDepositsToCommunityPool will burn the (deposits * prposal_cancel_burn_rate) amount of proposal deposits +// BurnAndSendDepositsToCommunityPool will burn the (deposits * proposal_cancel_burn_rate) amount of proposal deposits // and send remaining deposits of the proposal to community pool. func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64, totalDeposits []sdk.Coin) error { store := ctx.KVStore(keeper.storeKey) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 3232d4a16ed..4ec9ed9a1f1 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -102,8 +102,10 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer return sdkerrors.Wrapf(types.ErrProposalNotFound, "proposal not found with %d id", proposalID) } + // Checking proposal have proposer or not because old proposal doesn't have proposer feild, + // https://github.com/cosmos/cosmos-sdk/blob/v0.46.2/proto/cosmos/gov/v1/gov.proto#L43 if proposal.Proposer == "" { - return sdkerrors.Wrapf(types.ErrInvalidProposal, "proposal %d does n't have proposer %s, so cannot be canceled", proposalID, proposer) + return sdkerrors.Wrapf(types.ErrInvalidProposal, "proposal %d doesn't have proposer %s, so cannot be canceled", proposalID, proposer) } // Check creator of the proposal From 3e0b0c89968491f0ec70a5f375dd694f1e7c9eeb Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 18 Nov 2022 18:37:38 +0530 Subject: [PATCH 38/69] chore: update the proto files --- api/cosmos/gov/v1/gov.pulsar.go | 228 +++++++++++++------------- api/cosmos/gov/v1/tx.pulsar.go | 281 ++++++++++++++++++-------------- x/gov/types/v1/gov.pb.go | 152 ++++++++--------- x/gov/types/v1/tx.pb.go | 120 +++++++------- 4 files changed, 414 insertions(+), 367 deletions(-) diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 098ee2b3892..9970d56f38d 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -6924,7 +6924,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, 0xdb, 0x04, 0x0a, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x91, 0x05, 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, @@ -6962,121 +6962,129 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, + 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x0b, 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, + 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, 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, 0xd9, 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, + 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, 0xd9, 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, 0x22, + 0x54, 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, 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, 0x22, 0x54, 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, + 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, + 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x9a, 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, 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, 0x22, 0x87, 0x04, 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, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, - 0x9a, 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, 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, 0x22, 0xbc, 0x03, 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, + 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, 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, 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, + 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, 0x49, 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x61, 0x74, 0x65, 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, - 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, 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/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 73335903dd8..9d005504c9b 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7455,136 +7455,165 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, - 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x99, 0x02, 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, 0x62, - 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, - 0x12, 0x4d, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x18, 0x02, 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, - 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, - 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x03, 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, 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, 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, 0xa8, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3b, 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, 0x0b, 0xca, 0xb4, 0x2d, 0x07, 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, + 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, 0x99, 0x02, 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, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x18, 0x02, 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, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x03, 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, 0x32, 0x8a, 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, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 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, 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, 0xa8, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, + 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3b, 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, 0x0b, 0xca, 0xb4, 0x2d, 0x07, 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, 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, + 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, 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, + 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, 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, + 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, diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 4a48e7c7e1f..41fb6b2631f 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -809,81 +809,83 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1173 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x8f, 0xd3, 0xc6, - 0x17, 0x5f, 0x27, 0xde, 0x6c, 0xf2, 0xb2, 0x09, 0x66, 0xe0, 0x0b, 0xde, 0x05, 0x92, 0x25, 0xfa, - 0x0a, 0x6d, 0xf9, 0x91, 0x74, 0x41, 0xf4, 0x42, 0x2f, 0xc9, 0xc6, 0x14, 0x23, 0xba, 0x89, 0x6c, - 0x13, 0x44, 0x2f, 0x96, 0xb3, 0x36, 0xc9, 0xa8, 0xb1, 0x27, 0xf5, 0x4c, 0x02, 0xf9, 0x13, 0x7a, - 0xe3, 0x58, 0xf5, 0xd4, 0x63, 0x8f, 0x3d, 0xa0, 0x9e, 0xfa, 0x07, 0x70, 0xaa, 0x10, 0x97, 0xb6, - 0xaa, 0x44, 0x2b, 0x38, 0x54, 0xe2, 0xaf, 0xa8, 0x3c, 0x1e, 0x6f,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- 0xf6, 0x0d, 0xe1, 0xad, 0xfd, 0x20, 0xc1, 0x5a, 0xdb, 0x1b, 0x13, 0x8a, 0x19, 0xaa, 0x42, 0x71, - 0x1c, 0x92, 0x31, 0xa1, 0xce, 0xc8, 0xc6, 0x2e, 0xcf, 0x25, 0x1b, 0x90, 0x98, 0x74, 0x17, 0x7d, - 0x06, 0x05, 0x37, 0xc6, 0x92, 0x50, 0xc4, 0x55, 0x5f, 0xbf, 0xb8, 0x71, 0x56, 0xc4, 0x6d, 0xba, - 0x6e, 0xe8, 0x51, 0x6a, 0xb2, 0x10, 0x07, 0x03, 0x63, 0x0e, 0x45, 0x9f, 0x43, 0xce, 0xf1, 0xc9, - 0x24, 0x60, 0x6a, 0x76, 0x2b, 0xbb, 0x5d, 0x9c, 0xd7, 0x1f, 0x8d, 0xa9, 0x2e, 0xc6, 0x54, 0xdf, - 0x25, 0x38, 0x68, 0x15, 0x5e, 0xbe, 0xa9, 0xae, 0xfc, 0xf8, 0xcf, 0x4f, 0x57, 0x25, 0x43, 0x70, - 0x6a, 0x7f, 0xca, 0x90, 0xef, 0x8a, 0x22, 0x50, 0x19, 0x32, 0x07, 0xa5, 0x65, 0xb0, 0x8b, 0x3e, - 0x85, 0xbc, 0xef, 0x51, 0xea, 0x0c, 0x3c, 0xaa, 0x66, 0x78, 0xf0, 0xb3, 0xf5, 0x78, 0x22, 0xf5, - 0x64, 0x22, 0xf5, 0x66, 0x30, 0x33, 0x0e, 0x50, 0xe8, 0x36, 0xe4, 0x28, 0x73, 0xd8, 0x84, 0xaa, - 0x59, 0xde, 0xcc, 0x4b, 0xa9, 0x66, 0x26, 0xa9, 0x4c, 0x0e, 0x32, 0x04, 0x18, 0xdd, 0x03, 0xf4, - 0x04, 0x07, 0xce, 0xc8, 0x66, 0xce, 0x68, 0x34, 0xb3, 0x43, 0x8f, 0x4e, 0x46, 0x4c, 0x95, 0xb7, - 0xa4, 0xed, 0xe2, 0xcd, 0xcd, 0x54, 0x08, 0x2b, 0x82, 0x18, 0x1c, 0x61, 0x28, 0x9c, 0xb5, 0x60, - 0x41, 0x4d, 0x28, 0xd2, 0x49, 0xdf, 0xc7, 0xcc, 0x8e, 0x64, 0xa6, 0xae, 0x8a, 0x10, 0xe9, 0xaa, - 0xad, 0x44, 0x83, 0x2d, 0xf9, 0xf9, 0x5f, 0x55, 0xc9, 0x80, 0x98, 0x14, 0x99, 0xd1, 0x7d, 0x50, - 0x44, 0x77, 0x6d, 0x2f, 0x70, 0xe3, 0x38, 0xb9, 0x13, 0xc6, 0x29, 0x0b, 0xa6, 0x16, 0xb8, 0x3c, - 0x96, 0x0e, 0x25, 0x46, 0x98, 0x33, 0xb2, 0x85, 0x5d, 0x5d, 0xfb, 0x80, 0x19, 0xad, 0x73, 0x6a, - 0x22, 0xa0, 0x07, 0x70, 0x7a, 0x4a, 0x18, 0x0e, 0x06, 0x36, 0x65, 0x4e, 0x28, 0xd6, 0x97, 0x3f, - 0x61, 0x5d, 0xa7, 0x62, 0xaa, 0x19, 0x31, 0x79, 0x61, 0xf7, 0x40, 0x98, 0xe6, 0x6b, 0x2c, 0x9c, - 0x30, 0x56, 0x29, 0x26, 0x26, 0x4b, 0xdc, 0x8c, 0x44, 0xc2, 0x1c, 0xd7, 0x61, 0x8e, 0x0a, 0x91, - 0x6c, 0x8d, 0x83, 0xf7, 0xda, 0x6f, 0x12, 0x14, 0x17, 0xa7, 0x73, 0x0d, 0x0a, 0x33, 0x8f, 0xda, - 0xfb, 0x5c, 0xae, 0xd2, 0x91, 0xbd, 0xa3, 0x07, 0xcc, 0xc8, 0xcf, 0x3c, 0xba, 0x1b, 0xf9, 0xd1, - 0x2d, 0x28, 0x39, 0x7d, 0xca, 0x1c, 0x1c, 0x08, 0x42, 0x66, 0x29, 0x61, 0x5d, 0x80, 0x62, 0xd2, - 0x27, 0x90, 0x0f, 0x88, 0xc0, 0x67, 0x97, 0xe2, 0xd7, 0x02, 0x12, 0x43, 0xef, 0x00, 0x0a, 0x88, - 0x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b7, 0xee, - 0xd9, 0x3d, 0xcd, 0xea, 0x28, 0xf2, 0xd5, 0x5f, 0x25, 0x28, 0x1f, 0xfe, 0x3e, 0xa3, 0x2a, 0x5c, - 0xe8, 0x1a, 0x9d, 0x6e, 0xc7, 0x6c, 0x3e, 0xb0, 0x4d, 0xab, 0x69, 0x3d, 0x34, 0x53, 0x35, 0xd5, - 0xa0, 0x92, 0x06, 0xb4, 0xb5, 0x6e, 0xc7, 0xd4, 0x2d, 0xbb, 0xab, 0x19, 0x7a, 0xa7, 0xad, 0x48, - 0xe8, 0x32, 0x5c, 0x4a, 0x63, 0x7a, 0x1d, 0x4b, 0xdf, 0xfb, 0x22, 0x81, 0x64, 0xd0, 0x26, 0x9c, - 0x4b, 0x43, 0xba, 0x4d, 0xd3, 0xd4, 0xda, 0x71, 0xd1, 0x69, 0x9f, 0xa1, 0xdd, 0xd7, 0x76, 0x2d, - 0xad, 0xad, 0xc8, 0xcb, 0x98, 0x77, 0x9b, 0xfa, 0x03, 0xad, 0xad, 0xac, 0xb6, 0xb4, 0x97, 0x6f, - 0x2b, 0xd2, 0xab, 0xb7, 0x15, 0xe9, 0xef, 0xb7, 0x15, 0xe9, 0xf9, 0xbb, 0xca, 0xca, 0xab, 0x77, - 0x95, 0x95, 0xdf, 0xdf, 0x55, 0x56, 0xbe, 0xba, 0x36, 0xc0, 0x6c, 0x38, 0xe9, 0xd7, 0xf7, 0x89, - 0x2f, 0x6e, 0x8d, 0xe2, 0xef, 0x06, 0x75, 0xbf, 0x6e, 0x3c, 0xe3, 0x37, 0x61, 0x36, 0x1b, 0x7b, - 0x34, 0xba, 0xe6, 0xe6, 0xb8, 0x44, 0x6f, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x2e, 0xe3, 0xbc, - 0x91, 0x27, 0x0b, 0x00, 0x00, + // 1215 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 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d, 0x62, 0x76, 0x9b, + 0x8e, 0xb5, 0xf3, 0x65, 0x02, 0x49, 0xa1, 0x75, 0x38, 0x37, 0x0b, 0x69, 0xd5, 0xda, 0x6d, 0xb3, + 0x11, 0x17, 0x3d, 0x9b, 0xb3, 0xcd, 0xfb, 0xe6, 0xb6, 0x63, 0x36, 0x0a, 0xfa, 0x3c, 0xe6, 0xdd, + 0x9a, 0xf5, 0xc0, 0x6c, 0x14, 0x16, 0xeb, 0xe6, 0xcb, 0xb7, 0x45, 0xed, 0xd5, 0xdb, 0xa2, 0xf6, + 0xcf, 0xdb, 0xa2, 0xf6, 0xfc, 0x5d, 0x71, 0xe1, 0xd5, 0xbb, 0xe2, 0xc2, 0x9f, 0xef, 0x8a, 0x0b, + 0x5f, 0x5f, 0xeb, 0x51, 0xb1, 0x37, 0xec, 0x54, 0xba, 0xcc, 0x57, 0xd7, 0x56, 0xf5, 0x75, 0x83, + 0x7b, 0xdf, 0x54, 0x9f, 0xc9, 0xab, 0xb8, 0x18, 0x0f, 0x08, 0x8f, 0xee, 0xd9, 0x19, 0xe9, 0xf6, + 0x5b, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x62, 0x8b, 0x7f, 0x1c, 0xa8, 0x0b, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 1dcca97cbd6..73b1408419a 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -796,62 +796,70 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 878 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x9b,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- 0x2a, 0xad, 0x82, 0x03, 0x92, 0xd0, 0xe7, 0xae, 0x79, 0xac, 0x80, 0x5a, 0x8f, 0xe2, 0xad, 0x43, - 0x34, 0xf8, 0x02, 0x61, 0x38, 0x18, 0xbf, 0x21, 0x01, 0x43, 0x01, 0x53, 0x5f, 0x82, 0xd2, 0x40, - 0x3c, 0xc6, 0xac, 0x1b, 0xbc, 0xed, 0x56, 0x7e, 0x3d, 0xdd, 0x28, 0x49, 0x8e, 0x93, 0x30, 0xd4, - 0x27, 0xa0, 0x0c, 0x87, 0x6c, 0x9f, 0x44, 0x1e, 0x1b, 0x6b, 0x2b, 0xb1, 0xc6, 0x49, 0xa0, 0xf3, - 0x9c, 0x8b, 0x9c, 0xbc, 0x73, 0x95, 0x66, 0x46, 0x65, 0xa6, 0x23, 0xd3, 0x00, 0x4f, 0x16, 0xc5, - 0x13, 0xad, 0xe6, 0x9f, 0x0a, 0x28, 0xf5, 0x28, 0xde, 0x25, 0x0c, 0xa9, 0xcf, 0x17, 0xe8, 0xee, - 0xd6, 0xfe, 0xbe, 0x68, 0x4c, 0x87, 0xc5, 0xa6, 0x4e, 0xb9, 0xa1, 0x5a, 0xe0, 0xde, 0x88, 0x30, - 0x14, 0x89, 0x9e, 0x97, 0xec, 0xa6, 0x80, 0xa9, 0x6d, 0x50, 0x24, 0x21, 0xf3, 0x48, 0x10, 0x6f, - 0xff, 0xea, 0xe4, 0x18, 0x89, 0x41, 0xb3, 0x78, 0x2f, 0x5f, 0xc6, 0x00, 0x47, 0x02, 0x97, 0xee, - 0xfe, 0xbb, 0xdc, 0x18, 0x51, 0x9a, 0x9b, 0xf2, 0x30, 0x63, 0x0a, 0xaf, 0x67, 0x56, 0xc1, 0x03, - 0xf9, 0x98, 0x4a, 0xff, 0x47, 0x49, 0x63, 0x5f, 0x23, 0x0f, 0xef, 0x33, 0xe4, 0xfe, 0x5f, 0x16, - 0xbc, 0x04, 0x25, 0xa1, 0x8c, 0x6a, 0xf9, 0x78, 0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 0x40, 0x21, 0xbe, 0xb8, 0x1e, 0x65, 0x49, 0x3c, 0xae, 0x1b, 0x8b, 0xe3, 0x29, 0x7f, 0x17, 0xbc, - 0x35, 0x33, 0xfd, 0x37, 0xe0, 0x93, 0xbc, 0xfe, 0xde, 0xf2, 0x7c, 0x5a, 0xf7, 0x33, 0x50, 0x4a, - 0x06, 0xa7, 0x9e, 0xa5, 0xc8, 0x94, 0xfe, 0xf4, 0xc6, 0xd4, 0x74, 0x83, 0x33, 0x47, 0x70, 0x41, - 0x83, 0xd3, 0xf9, 0x45, 0x0d, 0x2e, 0x3a, 0x05, 0xfa, 0xbd, 0x1f, 0xf8, 0x39, 0xeb, 0x6e, 0x9d, - 0x5d, 0x1a, 0xca, 0xf9, 0xa5, 0xa1, 0xfc, 0x71, 0x69, 0x28, 0x3f, 0x5d, 0x19, 0xb9, 0xf3, 0x2b, - 0x23, 0xf7, 0xfb, 0x95, 0x91, 0xfb, 0x66, 0x1d, 0x7b, 0x6c, 0x7f, 0xd8, 0xb7, 0x06, 0xc4, 0x97, - 0xff, 0x4d, 0xec, 0xcc, 0xc1, 0x63, 0xe3, 0x10, 0x51, 0xfe, 0x4f, 0xa8, 0x18, 0x7f, 0xdc, 0x3e, - 0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x45, 0xda, 0x06, 0x49, 0x09, 0x00, 0x00, + // 997 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcd, 0x6f, 0xdc, 0x44, + 0x14, 0x8f, 0x93, 0x34, 0x9b, 0x4c, 0x9a, 0x44, 0xb1, 0xb6, 0xad, 0xd7, 0x2a, 0xde, 0xd4, 0x45, + 0x10, 0x25, 0xc4, 0x66, 0x03, 0xad, 0xd0, 0xb6, 0x42, 0xea, 0x86, 0x0a, 0x2a, 0xb1, 0xa2, 0x72, + 0xa1, 0x48, 0x08, 0x29, 0x9a,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x22, + 0x0c, 0xfb, 0xe3, 0x1d, 0x12, 0x31, 0x14, 0x31, 0xfd, 0x0e, 0xa8, 0xf5, 0xe5, 0x51, 0x58, 0x9d, + 0xc2, 0x6d, 0x67, 0xf1, 0xe7, 0xe7, 0x5b, 0x35, 0x65, 0xe3, 0x25, 0x16, 0xfa, 0x75, 0xb0, 0x00, + 0x87, 0x6c, 0x8f, 0x0c, 0x02, 0x36, 0x36, 0xa6, 0x45, 0x8e, 0x13, 0x41, 0xfb, 0x16, 0x4f, 0x72, + 0x72, 0xe7, 0x59, 0xda, 0xa5, 0x2c, 0x4b, 0x11, 0xd9, 0x16, 0xb8, 0x5e, 0x25, 0x4f, 0x72, 0xb5, + 0xff, 0xd0, 0x40, 0xad, 0x4b, 0xf1, 0x63, 0xc2, 0x90, 0x7e, 0xab, 0x22, 0xef, 0x4e, 0xfd, 0xef, + 0x57, 0xcd, 0xac, 0x58, 0x16, 0x35, 0xc3, 0x86, 0xee, 0x80, 0x4b, 0x23, 0xc2, 0xd0, 0x40, 0xc6, + 0x7c, 0x46, 0x35, 0x25, 0x4c, 0x6f, 0x81, 0x39, 0x12, 0xb3, 0x80, 0x44, 0xa2, 0xfc, 0xcb, 0x93, + 0xbf, 0x91, 0xec, 0x44, 0x87, 0xc7, 0xf2, 0x99, 0x00, 0x78, 0x0a, 0x78, 0x66, 0xf5, 0xdf, 0xe4, + 0xc4, 0x48, 0xd7, 0x9c, 0x94, 0x2b, 0x25, 0x52, 0xb8, 0x3f, 0x7b, 0x15, 0xac, 0xa8, 0x63, 0x9a, + 0xfa, 0x3f, 0x5a, 0x2a, 0xfb, 0x12, 0x05, 0x78, 0x8f, 0x21, 0xff, 0x75, 0x51, 0x70, 0x07, 0xd4, + 0x64, 0x66, 0xd4, 0x98, 0x11, 0xad, 0x74, 0xa3, 0xc0, 0x41, 0x12, 0x50, 0x86, 0x8b, 0xc4, 0xe2, + 0x4c, 0x32, 0xde, 0xc9, 0x93, 0xf1, 0x46, 0x25, 0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c, 0x3e, 0x09, 0xd5, 0xb7, 0xa6, 0x5b, 0x9a, 0x13, 0x6c, 0x1c, 0x23, 0xca, + 0xbf, 0x6c, 0xe7, 0x44, 0x1b, 0xbc, 0xf7, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x8b, 0x70, + 0x20, 0x19, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 5c8640ded6fd32c2b22b47149d96edfffcdbef8c Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 18 Nov 2022 21:32:41 +0530 Subject: [PATCH 39/69] add 'proposal_cancel_dest' param --- api/cosmos/gov/v1/gov.pulsar.go | 207 ++++++++++++++++++++--------- proto/cosmos/gov/v1/gov.proto | 8 +- tests/e2e/gov/query.go | 5 +- x/gov/client/cli/tx.go | 4 +- x/gov/keeper/deposit.go | 32 ++++- x/gov/keeper/proposal.go | 5 +- x/gov/migrations/v4/json.go | 3 +- x/gov/migrations/v4/store.go | 1 + x/gov/simulation/genesis.go | 2 +- x/gov/simulation/operations.go | 2 +- x/gov/types/v1/gov.pb.go | 229 ++++++++++++++++++++------------ x/gov/types/v1/msgs.go | 4 +- x/gov/types/v1/params.go | 30 +++-- 13 files changed, 351 insertions(+), 181 deletions(-) diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 9970d56f38d..d7b95e6e58b 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -5242,7 +5242,8 @@ var ( fd_Params_threshold protoreflect.FieldDescriptor fd_Params_veto_threshold protoreflect.FieldDescriptor fd_Params_min_initial_deposit_ratio protoreflect.FieldDescriptor - fd_Params_proposal_cancel_burn_rate protoreflect.FieldDescriptor + fd_Params_proposal_cancel_rate protoreflect.FieldDescriptor + fd_Params_proposal_cancel_dest protoreflect.FieldDescriptor ) func init() { @@ -5255,7 +5256,8 @@ func init() { fd_Params_threshold = md_Params.Fields().ByName("threshold") fd_Params_veto_threshold = md_Params.Fields().ByName("veto_threshold") fd_Params_min_initial_deposit_ratio = md_Params.Fields().ByName("min_initial_deposit_ratio") - fd_Params_proposal_cancel_burn_rate = md_Params.Fields().ByName("proposal_cancel_burn_rate") + fd_Params_proposal_cancel_rate = md_Params.Fields().ByName("proposal_cancel_rate") + fd_Params_proposal_cancel_dest = md_Params.Fields().ByName("proposal_cancel_dest") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -5365,9 +5367,15 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } - if x.ProposalCancelBurnRate != "" { - value := protoreflect.ValueOfString(x.ProposalCancelBurnRate) - if !f(fd_Params_proposal_cancel_burn_rate, value) { + if x.ProposalCancelRate != "" { + value := protoreflect.ValueOfString(x.ProposalCancelRate) + if !f(fd_Params_proposal_cancel_rate, value) { + return + } + } + if x.ProposalCancelDest != "" { + value := protoreflect.ValueOfString(x.ProposalCancelDest) + if !f(fd_Params_proposal_cancel_dest, value) { return } } @@ -5400,8 +5408,10 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.VetoThreshold != "" case "cosmos.gov.v1.Params.min_initial_deposit_ratio": return x.MinInitialDepositRatio != "" - case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": - return x.ProposalCancelBurnRate != "" + case "cosmos.gov.v1.Params.proposal_cancel_rate": + return x.ProposalCancelRate != "" + case "cosmos.gov.v1.Params.proposal_cancel_dest": + return x.ProposalCancelDest != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5432,8 +5442,10 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.VetoThreshold = "" case "cosmos.gov.v1.Params.min_initial_deposit_ratio": x.MinInitialDepositRatio = "" - case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": - x.ProposalCancelBurnRate = "" + case "cosmos.gov.v1.Params.proposal_cancel_rate": + x.ProposalCancelRate = "" + case "cosmos.gov.v1.Params.proposal_cancel_dest": + x.ProposalCancelDest = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5474,8 +5486,11 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.gov.v1.Params.min_initial_deposit_ratio": value := x.MinInitialDepositRatio return protoreflect.ValueOfString(value) - case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": - value := x.ProposalCancelBurnRate + case "cosmos.gov.v1.Params.proposal_cancel_rate": + value := x.ProposalCancelRate + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Params.proposal_cancel_dest": + value := x.ProposalCancelDest return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -5513,8 +5528,10 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.VetoThreshold = value.Interface().(string) case "cosmos.gov.v1.Params.min_initial_deposit_ratio": x.MinInitialDepositRatio = value.Interface().(string) - case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": - x.ProposalCancelBurnRate = value.Interface().(string) + case "cosmos.gov.v1.Params.proposal_cancel_rate": + x.ProposalCancelRate = value.Interface().(string) + case "cosmos.gov.v1.Params.proposal_cancel_dest": + x.ProposalCancelDest = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5559,8 +5576,10 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field veto_threshold of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.min_initial_deposit_ratio": panic(fmt.Errorf("field min_initial_deposit_ratio of message cosmos.gov.v1.Params is not mutable")) - case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": - panic(fmt.Errorf("field proposal_cancel_burn_rate of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.proposal_cancel_rate": + panic(fmt.Errorf("field proposal_cancel_rate of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.proposal_cancel_dest": + panic(fmt.Errorf("field proposal_cancel_dest of message cosmos.gov.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5591,7 +5610,9 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "cosmos.gov.v1.Params.min_initial_deposit_ratio": return protoreflect.ValueOfString("") - case "cosmos.gov.v1.Params.proposal_cancel_burn_rate": + case "cosmos.gov.v1.Params.proposal_cancel_rate": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Params.proposal_cancel_dest": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -5692,7 +5713,11 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.ProposalCancelBurnRate) + l = len(x.ProposalCancelRate) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ProposalCancelDest) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -5725,10 +5750,17 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.ProposalCancelBurnRate) > 0 { - i -= len(x.ProposalCancelBurnRate) - copy(dAtA[i:], x.ProposalCancelBurnRate) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposalCancelBurnRate))) + if len(x.ProposalCancelDest) > 0 { + i -= len(x.ProposalCancelDest) + copy(dAtA[i:], x.ProposalCancelDest) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposalCancelDest))) + i-- + dAtA[i] = 0x4a + } + if len(x.ProposalCancelRate) > 0 { + i -= len(x.ProposalCancelRate) + copy(dAtA[i:], x.ProposalCancelRate) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposalCancelRate))) i-- dAtA[i] = 0x42 } @@ -6089,7 +6121,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 8: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelBurnRate", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6117,7 +6149,39 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.ProposalCancelBurnRate = string(dAtA[iNdEx:postIndex]) + x.ProposalCancelRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelDest", 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.ProposalCancelDest = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6811,7 +6875,11 @@ type Params struct { // The burn rate of deposits when cancel the proposal // // Since: cosmos-sdk 0.47 - ProposalCancelBurnRate string `protobuf:"bytes,8,opt,name=proposal_cancel_burn_rate,json=proposalCancelBurnRate,proto3" json:"proposal_cancel_burn_rate,omitempty"` + ProposalCancelRate string `protobuf:"bytes,8,opt,name=proposal_cancel_rate,json=proposalCancelRate,proto3" json:"proposal_cancel_rate,omitempty"` + // The proposal cancel destination address will receive the remaining deposits of cancel proposal. + // + // Since: cosmos-sdk 0.47 + ProposalCancelDest string `protobuf:"bytes,9,opt,name=proposal_cancel_dest,json=proposalCancelDest,proto3" json:"proposal_cancel_dest,omitempty"` } func (x *Params) Reset() { @@ -6883,9 +6951,16 @@ func (x *Params) GetMinInitialDepositRatio() string { return "" } -func (x *Params) GetProposalCancelBurnRate() string { +func (x *Params) GetProposalCancelRate() string { if x != nil { - return x.ProposalCancelBurnRate + return x.ProposalCancelRate + } + return "" +} + +func (x *Params) GetProposalCancelDest() string { + if x != nil { + return x.ProposalCancelDest } return "" } @@ -7020,7 +7095,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x22, 0x87, 0x04, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, + 0x6c, 0x64, 0x22, 0xca, 0x04, 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, @@ -7048,43 +7123,47 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x49, 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x61, 0x74, 0x65, 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, + 0x6f, 0x12, 0x40, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, + 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, + 0x61, 0x74, 0x65, 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, 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, } var ( diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 759cb754556..45277d23e85 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -164,9 +164,13 @@ message Params { // The ratio representing the proportion of the deposit value that must be paid at proposal submission. string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec"]; - + // The burn rate of deposits when cancel the proposal // // Since: cosmos-sdk 0.47 - string proposal_cancel_burn_rate = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string proposal_cancel_rate = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // The proposal cancel destination address will receive the remaining deposits of cancel proposal. + // + // Since: cosmos-sdk 0.47 + string proposal_cancel_dest = 9 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/tests/e2e/gov/query.go b/tests/e2e/gov/query.go index 531a3d3bc57..bc3f537aa34 100644 --- a/tests/e2e/gov/query.go +++ b/tests/e2e/gov/query.go @@ -23,7 +23,7 @@ func (s *IntegrationTestSuite) TestCmdParams() { { "json output", []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000"}}`, + `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_rate":"0.000000000000000000","proposal_cancel_dest":""}}`, }, { "text output", @@ -40,7 +40,8 @@ params: - amount: "10000000" denom: stake min_initial_deposit_ratio: "0.000000000000000000" - proposal_cancel_burn_rate: "0.000000000000000000" + proposal_cancel_dest: "" + proposal_cancel_rate: "0.000000000000000000" quorum: "0.334000000000000000" threshold: "0.500000000000000000" veto_threshold: "0.334000000000000000" diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index c115a747383..fc034cc962a 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -158,9 +158,7 @@ func NewCmdCancelProposal() *cobra.Command { // Get proposer address from := clientCtx.GetFromAddress() - - msg := v1.NewMsgCancelProposal(proposalID, from) - + msg := v1.NewMsgCancelProposal(proposalID, from.String()) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 1b1630a4c69..ca5930bbc90 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) @@ -164,10 +165,10 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd // BurnAndSendDepositsToCommunityPool will burn the (deposits * proposal_cancel_burn_rate) amount of proposal deposits // and send remaining deposits of the proposal to community pool. -func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64, totalDeposits []sdk.Coin) error { +func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64, destAddress string, totalDeposits []sdk.Coin) error { store := ctx.KVStore(keeper.storeKey) - proposalCancelBurnRate := keeper.GetParams(ctx).ProposalCancelBurnRate + proposalCancelBurnRate := keeper.GetParams(ctx).ProposalCancelRate // burn the deposits * proposal_cancel_burn_rate amount from proposal deposits (gov module) burnRate := sdk.MustNewDecFromStr(proposalCancelBurnRate) @@ -192,10 +193,29 @@ func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposa } // send (deposits - burnAmount) to community pool from proposal deposits (gov module) - communityPoolAmount := sdk.NewCoins(totalDeposits...).Sub(burnDepositAmount...) - err := keeper.distrkeeper.FundCommunityPool(ctx, communityPoolAmount, keeper.ModuleAccountAddress()) - if err != nil { - return err + remainingAmount := sdk.Coins(totalDeposits).Sub(burnDepositAmount...) + + // get the distribution module account address + distributionAddress := keeper.authKeeper.GetModuleAddress(distributiontypes.ModuleName) + if distributionAddress.String() == destAddress { + err := keeper.distrkeeper.FundCommunityPool(ctx, remainingAmount, keeper.ModuleAccountAddress()) + if err != nil { + return err + } + } else { + if len(destAddress) == 0 { + // burn the remaining deposits also + err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, remainingAmount) + if err != nil { + return err + } + } else { + destAccAddress := sdk.MustAccAddressFromBech32(destAddress) + err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, destAccAddress, remainingAmount) + if err != nil { + return err + } + } } store.Delete(types.DepositsKey(proposalID)) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 7991b09ab52..8e842a2ffc9 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -124,8 +124,9 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer } // burn the (deposits * proposal_cancel_burn_rate) amount. - // and deposits * (1 - proposal_cancel_burn_rate) will be move to community pool. - err := keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id, proposal.TotalDeposit) + // and deposits * (1 - proposal_cancel_burn_rate) will be move to community pool or deposits destination address or will be burned. + destAddress := keeper.GetParams(ctx).ProposalCancelDest + err := keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id, destAddress, proposal.TotalDeposit) if err != nil { return err } diff --git a/x/gov/migrations/v4/json.go b/x/gov/migrations/v4/json.go index 0f37496ab5f..bb22884b27e 100644 --- a/x/gov/migrations/v4/json.go +++ b/x/gov/migrations/v4/json.go @@ -13,7 +13,8 @@ func MigrateJSON(oldState *v1.GenesisState) (*v1.GenesisState, error) { oldState.TallyParams.Threshold, oldState.TallyParams.VetoThreshold, v1.DefaultParams().MinInitialDepositRatio, - v1.DefaultParams().ProposalCancelBurnRate, + v1.DefaultParams().ProposalCancelRate, + v1.DefaultParams().ProposalCancelDest, ) return &v1.GenesisState{ diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go index 5a75d454774..ce10777dd5e 100644 --- a/x/gov/migrations/v4/store.go +++ b/x/gov/migrations/v4/store.go @@ -33,6 +33,7 @@ func migrateParams(ctx sdk.Context, storeKey storetypes.StoreKey, legacySubspace tp.VetoThreshold, sdk.ZeroDec().String(), sdk.ZeroDec().String(), + "", ) bz, err := cdc.Marshal(¶ms) diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index d03ea833294..86091bc27aa 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -122,7 +122,7 @@ func RandomizedGenState(simState *module.SimulationState) { govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelBurnRate.String()), + v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelBurnRate.String(), ""), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 544759c748f..2af2d60941e 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -412,7 +412,7 @@ func SimulateMsgCancelProposal(ak types.AccountKeeper, bk types.BankKeeper, k *k account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) - msg := v1.NewMsgCancelProposal(proposal.Id, account.GetAddress()) + msg := v1.NewMsgCancelProposal(proposal.Id, account.GetAddress().String()) txCtx := simulation.OperationInput{ R: r, diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 41fb6b2631f..bf1202801a9 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -700,7 +700,11 @@ type Params struct { // The burn rate of deposits when cancel the proposal // // Since: cosmos-sdk 0.47 - ProposalCancelBurnRate string `protobuf:"bytes,8,opt,name=proposal_cancel_burn_rate,json=proposalCancelBurnRate,proto3" json:"proposal_cancel_burn_rate,omitempty"` + ProposalCancelRate string `protobuf:"bytes,8,opt,name=proposal_cancel_rate,json=proposalCancelRate,proto3" json:"proposal_cancel_rate,omitempty"` + // The proposal cancel destination address will receive the remaining deposits of cancel proposal. + // + // Since: cosmos-sdk 0.47 + ProposalCancelDest string `protobuf:"bytes,9,opt,name=proposal_cancel_dest,json=proposalCancelDest,proto3" json:"proposal_cancel_dest,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -785,9 +789,16 @@ func (m *Params) GetMinInitialDepositRatio() string { return "" } -func (m *Params) GetProposalCancelBurnRate() string { +func (m *Params) GetProposalCancelRate() string { if m != nil { - return m.ProposalCancelBurnRate + return m.ProposalCancelRate + } + return "" +} + +func (m *Params) GetProposalCancelDest() string { + if m != nil { + return m.ProposalCancelDest } return "" } @@ -809,83 +820,84 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1215 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x6f, 0x13, 0x47, - 0x14, 0xce, 0xda, 0x1b, 0xc7, 0x79, 0x4e, 0x8c, 0x19, 0x28, 0x6c, 0x02, 0xd8, 0xc1, 0xaa, 0x50, - 0xca, 0x0f, 0xbb, 0x81, 0xd2, 0x0b, 0xbd, 0xd8, 0xf1, 0x52, 0x16, 0xd1, 0xd8, 0x5a, 0x2f, 0x41, - 0xf4, 0xb2, 0x1a, 0x7b, 0x07, 0x67, 0x54, 0xef, 0x8e, 0xbb, 0x33, 0x36, 0xf8, 0x2f, 0xa8, 0x7a, - 0xa3, 0xb7, 0xaa, 0xa7, 0x1e, 0x7b, 0xec, 0x01, 0xf5, 0x6f, 0xe0, 0x54, 0x21, 0x2e, 0x6d, 0x2f, - 0xb4, 0x82, 0x43, 0x25, 0xfe, 0x8a, 0x6a, 0x67, 0x67, 0x63, 0xc7, 0x71, 0x95, 0x84, 0x8b, 0xbd, - 0x7e, 0xef, 0xfb, 0xbe, 0x79, 0xf3, 0xde, 0xe7, 0xd9, 0x81, 0xf3, 0x5d, 0xc6, 0x7d, 0xc6, 0xab, - 0x3d, 0x36, 0xaa, 0x8e, 0xb6, 0xa2, 0xaf, 0xca, 0x20, 0x64, 0x82, 0xa1, 0xd5, 0x38, 0x51, 0x89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3, 0xa0, 0x93, 0xaa, 0xa9, 0x0a, 0xe5, 0x34, 0xa0, 0x69, 0xb6, 0x5b, 0x1d, 0xcb, + 0x71, 0xdb, 0xa6, 0x6d, 0xb5, 0x9a, 0x25, 0x0d, 0x5d, 0x82, 0x8b, 0x69, 0xcc, 0x6e, 0xcb, 0xb1, + 0x76, 0x3e, 0x4b, 0x20, 0x19, 0xb4, 0x06, 0x67, 0xd3, 0x90, 0x76, 0xa3, 0xd3, 0x31, 0x9b, 0x71, + 0xd1, 0xe9, 0x9c, 0x6d, 0xde, 0x33, 0xb7, 0x1d, 0xb3, 0x59, 0xd2, 0x67, 0x31, 0xef, 0x34, 0xac, + 0xfb, 0x66, 0xb3, 0x34, 0xbf, 0x65, 0xbe, 0x78, 0x53, 0xd6, 0x5e, 0xbe, 0x29, 0x6b, 0x7f, 0xbe, + 0x29, 0x6b, 0xcf, 0xde, 0x96, 0xe7, 0x5e, 0xbe, 0x2d, 0xcf, 0xfd, 0xf6, 0xb6, 0x3c, 0xf7, 0xc5, + 0xd5, 0x1e, 0x15, 0xfb, 0xc3, 0xbd, 0x5a, 0x97, 0xf9, 0xea, 0xcb, 0x57, 0xfd, 0xbb, 0xce, 0xbd, + 0x2f, 0xeb, 0x4f, 0xe5, 0xd7, 0xbc, 0x18, 0x0f, 0x08, 0x8f, 0x3e, 0xd5, 0x73, 0xf2, 0x85, 0xb9, + 0xf9, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd2, 0x41, 0xd9, 0xac, 0xeb, 0x0b, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1350,10 +1362,17 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.ProposalCancelBurnRate) > 0 { - i -= len(m.ProposalCancelBurnRate) - copy(dAtA[i:], m.ProposalCancelBurnRate) - i = encodeVarintGov(dAtA, i, uint64(len(m.ProposalCancelBurnRate))) + if len(m.ProposalCancelDest) > 0 { + i -= len(m.ProposalCancelDest) + copy(dAtA[i:], m.ProposalCancelDest) + i = encodeVarintGov(dAtA, i, uint64(len(m.ProposalCancelDest))) + i-- + dAtA[i] = 0x4a + } + if len(m.ProposalCancelRate) > 0 { + i -= len(m.ProposalCancelRate) + copy(dAtA[i:], m.ProposalCancelRate) + i = encodeVarintGov(dAtA, i, uint64(len(m.ProposalCancelRate))) i-- dAtA[i] = 0x42 } @@ -1666,7 +1685,11 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } - l = len(m.ProposalCancelBurnRate) + l = len(m.ProposalCancelRate) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.ProposalCancelDest) if l > 0 { n += 1 + l + sovGov(uint64(l)) } @@ -3277,7 +3300,39 @@ func (m *Params) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelBurnRate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelRate", 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.ProposalCancelRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelDest", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3305,7 +3360,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProposalCancelBurnRate = string(dAtA[iNdEx:postIndex]) + m.ProposalCancelDest = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 6268a8df3eb..f3263b93a7f 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -297,10 +297,10 @@ func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress { // NewMsgCancelProposal creates a new MsgCancelProposal instance // //nolint:interfacer -func NewMsgCancelProposal(proposalID uint64, proposer sdk.AccAddress) *MsgCancelProposal { +func NewMsgCancelProposal(proposalID uint64, proposer string) *MsgCancelProposal { return &MsgCancelProposal{ ProposalId: proposalID, - Proposer: proposer.String(), + Proposer: proposer, } } diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index a3ef765f95d..3a6205731b1 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -15,12 +15,13 @@ const ( // Default governance params var ( - DefaultMinDepositTokens = sdk.NewInt(10000000) - DefaultQuorum = sdk.NewDecWithPrec(334, 3) - DefaultThreshold = sdk.NewDecWithPrec(5, 1) - DefaultVetoThreshold = sdk.NewDecWithPrec(334, 3) - DefaultMinInitialDepositRatio = sdk.ZeroDec() - DefaultProposalCancelBurnRate = sdk.ZeroDec() + DefaultMinDepositTokens = sdk.NewInt(10000000) + DefaultQuorum = sdk.NewDecWithPrec(334, 3) + DefaultThreshold = sdk.NewDecWithPrec(5, 1) + DefaultVetoThreshold = sdk.NewDecWithPrec(334, 3) + DefaultMinInitialDepositRatio = sdk.ZeroDec() + DefaultProposalCancelRate = sdk.ZeroDec() + DefaultProposalCancelDestAddress = "" ) // Deprecated: NewDepositParams creates a new DepositParams object @@ -49,7 +50,7 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { func NewParams( minDeposit sdk.Coins, maxDepositPeriod time.Duration, votingPeriod time.Duration, - quorum, threshold, vetoThreshold, minInitialDepositRatio, proposalCancelBurnRate string, + quorum, threshold, vetoThreshold, minInitialDepositRatio, proposalCancelRate, proposalCancelDest string, ) Params { return Params{ MinDeposit: minDeposit, @@ -59,7 +60,8 @@ func NewParams( Threshold: threshold, VetoThreshold: vetoThreshold, MinInitialDepositRatio: minInitialDepositRatio, - ProposalCancelBurnRate: proposalCancelBurnRate, + ProposalCancelRate: proposalCancelRate, + ProposalCancelDest: proposalCancelDest, } } @@ -73,7 +75,8 @@ func DefaultParams() Params { DefaultThreshold.String(), DefaultVetoThreshold.String(), DefaultMinInitialDepositRatio.String(), - DefaultProposalCancelBurnRate.String(), + DefaultProposalCancelRate.String(), + DefaultProposalCancelDestAddress, ) } @@ -142,7 +145,7 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("mininum initial deposit ratio of proposal is too large: %s", minInitialDepositRatio) } - proposalCancelBurnRate, err := sdk.NewDecFromStr(p.ProposalCancelBurnRate) + proposalCancelBurnRate, err := sdk.NewDecFromStr(p.ProposalCancelRate) if err != nil { return fmt.Errorf("invalid burn rate of cancel proposal: %w", err) } @@ -153,5 +156,12 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("burn rate of cancel proposal is too large: %s", proposalCancelBurnRate) } + if len(p.ProposalCancelDest) != 0 { + _, err := sdk.AccAddressFromBech32(p.ProposalCancelDest) + if err != nil { + return fmt.Errorf("deposits destination address is invalid: %s", p.ProposalCancelDest) + } + } + return nil } From cc93b40434fa9b2a97f75f243cba48a95b2c3c6e Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 18 Nov 2022 21:48:22 +0530 Subject: [PATCH 40/69] chore: address the pr comments --- UPGRADING.md | 12 ++++++------ tests/e2e/gov/cli_test.go | 2 +- tests/e2e/gov/tx.go | 4 ++-- x/gov/client/cli/tx.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 1621b2975b7..e0589453000 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -116,7 +116,7 @@ modified to set the new parameter to the desired value. ##### Proposer field to Proposal -The `Proposal` state has been updated with proposer field. For proposal state migraton +The `Proposal` proto has been updated with proposer field. For proposal state migraton developers should ensure to call `v4.AddProposerAddressToProposal` in their upgrade handler. > This migration is optional, if chain wants to cancel previous proposals which are active (deposit or voting period) they can do this proposals state migration. @@ -142,16 +142,16 @@ func (app SimApp) RegisterUpgradeHandlers() { ``` -##### Proposal Cancel Burn Rate Param +##### New Feature: Cancelling Proposals -The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to community pool. The deposits burn rate will be determined by a new parameter called `ProposalCancelBurnRate` parameter. +The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to `ProposalCancelDest` address. The deposits burn rate will be determined by a new parameter called `ProposalCancelRate` parameter. ``` - 1. deposits * proposal_cancel_burn_rate will be burned - 2. deposits * (1 - proposal_cancel_burn_rate) will be sent to community pool + 1. deposits * proposal_cancel_rate will be burned + 2. deposits * (1 - proposal_cancel_rate) will be sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then all remaining deposits will be burned. ``` -By default, the new `ProposalCancelBurnRate` parameter is set to zero during migration. +By default, the new `ProposalCancelRate` parameter is set to zero during migration and `ProposalCancelDest` is set to empty string. #### `x/consensus` diff --git a/tests/e2e/gov/cli_test.go b/tests/e2e/gov/cli_test.go index 80c5cb73207..c092d20de95 100644 --- a/tests/e2e/gov/cli_test.go +++ b/tests/e2e/gov/cli_test.go @@ -18,7 +18,7 @@ import ( func TestIntegrationTestSuite(t *testing.T) { cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) - cfg.NumValidators = 2 + cfg.NumValidators = 1 suite.Run(t, NewIntegrationTestSuite(cfg)) } diff --git a/tests/e2e/gov/tx.go b/tests/e2e/gov/tx.go index a4a5b39220b..5755f0bab03 100644 --- a/tests/e2e/gov/tx.go +++ b/tests/e2e/gov/tx.go @@ -275,7 +275,7 @@ func (s *IntegrationTestSuite) TestNewCmdSubmitLegacyProposal() { func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { val := s.network.Validators[0] - val2 := s.network.Validators[1] + val2 := sdk.AccAddress("invalid_acc_addr") testCases := []struct { name string @@ -308,7 +308,7 @@ func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { "valid proposal-id but invalid proposer", []string{ "4", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val2.Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val2), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index fc034cc962a..47b34bb594f 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -141,7 +141,7 @@ Where proposal.json contains: func NewCmdCancelProposal() *cobra.Command { cmd := &cobra.Command{ Use: "cancel-proposal [proposal-id]", - Short: "Cancel governance proposal before the voting period ends.", + Short: "Cancel governance proposal before the voting period ends. Must be signed by the proposal creator.", Args: cobra.ExactArgs(1), Example: fmt.Sprintf(`$ %s tx gov cancel-proposal 1 --from mykey`, version.AppName), RunE: func(cmd *cobra.Command, args []string) error { From c58a0d37c436358edcdba83cda0ea5f4c24bfcb3 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 18 Nov 2022 21:59:47 +0530 Subject: [PATCH 41/69] chore: renamed 'proposal_cancel_burn_rate' to 'proposal_cancel_rate' --- UPGRADING.md | 11 +- api/cosmos/gov/v1/gov.pulsar.go | 137 ++++++++++++------------- proto/cosmos/gov/v1/gov.proto | 2 +- tests/e2e/gov/cli_test.go | 3 - tests/e2e/gov/query.go | 4 +- x/gov/keeper/deposit.go | 2 +- x/gov/migrations/v4/json.go | 2 +- x/gov/types/v1/gov.pb.go | 174 ++++++++++++++++---------------- x/gov/types/v1/params.go | 10 +- 9 files changed, 171 insertions(+), 174 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index e0589453000..a0d42ebae11 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -113,8 +113,7 @@ By default, the new `MinInitialDepositRatio` parameter is set to zero during mig feature is disabled. If chains wish to utilize the minimum proposal deposits at time of submission, the migration logic needs to be modified to set the new parameter to the desired value. -##### Proposer field to Proposal - +##### New Proposal.Proposer field The `Proposal` proto has been updated with proposer field. For proposal state migraton developers should ensure to call `v4.AddProposerAddressToProposal` in their upgrade handler. @@ -144,14 +143,14 @@ func (app SimApp) RegisterUpgradeHandlers() { ##### New Feature: Cancelling Proposals -The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to `ProposalCancelDest` address. The deposits burn rate will be determined by a new parameter called `ProposalCancelRate` parameter. +The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to `ProposalCancelDest` address. The deposits burn rate will be determined by a new parameter called `ProposalCancelRatio` parameter. ``` - 1. deposits * proposal_cancel_rate will be burned - 2. deposits * (1 - proposal_cancel_rate) will be sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then all remaining deposits will be burned. + 1. deposits * proposal_cancel_ratio will be burned + 2. deposits * (1 - proposal_cancel_ratio) will be sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then all remaining deposits will be burned. ``` -By default, the new `ProposalCancelRate` parameter is set to zero during migration and `ProposalCancelDest` is set to empty string. +By default, the new `ProposalCancelRatio` parameter is set to zero during migration and `ProposalCancelDest` is set to empty string. #### `x/consensus` diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index d7b95e6e58b..41428b48b39 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -5242,7 +5242,7 @@ var ( fd_Params_threshold protoreflect.FieldDescriptor fd_Params_veto_threshold protoreflect.FieldDescriptor fd_Params_min_initial_deposit_ratio protoreflect.FieldDescriptor - fd_Params_proposal_cancel_rate protoreflect.FieldDescriptor + fd_Params_proposal_cancel_ratio protoreflect.FieldDescriptor fd_Params_proposal_cancel_dest protoreflect.FieldDescriptor ) @@ -5256,7 +5256,7 @@ func init() { fd_Params_threshold = md_Params.Fields().ByName("threshold") fd_Params_veto_threshold = md_Params.Fields().ByName("veto_threshold") fd_Params_min_initial_deposit_ratio = md_Params.Fields().ByName("min_initial_deposit_ratio") - fd_Params_proposal_cancel_rate = md_Params.Fields().ByName("proposal_cancel_rate") + fd_Params_proposal_cancel_ratio = md_Params.Fields().ByName("proposal_cancel_ratio") fd_Params_proposal_cancel_dest = md_Params.Fields().ByName("proposal_cancel_dest") } @@ -5367,9 +5367,9 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } - if x.ProposalCancelRate != "" { - value := protoreflect.ValueOfString(x.ProposalCancelRate) - if !f(fd_Params_proposal_cancel_rate, value) { + if x.ProposalCancelRatio != "" { + value := protoreflect.ValueOfString(x.ProposalCancelRatio) + if !f(fd_Params_proposal_cancel_ratio, value) { return } } @@ -5408,8 +5408,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.VetoThreshold != "" case "cosmos.gov.v1.Params.min_initial_deposit_ratio": return x.MinInitialDepositRatio != "" - case "cosmos.gov.v1.Params.proposal_cancel_rate": - return x.ProposalCancelRate != "" + case "cosmos.gov.v1.Params.proposal_cancel_ratio": + return x.ProposalCancelRatio != "" case "cosmos.gov.v1.Params.proposal_cancel_dest": return x.ProposalCancelDest != "" default: @@ -5442,8 +5442,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.VetoThreshold = "" case "cosmos.gov.v1.Params.min_initial_deposit_ratio": x.MinInitialDepositRatio = "" - case "cosmos.gov.v1.Params.proposal_cancel_rate": - x.ProposalCancelRate = "" + case "cosmos.gov.v1.Params.proposal_cancel_ratio": + x.ProposalCancelRatio = "" case "cosmos.gov.v1.Params.proposal_cancel_dest": x.ProposalCancelDest = "" default: @@ -5486,8 +5486,8 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.gov.v1.Params.min_initial_deposit_ratio": value := x.MinInitialDepositRatio return protoreflect.ValueOfString(value) - case "cosmos.gov.v1.Params.proposal_cancel_rate": - value := x.ProposalCancelRate + case "cosmos.gov.v1.Params.proposal_cancel_ratio": + value := x.ProposalCancelRatio return protoreflect.ValueOfString(value) case "cosmos.gov.v1.Params.proposal_cancel_dest": value := x.ProposalCancelDest @@ -5528,8 +5528,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.VetoThreshold = value.Interface().(string) case "cosmos.gov.v1.Params.min_initial_deposit_ratio": x.MinInitialDepositRatio = value.Interface().(string) - case "cosmos.gov.v1.Params.proposal_cancel_rate": - x.ProposalCancelRate = value.Interface().(string) + case "cosmos.gov.v1.Params.proposal_cancel_ratio": + x.ProposalCancelRatio = value.Interface().(string) case "cosmos.gov.v1.Params.proposal_cancel_dest": x.ProposalCancelDest = value.Interface().(string) default: @@ -5576,8 +5576,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field veto_threshold of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.min_initial_deposit_ratio": panic(fmt.Errorf("field min_initial_deposit_ratio of message cosmos.gov.v1.Params is not mutable")) - case "cosmos.gov.v1.Params.proposal_cancel_rate": - panic(fmt.Errorf("field proposal_cancel_rate of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.proposal_cancel_ratio": + panic(fmt.Errorf("field proposal_cancel_ratio of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.proposal_cancel_dest": panic(fmt.Errorf("field proposal_cancel_dest of message cosmos.gov.v1.Params is not mutable")) default: @@ -5610,7 +5610,7 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "cosmos.gov.v1.Params.min_initial_deposit_ratio": return protoreflect.ValueOfString("") - case "cosmos.gov.v1.Params.proposal_cancel_rate": + case "cosmos.gov.v1.Params.proposal_cancel_ratio": return protoreflect.ValueOfString("") case "cosmos.gov.v1.Params.proposal_cancel_dest": return protoreflect.ValueOfString("") @@ -5713,7 +5713,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.ProposalCancelRate) + l = len(x.ProposalCancelRatio) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -5757,10 +5757,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x4a } - if len(x.ProposalCancelRate) > 0 { - i -= len(x.ProposalCancelRate) - copy(dAtA[i:], x.ProposalCancelRate) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposalCancelRate))) + if len(x.ProposalCancelRatio) > 0 { + i -= len(x.ProposalCancelRatio) + copy(dAtA[i:], x.ProposalCancelRatio) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposalCancelRatio))) i-- dAtA[i] = 0x42 } @@ -6121,7 +6121,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 8: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelRate", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelRatio", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6149,7 +6149,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.ProposalCancelRate = string(dAtA[iNdEx:postIndex]) + x.ProposalCancelRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 2 { @@ -6875,7 +6875,7 @@ type Params struct { // The burn rate of deposits when cancel the proposal // // Since: cosmos-sdk 0.47 - ProposalCancelRate string `protobuf:"bytes,8,opt,name=proposal_cancel_rate,json=proposalCancelRate,proto3" json:"proposal_cancel_rate,omitempty"` + ProposalCancelRatio string `protobuf:"bytes,8,opt,name=proposal_cancel_ratio,json=proposalCancelRatio,proto3" json:"proposal_cancel_ratio,omitempty"` // The proposal cancel destination address will receive the remaining deposits of cancel proposal. // // Since: cosmos-sdk 0.47 @@ -6951,9 +6951,9 @@ func (x *Params) GetMinInitialDepositRatio() string { return "" } -func (x *Params) GetProposalCancelRate() string { +func (x *Params) GetProposalCancelRatio() string { if x != nil { - return x.ProposalCancelRate + return x.ProposalCancelRatio } return "" } @@ -7095,7 +7095,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x22, 0xca, 0x04, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, + 0x6c, 0x64, 0x22, 0xcc, 0x04, 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, @@ -7123,47 +7123,48 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x40, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, - 0x61, 0x74, 0x65, 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, 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, + 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, 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, } var ( diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 45277d23e85..91033fec271 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -168,7 +168,7 @@ message Params { // The burn rate of deposits when cancel the proposal // // Since: cosmos-sdk 0.47 - string proposal_cancel_rate = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string proposal_cancel_ratio = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; // The proposal cancel destination address will receive the remaining deposits of cancel proposal. // // Since: cosmos-sdk 0.47 diff --git a/tests/e2e/gov/cli_test.go b/tests/e2e/gov/cli_test.go index c092d20de95..8fbb0f62d2c 100644 --- a/tests/e2e/gov/cli_test.go +++ b/tests/e2e/gov/cli_test.go @@ -1,6 +1,3 @@ -//go:build e2e -// +build e2e - package gov import ( diff --git a/tests/e2e/gov/query.go b/tests/e2e/gov/query.go index bc3f537aa34..2c3599188ac 100644 --- a/tests/e2e/gov/query.go +++ b/tests/e2e/gov/query.go @@ -23,7 +23,7 @@ func (s *IntegrationTestSuite) TestCmdParams() { { "json output", []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_rate":"0.000000000000000000","proposal_cancel_dest":""}}`, + `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_ratio":"0.000000000000000000","proposal_cancel_dest":""}}`, }, { "text output", @@ -41,7 +41,7 @@ params: denom: stake min_initial_deposit_ratio: "0.000000000000000000" proposal_cancel_dest: "" - proposal_cancel_rate: "0.000000000000000000" + proposal_cancel_ratio: "0.000000000000000000" quorum: "0.334000000000000000" threshold: "0.500000000000000000" veto_threshold: "0.334000000000000000" diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index ca5930bbc90..dce8ff332b1 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -168,7 +168,7 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64, destAddress string, totalDeposits []sdk.Coin) error { store := ctx.KVStore(keeper.storeKey) - proposalCancelBurnRate := keeper.GetParams(ctx).ProposalCancelRate + proposalCancelBurnRate := keeper.GetParams(ctx).ProposalCancelRatio // burn the deposits * proposal_cancel_burn_rate amount from proposal deposits (gov module) burnRate := sdk.MustNewDecFromStr(proposalCancelBurnRate) diff --git a/x/gov/migrations/v4/json.go b/x/gov/migrations/v4/json.go index bb22884b27e..db8fa6a6936 100644 --- a/x/gov/migrations/v4/json.go +++ b/x/gov/migrations/v4/json.go @@ -13,7 +13,7 @@ func MigrateJSON(oldState *v1.GenesisState) (*v1.GenesisState, error) { oldState.TallyParams.Threshold, oldState.TallyParams.VetoThreshold, v1.DefaultParams().MinInitialDepositRatio, - v1.DefaultParams().ProposalCancelRate, + v1.DefaultParams().ProposalCancelRatio, v1.DefaultParams().ProposalCancelDest, ) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index bf1202801a9..c7a54bc8448 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -700,7 +700,7 @@ type Params struct { // The burn rate of deposits when cancel the proposal // // Since: cosmos-sdk 0.47 - ProposalCancelRate string `protobuf:"bytes,8,opt,name=proposal_cancel_rate,json=proposalCancelRate,proto3" json:"proposal_cancel_rate,omitempty"` + ProposalCancelRatio string `protobuf:"bytes,8,opt,name=proposal_cancel_ratio,json=proposalCancelRatio,proto3" json:"proposal_cancel_ratio,omitempty"` // The proposal cancel destination address will receive the remaining deposits of cancel proposal. // // Since: cosmos-sdk 0.47 @@ -789,9 +789,9 @@ func (m *Params) GetMinInitialDepositRatio() string { return "" } -func (m *Params) GetProposalCancelRate() string { +func (m *Params) GetProposalCancelRatio() string { if m != nil { - return m.ProposalCancelRate + return m.ProposalCancelRatio } return "" } @@ -820,84 +820,84 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1231 bytes of a gzipped FileDescriptorProto + // 1226 bytes of a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, 0x61, 0xdc, 0xd7, 0x5b, 0xa5, + 0xf9, 0xa6, 0xfe, 0xe2, 0x4d, 0x59, 0x79, 0xf9, 0xa6, 0xac, 0xfc, 0xfd, 0xa6, 0xac, 0x3c, 0x7b, + 0x5b, 0x9e, 0x7b, 0xf9, 0xb6, 0x3c, 0xf7, 0xc7, 0xdb, 0xf2, 0xdc, 0x57, 0xd7, 0x7a, 0x84, 0xef, + 0x0f, 0xf7, 0x6a, 0x5d, 0xea, 0xcb, 0xbb, 0xaf, 0xfc, 0x77, 0x83, 0x79, 0x5f, 0xd7, 0x9f, 0x8a, + 0xfb, 0x3c, 0x1f, 0x0f, 0x30, 0x8b, 0x2e, 0xeb, 0x39, 0xf1, 0xca, 0xdc, 0xfa, 0x37, 0x00, 0x00, + 0xff, 0xff, 0x7f, 0xbb, 0x40, 0x74, 0xed, 0x0b, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1369,10 +1369,10 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x4a } - if len(m.ProposalCancelRate) > 0 { - i -= len(m.ProposalCancelRate) - copy(dAtA[i:], m.ProposalCancelRate) - i = encodeVarintGov(dAtA, i, uint64(len(m.ProposalCancelRate))) + if len(m.ProposalCancelRatio) > 0 { + i -= len(m.ProposalCancelRatio) + copy(dAtA[i:], m.ProposalCancelRatio) + i = encodeVarintGov(dAtA, i, uint64(len(m.ProposalCancelRatio))) i-- dAtA[i] = 0x42 } @@ -1685,7 +1685,7 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } - l = len(m.ProposalCancelRate) + l = len(m.ProposalCancelRatio) if l > 0 { n += 1 + l + sovGov(uint64(l)) } @@ -3300,7 +3300,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelRate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelRatio", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3328,7 +3328,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProposalCancelRate = string(dAtA[iNdEx:postIndex]) + m.ProposalCancelRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 2 { diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 3a6205731b1..6e7b52e1569 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -20,7 +20,7 @@ var ( DefaultThreshold = sdk.NewDecWithPrec(5, 1) DefaultVetoThreshold = sdk.NewDecWithPrec(334, 3) DefaultMinInitialDepositRatio = sdk.ZeroDec() - DefaultProposalCancelRate = sdk.ZeroDec() + DefaultProposalCancelRatio = sdk.ZeroDec() DefaultProposalCancelDestAddress = "" ) @@ -50,7 +50,7 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { func NewParams( minDeposit sdk.Coins, maxDepositPeriod time.Duration, votingPeriod time.Duration, - quorum, threshold, vetoThreshold, minInitialDepositRatio, proposalCancelRate, proposalCancelDest string, + quorum, threshold, vetoThreshold, minInitialDepositRatio, ProposalCancelRatio, proposalCancelDest string, ) Params { return Params{ MinDeposit: minDeposit, @@ -60,7 +60,7 @@ func NewParams( Threshold: threshold, VetoThreshold: vetoThreshold, MinInitialDepositRatio: minInitialDepositRatio, - ProposalCancelRate: proposalCancelRate, + ProposalCancelRatio: ProposalCancelRatio, ProposalCancelDest: proposalCancelDest, } } @@ -75,7 +75,7 @@ func DefaultParams() Params { DefaultThreshold.String(), DefaultVetoThreshold.String(), DefaultMinInitialDepositRatio.String(), - DefaultProposalCancelRate.String(), + DefaultProposalCancelRatio.String(), DefaultProposalCancelDestAddress, ) } @@ -145,7 +145,7 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("mininum initial deposit ratio of proposal is too large: %s", minInitialDepositRatio) } - proposalCancelBurnRate, err := sdk.NewDecFromStr(p.ProposalCancelRate) + proposalCancelBurnRate, err := sdk.NewDecFromStr(p.ProposalCancelRatio) if err != nil { return fmt.Errorf("invalid burn rate of cancel proposal: %w", err) } From 0c772584f1a4816f8a74d56a2328ac69ba862eff Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 18 Nov 2022 22:02:42 +0530 Subject: [PATCH 42/69] chore: small fix --- tests/e2e/gov/cli_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/e2e/gov/cli_test.go b/tests/e2e/gov/cli_test.go index 8fbb0f62d2c..c092d20de95 100644 --- a/tests/e2e/gov/cli_test.go +++ b/tests/e2e/gov/cli_test.go @@ -1,3 +1,6 @@ +//go:build e2e +// +build e2e + package gov import ( From 753d1b12a7cecfd4eb62cd9157e472224383e0d4 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 18 Nov 2022 22:42:19 +0530 Subject: [PATCH 43/69] chore: fix the lint --- x/gov/keeper/deposit.go | 6 +++--- x/gov/types/v1/params.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index dce8ff332b1..ab63c39c086 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -168,9 +168,9 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64, destAddress string, totalDeposits []sdk.Coin) error { store := ctx.KVStore(keeper.storeKey) - proposalCancelBurnRate := keeper.GetParams(ctx).ProposalCancelRatio - // burn the deposits * proposal_cancel_burn_rate amount from proposal deposits (gov module) - burnRate := sdk.MustNewDecFromStr(proposalCancelBurnRate) + proposalCancelRate := keeper.GetParams(ctx).ProposalCancelRatio + // burn the deposits * proposal_cancel_rate amount from proposal deposits (gov module) + burnRate := sdk.MustNewDecFromStr(proposalCancelRate) var burnDepositAmount sdk.Coins diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 6e7b52e1569..686a68efd12 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -50,7 +50,7 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { func NewParams( minDeposit sdk.Coins, maxDepositPeriod time.Duration, votingPeriod time.Duration, - quorum, threshold, vetoThreshold, minInitialDepositRatio, ProposalCancelRatio, proposalCancelDest string, + quorum, threshold, vetoThreshold, minInitialDepositRatio, proposalCancelRatio, proposalCancelDest string, ) Params { return Params{ MinDeposit: minDeposit, @@ -60,7 +60,7 @@ func NewParams( Threshold: threshold, VetoThreshold: vetoThreshold, MinInitialDepositRatio: minInitialDepositRatio, - ProposalCancelRatio: ProposalCancelRatio, + ProposalCancelRatio: proposalCancelRatio, ProposalCancelDest: proposalCancelDest, } } From 9eebbcf94022673ce2e4175f39b761afdfbc589d Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Sat, 19 Nov 2022 09:47:00 +0530 Subject: [PATCH 44/69] chore: fix the test cases --- tests/integration/gov/genesis_test.go | 4 ++-- x/bank/simulation/operations.go | 4 ++-- x/gov/keeper/common_test.go | 4 ++++ x/gov/keeper/deposit.go | 4 ++-- x/gov/migrations/v4/json_test.go | 3 ++- x/gov/migrations/v4/store_test.go | 4 ++-- x/gov/simulation/genesis.go | 14 +++++++------- x/gov/types/v1/params.go | 10 +++++----- 8 files changed, 26 insertions(+), 21 deletions(-) diff --git a/tests/integration/gov/genesis_test.go b/tests/integration/gov/genesis_test.go index 775aa888da9..475e3265e67 100644 --- a/tests/integration/gov/genesis_test.go +++ b/tests/integration/gov/genesis_test.go @@ -22,7 +22,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -107,7 +107,7 @@ func TestImportExportQueues(t *testing.T) { genesisState[banktypes.ModuleName] = s1.cdc.MustMarshalJSON(bankGenState) genesisState[types.ModuleName] = s1.cdc.MustMarshalJSON(govGenState) genesisState[stakingtypes.ModuleName] = s1.cdc.MustMarshalJSON(stakingGenState) - genesisState[distributiontypes.ModuleName] = s1.cdc.MustMarshalJSON(distributionGenState) + genesisState[disttypes.ModuleName] = s1.cdc.MustMarshalJSON(distributionGenState) stateBytes, err := json.MarshalIndent(genesisState, "", " ") require.NoError(t, err) diff --git a/x/bank/simulation/operations.go b/x/bank/simulation/operations.go index 29d0b07df6e..7818ebf1a2b 100644 --- a/x/bank/simulation/operations.go +++ b/x/bank/simulation/operations.go @@ -12,7 +12,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/cosmos/cosmos-sdk/x/bank/types" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/simulation" ) @@ -402,7 +402,7 @@ func getModuleAccounts(ak types.AccountKeeper, ctx sdk.Context, moduleAccCount i moduleAccounts := make([]simtypes.Account, moduleAccCount) for i := 0; i < moduleAccCount; i++ { - acc := ak.GetModuleAccount(ctx, distributiontypes.ModuleName) + acc := ak.GetModuleAccount(ctx, disttypes.ModuleName) mAcc := simtypes.Account{ Address: acc.GetAddress(), PrivKey: nil, diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index c70f0dff347..a14e595ccbf 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -16,6 +16,7 @@ import ( moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtestutil "github.com/cosmos/cosmos-sdk/x/gov/testutil" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -27,6 +28,7 @@ import ( var ( _, _, addr = testdata.KeyTestPubAddr() govAcct = authtypes.NewModuleAddress(types.ModuleName) + distAcct = authtypes.NewModuleAddress(disttypes.ModuleName) TestProposal = getTestProposal() ) @@ -71,6 +73,8 @@ func setupGovKeeper(t *testing.T) ( distributionKeeper := govtestutil.NewMockDistributionKeeper(ctrl) acctKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(govAcct).AnyTimes() + acctKeeper.EXPECT().GetModuleAddress(disttypes.ModuleName).Return(distAcct).AnyTimes() + acctKeeper.EXPECT().GetModuleAccount(gomock.Any(), types.ModuleName).Return(authtypes.NewEmptyModuleAccount(types.ModuleName)).AnyTimes() trackMockBalances(bankKeeper) stakingKeeper.EXPECT().TokensFromConsensusPower(ctx, gomock.Any()).DoAndReturn(func(ctx sdk.Context, power int64) math.Int { diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index ab63c39c086..110b634c1ae 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) @@ -196,7 +196,7 @@ func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposa remainingAmount := sdk.Coins(totalDeposits).Sub(burnDepositAmount...) // get the distribution module account address - distributionAddress := keeper.authKeeper.GetModuleAddress(distributiontypes.ModuleName) + distributionAddress := keeper.authKeeper.GetModuleAddress(disttypes.ModuleName) if distributionAddress.String() == destAddress { err := keeper.distrkeeper.FundCommunityPool(ctx, remainingAmount, keeper.ModuleAccountAddress()) if err != nil { diff --git a/x/gov/migrations/v4/json_test.go b/x/gov/migrations/v4/json_test.go index 851936eb174..b78bf84745b 100644 --- a/x/gov/migrations/v4/json_test.go +++ b/x/gov/migrations/v4/json_test.go @@ -48,7 +48,8 @@ func TestMigrateJSON(t *testing.T) { } ], "min_initial_deposit_ratio": "0.000000000000000000", - "proposal_cancel_burn_rate": "0.000000000000000000", + "proposal_cancel_dest": "", + "proposal_cancel_ratio": "0.000000000000000000", "quorum": "0.334000000000000000", "threshold": "0.500000000000000000", "veto_threshold": "0.334000000000000000", diff --git a/x/gov/migrations/v4/store_test.go b/x/gov/migrations/v4/store_test.go index cb6cd9bab48..210c95ad31f 100644 --- a/x/gov/migrations/v4/store_test.go +++ b/x/gov/migrations/v4/store_test.go @@ -75,13 +75,13 @@ func TestMigrateStore(t *testing.T) { // Create 2 proposals prop1Content, err := v1.NewLegacyContent(v1beta1.NewTextProposal("Test", "description"), authtypes.NewModuleAddress("gov").String()) require.NoError(t, err) - proposal1, err := v1.NewProposal([]sdk.Msg{prop1Content}, 1, "some metadata for the legacy content", propTime, propTime) + proposal1, err := v1.NewProposal([]sdk.Msg{prop1Content}, sdk.AccAddress("accaddress"), 1, "some metadata for the legacy content", propTime, propTime) require.NoError(t, err) prop1Bz, err := cdc.Marshal(&proposal1) require.NoError(t, err) store.Set(v1gov.ProposalKey(proposal1.Id), prop1Bz) - proposal2, err := v1.NewProposal(getTestProposal(), 2, "some metadata for the legacy content", propTime, propTime) + proposal2, err := v1.NewProposal(getTestProposal(), sdk.AccAddress("accaddress"), 2, "some metadata for the legacy content", propTime, propTime) proposal2.Status = v1.StatusVotingPeriod require.NoError(t, err) prop2Bz, err := cdc.Marshal(&proposal2) diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index d8af1ad8310..ee9724414dd 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -23,7 +23,7 @@ const ( TallyParamsQuorum = "tally_params_quorum" TallyParamsThreshold = "tally_params_threshold" TallyParamsVeto = "tally_params_veto" - ProposalCancelBurnRate = "proposal_cancel_burn_rate" + ProposalCancelRate = "proposal_cancel_rate" ) // GenDepositParamsDepositPeriod randomized DepositParamsDepositPeriod @@ -41,8 +41,8 @@ func GenDepositMinInitialDepositRatio(r *rand.Rand) sdk.Dec { return sdk.NewDec(int64(simulation.RandIntBetween(r, 0, 99))).Quo(sdk.NewDec(100)) } -// GenProposalCancelBurnRate randomized ProposalCancelBurnRate -func GenProposalCancelBurnRate(r *rand.Rand) sdk.Dec { +// GenProposalCancelRaterandomized ProposalCancelRate +func GenProposalCancelRate(r *rand.Rand) sdk.Dec { return sdk.NewDec(int64(simulation.RandIntBetween(r, 0, 99))).Quo(sdk.NewDec(100)) } @@ -88,10 +88,10 @@ func RandomizedGenState(simState *module.SimulationState) { func(r *rand.Rand) { minInitialDepositRatio = GenDepositMinInitialDepositRatio(r) }, ) - var proposalCancelBurnRate sdk.Dec + var proposalCancelRate sdk.Dec simState.AppParams.GetOrGenerate( - simState.Cdc, ProposalCancelBurnRate, &proposalCancelBurnRate, simState.Rand, - func(r *rand.Rand) { proposalCancelBurnRate = GenProposalCancelBurnRate(r) }, + simState.Cdc, ProposalCancelRate, &proposalCancelRate, simState.Rand, + func(r *rand.Rand) { proposalCancelRate = GenProposalCancelRate(r) }, ) var votingPeriod time.Duration @@ -120,7 +120,7 @@ func RandomizedGenState(simState *module.SimulationState) { govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelBurnRate.String(), ""), + v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelRate.String(), ""), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 686a68efd12..156ebd47701 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -145,15 +145,15 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("mininum initial deposit ratio of proposal is too large: %s", minInitialDepositRatio) } - proposalCancelBurnRate, err := sdk.NewDecFromStr(p.ProposalCancelRatio) + proposalCancelRate, err := sdk.NewDecFromStr(p.ProposalCancelRatio) if err != nil { return fmt.Errorf("invalid burn rate of cancel proposal: %w", err) } - if proposalCancelBurnRate.IsNegative() { - return fmt.Errorf("burn rate of cancel proposal must be positive: %s", proposalCancelBurnRate) + if proposalCancelRate.IsNegative() { + return fmt.Errorf("burn rate of cancel proposal must be positive: %s", proposalCancelRate) } - if proposalCancelBurnRate.GT(math.LegacyOneDec()) { - return fmt.Errorf("burn rate of cancel proposal is too large: %s", proposalCancelBurnRate) + if proposalCancelRate.GT(math.LegacyOneDec()) { + return fmt.Errorf("burn rate of cancel proposal is too large: %s", proposalCancelRate) } if len(p.ProposalCancelDest) != 0 { From 983e518a9bd1658f5a755419951796147b79b841 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 21 Nov 2022 19:35:33 +0530 Subject: [PATCH 45/69] chore: address the pr comments --- UPGRADING.md | 16 +- api/cosmos/auth/v1beta1/query.pulsar.go | 273 ++++++++++++------------ api/cosmos/gov/v1/gov.pulsar.go | 5 +- proto/cosmos/gov/v1/gov.proto | 5 +- x/auth/types/query.pb.go | 145 ++++++------- x/gov/keeper/deposit.go | 76 ++++--- x/gov/keeper/proposal.go | 10 +- x/gov/types/v1/gov.pb.go | 5 +- 8 files changed, 277 insertions(+), 258 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index a0d42ebae11..7f4768e616a 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -115,8 +115,7 @@ modified to set the new parameter to the desired value. ##### New Proposal.Proposer field -The `Proposal` proto has been updated with proposer field. For proposal state migraton -developers should ensure to call `v4.AddProposerAddressToProposal` in their upgrade handler. +The `Proposal` proto has been updated with proposer field. For proposal state migraton developers can call `v4.AddProposerAddressToProposal` in their upgrade handler to update all existing proposal and make them compatible. > This migration is optional, if chain wants to cancel previous proposals which are active (deposit or voting period) they can do this proposals state migration. @@ -124,17 +123,18 @@ developers should ensure to call `v4.AddProposerAddressToProposal` in their upgr import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" + // v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func (app SimApp) RegisterUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler(UpgradeName, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - // add proposal ids with proposers which are active (deposit or voting period) - proposals := make(map[uint64]string) + //// this migration is optional + //// add proposal ids with proposers which are active (deposit or voting period) + // proposals := make(map[uint64]string) // proposals[1] = "cosmos1luyncewxk4lm24k6gqy8y5dxkj0klr4tu0lmnj" ... - v4.AddProposerAddressToProposal(ctx, sdk.NewKVStoreKey(v4.ModuleName), app.appCodec, proposals) + // v4.AddProposerAddressToProposal(ctx, sdk.NewKVStoreKey(v4.ModuleName), app.appCodec, proposals) return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) }) } @@ -146,8 +146,8 @@ func (app SimApp) RegisterUpgradeHandlers() { The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to `ProposalCancelDest` address. The deposits burn rate will be determined by a new parameter called `ProposalCancelRatio` parameter. ``` - 1. deposits * proposal_cancel_ratio will be burned - 2. deposits * (1 - proposal_cancel_ratio) will be sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then all remaining deposits will be burned. + 1. deposits * proposal_cancel_ratio will be burned or sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then deposits will be burned. + 2. deposits * (1 - proposal_cancel_ratio) will be sent to depositors. ``` By default, the new `ProposalCancelRatio` parameter is set to zero during migration and `ProposalCancelDest` is set to empty string. diff --git a/api/cosmos/auth/v1beta1/query.pulsar.go b/api/cosmos/auth/v1beta1/query.pulsar.go index 88f5d938ba5..d8051b6828e 100644 --- a/api/cosmos/auth/v1beta1/query.pulsar.go +++ b/api/cosmos/auth/v1beta1/query.pulsar.go @@ -9173,10 +9173,12 @@ type QueryAccountAddressByIDRequest struct { // id is the account number of the address to be queried. This field // should have been an uint64 (like all account numbers), and will be // updated to uint64 in a future version of the auth query. + // + // Deprecated: Do not use. Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // account_id is the account number of the address to be queried. This field - // should have been an uint64 (like all account numbers), and will be - // updated to uint64 in a future version of the auth query. + // account_id is the account number of the address to be queried. + // + // Since: cosmos-sdk 0.47 AccountId uint64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` } @@ -9200,6 +9202,7 @@ func (*QueryAccountAddressByIDRequest) Descriptor() ([]byte, []int) { return file_cosmos_auth_v1beta1_query_proto_rawDescGZIP(), []int{16} } +// Deprecated: Do not use. func (x *QueryAccountAddressByIDRequest) GetId() int64 { if x != nil { return x.Id @@ -9423,145 +9426,145 @@ var file_cosmos_auth_v1beta1_query_proto_rawDesc = []byte{ 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x1e, 0x51, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x53, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, - 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x64, 0x0a, 0x1f, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x41, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 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, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x22, 0x4d, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x22, 0x50, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, - 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x04, 0x69, - 0x6e, 0x66, 0x6f, 0x32, 0xef, 0x0c, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x8d, 0x01, - 0x0a, 0x08, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2a, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x94, 0x01, - 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x18, 0x01, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, + 0x22, 0x64, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x4d, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x50, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x34, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x32, 0xef, 0x0c, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x8d, 0x01, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x29, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, - 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x7d, 0x12, 0xb5, 0x01, 0x0a, 0x12, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x12, 0x33, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, - 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x85, 0x01, 0x0a, - 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x88, 0xe7, 0xb0, 0x2a, - 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa6, 0x01, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x12, 0x94, 0x01, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x88, 0xe7, 0xb0, 0x2a, - 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0xbc, 0x01, - 0x0a, 0x13, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, - 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x63, 0x6f, + 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x34, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, + 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x7b, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0xb5, 0x01, 0x0a, 0x12, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x12, + 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, + 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x88, 0xe7, 0xb0, 0x2a, + 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x64, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x12, 0x85, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, + 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa6, 0x01, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x38, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, - 0x2b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x88, 0x01, 0x0a, - 0x0c, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x28, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x65, - 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x12, 0xb0, 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x7d, 0x12, 0xb1, 0x01, 0x0a, 0x14, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, - 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, - 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x2f, 0x7b, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x12, 0xa4, - 0x01, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2c, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x88, 0xe7, 0xb0, - 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x7b, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x7d, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, + 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x12, 0xbc, 0x01, 0x0a, 0x13, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x35, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, + 0x12, 0x88, 0x01, 0x0a, 0x0c, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, - 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, - 0x41, 0x75, 0x74, 0x68, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x2e, 0x42, 0x65, 0x63, 0x68, 0x33, 0x32, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x12, 0xb0, 0x01, 0x0a, 0x14, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, + 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2d, 0x12, 0x2b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, 0x32, 0x2f, 0x7b, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x7d, 0x12, 0xb1, + 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x54, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, + 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x65, 0x63, 0x68, 0x33, + 0x32, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x7d, 0x12, 0xa4, 0x01, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x38, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2f, + 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, + 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 41428b48b39..ad5e11019a1 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -6872,12 +6872,15 @@ type Params struct { VetoThreshold string `protobuf:"bytes,6,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` // The ratio representing the proportion of the deposit value that must be paid at proposal submission. MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` - // The burn rate of deposits when cancel the proposal + // The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. // // Since: cosmos-sdk 0.47 ProposalCancelRatio string `protobuf:"bytes,8,opt,name=proposal_cancel_ratio,json=proposalCancelRatio,proto3" json:"proposal_cancel_ratio,omitempty"` // The proposal cancel destination address will receive the remaining deposits of cancel proposal. // + // The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. + // If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. + // // Since: cosmos-sdk 0.47 ProposalCancelDest string `protobuf:"bytes,9,opt,name=proposal_cancel_dest,json=proposalCancelDest,proto3" json:"proposal_cancel_dest,omitempty"` } diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 91033fec271..7f320f32466 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -165,12 +165,15 @@ message Params { // The ratio representing the proportion of the deposit value that must be paid at proposal submission. string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec"]; - // The burn rate of deposits when cancel the proposal + // The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. // // Since: cosmos-sdk 0.47 string proposal_cancel_ratio = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; // The proposal cancel destination address will receive the remaining deposits of cancel proposal. // + // The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. + // If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. + // // Since: cosmos-sdk 0.47 string proposal_cancel_dest = 9 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/x/auth/types/query.pb.go b/x/auth/types/query.pb.go index f7c68b7cf08..c40dba734f6 100644 --- a/x/auth/types/query.pb.go +++ b/x/auth/types/query.pb.go @@ -764,10 +764,10 @@ type QueryAccountAddressByIDRequest struct { // id is the account number of the address to be queried. This field // should have been an uint64 (like all account numbers), and will be // updated to uint64 in a future version of the auth query. - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // account_id is the account number of the address to be queried. This field - // should have been an uint64 (like all account numbers), and will be - // updated to uint64 in a future version of the auth query. + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Deprecated: Do not use. + // account_id is the account number of the address to be queried. + // + // Since: cosmos-sdk 0.47 AccountId uint64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` } @@ -804,6 +804,7 @@ func (m *QueryAccountAddressByIDRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAccountAddressByIDRequest proto.InternalMessageInfo +// Deprecated: Do not use. func (m *QueryAccountAddressByIDRequest) GetId() int64 { if m != nil { return m.Id @@ -987,74 +988,74 @@ func init() { func init() { proto.RegisterFile("cosmos/auth/v1beta1/query.proto", fileDescriptor_c451370b3929a27c) } var fileDescriptor_c451370b3929a27c = []byte{ - // 1057 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xc7, 0xe3, 0x6e, 0x69, 0xbb, 0xaf, 0xd9, 0x22, 0x4d, 0xb3, 0xa2, 0xb8, 0x6d, 0x52, 0xb9, - 0xb0, 0xfd, 0xc1, 0xc6, 0xa6, 0x69, 0x56, 0xe2, 0x97, 0x90, 0xea, 0x2d, 0xa0, 0x1e, 0x16, 0x82, - 0xb7, 0x27, 0x0e, 0x44, 0x4e, 0xec, 0xa4, 0x16, 0x1b, 0x4f, 0x36, 0x76, 0xd0, 0x46, 0x55, 0x2e, - 0x48, 0x48, 0xbd, 0x20, 0x21, 0xc1, 0x1f, 0xd0, 0x03, 0xe2, 0xbc, 0x48, 0xe5, 0xc6, 0x1f, 0xb0, - 0xda, 0xd3, 0x0a, 0x2e, 0x9c, 0x10, 0x6a, 0x91, 0xe0, 0xc6, 0xbf, 0x80, 0x32, 0xf3, 0xc6, 0xb1, - 0xdb, 0x49, 0xe2, 0x8a, 0x53, 0x9d, 0x99, 0xf7, 0xbe, 0xef, 0x33, 0x33, 0x6f, 0xe6, 0x5b, 0x28, - 0xd4, 0x69, 0xd0, 0xa2, 0x81, 0x61, 0x77, 0xc3, 0x23, 0xe3, 0xcb, 0x9d, 0x9a, 0x1b, 0xda, 0x3b, - 0xc6, 0xe3, 0xae, 0xdb, 0xe9, 0xe9, 0xed, 0x0e, 0x0d, 0x29, 0x59, 0xe4, 0x01, 0xfa, 0x20, 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 0xa5, 0x4a, 0xc7, 0x6d, 0x78, 0x4f, 0xc4, - 0xd6, 0xbc, 0x0b, 0xb9, 0xe4, 0x30, 0x96, 0x5c, 0x87, 0x5b, 0x35, 0x36, 0x5e, 0x6d, 0xb3, 0x09, - 0x64, 0xce, 0xd6, 0x62, 0xc1, 0x9a, 0x09, 0xcb, 0xd8, 0x57, 0x66, 0x2f, 0x74, 0x83, 0x43, 0x8a, - 0xed, 0x85, 0xcb, 0x5d, 0x87, 0x5b, 0xd8, 0x67, 0xd5, 0xda, 0x60, 0x9e, 0x69, 0x64, 0xad, 0xac, - 0x1d, 0xcb, 0xd1, 0x3e, 0x80, 0x15, 0xb9, 0x06, 0x82, 0xbc, 0x0e, 0x0b, 0x42, 0x24, 0x60, 0x33, - 0x48, 0x22, 0xa4, 0x79, 0xb8, 0xb6, 0x1f, 0xa1, 0xf0, 0x81, 0x43, 0xca, 0xe4, 0x04, 0x4a, 0x4a, - 0x95, 0xfb, 0x11, 0xcc, 0x25, 0x95, 0xe1, 0xae, 0x4c, 0x5e, 0xd1, 0x27, 0x90, 0x8f, 0xdf, 0xa4, - 0x68, 0x75, 0x07, 0xfb, 0x82, 0x66, 0x01, 0xa6, 0x3c, 0x87, 0xe5, 0xde, 0xb0, 0xa6, 0x3c, 0x87, - 0xac, 0x02, 0xe0, 0x31, 0x55, 0x3d, 0x87, 0xbd, 0x0c, 0xd3, 0xd6, 0x4d, 0x1c, 0x39, 0x70, 0x34, - 0x07, 0x3b, 0x4b, 0x26, 0x88, 0x60, 0x7b, 0xf0, 0xb2, 0x50, 0x48, 0xfb, 0x06, 0x2c, 0xd8, 0x09, - 0x39, 0xed, 0x01, 0xbc, 0x12, 0xaf, 0x72, 0xe0, 0x37, 0xe8, 0xff, 0x78, 0x59, 0xb4, 0x0a, 0x2c, - 0x5d, 0x95, 0x43, 0xda, 0x32, 0x4c, 0x7b, 0x7e, 0x83, 0x62, 0x33, 0xaf, 0x49, 0xaf, 0xb9, 0x69, - 0x07,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0d, 0x00, - 0x00, + // 1061 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0x4f, 0x6f, 0xe3, 0xc4, + 0x1b, 0xc7, 0xe3, 0x6c, 0x7f, 0x6d, 0xf7, 0x69, 0xb6, 0x3f, 0x69, 0x9a, 0x15, 0xc1, 0x69, 0x93, + 0xca, 0x85, 0x6d, 0x5a, 0x36, 0x36, 0x4d, 0xb3, 0x12, 0xff, 0x84, 0x54, 0x6f, 0x01, 0xf5, 0xb0, + 0x28, 0xb8, 0x3d, 0x71, 0x20, 0x72, 0x62, 0x27, 0xb5, 0xd8, 0x78, 0xb2, 0xb1, 0x83, 0x36, 0xaa, + 0x72, 0x41, 0x42, 0xea, 0x05, 0x09, 0x09, 0x5e, 0x40, 0x0f, 0x88, 0xf3, 0x22, 0x95, 0x1b, 0x2f, + 0x60, 0xb5, 0xa7, 0x15, 0x5c, 0x38, 0x21, 0xd4, 0x22, 0xc1, 0x8d, 0xb7, 0x80, 0x32, 0xf3, 0xd8, + 0xb1, 0xdb, 0x49, 0xe2, 0x8a, 0x53, 0x9d, 0x99, 0xe7, 0xf9, 0x3e, 0x9f, 0x99, 0x79, 0x66, 0xbe, + 0x85, 0x62, 0x93, 0x7a, 0x1d, 0xea, 0x69, 0x66, 0xdf, 0x3f, 0xd6, 0xbe, 0xd8, 0x69, 0xd8, 0xbe, + 0xb9, 0xa3, 0x3d, 0xe9, 0xdb, 0xbd, 0x81, 0xda, 0xed, 0x51, 0x9f, 0x92, 0x15, 0x1e, 0xa0, 0x8e, + 0x02, 0x54, 0x0c, 0x90, 0xb7, 0x31, 0xab, 0x61, 0x7a, 0x36, 0x8f, 0x0e, 0x73, 0xbb, 0x66, 0xdb, + 0x71, 0x4d, 0xdf, 0xa1, 0x2e, 0x17, 0x90, 0xb3, 0x6d, 0xda, 0xa6, 0xec, 0x53, 0x1b, 0x7d, 0xe1, + 0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 0x81, 0x6f, 0x7b, 0x47, + 0x14, 0xdb, 0x0b, 0x97, 0xbb, 0x01, 0x77, 0xb0, 0xcf, 0xea, 0x8d, 0xd1, 0x3c, 0xd3, 0xc8, 0x18, + 0x19, 0x33, 0x92, 0xa3, 0x7c, 0x00, 0xab, 0x62, 0x0d, 0x04, 0x79, 0x1d, 0x96, 0x03, 0x11, 0x8f, + 0xcd, 0x20, 0x49, 0x20, 0xcd, 0xc3, 0x95, 0xfd, 0x10, 0x85, 0x0f, 0x1c, 0x51, 0x26, 0x17, 0xa0, + 0x24, 0x54, 0x79, 0x18, 0xc2, 0x5c, 0x51, 0x19, 0xef, 0xca, 0xec, 0x15, 0x1d, 0x42, 0x21, 0x7a, + 0x93, 0xc2, 0xd5, 0x1d, 0xec, 0x8f, 0xfb, 0x20, 0xed, 0x58, 0x2c, 0xf7, 0x96, 0x9e, 0xce, 0x49, + 0x46, 0xda, 0xb1, 0xc8, 0x1a, 0x00, 0x1e, 0x55, 0xdd, 0xb1, 0xd8, 0xeb, 0x30, 0x67, 0xdc, 0xc6, + 0x91, 0x03, 0x4b, 0xb1, 0xb0, 0xbb, 0x44, 0xa2, 0x08, 0xb7, 0x07, 0xff, 0x0f, 0x14, 0x92, 0xbe, + 0x03, 0xcb, 0x66, 0x4c, 0x4e, 0x79, 0x04, 0xaf, 0x44, 0xab, 0x1c, 0xb8, 0x2d, 0xfa, 0x1f, 0x5e, + 0x17, 0xa5, 0x06, 0xb9, 0xeb, 0x72, 0x48, 0x5b, 0x85, 0x39, 0xc7, 0x6d, 0x51, 0x6c, 0xe8, 0x75, + 0xe1, 0x55, 0xd7, 0x4d, 0x2f, 0xe8, 0x64, 0x83, 0x45, 0x57, 0xfe, 0xc9, 0xc0, 0xff, 0x98, 0x24, + 0xf9, 0x5a, 0x82, 0xe0, 0xbd, 0xf1, 0xc8, 0x96, 0x30, 0x5d, 0xe4, 0x13, 0xf2, 0x76, 0x92, 0x50, + 0xce, 0xa8, 0x6c, 0x9f,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91, 0x73, 0x6f, 0x23, 0xcf, 0x24, + 0xc8, 0x8a, 0x2c, 0x89, 0x88, 0xcf, 0x71, 0x8a, 0x03, 0xca, 0x3b, 0x37, 0xc8, 0x40, 0xc4, 0xdd, + 0xa9, 0xbb, 0xc7, 0x11, 0xc3, 0xfb, 0xcd, 0x5d, 0x68, 0x48, 0x7e, 0x1c, 0x23, 0xc7, 0x8c, 0x6b, + 0x3a, 0xb2, 0xc8, 0x29, 0xa7, 0x23, 0x0b, 0x5d, 0x51, 0xa9, 0x32, 0x64, 0x95, 0xdc, 0x4f, 0x84, + 0xcc, 0xfd, 0x77, 0x48, 0xbe, 0x97, 0x60, 0x29, 0x62, 0x0c, 0xe4, 0xfe, 0xcc, 0xd7, 0x25, 0x62, + 0x47, 0x72, 0x39, 0x61, 0x74, 0xf2, 0xc6, 0x0c, 0xdd, 0xd7, 0x6d, 0xd1, 0xf1, 0x03, 0xaa, 0x3f, + 0x7c, 0x7e, 0x51, 0x90, 0x5e, 0x5e, 0x14, 0xa4, 0x3f, 0x2e, 0x0a, 0xd2, 0x37, 0x97, 0x85, 0xd4, + 0xcb, 0xcb, 0x42, 0xea, 0xb7, 0xcb, 0x42, 0xea, 0xd3, 0xad, 0xb6, 0xe3, 0x1f, 0xf7, 0x1b, 0x6a, + 0x93, 0x76, 0x02, 0x41, 0xfe, 0xa7, 0xec, 0x59, 0x9f, 0x6b, 0x4f, 0xb9, 0xba, 0x3f, 0xe8, 0xda, + 0x5e, 0x63, 0x9e, 0xfd, 0x9f, 0xb6, 0xfb, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x04, 0x10, + 0xe4, 0xc6, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 110b634c1ae..0e27481f640 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -165,59 +165,65 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd // BurnAndSendDepositsToCommunityPool will burn the (deposits * proposal_cancel_burn_rate) amount of proposal deposits // and send remaining deposits of the proposal to community pool. -func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64, destAddress string, totalDeposits []sdk.Coin) error { +func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64, destAddress, proposalCancelRate string, totalDeposits []sdk.Coin) error { store := ctx.KVStore(keeper.storeKey) - proposalCancelRate := keeper.GetParams(ctx).ProposalCancelRatio - // burn the deposits * proposal_cancel_rate amount from proposal deposits (gov module) - burnRate := sdk.MustNewDecFromStr(proposalCancelRate) + rate := sdk.MustNewDecFromStr(proposalCancelRate) + var cancellationCharges sdk.Coins - var burnDepositAmount sdk.Coins - - if burnRate.IsPositive() { + if rate.IsPositive() { for _, deposit := range totalDeposits { burnAmount := sdk.NewCoin( deposit.Denom, - sdk.NewDecFromInt(deposit.Amount).Mul(burnRate).RoundInt(), + sdk.NewDecFromInt(deposit.Amount).Mul(rate).RoundInt(), ) - burnDepositAmount = burnDepositAmount.Add(burnAmount) - } - } - - // burn the deposits - if !burnDepositAmount.IsZero() { - err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, burnDepositAmount) - if err != nil { - return err + cancellationCharges = cancellationCharges.Add(burnAmount) } } - // send (deposits - burnAmount) to community pool from proposal deposits (gov module) - remainingAmount := sdk.Coins(totalDeposits).Sub(burnDepositAmount...) - - // get the distribution module account address - distributionAddress := keeper.authKeeper.GetModuleAddress(disttypes.ModuleName) - if distributionAddress.String() == destAddress { - err := keeper.distrkeeper.FundCommunityPool(ctx, remainingAmount, keeper.ModuleAccountAddress()) - if err != nil { - return err - } - } else { - if len(destAddress) == 0 { - // burn the remaining deposits also - err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, remainingAmount) + // burn the cancellation fee or sent to cancellation changes to destination address + if !cancellationCharges.IsZero() { + // get the distribution module account address + distributionAddress := keeper.authKeeper.GetModuleAddress(disttypes.ModuleName) + if distributionAddress.String() == destAddress { + err := keeper.distrkeeper.FundCommunityPool(ctx, cancellationCharges, keeper.ModuleAccountAddress()) if err != nil { return err } } else { - destAccAddress := sdk.MustAccAddressFromBech32(destAddress) - err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, destAccAddress, remainingAmount) - if err != nil { - return err + if len(destAddress) == 0 { + // burn the remaining deposits also + err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, cancellationCharges) + if err != nil { + return err + } + } else { + destAccAddress := sdk.MustAccAddressFromBech32(destAddress) + err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, destAccAddress, cancellationCharges) + if err != nil { + return err + } } } } + // send remaining (deposits - cancellationCharges) to depositors + for _, deposits := range keeper.GetDeposits(ctx, proposalID) { + depositerAddress := sdk.MustAccAddressFromBech32(deposits.Depositor) + var remainingAmount sdk.Coins + for _, deposit := range deposits.Amount { + remainAmount := sdk.NewCoin( + deposit.Denom, + sdk.NewDecFromInt(deposit.Amount).Sub(sdk.NewDec(1).Sub(rate)).RoundInt(), + ) + remainingAmount = remainingAmount.Add(remainAmount) + } + err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositerAddress, remainingAmount) + if err != nil { + return err + } + } + store.Delete(types.DepositsKey(proposalID)) return nil diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 8e842a2ffc9..95e7f7d1014 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -99,7 +99,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, proposer sdk.AccAddress, me func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer string) error { proposal, ok := keeper.GetProposal(ctx, proposalID) if !ok { - return sdkerrors.Wrapf(types.ErrProposalNotFound, "proposal not found with %d id", proposalID) + return sdkerrors.Wrapf(types.ErrProposalNotFound, "proposal_id %d", proposalID) } // Checking proposal have proposer or not because old proposal doesn't have proposer feild, @@ -123,10 +123,10 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer return sdkerrors.Wrapf(types.ErrVotingPeriodEnded, "voting period is already ended for this proposal %d", proposalID) } - // burn the (deposits * proposal_cancel_burn_rate) amount. - // and deposits * (1 - proposal_cancel_burn_rate) will be move to community pool or deposits destination address or will be burned. - destAddress := keeper.GetParams(ctx).ProposalCancelDest - err := keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id, destAddress, proposal.TotalDeposit) + // burn the (deposits * proposal_cancel_rate) amount or sent to cancellation destination address. + // and deposits * (1 - proposal_cancel_rate) will be sent to depositors. + params := keeper.GetParams(ctx) + err := keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id, params.ProposalCancelDest, params.ProposalCancelRatio, proposal.TotalDeposit) if err != nil { return err } diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index c7a54bc8448..b08c2d8b112 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -697,12 +697,15 @@ type Params struct { VetoThreshold string `protobuf:"bytes,6,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` // The ratio representing the proportion of the deposit value that must be paid at proposal submission. MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` - // The burn rate of deposits when cancel the proposal + // The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. // // Since: cosmos-sdk 0.47 ProposalCancelRatio string `protobuf:"bytes,8,opt,name=proposal_cancel_ratio,json=proposalCancelRatio,proto3" json:"proposal_cancel_ratio,omitempty"` // The proposal cancel destination address will receive the remaining deposits of cancel proposal. // + // The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. + // If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. + // // Since: cosmos-sdk 0.47 ProposalCancelDest string `protobuf:"bytes,9,opt,name=proposal_cancel_dest,json=proposalCancelDest,proto3" json:"proposal_cancel_dest,omitempty"` } From 1df9399d69f759aa776214cde5c3171432680a81 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Mon, 21 Nov 2022 16:04:16 +0100 Subject: [PATCH 46/69] Update proto/cosmos/gov/v1/gov.proto --- proto/cosmos/gov/v1/gov.proto | 2 -- 1 file changed, 2 deletions(-) diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 7f320f32466..dc6359c4979 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -169,8 +169,6 @@ message Params { // // Since: cosmos-sdk 0.47 string proposal_cancel_ratio = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; - // The proposal cancel destination address will receive the remaining deposits of cancel proposal. - // // The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. // If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. // From 095e83b838fe9cd73b52fbf63715c4ff84bebd0d Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 21 Nov 2022 20:54:44 +0530 Subject: [PATCH 47/69] chore: address the pr comments --- UPGRADING.md | 38 +++++++++++++++++++------------------- x/gov/keeper/deposit.go | 7 ++++--- x/gov/keeper/proposal.go | 2 +- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 7f4768e616a..7d1df2e3164 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -115,29 +115,29 @@ modified to set the new parameter to the desired value. ##### New Proposal.Proposer field -The `Proposal` proto has been updated with proposer field. For proposal state migraton developers can call `v4.AddProposerAddressToProposal` in their upgrade handler to update all existing proposal and make them compatible. +The `Proposal` proto has been updated with proposer field. For proposal state migraton developers can call `v4.AddProposerAddressToProposal` in their upgrade handler to update all existing proposal and make them compatible and this migration is optional. > This migration is optional, if chain wants to cancel previous proposals which are active (deposit or voting period) they can do this proposals state migration. ```go -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - // v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func (app SimApp) RegisterUpgradeHandlers() { - app.UpgradeKeeper.SetUpgradeHandler(UpgradeName, - func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - //// this migration is optional - //// add proposal ids with proposers which are active (deposit or voting period) - // proposals := make(map[uint64]string) - // proposals[1] = "cosmos1luyncewxk4lm24k6gqy8y5dxkj0klr4tu0lmnj" ... - // v4.AddProposerAddressToProposal(ctx, sdk.NewKVStoreKey(v4.ModuleName), app.appCodec, proposals) - return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) - }) -} +// import ( +// sdk "github.com/cosmos/cosmos-sdk/types" +// "github.com/cosmos/cosmos-sdk/types/module" +// // v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" +// upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +// ) + +// func (app SimApp) RegisterUpgradeHandlers() { +// app.UpgradeKeeper.SetUpgradeHandler(UpgradeName, +// func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { +// //// this migration is optional +// //// add proposal ids with proposers which are active (deposit or voting period) +// // proposals := make(map[uint64]string) +// // proposals[1] = "cosmos1luyncewxk4lm24k6gqy8y5dxkj0klr4tu0lmnj" ... +// // v4.AddProposerAddressToProposal(ctx, sdk.NewKVStoreKey(v4.ModuleName), app.appCodec, proposals) +// return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) +// }) +// } ``` diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 0e27481f640..cb8af3ed82c 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -163,9 +163,10 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd return activatedVotingPeriod, nil } -// BurnAndSendDepositsToCommunityPool will burn the (deposits * proposal_cancel_burn_rate) amount of proposal deposits -// and send remaining deposits of the proposal to community pool. -func (keeper Keeper) BurnAndSendDepositsToCommunityPool(ctx sdk.Context, proposalID uint64, destAddress, proposalCancelRate string, totalDeposits []sdk.Coin) error { +// chargeDeposit will charge proposal cancellation fee (deposits * proposal_cancel_burn_rate) and +// send to a destAddress if defined or burn otherwise. +// Remaining funds are send back to the depositor. +func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddress, proposalCancelRate string, totalDeposits []sdk.Coin) error { store := ctx.KVStore(keeper.storeKey) rate := sdk.MustNewDecFromStr(proposalCancelRate) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 95e7f7d1014..a5f4f9dc01c 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -126,7 +126,7 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer // burn the (deposits * proposal_cancel_rate) amount or sent to cancellation destination address. // and deposits * (1 - proposal_cancel_rate) will be sent to depositors. params := keeper.GetParams(ctx) - err := keeper.BurnAndSendDepositsToCommunityPool(ctx, proposal.Id, params.ProposalCancelDest, params.ProposalCancelRatio, proposal.TotalDeposit) + err := keeper.chargeDeposit(ctx, proposal.Id, params.ProposalCancelDest, params.ProposalCancelRatio, proposal.TotalDeposit) if err != nil { return err } From cd87a02dc4706bb9fed09ed237daa275e0d46ed5 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 28 Nov 2022 21:00:56 +0530 Subject: [PATCH 48/69] chore: address the pr comments --- CHANGELOG.md | 2 +- UPGRADING.md | 2 +- api/cosmos/consensus/v1/tx.pulsar.go | 2 ++ api/cosmos/gov/v1/gov.pulsar.go | 8 +++----- api/cosmos/gov/v1/tx.pulsar.go | 4 ++-- api/cosmos/gov/v1/tx_grpc.pb.go | 4 ++-- proto/cosmos/auth/v1beta1/query.proto | 4 ++-- proto/cosmos/gov/v1/gov.proto | 6 +++--- proto/cosmos/gov/v1/tx.proto | 6 +++--- tests/e2e/gov/tx.go | 2 +- x/consensus/types/tx.pb.go | 2 ++ x/gov/README.md | 3 +-- x/gov/keeper/deposit.go | 4 ++-- x/gov/simulation/genesis.go | 2 +- x/gov/types/v1/gov.pb.go | 8 +++----- x/gov/types/v1/tx.pb.go | 8 ++++---- 16 files changed, 33 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 900576e0152..5fda05a9f4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -170,7 +170,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [#13430](https://github.com/cosmos/cosmos-sdk/pull/13430) Remove unused code `ResponseCheckTx` and `ResponseDeliverTx` * (store) [#13529](https://github.com/cosmos/cosmos-sdk/pull/13529) Add method `LatestVersion` to `MultiStore` interface, add method `SetQueryMultiStore` to baesapp to support alternative `MultiStore` implementation for query service. * (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Add `proposer` parameter to `NewProposal` method. -* (pruning) [#13609](https://github.com/cosmos/cosmos-sdk/pull/13609) Move pruning pacakge to be under store pacakge. +* (pruning) [#13609](https://github.com/cosmos/cosmos-sdk/pull/13609) Move pruning package to be under store package. * [#13794](https://github.com/cosmos/cosmos-sdk/pull/13794) Most methods on `types/module.AppModule` have been moved to extension interfaces. `module.Manager.Modules` is now of type `map[string]interface{}` to support in parallel the new `cosmossdk.io/core/appmodule.AppModule` API. diff --git a/UPGRADING.md b/UPGRADING.md index 7d1df2e3164..848feb15211 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -143,7 +143,7 @@ The `Proposal` proto has been updated with proposer field. For proposal state mi ##### New Feature: Cancelling Proposals -The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burned or sent to `ProposalCancelDest` address. The deposits burn rate will be determined by a new parameter called `ProposalCancelRatio` parameter. +The `gov` module has been updated to support the ability to cancel governance proposals. When a proposal is canceled, all the deposits of the proposal are either burnt or sent to `ProposalCancelDest` address. The deposits burn rate will be determined by a new parameter called `ProposalCancelRatio` parameter. ``` 1. deposits * proposal_cancel_ratio will be burned or sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then deposits will be burned. diff --git a/api/cosmos/consensus/v1/tx.pulsar.go b/api/cosmos/consensus/v1/tx.pulsar.go index fbfaf5d071d..b455e4ca008 100644 --- a/api/cosmos/consensus/v1/tx.pulsar.go +++ b/api/cosmos/consensus/v1/tx.pulsar.go @@ -1052,6 +1052,8 @@ type MsgUpdateParams struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // params defines the x/consensus_params parameters to update. + // VersionsParams is not included in this Msg because it is tracked + // separarately in x/upgrade. // // NOTE: All parameters must be supplied. Block *types.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index ad5e11019a1..a24bc3b73fb 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -6483,7 +6483,7 @@ type Proposal struct { Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` // proposer defines the address of the proposal's proposer. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 Proposer string `protobuf:"bytes,11,opt,name=proposer,proto3" json:"proposer,omitempty"` } @@ -6874,14 +6874,12 @@ type Params struct { MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` // The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 ProposalCancelRatio string `protobuf:"bytes,8,opt,name=proposal_cancel_ratio,json=proposalCancelRatio,proto3" json:"proposal_cancel_ratio,omitempty"` - // The proposal cancel destination address will receive the remaining deposits of cancel proposal. - // // The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. // If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 ProposalCancelDest string `protobuf:"bytes,9,opt,name=proposal_cancel_dest,json=proposalCancelDest,proto3" json:"proposal_cancel_dest,omitempty"` } diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 9d005504c9b..68d9ffe779b 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7338,7 +7338,7 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { // MsgCancelProposal is the Msg/CancelProposal request type. // -// Since: cosmos-sdk 0.47 +// Since: cosmos-sdk 0.48 type MsgCancelProposal struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -7385,7 +7385,7 @@ func (x *MsgCancelProposal) GetProposer() string { // MsgCancelProposalResponse defines the response structure for executing a // MsgCancelProposal message. // -// Since: cosmos-sdk 0.47 +// Since: cosmos-sdk 0.48 type MsgCancelProposalResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/cosmos/gov/v1/tx_grpc.pb.go b/api/cosmos/gov/v1/tx_grpc.pb.go index 3d0df1eddd3..6ffe7106fcf 100644 --- a/api/cosmos/gov/v1/tx_grpc.pb.go +++ b/api/cosmos/gov/v1/tx_grpc.pb.go @@ -40,7 +40,7 @@ type MsgClient interface { UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) // CancelProposal defines a method to cancel governance proposal // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) } @@ -137,7 +137,7 @@ type MsgServer interface { UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) // CancelProposal defines a method to cancel governance proposal // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 CancelProposal(context.Context, *MsgCancelProposal) (*MsgCancelProposalResponse, error) mustEmbedUnimplementedMsgServer() } diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto index b37082bc1aa..866c49c978e 100644 --- a/proto/cosmos/auth/v1beta1/query.proto +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -198,14 +198,14 @@ message AddressStringToBytesResponse { // Since: cosmos-sdk 0.46.2 message QueryAccountAddressByIDRequest { // Deprecated, use account_id instead - // + // // id is the account number of the address to be queried. This field // should have been an uint64 (like all account numbers), and will be // updated to uint64 in a future version of the auth query. int64 id = 1 [deprecated = true]; // account_id is the account number of the address to be queried. - // + // // Since: cosmos-sdk 0.47 uint64 account_id = 2; } diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index dc6359c4979..10a9a8a038c 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -60,7 +60,7 @@ message Proposal { // proposer defines the address of the proposal's proposer. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 string proposer = 11 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } @@ -167,11 +167,11 @@ message Params { // The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 string proposal_cancel_ratio = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; // The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. // If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 string proposal_cancel_dest = 9 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 70d90442c34..4be2456d990 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -41,7 +41,7 @@ service Msg { // CancelProposal defines a method to cancel governance proposal // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 rpc CancelProposal(MsgCancelProposal) returns (MsgCancelProposalResponse); } @@ -143,7 +143,7 @@ message MsgUpdateParamsResponse {} // MsgCancelProposal is the Msg/CancelProposal request type. // -// Since: cosmos-sdk 0.47 +// Since: cosmos-sdk 0.48 message MsgCancelProposal { option (cosmos.msg.v1.signer) = "proposer"; @@ -154,7 +154,7 @@ message MsgCancelProposal { // MsgCancelProposalResponse defines the response structure for executing a // MsgCancelProposal message. // -// Since: cosmos-sdk 0.47 +// Since: cosmos-sdk 0.48 message MsgCancelProposalResponse { uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; // canceled_time is the time when proposal is canceled. diff --git a/tests/e2e/gov/tx.go b/tests/e2e/gov/tx.go index 5755f0bab03..3c08b566b8f 100644 --- a/tests/e2e/gov/tx.go +++ b/tests/e2e/gov/tx.go @@ -73,7 +73,7 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) - // create a proposal4 with deposit for check the cancel proposal cli tx + // create a proposal4 with deposit to check the cancel proposal cli tx out, err = govclitestutil.MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), "Text Proposal 4", "Where is the title!?", v1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens).String())) diff --git a/x/consensus/types/tx.pb.go b/x/consensus/types/tx.pb.go index d8ef6119430..1c36f34eef7 100644 --- a/x/consensus/types/tx.pb.go +++ b/x/consensus/types/tx.pb.go @@ -35,6 +35,8 @@ type MsgUpdateParams struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // params defines the x/consensus_params parameters to update. + // VersionsParams is not included in this Msg because it is tracked + // separarately in x/upgrade. // // NOTE: All parameters must be supplied. Block *types.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` diff --git a/x/gov/README.md b/x/gov/README.md index 37ec0f1327c..34d5c3e0f86 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -1229,8 +1229,7 @@ simd tx gov submit-legacy-proposal software-upgrade v2 --title="Test Proposal" - #### cancel-proposal -The `cancel-proposal` command allows the proposer to cancel the goverance proposal before voting period ends. -Once proposal is canceled, from the deposits of proposal `proposal_cancel_burn_rate * deposits` will be sent to community pool and `remaining deposits` will be burned. +Once proposal is canceled, from the deposits of proposal `proposal_cancel_burn_rate * deposits` will be sent to the `ProposalCancelDest` address and `remaining deposits` will be burned. ```bash simd tx gov cancel-proposal [proposal-id] [flags] diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index cb8af3ed82c..e2e85bcb4fc 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -182,7 +182,7 @@ func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddre } } - // burn the cancellation fee or sent to cancellation changes to destination address + // burn the cancellation fee or sent the cancellation charges to destination address. if !cancellationCharges.IsZero() { // get the distribution module account address distributionAddress := keeper.authKeeper.GetModuleAddress(disttypes.ModuleName) @@ -215,7 +215,7 @@ func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddre for _, deposit := range deposits.Amount { remainAmount := sdk.NewCoin( deposit.Denom, - sdk.NewDecFromInt(deposit.Amount).Sub(sdk.NewDec(1).Sub(rate)).RoundInt(), + sdk.NewDecFromInt(deposit.Amount).Mul(sdk.NewDec(1).Sub(rate)).RoundInt(), ) remainingAmount = remainingAmount.Add(remainAmount) } diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index ee9724414dd..1fb04051219 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -41,7 +41,7 @@ func GenDepositMinInitialDepositRatio(r *rand.Rand) sdk.Dec { return sdk.NewDec(int64(simulation.RandIntBetween(r, 0, 99))).Quo(sdk.NewDec(100)) } -// GenProposalCancelRaterandomized ProposalCancelRate +// GenProposalCancelRate randomized ProposalCancelRate func GenProposalCancelRate(r *rand.Rand) sdk.Dec { return sdk.NewDec(int64(simulation.RandIntBetween(r, 0, 99))).Quo(sdk.NewDec(100)) } diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index b08c2d8b112..6c25abfa8f3 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -254,7 +254,7 @@ type Proposal struct { Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` // proposer defines the address of the proposal's proposer. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 Proposer string `protobuf:"bytes,11,opt,name=proposer,proto3" json:"proposer,omitempty"` } @@ -699,14 +699,12 @@ type Params struct { MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` // The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 ProposalCancelRatio string `protobuf:"bytes,8,opt,name=proposal_cancel_ratio,json=proposalCancelRatio,proto3" json:"proposal_cancel_ratio,omitempty"` - // The proposal cancel destination address will receive the remaining deposits of cancel proposal. - // // The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. // If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 ProposalCancelDest string `protobuf:"bytes,9,opt,name=proposal_cancel_dest,json=proposalCancelDest,proto3" json:"proposal_cancel_dest,omitempty"` } diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 73b1408419a..b84755bbdab 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -657,7 +657,7 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // MsgCancelProposal is the Msg/CancelProposal request type. // -// Since: cosmos-sdk 0.47 +// Since: cosmos-sdk 0.48 type MsgCancelProposal struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` @@ -713,7 +713,7 @@ func (m *MsgCancelProposal) GetProposer() string { // MsgCancelProposalResponse defines the response structure for executing a // MsgCancelProposal message. // -// Since: cosmos-sdk 0.47 +// Since: cosmos-sdk 0.48 type MsgCancelProposalResponse struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` // canceled_time is the time when proposal is canceled. @@ -892,7 +892,7 @@ type MsgClient interface { UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) // CancelProposal defines a method to cancel governance proposal // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) } @@ -987,7 +987,7 @@ type MsgServer interface { UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) // CancelProposal defines a method to cancel governance proposal // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 CancelProposal(context.Context, *MsgCancelProposal) (*MsgCancelProposalResponse, error) } From c868a05a2b9e0d1aab73d93c91d1159469a72019 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 28 Nov 2022 21:35:14 +0530 Subject: [PATCH 49/69] chore: fix build issue and add test for balance check on cancel proposal --- simapp/app.go | 2 +- tests/e2e/gov/tx.go | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/simapp/app.go b/simapp/app.go index ad536049487..4b5182c56c5 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -341,7 +341,7 @@ func NewSimApp( */ govKeeper := govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - app.StakingKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + app.StakingKeeper, app.DistrKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.GovKeeper = *govKeeper.SetHooks( diff --git a/tests/e2e/gov/tx.go b/tests/e2e/gov/tx.go index 3c08b566b8f..2312937f0c8 100644 --- a/tests/e2e/gov/tx.go +++ b/tests/e2e/gov/tx.go @@ -14,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" govclitestutil "github.com/cosmos/cosmos-sdk/x/gov/client/testutil" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -345,6 +346,14 @@ func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { s.Run(tc.name, func() { cmd := cli.NewCmdCancelProposal() clientCtx := val.ClientCtx + var balRes banktypes.QueryAllBalancesResponse + var newBalance banktypes.QueryAllBalancesResponse + if !tc.expectErr && tc.expectedCode == 0 { + resp, err := clitestutil.QueryBalancesExec(clientCtx, val.Address) + s.Require().NoError(err) + err = val.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &balRes) + s.Require().NoError(err) + } out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) if tc.expectErr { @@ -354,6 +363,16 @@ func (s *IntegrationTestSuite) TestNewCmdCancelProposal() { s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, tc.expectedCode)) + + if !tc.expectErr && tc.expectedCode == 0 { + resp, err := clitestutil.QueryBalancesExec(clientCtx, val.Address) + s.Require().NoError(err) + err = val.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &newBalance) + s.Require().NoError(err) + s.Require().True( + newBalance.Balances.AmountOf(s.network.Config.BondDenom).GT(balRes.Balances.AmountOf(s.network.Config.BondDenom)), + ) + } } }) } From ee06adb41677f81ad6b0d2e71872ffa3ec462842 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Tue, 29 Nov 2022 22:26:48 +0530 Subject: [PATCH 50/69] chore: address pr comments --- UPGRADING.md | 36 ++++++++++++++++++------------------ simapp/upgrades.go | 3 +++ x/gov/keeper/deposit.go | 31 +++++++++++++++++-------------- 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 6307930ca7e..ce63286c991 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -130,24 +130,24 @@ The `Proposal` proto has been updated with proposer field. For proposal state mi > This migration is optional, if chain wants to cancel previous proposals which are active (deposit or voting period) they can do this proposals state migration. ```go -// import ( -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/types/module" -// // v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" -// upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -// ) - -// func (app SimApp) RegisterUpgradeHandlers() { -// app.UpgradeKeeper.SetUpgradeHandler(UpgradeName, -// func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { -// //// this migration is optional -// //// add proposal ids with proposers which are active (deposit or voting period) -// // proposals := make(map[uint64]string) -// // proposals[1] = "cosmos1luyncewxk4lm24k6gqy8y5dxkj0klr4tu0lmnj" ... -// // v4.AddProposerAddressToProposal(ctx, sdk.NewKVStoreKey(v4.ModuleName), app.appCodec, proposals) -// return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) -// }) -// } +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +func (app SimApp) RegisterUpgradeHandlers() { + app.UpgradeKeeper.SetUpgradeHandler(UpgradeName, + func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // this migration is optional + // add proposal ids with proposers which are active (deposit or voting period) + proposals := make(map[uint64]string) + proposals[1] = "cosmos1luyncewxk4lm24k6gqy8y5dxkj0klr4tu0lmnj" ... + v4.AddProposerAddressToProposal(ctx, sdk.NewKVStoreKey(v4.ModuleName), app.appCodec, proposals) + return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) + }) +} ``` diff --git a/simapp/upgrades.go b/simapp/upgrades.go index 1324d9d98e8..ae86496bfd0 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -27,6 +27,9 @@ func (app SimApp) RegisterUpgradeHandlers() { // dedicated x/consensus module. baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) + // Note: this migration is optional, + // You can include x/gov proposal migration documented at UPGRADING.md(https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md) + return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) }, ) diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index e2e85bcb4fc..0a6e6c26956 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -208,20 +208,23 @@ func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddre } } - // send remaining (deposits - cancellationCharges) to depositors - for _, deposits := range keeper.GetDeposits(ctx, proposalID) { - depositerAddress := sdk.MustAccAddressFromBech32(deposits.Depositor) - var remainingAmount sdk.Coins - for _, deposit := range deposits.Amount { - remainAmount := sdk.NewCoin( - deposit.Denom, - sdk.NewDecFromInt(deposit.Amount).Mul(sdk.NewDec(1).Sub(rate)).RoundInt(), - ) - remainingAmount = remainingAmount.Add(remainAmount) - } - err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositerAddress, remainingAmount) - if err != nil { - return err + // proposal cancel rate is not 100% then we have remaining deposits after the cancellation charges + if !rate.Equal(sdk.MustNewDecFromStr("1")) { + // send remaining (deposits - cancellationCharges) to depositors + for _, deposits := range keeper.GetDeposits(ctx, proposalID) { + depositerAddress := sdk.MustAccAddressFromBech32(deposits.Depositor) + var remainingAmount sdk.Coins + for _, deposit := range deposits.Amount { + remainAmount := sdk.NewCoin( + deposit.Denom, + sdk.NewDecFromInt(deposit.Amount).Mul(sdk.NewDec(1).Sub(rate)).RoundInt(), + ) + remainingAmount = remainingAmount.Add(remainAmount) + } + err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositerAddress, remainingAmount) + if err != nil { + return err + } } } From 77b6023d07043bd051706a3de6ccc986ccff9708 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 12 Dec 2022 13:21:51 +0530 Subject: [PATCH 51/69] chore: address the pr comments --- CHANGELOG.md | 1 - UPGRADING.md | 2 +- tests/e2e/gov/query.go | 4 ++-- x/gov/README.md | 4 ++-- x/gov/keeper/proposal.go | 10 +++++----- x/gov/keeper/vote.go | 4 ++-- x/gov/migrations/v4/store.go | 3 ++- x/gov/types/v1/params.go | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2f741f97bd..9b778a7666a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,7 +55,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/auth) [#13210](https://github.com/cosmos/cosmos-sdk/pull/13210) Add `Query/AccountInfo` endpoint for simplified access to basic account info. * (x/consensus) [#12905](https://github.com/cosmos/cosmos-sdk/pull/12905) Create a new `x/consensus` module that is now responsible for maintaining Tendermint consensus parameters instead of `x/param`. Legacy types remain in order to facilitate parameter migration from the deprecated `x/params`. App developers should ensure that they execute `baseapp.MigrateParams` during their chain upgrade. These legacy types will be removed in a future release. * (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Add `cancel-proposal` feature to proposals. Now proposers can cancel the proposal prior to the proposal's voting period end time. -* (cli) [#13454](https://github.com/cosmos/cosmos-sdk/pull/13454) `sign-batch` CLI can now read multiple transaction files. * (client/tx) [#13670](https://github.com/cosmos/cosmos-sdk/pull/13670) Add validation in `BuildUnsignedTx` to prevent simple inclusion of valid mnemonics ### Improvements diff --git a/UPGRADING.md b/UPGRADING.md index ce63286c991..a28415f1bf7 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -160,7 +160,7 @@ The `gov` module has been updated to support the ability to cancel governance pr 2. deposits * (1 - proposal_cancel_ratio) will be sent to depositors. ``` -By default, the new `ProposalCancelRatio` parameter is set to zero during migration and `ProposalCancelDest` is set to empty string. +By default, the new `ProposalCancelRatio` parameter is set to 0.5 during migration and `ProposalCancelDest` is set to empty string. #### `x/consensus` diff --git a/tests/e2e/gov/query.go b/tests/e2e/gov/query.go index 2c3599188ac..6703a312e46 100644 --- a/tests/e2e/gov/query.go +++ b/tests/e2e/gov/query.go @@ -23,7 +23,7 @@ func (s *IntegrationTestSuite) TestCmdParams() { { "json output", []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_ratio":"0.000000000000000000","proposal_cancel_dest":""}}`, + `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_ratio":"0.500000000000000000","proposal_cancel_dest":""}}`, }, { "text output", @@ -41,7 +41,7 @@ params: denom: stake min_initial_deposit_ratio: "0.000000000000000000" proposal_cancel_dest: "" - proposal_cancel_ratio: "0.000000000000000000" + proposal_cancel_ratio: "0.500000000000000000" quorum: "0.334000000000000000" threshold: "0.500000000000000000" veto_threshold: "0.334000000000000000" diff --git a/x/gov/README.md b/x/gov/README.md index 34d5c3e0f86..d9a578b7b3e 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -881,7 +881,7 @@ params: - amount: "10000000" denom: stake min_initial_deposit_ratio: "0.000000000000000000" - proposal_cancel_burn_rate: "0.000000000000000000" + proposal_cancel_burn_rate: "0.500000000000000000" quorum: "0.334000000000000000" threshold: "0.500000000000000000" veto_threshold: "0.334000000000000000" @@ -1229,7 +1229,7 @@ simd tx gov submit-legacy-proposal software-upgrade v2 --title="Test Proposal" - #### cancel-proposal -Once proposal is canceled, from the deposits of proposal `proposal_cancel_burn_rate * deposits` will be sent to the `ProposalCancelDest` address and `remaining deposits` will be burned. +Once proposal is canceled, from the deposits of proposal `deposits * proposal_cancel_ratio` will be burned or sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then deposits will be burned. and `remaining deposits` will be sent to depositers. ```bash simd tx gov cancel-proposal [proposal-id] [flags] diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index a5f4f9dc01c..04b68f36a25 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -105,22 +105,22 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer // Checking proposal have proposer or not because old proposal doesn't have proposer feild, // https://github.com/cosmos/cosmos-sdk/blob/v0.46.2/proto/cosmos/gov/v1/gov.proto#L43 if proposal.Proposer == "" { - return sdkerrors.Wrapf(types.ErrInvalidProposal, "proposal %d doesn't have proposer %s, so cannot be canceled", proposalID, proposer) + return types.ErrInvalidProposal.Wrapf("proposal %d doesn't have proposer %s, so cannot be canceled", proposalID, proposer) } // Check creator of the proposal if proposal.Proposer != proposer { - return sdkerrors.Wrapf(types.ErrInvalidProposer, "invalid proposer %s", proposer) + return types.ErrInvalidProposer.Wrapf("invalid proposer %s", proposer) } // Check if proposal is active or not if (proposal.Status != v1.StatusDepositPeriod) && (proposal.Status != v1.StatusVotingPeriod) { - return sdkerrors.Wrap(types.ErrInvalidProposal, "proposal should be in the deposit or voting period") + return types.ErrInvalidProposal.Wrap("proposal should be in the deposit or voting period") } // Check proposal voting period is ended. if proposal.VotingEndTime != nil && proposal.VotingEndTime.Before(ctx.BlockTime()) { - return sdkerrors.Wrapf(types.ErrVotingPeriodEnded, "voting period is already ended for this proposal %d", proposalID) + return types.ErrVotingPeriodEnded.Wrapf("voting period is already ended for this proposal %d", proposalID) } // burn the (deposits * proposal_cancel_rate) amount or sent to cancellation destination address. @@ -132,7 +132,7 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer } if proposal.VotingStartTime != nil { - keeper.DeleteVotes(ctx, proposal.Id) + keeper.deleteVotes(ctx, proposal.Id) } keeper.DeleteProposal(ctx, proposal.Id) diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 6ab75e74150..558fc14172b 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -117,8 +117,8 @@ func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vo } } -// DeleteVotes deletes all the votes from a given proposalID. -func (keeper Keeper) DeleteVotes(ctx sdk.Context, proposalID uint64) { +// deleteVotes deletes the all votes from a given proposalID. +func (keeper Keeper) deleteVotes(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(keeper.storeKey) store.Delete(types.VotesKey(proposalID)) } diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go index ce10777dd5e..29f943fa6c8 100644 --- a/x/gov/migrations/v4/store.go +++ b/x/gov/migrations/v4/store.go @@ -69,7 +69,8 @@ func migrateProposalVotingPeriod(ctx sdk.Context, storeKey storetypes.StoreKey, } // AddProposerAddressToProposal will add proposer to proposal -// and set to the store +// and set to the store. This function is optional, and only needed +// if you wish that migrated proposals be cancellable. func AddProposerAddressToProposal(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, proposals map[uint64]string) error { proposalIDs := make([]uint64, 0, len(proposals)) diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 156ebd47701..da58a4d22d1 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -20,7 +20,7 @@ var ( DefaultThreshold = sdk.NewDecWithPrec(5, 1) DefaultVetoThreshold = sdk.NewDecWithPrec(334, 3) DefaultMinInitialDepositRatio = sdk.ZeroDec() - DefaultProposalCancelRatio = sdk.ZeroDec() + DefaultProposalCancelRatio = sdk.MustNewDecFromStr("0.5") DefaultProposalCancelDestAddress = "" ) From c729d4a2644bad318b83ee704d6a7cfa30de2ee8 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 12 Dec 2022 13:43:37 +0530 Subject: [PATCH 52/69] fix: fix the test cases --- x/gov/keeper/proposal_test.go | 2 +- x/gov/migrations/v4/json_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index a142fff4ae2..cddbe4cb081 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -36,7 +36,7 @@ func (suite *KeeperTestSuite) TestDeleteProposal() { }, ) tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "") + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[0], tp, "") suite.Require().NoError(err) proposalID := proposal.Id suite.govKeeper.SetProposal(suite.ctx, proposal) diff --git a/x/gov/migrations/v4/json_test.go b/x/gov/migrations/v4/json_test.go index b78bf84745b..84131ba2e20 100644 --- a/x/gov/migrations/v4/json_test.go +++ b/x/gov/migrations/v4/json_test.go @@ -49,7 +49,7 @@ func TestMigrateJSON(t *testing.T) { ], "min_initial_deposit_ratio": "0.000000000000000000", "proposal_cancel_dest": "", - "proposal_cancel_ratio": "0.000000000000000000", + "proposal_cancel_ratio": "0.500000000000000000", "quorum": "0.334000000000000000", "threshold": "0.500000000000000000", "veto_threshold": "0.334000000000000000", From c3f3d281a4433174ead4ebcb52e9a98fe78eebd9 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 12 Dec 2022 22:06:48 +0530 Subject: [PATCH 53/69] chore: address the pr comments --- UPGRADING.md | 2 +- x/gov/README.md | 2 +- x/gov/keeper/deposit.go | 27 +++++++++++++-------------- x/gov/keeper/proposal.go | 2 +- x/gov/keeper/proposal_test.go | 26 ++++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 17 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index a28415f1bf7..46eb5837cf1 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -160,7 +160,7 @@ The `gov` module has been updated to support the ability to cancel governance pr 2. deposits * (1 - proposal_cancel_ratio) will be sent to depositors. ``` -By default, the new `ProposalCancelRatio` parameter is set to 0.5 during migration and `ProposalCancelDest` is set to empty string. +By default, the new `ProposalCancelRatio` parameter is set to 0.5 during migration and `ProposalCancelDest` is set to empty string (i.e. burnt). #### `x/consensus` diff --git a/x/gov/README.md b/x/gov/README.md index d9a578b7b3e..f10dae43898 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -1229,7 +1229,7 @@ simd tx gov submit-legacy-proposal software-upgrade v2 --title="Test Proposal" - #### cancel-proposal -Once proposal is canceled, from the deposits of proposal `deposits * proposal_cancel_ratio` will be burned or sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then deposits will be burned. and `remaining deposits` will be sent to depositers. +Once proposal is canceled, from the deposits of proposal `deposits * proposal_cancel_ratio` will be burned or sent to `ProposalCancelDest` address , if `ProposalCancelDest` is empty then deposits will be burned. The `remaining deposits` will be sent to depositers. ```bash simd tx gov cancel-proposal [proposal-id] [flags] diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 47a6adc7f5f..7633e3c5bc5 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -186,24 +186,23 @@ func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddre if !cancellationCharges.IsZero() { // get the distribution module account address distributionAddress := keeper.authKeeper.GetModuleAddress(disttypes.ModuleName) - if distributionAddress.String() == destAddress { + switch { + case len(destAddress) == 0: + // burn the cancellation charges from deposits + err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, cancellationCharges) + if err != nil { + return err + } + case distributionAddress.String() == destAddress: err := keeper.distrkeeper.FundCommunityPool(ctx, cancellationCharges, keeper.ModuleAccountAddress()) if err != nil { return err } - } else { - if len(destAddress) == 0 { - // burn the remaining deposits also - err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, cancellationCharges) - if err != nil { - return err - } - } else { - destAccAddress := sdk.MustAccAddressFromBech32(destAddress) - err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, destAccAddress, cancellationCharges) - if err != nil { - return err - } + default: + destAccAddress := sdk.MustAccAddressFromBech32(destAddress) + err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, destAccAddress, cancellationCharges) + if err != nil { + return err } } } diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 5c940105fa8..13ee9d74dc7 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -102,7 +102,7 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer return sdkerrors.Wrapf(types.ErrProposalNotFound, "proposal_id %d", proposalID) } - // Checking proposal have proposer or not because old proposal doesn't have proposer feild, + // Checking proposal have proposer or not because old proposal doesn't have proposer field, // https://github.com/cosmos/cosmos-sdk/blob/v0.46.2/proto/cosmos/gov/v1/gov.proto#L43 if proposal.Proposer == "" { return types.ErrInvalidProposal.Wrapf("proposal %d doesn't have proposer %s, so cannot be canceled", proposalID, proposer) diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index cddbe4cb081..a086b4c178f 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -168,12 +168,28 @@ func (suite *KeeperTestSuite) TestCancelProposal() { proposalResp, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[0], []sdk.Msg{prop}, "") proposalID := proposalResp.Id + proposal2Resp, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[0], []sdk.Msg{prop}, "") + proposal2ID := proposal2Resp.Id + makeProposalPass := func() { + proposal2, ok := suite.govKeeper.GetProposal(suite.ctx, 2) + suite.Require().True(ok) + + proposal2.Status = v1.ProposalStatus_PROPOSAL_STATUS_PASSED + suite.govKeeper.SetProposal(suite.ctx, proposal2) + } + testCases := []struct { name string proposalID uint64 proposer string expectedErr bool }{ + { + name: "without proposer", + proposalID: 1, + proposer: "", + expectedErr: true, + }, { name: "invalid proposal id", proposalID: 1, @@ -186,6 +202,12 @@ func (suite *KeeperTestSuite) TestCancelProposal() { proposer: suite.addrs[1].String(), expectedErr: true, }, + { + name: "valid proposalID but invalid proposal which has already passed", + proposalID: proposal2ID, + proposer: suite.addrs[1].String(), + expectedErr: true, + }, { name: "valid proposer and proposal id", proposalID: proposalID, @@ -196,6 +218,10 @@ func (suite *KeeperTestSuite) TestCancelProposal() { for _, tc := range testCases { suite.Run(tc.name, func() { + if tc.proposalID == proposal2ID { + // making proposal status pass + makeProposalPass() + } err = suite.govKeeper.CancelProposal(suite.ctx, tc.proposalID, tc.proposer) if tc.expectedErr { suite.Require().Error(err) From f8fdd0e2a4b382af57c0ab02257819c35ec6fdb4 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 16 Dec 2022 15:24:00 +0530 Subject: [PATCH 54/69] test: add more tests for cancel proposal --- x/gov/keeper/msg_server_test.go | 68 +++++++++++++++++++++++++++++++++ x/gov/keeper/proposal_test.go | 2 +- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 160e245724a..29e102a1385 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -120,6 +120,74 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { } } +func (suite *KeeperTestSuite) TestCancelProposalReq() { + govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() + addrs := suite.addrs + proposer := addrs[0] + + coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) + bankMsg := &banktypes.MsgSend{ + FromAddress: govAcct.String(), + ToAddress: proposer.String(), + Amount: coins, + } + + msg, err := v1.NewMsgSubmitProposal( + []sdk.Msg{bankMsg}, + coins, + proposer.String(), + "", + ) + suite.Require().NoError(err) + + res, err := suite.msgSrvr.SubmitProposal(suite.ctx, msg) + suite.Require().NoError(err) + suite.Require().NotNil(res.ProposalId) + pId := res.ProposalId + + cases := map[string]struct { + preRun func() uint64 + expErr bool + proposalId uint64 + depositor sdk.AccAddress + }{ + "wrong proposal id": { + preRun: func() uint64 { + return 0 + }, + depositor: proposer, + expErr: true, + }, + "valid proposal but invalid proposer": { + preRun: func() uint64 { + return pId + }, + depositor: addrs[1], + expErr: true, + }, + "all good": { + preRun: func() uint64 { + return pId + }, + depositor: proposer, + expErr: false, + }, + } + + for name, tc := range cases { + suite.Run(name, func() { + proposalId := tc.preRun() + cancelProposalReq := v1.NewMsgCancelProposal(proposalId, tc.depositor.String()) + _, err := suite.msgSrvr.CancelProposal(suite.ctx, cancelProposalReq) + if tc.expErr { + suite.Require().Error(err) + } else { + suite.Require().NoError(err) + } + }) + } +} + func (suite *KeeperTestSuite) TestVoteReq() { suite.reset() govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index a086b4c178f..3876f607b3c 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -205,7 +205,7 @@ func (suite *KeeperTestSuite) TestCancelProposal() { { name: "valid proposalID but invalid proposal which has already passed", proposalID: proposal2ID, - proposer: suite.addrs[1].String(), + proposer: suite.addrs[0].String(), expectedErr: true, }, { From 1a9a4d71c114d15eb2b81afc3a799d540bdb87a3 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 16 Dec 2022 15:34:59 +0530 Subject: [PATCH 55/69] chore: removed extra test of cancelProposal on msg_server --- x/gov/keeper/msg_server_test.go | 68 --------------------------------- x/gov/keeper/proposal_test.go | 3 +- 2 files changed, 2 insertions(+), 69 deletions(-) diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 29e102a1385..160e245724a 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -120,74 +120,6 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { } } -func (suite *KeeperTestSuite) TestCancelProposalReq() { - govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() - addrs := suite.addrs - proposer := addrs[0] - - coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) - bankMsg := &banktypes.MsgSend{ - FromAddress: govAcct.String(), - ToAddress: proposer.String(), - Amount: coins, - } - - msg, err := v1.NewMsgSubmitProposal( - []sdk.Msg{bankMsg}, - coins, - proposer.String(), - "", - ) - suite.Require().NoError(err) - - res, err := suite.msgSrvr.SubmitProposal(suite.ctx, msg) - suite.Require().NoError(err) - suite.Require().NotNil(res.ProposalId) - pId := res.ProposalId - - cases := map[string]struct { - preRun func() uint64 - expErr bool - proposalId uint64 - depositor sdk.AccAddress - }{ - "wrong proposal id": { - preRun: func() uint64 { - return 0 - }, - depositor: proposer, - expErr: true, - }, - "valid proposal but invalid proposer": { - preRun: func() uint64 { - return pId - }, - depositor: addrs[1], - expErr: true, - }, - "all good": { - preRun: func() uint64 { - return pId - }, - depositor: proposer, - expErr: false, - }, - } - - for name, tc := range cases { - suite.Run(name, func() { - proposalId := tc.preRun() - cancelProposalReq := v1.NewMsgCancelProposal(proposalId, tc.depositor.String()) - _, err := suite.msgSrvr.CancelProposal(suite.ctx, cancelProposalReq) - if tc.expErr { - suite.Require().Error(err) - } else { - suite.Require().NoError(err) - } - }) - } -} - func (suite *KeeperTestSuite) TestVoteReq() { suite.reset() govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 3876f607b3c..dca021456c3 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -222,7 +222,8 @@ func (suite *KeeperTestSuite) TestCancelProposal() { // making proposal status pass makeProposalPass() } - err = suite.govKeeper.CancelProposal(suite.ctx, tc.proposalID, tc.proposer) + cancelProposalReq := v1.NewMsgCancelProposal(tc.proposalID, tc.proposer) + _, err = suite.msgSrvr.CancelProposal(suite.ctx, cancelProposalReq) if tc.expectedErr { suite.Require().Error(err) } else { From fb1bfd7189a84a874bac2e56616eaeceb4f6048b Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 16 Dec 2022 15:49:20 +0530 Subject: [PATCH 56/69] fix: fix the failing tests --- x/gov/keeper/msg_server_test.go | 68 +++++++++++++++++++++++++++++++++ x/gov/keeper/proposal_test.go | 9 ++--- 2 files changed, 72 insertions(+), 5 deletions(-) diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 160e245724a..29e102a1385 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -120,6 +120,74 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { } } +func (suite *KeeperTestSuite) TestCancelProposalReq() { + govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() + addrs := suite.addrs + proposer := addrs[0] + + coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))) + bankMsg := &banktypes.MsgSend{ + FromAddress: govAcct.String(), + ToAddress: proposer.String(), + Amount: coins, + } + + msg, err := v1.NewMsgSubmitProposal( + []sdk.Msg{bankMsg}, + coins, + proposer.String(), + "", + ) + suite.Require().NoError(err) + + res, err := suite.msgSrvr.SubmitProposal(suite.ctx, msg) + suite.Require().NoError(err) + suite.Require().NotNil(res.ProposalId) + pId := res.ProposalId + + cases := map[string]struct { + preRun func() uint64 + expErr bool + proposalId uint64 + depositor sdk.AccAddress + }{ + "wrong proposal id": { + preRun: func() uint64 { + return 0 + }, + depositor: proposer, + expErr: true, + }, + "valid proposal but invalid proposer": { + preRun: func() uint64 { + return pId + }, + depositor: addrs[1], + expErr: true, + }, + "all good": { + preRun: func() uint64 { + return pId + }, + depositor: proposer, + expErr: false, + }, + } + + for name, tc := range cases { + suite.Run(name, func() { + proposalId := tc.preRun() + cancelProposalReq := v1.NewMsgCancelProposal(proposalId, tc.depositor.String()) + _, err := suite.msgSrvr.CancelProposal(suite.ctx, cancelProposalReq) + if tc.expErr { + suite.Require().Error(err) + } else { + suite.Require().NoError(err) + } + }) + } +} + func (suite *KeeperTestSuite) TestVoteReq() { suite.reset() govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index dca021456c3..b1580e0d81e 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -168,10 +168,10 @@ func (suite *KeeperTestSuite) TestCancelProposal() { proposalResp, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[0], []sdk.Msg{prop}, "") proposalID := proposalResp.Id - proposal2Resp, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[0], []sdk.Msg{prop}, "") + proposal2Resp, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[1], []sdk.Msg{prop}, "") proposal2ID := proposal2Resp.Id makeProposalPass := func() { - proposal2, ok := suite.govKeeper.GetProposal(suite.ctx, 2) + proposal2, ok := suite.govKeeper.GetProposal(suite.ctx, proposal2ID) suite.Require().True(ok) proposal2.Status = v1.ProposalStatus_PROPOSAL_STATUS_PASSED @@ -205,7 +205,7 @@ func (suite *KeeperTestSuite) TestCancelProposal() { { name: "valid proposalID but invalid proposal which has already passed", proposalID: proposal2ID, - proposer: suite.addrs[0].String(), + proposer: suite.addrs[1].String(), expectedErr: true, }, { @@ -222,8 +222,7 @@ func (suite *KeeperTestSuite) TestCancelProposal() { // making proposal status pass makeProposalPass() } - cancelProposalReq := v1.NewMsgCancelProposal(tc.proposalID, tc.proposer) - _, err = suite.msgSrvr.CancelProposal(suite.ctx, cancelProposalReq) + err = suite.govKeeper.CancelProposal(suite.ctx, tc.proposalID, tc.proposer) if tc.expectedErr { suite.Require().Error(err) } else { From cc03dede20adff2a8f4676232a954406bc24a061 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 28 Dec 2022 21:18:09 +0530 Subject: [PATCH 57/69] chore: fix the test and proto-gen for gov --- api/cosmos/gov/v1/gov.pulsar.go | 13 ++- api/cosmos/gov/v1/tx.pulsar.go | 77 ++++------------ x/gov/keeper/deposit_test.go | 4 +- x/gov/keeper/grpc_query_test.go | 24 ++--- x/gov/keeper/msg_server.go | 5 - x/gov/keeper/msg_server_test.go | 4 +- x/gov/keeper/proposal_test.go | 4 +- x/gov/types/v1/gov.pb.go | 157 ++++++++++++++++---------------- x/gov/types/v1/tx.pb.go | 123 +++++++++++++------------ 9 files changed, 191 insertions(+), 220 deletions(-) diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 7606d276673..ffbf6351c35 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -7262,7 +7262,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x22, 0xbc, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, + 0x6c, 0x64, 0x22, 0xcc, 0x04, 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, @@ -7290,7 +7290,16 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x2a, 0x89, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 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, 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, diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index 2a76aca9d65..8592b3557e2 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7616,70 +7616,27 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, - 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x02, 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, 0x62, - 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, - 0x12, 0x4d, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x18, 0x02, 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, - 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, - 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x03, 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, 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, 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, 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, 0xa8, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3b, 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, 0x0b, 0xca, 0xb4, 0x2d, 0x07, 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, + 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, 0xc9, 0x02, 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, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x18, 0x02, 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, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x03, 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, 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, 0x31, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x74, 0x61, 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, 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, diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index af720f0fe8f..02e168a44e8 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -21,7 +21,7 @@ func TestDeposits(t *testing.T) { TestAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, TestAddrs[0], tp, "") + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0]) require.NoError(t, err) proposalID := proposal.Id @@ -105,7 +105,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, TestAddrs[0], tp, "") + proposal, err = govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0]) require.NoError(t, err) proposalID = proposal.Id _, err = govKeeper.AddDeposit(ctx, proposalID, TestAddrs[0], fourStake) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 7d99bae6d4f..8cbb4802fd7 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -57,7 +57,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, addrs[0], []sdk.Msg{msgContent}, "") + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0]) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -127,7 +127,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, addrs[0], []sdk.Msg{msgContent}, "") + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0]) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -188,7 +188,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { testProposal := []sdk.Msg{ v1.NewMsgVote(govAddress, uint64(i), v1.OptionYes, ""), } - proposal, err := suite.govKeeper.SubmitProposal(ctx, addrs[0], testProposal, "") + proposal, err := suite.govKeeper.SubmitProposal(ctx, testProposal, "", "title", "summary", addrs[0]) suite.Require().NotEmpty(proposal) suite.Require().NoError(err) testProposals = append(testProposals, &proposal) @@ -321,7 +321,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, addrs[0], []sdk.Msg{msgContent}, "") + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0]) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) }, @@ -402,7 +402,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0]) suite.Require().NoError(err) req = &v1.QueryVoteRequest{ @@ -516,7 +516,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0]) suite.Require().NoError(err) req = &v1beta1.QueryVoteRequest{ @@ -622,7 +622,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0]) suite.Require().NoError(err) req = &v1.QueryVotesRequest{ @@ -724,7 +724,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0]) suite.Require().NoError(err) req = &v1beta1.QueryVotesRequest{ @@ -1009,7 +1009,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0]) suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -1110,7 +1110,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0]) suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -1200,7 +1200,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0]) suite.Require().NoError(err) req = &v1.QueryDepositsRequest{ @@ -1295,7 +1295,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0]) suite.Require().NoError(err) req = &v1beta1.QueryDepositsRequest{ diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 27fa5024f61..0f699d86581 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -47,11 +47,6 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos return nil, err } - proposer, err := sdk.AccAddressFromBech32(msg.GetProposer()) - if err != nil { - return nil, err - } - proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata, msg.Title, msg.Summary, proposer) 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 29b1386a4b9..a532bb6fef9 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -147,8 +147,8 @@ func (suite *KeeperTestSuite) TestCancelProposalReq() { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, coins, - proposer.String(), - "", + proposer.String(), "", + "title", "summary", ) suite.Require().NoError(err) diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index d0ef151bb20..b8cb8cf84ee 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -165,10 +165,10 @@ func (suite *KeeperTestSuite) TestCancelProposal() { tp := v1beta1.TextProposal{Title: "title", Description: "description"} prop, err := v1.NewLegacyContent(&tp, govAcct) suite.Require().NoError(err) - proposalResp, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[0], []sdk.Msg{prop}, "") + proposalResp, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[0]) proposalID := proposalResp.Id - proposal2Resp, err := suite.govKeeper.SubmitProposal(suite.ctx, suite.addrs[1], []sdk.Msg{prop}, "") + proposal2Resp, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[1]) proposal2ID := proposal2Resp.Id makeProposalPass := func() { proposal2, ok := suite.govKeeper.GetProposal(suite.ctx, proposal2ID) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 9d479afebc9..9c1fab0f93e 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -856,83 +856,86 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1212 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x3f, 0x73, 0x13, 0x47, - 0x14, 0xf7, 0x49, 0x27, 0x59, 0x7e, 0xb2, 0x84, 0x58, 0x1c, 0x38, 0x1b, 0x90, 0x8c, 0x26, 0xc3, - 0x38, 0xfc, 0x91, 0x62, 0x08, 0x69, 0x48, 0x23, 0x5b, 0x47, 0x38, 0x86, 0x58, 0x9a, 0xd3, 0x61, - 0x86, 0x34, 0x37, 0x6b, 0xdf, 0x22, 0xed, 0x44, 0x77, 0xab, 0xdc, 0xae, 0x04, 0xfa, 0x08, 0xe9, - 0x28, 0x33, 0xa9, 0x52, 0xa6, 0x4c, 0xc1, 0xa4, 0x4a, 0x93, 0x8e, 0x2a, 0xc3, 0xd0, 0x24, 0x69, - 0x48, 0x06, 0x8a, 0xcc, 0xf0, 0x29, 0x32, 0xb7, 0xb7, 0x67, 0xc9, 0xb2, 0x32, 0x36, 0x34, 0xd2, - 0xed, 0x7b, 0xbf, 0xdf, 0x7b, 0x6f, 0xdf, 0x9f, 0xdd, 0x85, 0x73, 0xfb, 0x8c, 0xfb, 0x8c, 0xd7, - 0xbb, 0x6c, 0x54, 0x1f, 0x6d, 0x46, 0x7f, 0xb5, 0x41, 0xc8, 0x04, 0x43, 0x85, 0x58, 0x51, 0x8b, - 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d9, 0x75, - 0x49, 0xe0, 0xc5, 0x76, 0xb2, 0x27, 0xb4, 0x53, 0x54, 0x4c, 0x33, 0xf0, 0xa4, 0x2d, 0x0b, 0x0a, - 0x82, 0x09, 0xdc, 0x77, 0x95, 0xdc, 0x58, 0x7c, 0x8f, 0x1a, 0x2d, 0x4b, 0x6a, 0xd2, 0x40, 0xf7, - 0xe1, 0xf4, 0x88, 0x09, 0x1a, 0x74, 0x5d, 0x2e, 0x70, 0xa8, 0xf6, 0x97, 0x3b, 0x61, 0x5c, 0xa7, - 0x62, 0x6a, 0x27, 0x62, 0xca, 0xc0, 0xee, 0x82, 0x12, 0x4d, 0xf6, 0xb8, 0x74, 0x42, 0x5b, 0x85, - 0x98, 0x98, 0x6c, 0x71, 0x2d, 0x6a, 0x12, 0x81, 0x3d, 0x2c, 0xb0, 0x01, 0x51, 0xdb, 0xda, 0x07, - 0x6b, 0xb4, 0x02, 0x19, 0x41, 0x45, 0x9f, 0x18, 0x79, 0xa9, 0x88, 0x17, 0xc8, 0x80, 0x45, 0x3e, - 0xf4, 0x7d, 0x1c, 0x8e, 0x8d, 0x65, 0x29, 0x4f, 0x96, 0xe8, 0x33, 0xc8, 0xc5, 0x13, 0x41, 0x42, - 0xa3, 0x70, 0xcc, 0x08, 0x1c, 0x20, 0xab, 0x7f, 0x68, 0x90, 0x9f, 0xee, 0x81, 0xab, 0xb0, 0x34, - 0x26, 0xdc, 0xdd, 0x97, 0x43, 0xa1, 0x1d, 0x99, 0x50, 0x2b, 0x10, 0x76, 0x6e, 0x4c, 0xf8, 0x76, - 0xa4, 0x47, 0x37, 0xa1, 0x80, 0xf7, 0xb8, 0xc0, 0x34, 0x50, 0x84, 0xd4, 0x5c, 0xc2, 0xb2, 0x02, - 0xc5, 0xa4, 0x4f, 0x20, 0x17, 0x30, 0x85, 0x4f, 0xcf, 0xc5, 0x2f, 0x06, 0x2c, 0x86, 0xde, 0x06, - 0x14, 0x30, 0xf7, 0x09, 0x15, 0x3d, 0x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xdb, 0x21, - 0x0b, 0x87, 0xfe, 0x9c, 0x0e, 0x96, 0x77, 0x4c, 0xac, 0x45, 0xd7, 0x60, 0x49, 0xf4, 0x42, 0xc2, - 0x7b, 0xac, 0xef, 0xfd, 0xcf, 0x75, 0x34, 0x01, 0xa0, 0x5b, 0x50, 0x94, 0x5d, 0x38, 0xa1, 0xa4, - 0xe7, 0x52, 0x0a, 0x11, 0xca, 0x49, 0x40, 0xd5, 0x5f, 0xd3, 0x90, 0x55, 0x71, 0x99, 0xef, 0x59, - 0xc7, 0xa9, 0xf3, 0x6c, 0xba, 0x66, 0x5f, 0x7d, 0x58, 0xcd, 0xf4, 0xf9, 0x35, 0x39, 0x5a, 0x83, - 0xf4, 0x07, 0xd4, 0x60, 0x2a, 0xe7, 0xfa, 0xc9, 0x73, 0x9e, 0x79, 0xff, 0x9c, 0x67, 0x4f, 0x90, - 0x73, 0x64, 0xc1, 0x6a, 0x94, 0x68, 0x1a, 0x50, 0x41, 0x27, 0x17, 0x88, 0x2b, 0xc3, 0x37, 0x16, - 0xe7, 0x5a, 0x38, 0xeb, 0xd3, 0xc0, 0x8a, 0xf1, 0x2a, 0x3d, 0x76, 0x84, 0xbe, 0xf2, 0x9d, 0x06, - 0x30, 0xf5, 0xe2, 0x39, 0x0f, 0xe7, 0x76, 0x5b, 0x8e, 0xe9, 0xb6, 0xda, 0x8e, 0xd5, 0xda, 0x71, - 0x1f, 0xec, 0x74, 0xda, 0xe6, 0xb6, 0x75, 0xc7, 0x32, 0x9b, 0xa5, 0x05, 0x74, 0x06, 0x4e, 0x4d, - 0x2b, 0x1f, 0x99, 0x9d, 0x92, 0x86, 0xce, 0xc1, 0x99, 0x69, 0x61, 0x63, 0xab, 0xe3, 0x34, 0xac, - 0x9d, 0x52, 0x0a, 0x21, 0x28, 0x4e, 0x2b, 0x76, 0x5a, 0xa5, 0x34, 0xba, 0x00, 0xc6, 0x61, 0x99, - 0xfb, 0xd0, 0x72, 0xee, 0xba, 0xbb, 0xa6, 0xd3, 0x2a, 0xe9, 0x57, 0x7e, 0xd7, 0xa0, 0x78, 0xf8, - 0x15, 0x80, 0x2a, 0x70, 0xbe, 0x6d, 0xb7, 0xda, 0xad, 0x4e, 0xe3, 0xbe, 0xdb, 0x71, 0x1a, 0xce, - 0x83, 0xce, 0x4c, 0x4c, 0x55, 0x28, 0xcf, 0x02, 0x9a, 0x66, 0xbb, 0xd5, 0xb1, 0x1c, 0xb7, 0x6d, - 0xda, 0x56, 0xab, 0x59, 0xd2, 0xd0, 0x25, 0xb8, 0x38, 0x8b, 0xd9, 0x6d, 0x39, 0xd6, 0xce, 0x97, - 0x09, 0x24, 0x85, 0xd6, 0xe0, 0xec, 0x2c, 0xa4, 0xdd, 0xe8, 0x74, 0xcc, 0x66, 0x1c, 0xf4, 0xac, - 0xce, 0x36, 0xef, 0x99, 0xdb, 0x8e, 0xd9, 0x2c, 0xe9, 0xf3, 0x98, 0x77, 0x1a, 0xd6, 0x7d, 0xb3, - 0x59, 0xca, 0x6c, 0x99, 0x2f, 0xde, 0x94, 0xb5, 0x97, 0x6f, 0xca, 0xda, 0x3f, 0x6f, 0xca, 0xda, - 0xb3, 0xb7, 0xe5, 0x85, 0x97, 0x6f, 0xcb, 0x0b, 0x7f, 0xbe, 0x2d, 0x2f, 0x7c, 0x7d, 0xb5, 0x4b, - 0x45, 0x6f, 0xb8, 0x57, 0xdb, 0x67, 0xbe, 0x7a, 0x9b, 0xaa, 0xbf, 0xeb, 0xdc, 0xfb, 0xa6, 0xfe, - 0x54, 0xbe, 0xb7, 0xc5, 0x78, 0x40, 0x78, 0xf4, 0x98, 0xce, 0xca, 0x16, 0xbd, 0xf9, 0x5f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x31, 0x0a, 0x72, 0x23, 0x8d, 0x0b, 0x00, 0x00, + // 1252 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x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63, 0xb6, + 0x3b, 0xed, 0x6e, 0xe3, 0xbe, 0xdd, 0xb5, 0x1a, 0xd6, 0x83, 0x6e, 0x22, 0xa6, 0x2a, 0x94, 0x93, + 0x80, 0x96, 0xde, 0x69, 0x77, 0x0d, 0xcb, 0xee, 0xe8, 0xa6, 0xd1, 0x6e, 0x95, 0x14, 0x74, 0x19, + 0x2e, 0x25, 0x31, 0xbb, 0x6d, 0xcb, 0xd8, 0xf9, 0x22, 0x86, 0xa4, 0xd0, 0x1a, 0x9c, 0x4b, 0x42, + 0x3a, 0x8d, 0x6e, 0x57, 0x6f, 0x45, 0x41, 0x27, 0x7d, 0xa6, 0xbe, 0xad, 0x6f, 0x59, 0x7a, 0xab, + 0xa4, 0xce, 0x63, 0xde, 0x6d, 0x18, 0xf7, 0xf5, 0x56, 0x29, 0xd3, 0xd4, 0x5f, 0xbc, 0x29, 0x2b, + 0x2f, 0xdf, 0x94, 0x95, 0xbf, 0xdf, 0x94, 0x95, 0x67, 0x6f, 0xcb, 0x0b, 0x2f, 0xdf, 0x96, 0x17, + 0xfe, 0x78, 0x5b, 0x5e, 0xf8, 0xea, 0x5a, 0x9f, 0xf0, 0xfd, 0xd1, 0x5e, 0xad, 0x47, 0x3d, 0x79, + 0x57, 0x96, 0x7f, 0x37, 0x98, 0xfb, 0x75, 0xfd, 0xa9, 0xb8, 0xff, 0xf3, 0xc9, 0x10, 0xb3, 0xf0, + 0x72, 0x9f, 0x15, 0x23, 0x73, 0xeb, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x56, 0xd0, 0x44, 0x5e, + 0x1d, 0x0c, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index eb89a7b8c26..72a26819dc9 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -829,64 +829,71 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 904 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xe6, 0x8f, 0xdd, 0xbc, 0x40, 0xaa, 0x8c, 0xdc, 0x76, 0xbd, 0x2a, 0x9b, 0x74, 0x8b, - 0x50, 0x94, 0x90, 0x5d, 0x1c, 0x68, 0x85, 0xdc, 0x0a, 0xa9, 0x2e, 0x15, 0x42, 0xc2, 0xa2, 0x72, - 0x45, 0x91, 0x10, 0x52, 0x34, 0xf6, 0x0e, 0x93, 0x15, 0xd9, 0x9d, 0xd5, 0xce, 0xd8, 0x8a, 0x6f, - 0x88, 0x63, 0x4f, 0x7c, 0x8c, 0x1e, 0x73, 0xe8, 0x8d, 0x2f, 0x50, 0x38, 0x55, 0x9c, 0x38, 0x55, - 0x28, 0x11, 0x44, 0xe2, 0x4b, 0x80, 0xe6, 0xcf, 0xae, 0xff, 0xac, 0xe3, 0x54, 0x1c, 0xb8, 0x58, - 0x33, 0xef, 0xfd, 0xde, 0x9b, 0xf7, 0xfb, 0xcd, 0x7b, 0xb3, 0x86, 0xeb, 0x3d, 0xc6, 0x63, 0xc6, - 0x03, 0xca, 0x06, 0xc1, 0xa0, 0x11, 0x88, 0x63, 0x3f, 0xcd, 0x98, 0x60, 0xe8, 0x6d, 0x6d, 0xf7, - 0x29, 0x1b, 0xf8, 0x83, 0x86, 0xe3, 0x1a, 0x58, 0x17, 0x73, 0x12, 0x0c, 0x1a, 0x5d, 0x22, 0x70, - 0x23, 0xe8, 0xb1, 0x28, 0xd1, 0x70, 0xe7, 0xc6, 0x64, 0x1a, 0x19, 0xa5, 0x1d, 0x35, 0xca, 0x28, - 0x53, 0xcb, 0x40, 0xae, 0x8c, 0xb5, 0xae, 0xe1,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 0x4b, 0x45, 0xc4, 0x12, 0xd5, 0x2e, 0xeb, 0xa3, 0xb6, 0xd3, 0x83, 0xe9, - 0xcb, 0x5a, 0xbe, 0x54, 0x80, 0x8e, 0x01, 0xce, 0xeb, 0x96, 0xe6, 0xbb, 0x52, 0x18, 0x9d, 0x5a, - 0x8a, 0x72, 0xad, 0x24, 0x8a, 0xcc, 0xe7, 0x6d, 0xc0, 0x55, 0xb3, 0x2c, 0xa8, 0xff, 0x63, 0x15, - 0xb6, 0xaf, 0x49, 0x44, 0x0f, 0x05, 0x09, 0xff, 0x2f, 0x09, 0xee, 0x41, 0x55, 0x33, 0xe3, 0xf6, - 0x92, 0x1a, 0xbd, 0x5b, 0x53, 0x1a, 0xe4, 0x05, 0x8d, 0x69, 0x91, 0x47, 0xcc, 0x15, 0xe3, 0xfd, - 0x49, 0x31, 0xde, 0x99, 0x29, 0x46, 0x9e, 0xdc, 0xab, 0xc3, 0x8d, 0x29, 0x53, 0x21, 0xce, 0x5f, - 0x16, 0x40, 0x9b, 0xd3, 0x7c, 0xc8, 0xff, 0xa3, 0x2e, 0x77, 0x61, 0xd5, 0x3c, 0x31, 0xec, 0x72, - 0x6d, 0x46, 0x50, 0x74, 0x1f, 0x2a, 0x38, 0x66, 0xfd, 0x44, 0x18, 0x79, 0xde, 0xec, 0x65, 0x32, - 0x31, 0xcd, 0x5d, 0x35, 0x2a, 0x45, 0x36, 0x29, 0x84, 0x5d, 0x12, 0xc2, 0x30, 0xf3, 0x6a, 0x80, - 0x46, 0xbb, 0x82, 0xfe, 0xcf, 0xba, 0x37, 0xbe, 0x4a, 0x43, 0x2c, 0xc8, 0x63, 0x9c, 0xe1, 0x98, - 0x4b, 0x32, 0xa3, 0xf9, 0xb4, 0x2e, 0x23, 0x53, 0x40, 0xd1, 0xc7, 0x50, 0x49, 0x55, 0x06, 0xa5, - 0xc0, 0xda, 0xfe, 0xb5, 0xa9, 0xbb, 0xd6, 0xe9, 0x27, 0x88, 0x68, 0x7c, 0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ff, 0xff, - 0xa1, 0xb4, 0x35, 0x16, 0x79, 0x09, 0x00, 0x00, + // 1023 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x26, 0x8e, 0x9d, 0x4c, 0x9a, 0x44, 0x59, 0xb9, 0xed, 0x7a, 0x55, 0xec, 0x74, 0x8b, + 0x20, 0x4a, 0xc8, 0x2e, 0x0e, 0xb4, 0x42, 0x6e, 0x85, 0x54, 0x87, 0x0a, 0x2a, 0x61, 0x51, 0x6d, + 0xa1, 0x48, 0x08, 0x29, 0x1a, 0x7b, 0x87, 0xc9, 0x0a, 0xef, 0xce, 0xca, 0x33, 0xb6, 0xe2, 0x1b, + 0xe2, 0xd8, 0x53, 0xff, 0x8c, 0x1e, 0x73, 0xe8, 0x8d, 0x13, 0xb7, 0xc2, 0xa9, 0xe2, 0xc4, 0x29, + 0xa0, 0x44, 0x10, 0xc4, 0x3f, 0x01, 0x9a, 0x8f, 0x5d, 0x7b, 0x3f, 0xf2, 0x01, 0x87, 0x5e, 0xac, + 0x9d, 0xf7, 0x7e, 0xef, 0xcd, 0x7b, 0xbf, 0x37, 0xef, 0x3d, 0x83, 0x6b, 0x3d, 0x42, 0x03, 0x42, + 0x1d, 0x4c, 0x46, 0xce, 0xa8, 0xe9, 0xb0, 0x03, 0x3b, 0x1a, 0x10, 0x46, 0xf4, 0x65, 0x29, 0xb7, + 0x31, 0x19, 0xd9, 0xa3, 0xa6, 0x59, 0x57, 0xb0, 0x2e, 0xa4, 0xc8, 0x19, 0x35, 0xbb, 0x88, 0xc1, + 0xa6, 0xd3, 0x23, 0x7e, 0x28, 0xe1, 0xe6, 0xf5, 0xb4, 0x1b, 0x6e, 0x25, 0x15, 0x55, 0x4c, 0x30, + 0x11, 0x9f, 0x0e, 0xff, 0x52, 0xd2, 0x9a, 0x84, 0xef, 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, 0x06, 0x3e, 0xd6, 0x9b, 0x6f, 0x9d, 0xaf, 0x4f, 0xfc, 0x7e, + 0x0c, 0x2a, 0xf1, 0x24, 0xaa, 0xe5, 0x4d, 0x94, 0xca, 0xbc, 0x79, 0xa6, 0x6a, 0x3a, 0xc0, 0x54, + 0x4f, 0x17, 0x04, 0x38, 0xad, 0x2f, 0x0a, 0xb0, 0xa8, 0xad, 0x78, 0xf5, 0x33, 0x2d, 0x55, 0x50, + 0xfd, 0x34, 0xa2, 0xa8, 0xfa, 0xc5, 0x9d, 0x60, 0xce, 0x7f, 0xc7, 0xc7, 0x42, 0xfb, 0xc1, 0xcb, + 0xe3, 0xba, 0xf6, 0xea, 0xb8, 0xae, 0xfd, 0x7e, 0x5c, 0xd7, 0x9e, 0x9d, 0xd4, 0x67, 0x5e, 0x9d, + 0xd4, 0x67, 0x7e, 0x3d, 0xa9, 0xcf, 0x7c, 0xb5, 0x85, 0x7d, 0xb6, 0x3f, 0xec, 0xda, 0x3d, 0x12, + 0xa8, 0xff, 0xa6, 0x4e, 0x6e, 0x4e, 0xb0, 0x71, 0x84, 0x28, 0xff, 0x27, 0x5c, 0x16, 0x6d, 0xf0, + 0xde, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x96, 0xf2, 0x3e, 0x7e, 0x49, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From c77ca59ffd3013163e9975b674f4c9d8813dd0f7 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 28 Dec 2022 21:29:52 +0530 Subject: [PATCH 58/69] fix: fix the lint --- baseapp/options.go | 3 ++- store/streaming/constructor_test.go | 1 - x/gov/abci_test.go | 4 ++-- x/gov/keeper/keeper.go | 4 ++-- x/gov/keeper/msg_server_test.go | 12 ++++++------ x/gov/keeper/proposal_test.go | 1 + x/gov/simulation/operations_test.go | 5 +---- x/gov/types/v1/proposals_test.go | 1 - 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/baseapp/options.go b/baseapp/options.go index a98992398d7..21f168aba7d 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -238,7 +238,8 @@ func (app *BaseApp) SetInterfaceRegistry(registry types.InterfaceRegistry) { func (app *BaseApp) SetStreamingService( appOpts servertypes.AppOptions, appCodec storetypes.Codec, - keys map[string]*storetypes.KVStoreKey) error { + keys map[string]*storetypes.KVStoreKey, +) error { streamers, _, err := streaming.LoadStreamingServices(appOpts, appCodec, app.logger, keys) if err != nil { return err diff --git a/store/streaming/constructor_test.go b/store/streaming/constructor_test.go index 28f462a268f..3f6b033a819 100644 --- a/store/streaming/constructor_test.go +++ b/store/streaming/constructor_test.go @@ -47,7 +47,6 @@ func TestStreamingServiceConstructor(t *testing.T) { } func TestLoadStreamingServices(t *testing.T) { - encCdc := types.NewTestCodec() keys := types.NewKVStoreKeys("mockKey1", "mockKey2") diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 74665e6c978..f58b86daccb 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -308,7 +308,7 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NotNil(t, macc) initialModuleAccCoins := suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - proposal, err := suite.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") + proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "title", "summary", proposer) require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10))} @@ -358,7 +358,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { staking.EndBlocker(ctx, suite.StakingKeeper) msg := banktypes.NewMsgSend(authtypes.NewModuleAddress(types.ModuleName), addrs[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000)))) - proposal, err := suite.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{msg}, "") + proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msg}, "", "title", "summary", proposer) require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10))) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 3b7e75712f7..3aa1e1dcfcb 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -222,8 +222,8 @@ func (k Keeper) InactiveProposalQueueIterator(ctx sdk.Context, endTime time.Time } // ModuleAccountAddress returns gov module account address -func (keeper Keeper) ModuleAccountAddress() sdk.AccAddress { - return keeper.authKeeper.GetModuleAddress(types.ModuleName) +func (k Keeper) ModuleAccountAddress() sdk.AccAddress { + return k.authKeeper.GetModuleAddress(types.ModuleName) } // assertMetadataLength returns an error if given metadata length diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index a532bb6fef9..bd1f98612fa 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -155,12 +155,12 @@ func (suite *KeeperTestSuite) TestCancelProposalReq() { res, err := suite.msgSrvr.SubmitProposal(suite.ctx, msg) suite.Require().NoError(err) suite.Require().NotNil(res.ProposalId) - pId := res.ProposalId + proposalID := res.ProposalId cases := map[string]struct { preRun func() uint64 expErr bool - proposalId uint64 + proposalID uint64 depositor sdk.AccAddress }{ "wrong proposal id": { @@ -172,14 +172,14 @@ func (suite *KeeperTestSuite) TestCancelProposalReq() { }, "valid proposal but invalid proposer": { preRun: func() uint64 { - return pId + return proposalID }, depositor: addrs[1], expErr: true, }, "all good": { preRun: func() uint64 { - return pId + return proposalID }, depositor: proposer, expErr: false, @@ -188,8 +188,8 @@ func (suite *KeeperTestSuite) TestCancelProposalReq() { for name, tc := range cases { suite.Run(name, func() { - proposalId := tc.preRun() - cancelProposalReq := v1.NewMsgCancelProposal(proposalId, tc.depositor.String()) + proposalID := tc.preRun() + cancelProposalReq := v1.NewMsgCancelProposal(proposalID, tc.depositor.String()) _, err := suite.msgSrvr.CancelProposal(suite.ctx, cancelProposalReq) if tc.expErr { suite.Require().Error(err) diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index b8cb8cf84ee..b070df4e499 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -166,6 +166,7 @@ func (suite *KeeperTestSuite) TestCancelProposal() { prop, err := v1.NewLegacyContent(&tp, govAcct) suite.Require().NoError(err) proposalResp, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[0]) + suite.Require().NoError(err) proposalID := proposalResp.Id proposal2Resp, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[1]) diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 5284f01bba6..4506314c9aa 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -167,7 +167,7 @@ func TestSimulateMsgCancelProposal(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := suite.GovKeeper.GetParams(ctx).MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, proposer, 1, "", submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, "", submitTime, submitTime.Add(*depositPeriod), "title", "summary", proposer) require.NoError(t, err) suite.GovKeeper.SetProposal(ctx, proposal) @@ -205,7 +205,6 @@ func TestSimulateMsgDeposit(t *testing.T) { accounts := getTestingAccounts(t, r, suite.AccountKeeper, suite.BankKeeper, suite.StakingKeeper, ctx, 3) // setup a proposal - proposer := accounts[0].Address content := v1beta1.NewTextProposal("Test", "description") contentMsg, err := v1.NewLegacyContent(content, suite.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String()) require.NoError(t, err) @@ -253,7 +252,6 @@ func TestSimulateMsgVote(t *testing.T) { accounts := getTestingAccounts(t, r, suite.AccountKeeper, suite.BankKeeper, suite.StakingKeeper, ctx, 3) // setup a proposal - proposer := accounts[0].Address govAcc := suite.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() contentMsg, err := v1.NewLegacyContent(v1beta1.NewTextProposal("Test", "description"), govAcc) require.NoError(t, err) @@ -299,7 +297,6 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { accounts := getTestingAccounts(t, r, suite.AccountKeeper, suite.BankKeeper, suite.StakingKeeper, ctx, 3) // setup a proposal - proposer := accounts[0].Address govAcc := suite.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() contentMsg, err := v1.NewLegacyContent(v1beta1.NewTextProposal("Test", "description"), govAcc) require.NoError(t, err) diff --git a/x/gov/types/v1/proposals_test.go b/x/gov/types/v1/proposals_test.go index 3d81a2722bf..7678ba1834e 100644 --- a/x/gov/types/v1/proposals_test.go +++ b/x/gov/types/v1/proposals_test.go @@ -34,7 +34,6 @@ func TestProposalStatus_Format(t *testing.T) { func TestNestedAnys(t *testing.T) { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, "cosmos1govacct") - proposerAddr := sdk.AccAddress("proposer") require.NoError(t, err) proposal, err := v1.NewProposal([]sdk.Msg{msgContent}, 1, "", time.Now(), time.Now(), "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) require.NoError(t, err) From 594cb12eafe18535596f486ee6d2dd3ad4333412 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 28 Dec 2022 21:56:36 +0530 Subject: [PATCH 59/69] fix: fix the test --- tests/integration/gov/genesis_test.go | 4 +-- .../integration/gov/keeper/grpc_query_test.go | 4 +-- tests/integration/gov/keeper/tally_test.go | 30 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/integration/gov/genesis_test.go b/tests/integration/gov/genesis_test.go index 475e3265e67..7762a8932a2 100644 --- a/tests/integration/gov/genesis_test.go +++ b/tests/integration/gov/genesis_test.go @@ -75,11 +75,11 @@ func TestImportExportQueues(t *testing.T) { ctx = s1.app.BaseApp.NewContext(false, tmproto.Header{}) // Create two proposals, put the second into the voting period - proposal1, err := s1.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") + proposal1, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "title", "summary", proposer) require.NoError(t, err) proposalID1 := proposal1.Id - proposal2, err := s1.GovKeeper.SubmitProposal(ctx, proposer, []sdk.Msg{mkTestLegacyContent(t)}, "") + proposal2, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "title", "summary", proposer) require.NoError(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 1f44a66a3f2..8dd0958806f 100644 --- a/tests/integration/gov/keeper/grpc_query_test.go +++ b/tests/integration/gov/keeper/grpc_query_test.go @@ -50,7 +50,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { "create a proposal and get tally", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0]) suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -161,7 +161,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTally() { "create a proposal and get tally", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, addrs[0], TestProposal, "") + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0]) suite.Require().NoError(err) suite.Require().NotNil(proposal) diff --git a/tests/integration/gov/keeper/tally_test.go b/tests/integration/gov/keeper/tally_test.go index 1b7a58d28d1..a74df0e48bf 100644 --- a/tests/integration/gov/keeper/tally_test.go +++ b/tests/integration/gov/keeper/tally_test.go @@ -20,7 +20,7 @@ func TestTallyNoOneVotes(t *testing.T) { addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", addrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -44,7 +44,7 @@ func TestTallyNoQuorum(t *testing.T) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", addrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -67,7 +67,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", addrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -93,7 +93,7 @@ func TestTallyOnlyValidators51No(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", valAccAddrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -117,7 +117,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", valAccAddrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -142,7 +142,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", valAccAddrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -168,7 +168,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", valAccAddrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -194,7 +194,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", valAccAddrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -221,7 +221,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { valAccAddr1, valAccAddr2 := valAccAddrs[0], valAccAddrs[1] tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, valAccAddrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", valAccAddrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -255,7 +255,7 @@ func TestTallyDelgatorOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", addrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -291,7 +291,7 @@ func TestTallyDelgatorInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", addrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -330,7 +330,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", addrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -372,7 +372,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", addrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -415,7 +415,7 @@ func TestTallyJailedValidator(t *testing.T) { app.StakingKeeper.Jail(ctx, sdk.ConsAddress(consAddr.Bytes())) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", addrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -448,7 +448,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { require.NoError(t, err) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, addrs[0], tp, "") + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "title", "summary", addrs[0]) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod From a5a2b57ac90fb3117b1a3c99189513ae5e5460e9 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 29 Dec 2022 01:03:38 +0530 Subject: [PATCH 60/69] fix: fix the charging fees and remaining deposit calculations --- tests/e2e/gov/tx.go | 10 ++++++- x/gov/keeper/deposit.go | 58 ++++++++++++++++++++-------------------- x/gov/keeper/proposal.go | 2 +- 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/tests/e2e/gov/tx.go b/tests/e2e/gov/tx.go index cfd2f6750b1..a8e06691133 100644 --- a/tests/e2e/gov/tx.go +++ b/tests/e2e/gov/tx.go @@ -371,8 +371,16 @@ func (s *E2ETestSuite) TestNewCmdCancelProposal() { s.Require().NoError(err) err = val.ClientCtx.Codec.UnmarshalJSON(resp.Bytes(), &newBalance) s.Require().NoError(err) + remainingAmount := v1.DefaultMinDepositTokens.Mul( + v1.DefaultProposalCancelRatio.Mul(sdk.MustNewDecFromStr("100")).TruncateInt(), + ).Quo(sdk.NewIntFromUint64(100)) + + // new balance = old balance + remaining amount from proposal deposit - txFee (cancel proposal) + txFee := sdk.NewInt(10) s.Require().True( - newBalance.Balances.AmountOf(s.network.Config.BondDenom).GT(balRes.Balances.AmountOf(s.network.Config.BondDenom)), + newBalance.Balances.AmountOf(s.network.Config.BondDenom).Equal( + balRes.Balances.AmountOf(s.network.Config.BondDenom).Add(remainingAmount).Sub(txFee), + ), ) } } diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 7633e3c5bc5..968b1f66259 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -166,24 +166,42 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd // chargeDeposit will charge proposal cancellation fee (deposits * proposal_cancel_burn_rate) and // send to a destAddress if defined or burn otherwise. // Remaining funds are send back to the depositor. -func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddress, proposalCancelRate string, totalDeposits []sdk.Coin) error { +func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddress, proposalCancelRate string) error { store := ctx.KVStore(keeper.storeKey) - rate := sdk.MustNewDecFromStr(proposalCancelRate) var cancellationCharges sdk.Coins - if rate.IsPositive() { - for _, deposit := range totalDeposits { - burnAmount := sdk.NewCoin( + for _, deposits := range keeper.GetDeposits(ctx, proposalID) { + depositerAddress := sdk.MustAccAddressFromBech32(deposits.Depositor) + var remainingAmount sdk.Coins + + for _, deposit := range deposits.Amount { + burnAmount := sdk.NewDecFromInt(deposit.Amount).Mul(rate).TruncateInt() + // remainin amount = deposits amount - burn amount + remainAmount := sdk.NewCoin( deposit.Denom, - sdk.NewDecFromInt(deposit.Amount).Mul(rate).RoundInt(), + deposit.Amount.Sub(burnAmount), ) - cancellationCharges = cancellationCharges.Add(burnAmount) + remainingAmount = remainingAmount.Add(remainAmount) + cancellationCharges = cancellationCharges.Add( + sdk.NewCoin( + deposit.Denom, + burnAmount, + )) + } + + if !remainingAmount.IsAnyNil() && !remainingAmount.IsZero() { + err := keeper.bankKeeper.SendCoinsFromModuleToAccount( + ctx, types.ModuleName, depositerAddress, remainingAmount, + ) + if err != nil { + return err + } } } // burn the cancellation fee or sent the cancellation charges to destination address. - if !cancellationCharges.IsZero() { + if !cancellationCharges.IsAnyNil() && !cancellationCharges.IsZero() { // get the distribution module account address distributionAddress := keeper.authKeeper.GetModuleAddress(disttypes.ModuleName) switch { @@ -200,27 +218,9 @@ func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddre } default: destAccAddress := sdk.MustAccAddressFromBech32(destAddress) - err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, destAccAddress, cancellationCharges) - if err != nil { - return err - } - } - } - - // proposal cancel rate is not 100% then we have remaining deposits after the cancellation charges - if !rate.Equal(sdk.MustNewDecFromStr("1")) { - // send remaining (deposits - cancellationCharges) to depositors - for _, deposits := range keeper.GetDeposits(ctx, proposalID) { - depositerAddress := sdk.MustAccAddressFromBech32(deposits.Depositor) - var remainingAmount sdk.Coins - for _, deposit := range deposits.Amount { - remainAmount := sdk.NewCoin( - deposit.Denom, - sdk.NewDecFromInt(deposit.Amount).Mul(sdk.NewDec(1).Sub(rate)).RoundInt(), - ) - remainingAmount = remainingAmount.Add(remainAmount) - } - err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositerAddress, remainingAmount) + err := keeper.bankKeeper.SendCoinsFromModuleToAccount( + ctx, types.ModuleName, destAccAddress, cancellationCharges, + ) if err != nil { return err } diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index ec346168e64..534e78952fd 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -132,7 +132,7 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer // burn the (deposits * proposal_cancel_rate) amount or sent to cancellation destination address. // and deposits * (1 - proposal_cancel_rate) will be sent to depositors. params := keeper.GetParams(ctx) - err := keeper.chargeDeposit(ctx, proposal.Id, params.ProposalCancelDest, params.ProposalCancelRatio, proposal.TotalDeposit) + err := keeper.chargeDeposit(ctx, proposal.Id, params.ProposalCancelDest, params.ProposalCancelRatio) if err != nil { return err } From 5c32186234526f8c55dec371c46b9f24de9d707e Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 29 Dec 2022 01:10:13 +0530 Subject: [PATCH 61/69] chore: move the proposer address migration to v5 --- x/gov/migrations/v4/store.go | 53 ------------------------------- x/gov/migrations/v5/store.go | 61 ++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 53 deletions(-) create mode 100644 x/gov/migrations/v5/store.go diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go index 29f943fa6c8..c353dec1ed5 100644 --- a/x/gov/migrations/v4/store.go +++ b/x/gov/migrations/v4/store.go @@ -1,16 +1,12 @@ package v4 import ( - "fmt" - "sort" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/exported" v1 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v1" - types "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) @@ -68,55 +64,6 @@ func migrateProposalVotingPeriod(ctx sdk.Context, storeKey storetypes.StoreKey, return nil } -// AddProposerAddressToProposal will add proposer to proposal -// and set to the store. This function is optional, and only needed -// if you wish that migrated proposals be cancellable. -func AddProposerAddressToProposal(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, proposals map[uint64]string) error { - proposalIDs := make([]uint64, 0, len(proposals)) - - for proposalID := range proposals { - proposalIDs = append(proposalIDs, proposalID) - } - - // sort the proposalIDs - sort.Slice(proposalIDs, func(i, j int) bool { return proposalIDs[i] < proposalIDs[j] }) - - store := ctx.KVStore(storeKey) - - for _, proposalID := range proposalIDs { - if len(proposals[proposalID]) == 0 { - return fmt.Errorf("found missing proposer for proposal ID: %d", proposalID) - } - - if _, err := sdk.AccAddressFromBech32(proposals[proposalID]); err != nil { - return fmt.Errorf("invalid proposer address : %s", proposals[proposalID]) - } - - bz := store.Get(types.ProposalKey(proposalID)) - var proposal govv1.Proposal - if err := cdc.Unmarshal(bz, &proposal); err != nil { - panic(err) - } - - // Check if proposal is active - if proposal.Status != govv1.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD && - proposal.Status != govv1.ProposalStatus_PROPOSAL_STATUS_DEPOSIT_PERIOD { - return fmt.Errorf("invalid proposal : %s, proposal not active", proposals[proposalID]) - } - - proposal.Proposer = proposals[proposalID] - - // set the new proposal with proposer - bz, err := cdc.Marshal(&proposal) - if err != nil { - panic(err) - } - store.Set(types.ProposalKey(proposal.Id), bz) - } - - return nil -} - // MigrateStore performs in-place store migrations from v3 (v0.46) to v4 (v0.47). The // migration includes: // diff --git a/x/gov/migrations/v5/store.go b/x/gov/migrations/v5/store.go new file mode 100644 index 00000000000..2888aa460e9 --- /dev/null +++ b/x/gov/migrations/v5/store.go @@ -0,0 +1,61 @@ +package v5 + +import ( + "fmt" + "sort" + + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" +) + +// AddProposerAddressToProposal will add proposer to proposal +// and set to the store. This function is optional, and only needed +// if you wish that migrated proposals be cancellable. +func AddProposerAddressToProposal(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, proposals map[uint64]string) error { + proposalIDs := make([]uint64, 0, len(proposals)) + + for proposalID := range proposals { + proposalIDs = append(proposalIDs, proposalID) + } + + // sort the proposalIDs + sort.Slice(proposalIDs, func(i, j int) bool { return proposalIDs[i] < proposalIDs[j] }) + + store := ctx.KVStore(storeKey) + + for _, proposalID := range proposalIDs { + if len(proposals[proposalID]) == 0 { + return fmt.Errorf("found missing proposer for proposal ID: %d", proposalID) + } + + if _, err := sdk.AccAddressFromBech32(proposals[proposalID]); err != nil { + return fmt.Errorf("invalid proposer address : %s", proposals[proposalID]) + } + + bz := store.Get(types.ProposalKey(proposalID)) + var proposal govv1.Proposal + if err := cdc.Unmarshal(bz, &proposal); err != nil { + panic(err) + } + + // Check if proposal is active + if proposal.Status != govv1.ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD && + proposal.Status != govv1.ProposalStatus_PROPOSAL_STATUS_DEPOSIT_PERIOD { + return fmt.Errorf("invalid proposal : %s, proposal not active", proposals[proposalID]) + } + + proposal.Proposer = proposals[proposalID] + + // set the new proposal with proposer + bz, err := cdc.Marshal(&proposal) + if err != nil { + panic(err) + } + store.Set(types.ProposalKey(proposal.Id), bz) + } + + return nil +} From bdbf3ae059b5675ccb216af76c5bcfb153213325 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 29 Dec 2022 01:36:46 +0530 Subject: [PATCH 62/69] fix: fix the rand genesis state test --- x/gov/simulation/genesis_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index f7bd89cbb69..c905007f4e5 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -42,15 +42,15 @@ func TestRandomizedGenState(t *testing.T) { simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &govGenesis) const ( - tallyQuorum = "0.400000000000000000" - tallyThreshold = "0.539000000000000000" - tallyVetoThreshold = "0.314000000000000000" + tallyQuorum = "0.375000000000000000" + tallyThreshold = "0.478000000000000000" + tallyVetoThreshold = "0.324000000000000000" minInitialDepositDec = "0.590000000000000000" ) require.Equal(t, "905stake", govGenesis.Params.MinDeposit[0].String()) require.Equal(t, "77h26m10s", govGenesis.Params.MaxDepositPeriod.String()) - require.Equal(t, float64(275567), govGenesis.Params.VotingPeriod.Seconds()) + require.Equal(t, float64(135894), govGenesis.Params.VotingPeriod.Seconds()) require.Equal(t, tallyQuorum, govGenesis.Params.Quorum) require.Equal(t, tallyThreshold, govGenesis.Params.Threshold) require.Equal(t, tallyVetoThreshold, govGenesis.Params.VetoThreshold) From 58ff8d48edf3f9fc963b9a0b2799efd2f5479a7a Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 30 Dec 2022 22:12:44 +0530 Subject: [PATCH 63/69] chore: address the pr comments --- CHANGELOG.md | 2 -- proto/cosmos/gov/v1/gov.proto | 1 + simapp/upgrades.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48ffc8d1144..7c8bb583cd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -136,7 +136,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [#12771](https://github.com/cosmos/cosmos-sdk/pull/12771) Initial deposit requirement for proposals at submission time. * (x/staking) [#12967](https://github.com/cosmos/cosmos-sdk/pull/12967) `unbond` now creates only one unbonding delegation entry when multiple unbondings exist at a single height (e.g. through multiple messages in a transaction). * (x/auth/vesting) [#13502](https://github.com/cosmos/cosmos-sdk/pull/13502) Add Amino Msg registration for `MsgCreatePeriodicVestingAccount`. -* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) `submit-proposal` gov cli tx adds `proposer` field to proposal * (x/auth)[#13780](https://github.com/cosmos/cosmos-sdk/pull/13780) `id` (type of int64) in `AccountAddressByID` grpc query is now deprecated, update to account-id(type of uint64) to use `AccountAddressByID`. * (x/group) [#13876](https://github.com/cosmos/cosmos-sdk/pull/13876) Fix group MinExecutionPeriod that is checked on execution now, instead of voting period end. * (store) [#14378](https://github.com/cosmos/cosmos-sdk/pull/14378) The `CacheKV` store is thread-safe again, which includes improved iteration and deletion logic. Iteration is on a strictly isolated view now, which is breaking from previous behavior. @@ -193,7 +192,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [#13160](https://github.com/cosmos/cosmos-sdk/pull/13160) Remove custom marshaling of proposl and voteoption. * (types) [#13430](https://github.com/cosmos/cosmos-sdk/pull/13430) Remove unused code `ResponseCheckTx` and `ResponseDeliverTx` * (store) [#13529](https://github.com/cosmos/cosmos-sdk/pull/13529) Add method `LatestVersion` to `MultiStore` interface, add method `SetQueryMultiStore` to baesapp to support alternative `MultiStore` implementation for query service. -* (x/gov) [#13010](https://github.com/cosmos/cosmos-sdk/pull/13010) Add `proposer` parameter to `NewProposal` method. * (pruning) [#13609](https://github.com/cosmos/cosmos-sdk/pull/13609) Move pruning package to be under store package. * [#13794](https://github.com/cosmos/cosmos-sdk/pull/13794) Most methods on `types/module.AppModule` have been moved to extension interfaces. `module.Manager.Modules` is now of type `map[string]interface{}` to support in parallel the new diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 8762f8bc1a4..8619bba4f0c 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -206,6 +206,7 @@ message Params { // // Since: cosmos-sdk 0.48 string proposal_cancel_ratio = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. // If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. // diff --git a/simapp/upgrades.go b/simapp/upgrades.go index ae86496bfd0..d92a9dbd7da 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -28,7 +28,7 @@ func (app SimApp) RegisterUpgradeHandlers() { baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) // Note: this migration is optional, - // You can include x/gov proposal migration documented at UPGRADING.md(https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md) + // You can include x/gov proposal migration documented at [UPGRADING.md](https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md) return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) }, From d2cd3c1d706f23de72a5fcab7b3771e0b8069d0a Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Tue, 3 Jan 2023 18:08:04 +0530 Subject: [PATCH 64/69] fix: fix the failing simulations --- x/gov/simulation/operations.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index bca62d36d89..d185b323c19 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -401,7 +401,7 @@ func SimulateMsgCancelProposal(ak types.AccountKeeper, bk types.BankKeeper, k *k ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount := accs[0] proposal := randomProposal(r, k, ctx) - if proposal.SubmitTime == nil { + if proposal == nil { return simtypes.NoOpMsg(types.ModuleName, TypeMsgCancelProposal, "no proposals found"), nil, nil } @@ -489,10 +489,13 @@ func randomDeposit( } // randomProposal -func randomProposal(r *rand.Rand, k *keeper.Keeper, ctx sdk.Context) v1.Proposal { +func randomProposal(r *rand.Rand, k *keeper.Keeper, ctx sdk.Context) *v1.Proposal { proposals := k.GetProposals(ctx) + if len(proposals) <= 0 { + return nil + } randomIndex := r.Intn(len(proposals)) - return *proposals[randomIndex] + return proposals[randomIndex] } // Pick a random proposal ID between the initial proposal ID From 45facd68dac1531ae7ad25c1ecb337a3198af1fc Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Tue, 3 Jan 2023 18:18:02 +0530 Subject: [PATCH 65/69] fix: fix the lint --- x/gov/simulation/operations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index d185b323c19..47f81408c7a 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -491,7 +491,7 @@ func randomDeposit( // randomProposal func randomProposal(r *rand.Rand, k *keeper.Keeper, ctx sdk.Context) *v1.Proposal { proposals := k.GetProposals(ctx) - if len(proposals) <= 0 { + if len(proposals) == 0 { return nil } randomIndex := r.Intn(len(proposals)) From 72f234e8f6308e0cbeba95fc44bbe428123345e2 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 5 Jan 2023 18:47:25 +0530 Subject: [PATCH 66/69] fix: fix the proto-gen --- api/cosmos/gov/v1/tx.pulsar.go | 269 +++++++++++++++++---------------- x/gov/types/v1/tx.pb.go | 129 ++++++++-------- 2 files changed, 200 insertions(+), 198 deletions(-) diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index f90788bebea..1525f069f47 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7647,152 +7647,153 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 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, 0xa8, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, - 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x07, + 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, 0x0b, 0xca, 0xb4, 0x2d, 0x07, 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, + 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, 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, + 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, 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, 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, + 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, - 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, + 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, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x26, 0x2e, + 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, 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, + 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, 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 ( diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 665454b0ae7..32eaaf8c4b4 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -833,71 +833,72 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 1023 bytes of a gzipped FileDescriptorProto + // 1027 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0x26, 0x8e, 0x9d, 0x4c, 0x9a, 0x44, 0x59, 0xb9, 0xed, 0x7a, 0x55, 0xec, 0x74, 0x8b, - 0x20, 0x4a, 0xc8, 0x2e, 0x0e, 0xb4, 0x42, 0x6e, 0x85, 0x54, 0x87, 0x0a, 0x2a, 0x61, 0x51, 0x6d, - 0xa1, 0x48, 0x08, 0x29, 0x1a, 0x7b, 0x87, 0xc9, 0x0a, 0xef, 0xce, 0xca, 0x33, 0xb6, 0xe2, 0x1b, - 0xe2, 0xd8, 0x53, 0xff, 0x8c, 0x1e, 0x73, 0xe8, 0x8d, 0x13, 0xb7, 0xc2, 0xa9, 0xe2, 0xc4, 0x29, - 0xa0, 0x44, 0x10, 0xc4, 0x3f, 0x01, 0x9a, 0x8f, 0x5d, 0x7b, 0x3f, 0xf2, 0x01, 0x87, 0x5e, 0xac, - 0x9d, 0xf7, 0x7e, 0xef, 0xcd, 0x7b, 0xbf, 0x37, 0xef, 0x3d, 0x83, 0x6b, 0x3d, 0x42, 0x03, 0x42, - 0x1d, 0x4c, 0x46, 0xce, 0xa8, 0xe9, 0xb0, 0x03, 0x3b, 0x1a, 0x10, 0x46, 0xf4, 0x65, 0x29, 0xb7, - 0x31, 0x19, 0xd9, 0xa3, 0xa6, 0x59, 0x57, 0xb0, 0x2e, 0xa4, 0xc8, 0x19, 0x35, 0xbb, 0x88, 0xc1, - 0xa6, 0xd3, 0x23, 0x7e, 0x28, 0xe1, 0xe6, 0xf5, 0xb4, 0x1b, 0x6e, 0x25, 0x15, 0x55, 0x4c, 0x30, - 0x11, 0x9f, 0x0e, 0xff, 0x52, 0xd2, 0x9a, 0x84, 0xef, 0x49, 0x85, 0xba, 0x4a, 0xa9, 0x30, 0x21, - 0xb8, 0x8f, 0x1c, 0x71, 0xea, 0x0e, 0xbf, 0x71, 0x60, 0x38, 0xce, 0x5c, 0x12, 0x50, 0xcc, 0x2f, - 0x09, 0x28, 0x56, 0x8a, 0x35, 0x18, 0xf8, 0x21, 0x71, 0xc4, 0xaf, 0x12, 0x35, 0xb2, 0x6e, 0x98, - 0x1f, 0x20, 0xca, 0x60, 0x10, 0x49, 0x80, 0xf5, 0xd3, 0x2c, 0x58, 0xeb, 0x50, 0xfc, 0x78, 0xd8, - 0x0d, 0x7c, 0xf6, 0x68, 0x40, 0x22, 0x42, 0x61, 0x5f, 0x7f, 0x17, 0x2c, 0x04, 0x88, 0x52, 0x88, - 0x11, 0x35, 0xb4, 0xf5, 0xb9, 0x8d, 0xa5, 0x9d, 0xaa, 0x2d, 0x3d, 0xd9, 0xb1, 0x27, 0xfb, 0x7e, - 0x38, 0x76, 0x13, 0x94, 0xde, 0x01, 0xab, 0x7e, 0xe8, 0x33, 0x1f, 0xf6, 0xf7, 0x3c, 0x14, 0x11, - 0xea, 0x33, 0x63, 0x56, 0x18, 0xd6, 0x6c, 0x95, 0x17, 0xe7, 0xcc, 0x56, 0x9c, 0xd9, 0xbb, 0xc4, - 0x0f, 0xdb, 0x8b, 0x2f, 0x8f, 0x1a, 0x33, 0xcf, 0x4f, 0x0f, 0x37, 0x35, 0x77, 0x45, 0x19, 0x7f, - 0x24, 0x6d, 0xf5, 0xf7, 0xc1, 0x42, 0x24, 0x82, 0x41, 0x03, 0x63, 0x6e, 0x5d, 0xdb, 0x58, 0x6c, - 0x1b, 0xbf, 0xbc,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 0xa1, 0x81, 0x4a, 0x87, 0xe2, 0x27, 0x84, - 0x21, 0xfd, 0x76, 0x41, 0xde, 0xed, 0xea, 0xdf, 0x47, 0x8d, 0x69, 0xb1, 0x7c, 0x04, 0x53, 0x6c, - 0xe8, 0x36, 0x98, 0x1f, 0x11, 0x86, 0x06, 0x32, 0xe6, 0x73, 0xaa, 0x2f, 0x61, 0x7a, 0x13, 0x94, - 0x49, 0xc4, 0x7c, 0x12, 0x8a, 0xe7, 0xb2, 0x32, 0x79, 0x76, 0xb2, 0x73, 0x6d, 0x1e, 0xcb, 0x67, - 0x02, 0xe0, 0x2a, 0xe0, 0x79, 0xaf, 0xa5, 0xf5, 0x26, 0x27, 0x46, 0xba, 0xe6, 0xa4, 0x5c, 0xcd, - 0x91, 0xc2, 0xfd, 0x59, 0x6b, 0x60, 0x55, 0x7d, 0x26, 0xa9, 0xff, 0xa3, 0x25, 0xb2, 0x2f, 0x91, - 0x8f, 0xf7, 0x19, 0xf2, 0x5e, 0x17, 0x05, 0x77, 0x41, 0x45, 0x66, 0x46, 0x8d, 0x39, 0xd1, 0x7a, - 0x37, 0x33, 0x1c, 0xc4, 0x01, 0x4d, 0x71, 0x11, 0x5b, 0x9c, 0x4b, 0xc6, 0x3b, 0x69, 0x32, 0xde, - 0x28, 0x24, 0x23, 0x76, 0x6e, 0xd5, 0xc0, 0xf5, 0x8c, 0x28, 0x21, 0xe7, 0x4f, 0x0d, 0x80, 0x0e, - 0xc5, 0x71, 0x93, 0xff, 0x4f, 0x5e, 0xee, 0x80, 0x45, 0x35, 0x62, 0xc8, 0xc5, 0xdc, 0x4c, 0xa0, - 0xfa, 0x3d, 0x50, 0x86, 0x01, 0x19, 0x86, 0x4c, 0xd1, 0x73, 0xb9, 0xc9, 0xa4, 0x6c, 0x5a, 0x5b, - 0xa2, 0x55, 0x12, 0x6f, 0x9c, 0x08, 0x23, 0x47, 0x84, 0xca, 0xcc, 0xaa, 0x02, 0x7d, 0x72, 0x4a, - 0xd2,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0xf9, 0xef, 0xd8, + 0x58, 0xe8, 0xdc, 0x7f, 0x71, 0x6c, 0x28, 0x2f, 0x8f, 0x0d, 0xe5, 0xf7, 0x63, 0x43, 0x79, 0x7a, + 0x62, 0xcc, 0xbc, 0x3c, 0x31, 0x66, 0x7e, 0x3d, 0x31, 0x66, 0xbe, 0xda, 0xf2, 0x7c, 0xba, 0x3f, + 0xea, 0x59, 0x7d, 0x1c, 0xc8, 0xbf, 0xab, 0x76, 0x61, 0x4e, 0xd0, 0x49, 0x84, 0x08, 0xfb, 0x73, + 0x5c, 0xe5, 0x6d, 0xf0, 0xce, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x12, 0xb3, 0x26, 0x14, 0x5c, + 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 388e97f2028e7ced706b3c62a21784b49700e1d9 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 6 Jan 2023 18:03:40 +0530 Subject: [PATCH 67/69] test: add test for `ChargeDeposit` --- x/gov/keeper/common_test.go | 30 ++++++++-- x/gov/keeper/deposit.go | 22 +++---- x/gov/keeper/deposit_test.go | 113 ++++++++++++++++++++++++++++++++++- x/gov/keeper/hooks_test.go | 2 +- x/gov/keeper/keeper_test.go | 8 ++- x/gov/keeper/proposal.go | 2 +- x/gov/keeper/vote_test.go | 2 +- 7 files changed, 156 insertions(+), 23 deletions(-) diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index d29a618243b..acbaf6a7081 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -51,6 +51,7 @@ func setupGovKeeper(t *testing.T) ( *govtestutil.MockAccountKeeper, *govtestutil.MockBankKeeper, *govtestutil.MockStakingKeeper, + *govtestutil.MockDistributionKeeper, moduletestutil.TestEncodingConfig, sdk.Context, ) { @@ -75,9 +76,8 @@ func setupGovKeeper(t *testing.T) ( acctKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(govAcct).AnyTimes() acctKeeper.EXPECT().GetModuleAddress(disttypes.ModuleName).Return(distAcct).AnyTimes() - acctKeeper.EXPECT().GetModuleAccount(gomock.Any(), types.ModuleName).Return(authtypes.NewEmptyModuleAccount(types.ModuleName)).AnyTimes() - trackMockBalances(bankKeeper) + trackMockBalances(bankKeeper, distributionKeeper) stakingKeeper.EXPECT().TokensFromConsensusPower(ctx, gomock.Any()).DoAndReturn(func(ctx sdk.Context, power int64) math.Int { return sdk.TokensFromConsensusPower(power, math.NewIntFromUint64(1000000)) }).AnyTimes() @@ -100,13 +100,14 @@ func setupGovKeeper(t *testing.T) ( v1.RegisterMsgServer(msr, keeper.NewMsgServerImpl(govKeeper)) banktypes.RegisterMsgServer(msr, nil) // Nil is fine here as long as we never execute the proposal's Msgs. - return govKeeper, acctKeeper, bankKeeper, stakingKeeper, encCfg, ctx + return govKeeper, acctKeeper, bankKeeper, stakingKeeper, distributionKeeper, encCfg, ctx } // trackMockBalances sets up expected calls on the Mock BankKeeper, and also // locally tracks accounts balances (not modules balances). -func trackMockBalances(bankKeeper *govtestutil.MockBankKeeper) { +func trackMockBalances(bankKeeper *govtestutil.MockBankKeeper, distributionKeeper *govtestutil.MockDistributionKeeper) { balances := make(map[string]sdk.Coins) + balances[distAcct.String()] = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(0))) // We don't track module account balances. bankKeeper.EXPECT().MintCoins(gomock.Any(), minttypes.ModuleName, gomock.Any()).AnyTimes() @@ -129,4 +130,25 @@ func trackMockBalances(bankKeeper *govtestutil.MockBankKeeper) { bankKeeper.EXPECT().GetAllBalances(gomock.Any(), gomock.Any()).DoAndReturn(func(_ sdk.Context, addr sdk.AccAddress) sdk.Coins { return balances[addr.String()] }).AnyTimes() + bankKeeper.EXPECT().GetBalance(gomock.Any(), gomock.Any(), sdk.DefaultBondDenom).DoAndReturn(func(_ sdk.Context, addr sdk.AccAddress, _ string) sdk.Coin { + balances := balances[addr.String()] + for _, balance := range balances { + if balance.Denom == sdk.DefaultBondDenom { + return balance + } + } + return sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(0)) + }).AnyTimes() + + distributionKeeper.EXPECT().FundCommunityPool(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(_ sdk.Context, coins sdk.Coins, sender sdk.AccAddress) error { + // sender balance + newBalance, negative := balances[sender.String()].SafeSub(coins...) + if negative { + return fmt.Errorf("not enough balance") + } + balances[sender.String()] = newBalance + // receiver balance + balances[distAcct.String()] = balances[distAcct.String()].Add(coins...) + return nil + }).AnyTimes() } diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 968b1f66259..418d3f2fe7e 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -163,10 +163,10 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd return activatedVotingPeriod, nil } -// chargeDeposit will charge proposal cancellation fee (deposits * proposal_cancel_burn_rate) and +// ChargeDeposit will charge proposal cancellation fee (deposits * proposal_cancel_burn_rate) and // send to a destAddress if defined or burn otherwise. // Remaining funds are send back to the depositor. -func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddress, proposalCancelRate string) error { +func (keeper Keeper) ChargeDeposit(ctx sdk.Context, proposalID uint64, destAddress, proposalCancelRate string) error { store := ctx.KVStore(keeper.storeKey) rate := sdk.MustNewDecFromStr(proposalCancelRate) var cancellationCharges sdk.Coins @@ -177,20 +177,22 @@ func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddre for _, deposit := range deposits.Amount { burnAmount := sdk.NewDecFromInt(deposit.Amount).Mul(rate).TruncateInt() - // remainin amount = deposits amount - burn amount - remainAmount := sdk.NewCoin( - deposit.Denom, - deposit.Amount.Sub(burnAmount), + // remaining amount = deposits amount - burn amount + remainingAmount = remainingAmount.Add( + sdk.NewCoin( + deposit.Denom, + deposit.Amount.Sub(burnAmount), + ), ) - remainingAmount = remainingAmount.Add(remainAmount) cancellationCharges = cancellationCharges.Add( sdk.NewCoin( deposit.Denom, burnAmount, - )) + ), + ) } - if !remainingAmount.IsAnyNil() && !remainingAmount.IsZero() { + if !remainingAmount.IsZero() { err := keeper.bankKeeper.SendCoinsFromModuleToAccount( ctx, types.ModuleName, depositerAddress, remainingAmount, ) @@ -201,7 +203,7 @@ func (keeper Keeper) chargeDeposit(ctx sdk.Context, proposalID uint64, destAddre } // burn the cancellation fee or sent the cancellation charges to destination address. - if !cancellationCharges.IsAnyNil() && !cancellationCharges.IsZero() { + if !cancellationCharges.IsZero() { // get the distribution module account address distributionAddress := keeper.authKeeper.GetModuleAddress(disttypes.ModuleName) switch { diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 02e168a44e8..747ed74f78a 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -1,12 +1,16 @@ package keeper_test import ( + "fmt" "testing" + "cosmossdk.io/math" "github.com/stretchr/testify/require" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) @@ -16,8 +20,8 @@ const ( ) func TestDeposits(t *testing.T) { - govKeeper, _, bankKeeper, stakingKeeper, _, ctx := setupGovKeeper(t) - trackMockBalances(bankKeeper) + govKeeper, _, bankKeeper, stakingKeeper, distKeeper, _, ctx := setupGovKeeper(t) + trackMockBalances(bankKeeper, distKeeper) TestAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(10000000)) tp := TestProposal @@ -193,7 +197,7 @@ func TestValidateInitialDeposit(t *testing.T) { for name, tc := range testcases { t.Run(name, func(t *testing.T) { - govKeeper, _, _, _, _, ctx := setupGovKeeper(t) + govKeeper, _, _, _, _, _, ctx := setupGovKeeper(t) params := v1.DefaultParams() params.MinDeposit = tc.minDeposit @@ -211,3 +215,106 @@ func TestValidateInitialDeposit(t *testing.T) { }) } } + +func TestChargeDeposit(t *testing.T) { + testCases := []struct { + name string + proposalCancelRatio string + proposalCancelDestAddress string + expectError bool + }{ + { + name: "Success: CancelRatio=0", + proposalCancelRatio: "0", + proposalCancelDestAddress: "", + expectError: false, + }, + { + name: "Success: CancelRatio=0.5", + proposalCancelRatio: "0.5", + proposalCancelDestAddress: "", + expectError: false, + }, + { + name: "Success: CancelRatio=1", + proposalCancelRatio: "1", + proposalCancelDestAddress: "", + expectError: false, + }, + } + + for _, tc := range testCases { + for i := 0; i < 3; i++ { + testName := func(i int) string { + if i == 0 { + return fmt.Sprintf("%s and dest address is %s", tc.name, "nil") + } else if i == 1 { + return fmt.Sprintf("%s and dest address is normal address", tc.name) + } + return fmt.Sprintf("%s and dest address is community address", tc.name) + } + + t.Run(testName(i), func(t *testing.T) { + govKeeper, _, bankKeeper, stakingKeeper, _, _, ctx := setupGovKeeper(t) + params := v1.DefaultParams() + params.ProposalCancelRatio = tc.proposalCancelRatio + TestAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(10000000000)) + + switch i { + case 0: + // no dest address for cancel proposal, total cancellation charges will be burned + params.ProposalCancelDest = "" + case 1: + // normal account address for proposal cancel dest address + params.ProposalCancelDest = TestAddrs[1].String() + default: + // community address for proposal cancel dest address + params.ProposalCancelDest = authtypes.NewModuleAddress(disttypes.ModuleName).String() + } + + err := govKeeper.SetParams(ctx, params) + require.NoError(t, err) + + tp := TestProposal + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0]) + require.NoError(t, err) + proposalID := proposal.Id + // deposit to proposal + fiveStake := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, stakingKeeper.TokensFromConsensusPower(ctx, 300))) + _, err = govKeeper.AddDeposit(ctx, proposalID, TestAddrs[0], fiveStake) + require.NoError(t, err) + + // get balances of dest address + var prevBalance sdk.Coin + if len(params.ProposalCancelDest) != 0 { + accAddr := sdk.MustAccAddressFromBech32(params.ProposalCancelDest) + prevBalance = bankKeeper.GetBalance(ctx, accAddr, sdk.DefaultBondDenom) + } + + // get the deposits + allDeposits := govKeeper.GetDeposits(ctx, proposalID) + + // charge cancellation charges for cancel proposal + err = govKeeper.ChargeDeposit(ctx, proposalID, TestAddrs[0].String(), params.ProposalCancelRatio) + if tc.expectError { + require.Error(t, err) + return + } + require.NoError(t, err) + + if len(params.ProposalCancelDest) != 0 { + accAddr := sdk.MustAccAddressFromBech32(params.ProposalCancelDest) + newBalanceAfterCancelProposal := bankKeeper.GetBalance(ctx, accAddr, sdk.DefaultBondDenom) + cancellationCharges := math.NewInt(0) + for _, deposits := range allDeposits { + for _, deposit := range deposits.Amount { + burnAmount := sdk.NewDecFromInt(deposit.Amount).Mul(sdk.MustNewDecFromStr(params.MinInitialDepositRatio)).TruncateInt() + cancellationCharges = cancellationCharges.Add(burnAmount) + } + } + require.True(t, newBalanceAfterCancelProposal.Equal(prevBalance.Add(sdk.NewCoin(sdk.DefaultBondDenom, cancellationCharges)))) + } + }) + } + } +} diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index cf07cd12132..14c0c050022 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -47,7 +47,7 @@ func (h *MockGovHooksReceiver) AfterProposalVotingPeriodEnded(ctx sdk.Context, p func TestHooks(t *testing.T) { minDeposit := v1.DefaultParams().MinDeposit - govKeeper, _, bankKeeper, stakingKeeper, _, ctx := setupGovKeeper(t) + govKeeper, _, bankKeeper, stakingKeeper, _, _, ctx := setupGovKeeper(t) addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 1, minDeposit[0].Amount) govHooksReceiver := MockGovHooksReceiver{} diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index 03004ade804..d9c6a7bb474 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -27,6 +27,7 @@ type KeeperTestSuite struct { acctKeeper *govtestutil.MockAccountKeeper bankKeeper *govtestutil.MockBankKeeper stakingKeeper *govtestutil.MockStakingKeeper + distKeeper *govtestutil.MockDistributionKeeper queryClient v1.QueryClient legacyQueryClient v1beta1.QueryClient addrs []sdk.AccAddress @@ -39,7 +40,7 @@ func (suite *KeeperTestSuite) SetupSuite() { } func (suite *KeeperTestSuite) reset() { - govKeeper, acctKeeper, bankKeeper, stakingKeeper, encCfg, ctx := setupGovKeeper(suite.T()) + govKeeper, acctKeeper, bankKeeper, stakingKeeper, distKeeper, encCfg, ctx := setupGovKeeper(suite.T()) // Populate the gov account with some coins, as the TestProposal we have // is a MsgSend from the gov account. @@ -61,6 +62,7 @@ func (suite *KeeperTestSuite) reset() { suite.acctKeeper = acctKeeper suite.bankKeeper = bankKeeper suite.stakingKeeper = stakingKeeper + suite.distKeeper = distKeeper suite.cdc = encCfg.Codec suite.queryClient = queryClient suite.legacyQueryClient = legacyQueryClient @@ -71,7 +73,7 @@ func (suite *KeeperTestSuite) reset() { } func TestIncrementProposalNumber(t *testing.T) { - govKeeper, _, _, _, _, ctx := setupGovKeeper(t) //nolint:dogsled + govKeeper, _, _, _, _, _, ctx := setupGovKeeper(t) //nolint:dogsled tp := TestProposal _, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) @@ -91,7 +93,7 @@ func TestIncrementProposalNumber(t *testing.T) { } func TestProposalQueues(t *testing.T) { - govKeeper, _, _, _, _, ctx := setupGovKeeper(t) //nolint:dogsled + govKeeper, _, _, _, _, _, ctx := setupGovKeeper(t) //nolint:dogsled // create test proposals tp := TestProposal diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 5b9c3a8bc3e..ac465e0aac8 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -138,7 +138,7 @@ func (keeper Keeper) CancelProposal(ctx sdk.Context, proposalID uint64, proposer // burn the (deposits * proposal_cancel_rate) amount or sent to cancellation destination address. // and deposits * (1 - proposal_cancel_rate) will be sent to depositors. params := keeper.GetParams(ctx) - err := keeper.chargeDeposit(ctx, proposal.Id, params.ProposalCancelDest, params.ProposalCancelRatio) + err := keeper.ChargeDeposit(ctx, proposal.Id, params.ProposalCancelDest, params.ProposalCancelRatio) if err != nil { return err } diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 048b75c38d0..fbad33c255e 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -11,7 +11,7 @@ import ( ) func TestVotes(t *testing.T) { - govKeeper, _, bankKeeper, stakingKeeper, _, ctx := setupGovKeeper(t) + govKeeper, _, bankKeeper, stakingKeeper, _, _, ctx := setupGovKeeper(t) addrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(10000000)) tp := TestProposal From ded114473bc9a2733561f10fdf8dc8746a970a6d Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 9 Jan 2023 18:05:30 +0530 Subject: [PATCH 68/69] fix: fix the tests --- tests/integration/gov/keeper/tally_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/gov/keeper/tally_test.go b/tests/integration/gov/keeper/tally_test.go index 4dbffa5ba9d..aa88c0e9ba2 100644 --- a/tests/integration/gov/keeper/tally_test.go +++ b/tests/integration/gov/keeper/tally_test.go @@ -18,7 +18,7 @@ func TestTallyNoOneVotes(t *testing.T) { app, ctx := f.app, f.ctx - addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) + createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) From 348ef12bea8cd7221d5ea35b8e04eb711ca40704 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 9 Jan 2023 19:02:37 +0530 Subject: [PATCH 69/69] fix: fix the integration test of gov --- tests/integration/gov/module_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/gov/module_test.go b/tests/integration/gov/module_test.go index a3fc2eb5e84..c02bdf457da 100644 --- a/tests/integration/gov/module_test.go +++ b/tests/integration/gov/module_test.go @@ -10,6 +10,7 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + _ "github.com/cosmos/cosmos-sdk/x/distribution" "github.com/cosmos/cosmos-sdk/x/gov/types" _ "github.com/cosmos/cosmos-sdk/x/mint" ) @@ -23,6 +24,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { configurator.StakingModule(), configurator.BankModule(), configurator.GovModule(), + configurator.DistributionModule(), configurator.ConsensusModule(), ), &accountKeeper,