diff --git a/api/cosmos/protocolpool/v1/query.pulsar.go b/api/cosmos/protocolpool/v1/query.pulsar.go index 607f98c972c3..85359a03746c 100644 --- a/api/cosmos/protocolpool/v1/query.pulsar.go +++ b/api/cosmos/protocolpool/v1/query.pulsar.go @@ -4,12 +4,15 @@ package protocolpoolv1 import ( v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" sync "sync" @@ -865,7 +868,1224 @@ func (x *fastReflection_QueryCommunityPoolResponse) ProtoMethods() *protoiface.M } } -// Since: cosmos-sdk 0.50 +var ( + md_QueryUnclaimedBudgetRequest protoreflect.MessageDescriptor + fd_QueryUnclaimedBudgetRequest_address protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_query_proto_init() + md_QueryUnclaimedBudgetRequest = File_cosmos_protocolpool_v1_query_proto.Messages().ByName("QueryUnclaimedBudgetRequest") + fd_QueryUnclaimedBudgetRequest_address = md_QueryUnclaimedBudgetRequest.Fields().ByName("address") +} + +var _ protoreflect.Message = (*fastReflection_QueryUnclaimedBudgetRequest)(nil) + +type fastReflection_QueryUnclaimedBudgetRequest QueryUnclaimedBudgetRequest + +func (x *QueryUnclaimedBudgetRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryUnclaimedBudgetRequest)(x) +} + +func (x *QueryUnclaimedBudgetRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[2] + 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_QueryUnclaimedBudgetRequest_messageType fastReflection_QueryUnclaimedBudgetRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryUnclaimedBudgetRequest_messageType{} + +type fastReflection_QueryUnclaimedBudgetRequest_messageType struct{} + +func (x fastReflection_QueryUnclaimedBudgetRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryUnclaimedBudgetRequest)(nil) +} +func (x fastReflection_QueryUnclaimedBudgetRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryUnclaimedBudgetRequest) +} +func (x fastReflection_QueryUnclaimedBudgetRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryUnclaimedBudgetRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryUnclaimedBudgetRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryUnclaimedBudgetRequest +} + +// 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_QueryUnclaimedBudgetRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryUnclaimedBudgetRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryUnclaimedBudgetRequest) New() protoreflect.Message { + return new(fastReflection_QueryUnclaimedBudgetRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryUnclaimedBudgetRequest) Interface() protoreflect.ProtoMessage { + return (*QueryUnclaimedBudgetRequest)(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_QueryUnclaimedBudgetRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_QueryUnclaimedBudgetRequest_address, 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_QueryUnclaimedBudgetRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest.address": + return x.Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest 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_QueryUnclaimedBudgetRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest.address": + x.Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest 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_QueryUnclaimedBudgetRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest.address": + value := x.Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest 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_QueryUnclaimedBudgetRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest.address": + x.Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest 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_QueryUnclaimedBudgetRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest.address": + panic(fmt.Errorf("field address of message cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest 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_QueryUnclaimedBudgetRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest.address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest 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_QueryUnclaimedBudgetRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest", 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_QueryUnclaimedBudgetRequest) 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_QueryUnclaimedBudgetRequest) 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_QueryUnclaimedBudgetRequest) 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_QueryUnclaimedBudgetRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryUnclaimedBudgetRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + 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().(*QueryUnclaimedBudgetRequest) + 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.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + 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().(*QueryUnclaimedBudgetRequest) + 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: QueryUnclaimedBudgetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryUnclaimedBudgetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = 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_QueryUnclaimedBudgetResponse protoreflect.MessageDescriptor + fd_QueryUnclaimedBudgetResponse_total_budget protoreflect.FieldDescriptor + fd_QueryUnclaimedBudgetResponse_claimed_amount protoreflect.FieldDescriptor + fd_QueryUnclaimedBudgetResponse_unclaimed_amount protoreflect.FieldDescriptor + fd_QueryUnclaimedBudgetResponse_next_claim_from protoreflect.FieldDescriptor + fd_QueryUnclaimedBudgetResponse_period protoreflect.FieldDescriptor + fd_QueryUnclaimedBudgetResponse_tranches_left protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_query_proto_init() + md_QueryUnclaimedBudgetResponse = File_cosmos_protocolpool_v1_query_proto.Messages().ByName("QueryUnclaimedBudgetResponse") + fd_QueryUnclaimedBudgetResponse_total_budget = md_QueryUnclaimedBudgetResponse.Fields().ByName("total_budget") + fd_QueryUnclaimedBudgetResponse_claimed_amount = md_QueryUnclaimedBudgetResponse.Fields().ByName("claimed_amount") + fd_QueryUnclaimedBudgetResponse_unclaimed_amount = md_QueryUnclaimedBudgetResponse.Fields().ByName("unclaimed_amount") + fd_QueryUnclaimedBudgetResponse_next_claim_from = md_QueryUnclaimedBudgetResponse.Fields().ByName("next_claim_from") + fd_QueryUnclaimedBudgetResponse_period = md_QueryUnclaimedBudgetResponse.Fields().ByName("period") + fd_QueryUnclaimedBudgetResponse_tranches_left = md_QueryUnclaimedBudgetResponse.Fields().ByName("tranches_left") +} + +var _ protoreflect.Message = (*fastReflection_QueryUnclaimedBudgetResponse)(nil) + +type fastReflection_QueryUnclaimedBudgetResponse QueryUnclaimedBudgetResponse + +func (x *QueryUnclaimedBudgetResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryUnclaimedBudgetResponse)(x) +} + +func (x *QueryUnclaimedBudgetResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[3] + 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_QueryUnclaimedBudgetResponse_messageType fastReflection_QueryUnclaimedBudgetResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryUnclaimedBudgetResponse_messageType{} + +type fastReflection_QueryUnclaimedBudgetResponse_messageType struct{} + +func (x fastReflection_QueryUnclaimedBudgetResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryUnclaimedBudgetResponse)(nil) +} +func (x fastReflection_QueryUnclaimedBudgetResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryUnclaimedBudgetResponse) +} +func (x fastReflection_QueryUnclaimedBudgetResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryUnclaimedBudgetResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryUnclaimedBudgetResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryUnclaimedBudgetResponse +} + +// 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_QueryUnclaimedBudgetResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryUnclaimedBudgetResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryUnclaimedBudgetResponse) New() protoreflect.Message { + return new(fastReflection_QueryUnclaimedBudgetResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryUnclaimedBudgetResponse) Interface() protoreflect.ProtoMessage { + return (*QueryUnclaimedBudgetResponse)(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_QueryUnclaimedBudgetResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.TotalBudget != nil { + value := protoreflect.ValueOfMessage(x.TotalBudget.ProtoReflect()) + if !f(fd_QueryUnclaimedBudgetResponse_total_budget, value) { + return + } + } + if x.ClaimedAmount != nil { + value := protoreflect.ValueOfMessage(x.ClaimedAmount.ProtoReflect()) + if !f(fd_QueryUnclaimedBudgetResponse_claimed_amount, value) { + return + } + } + if x.UnclaimedAmount != nil { + value := protoreflect.ValueOfMessage(x.UnclaimedAmount.ProtoReflect()) + if !f(fd_QueryUnclaimedBudgetResponse_unclaimed_amount, value) { + return + } + } + if x.NextClaimFrom != nil { + value := protoreflect.ValueOfMessage(x.NextClaimFrom.ProtoReflect()) + if !f(fd_QueryUnclaimedBudgetResponse_next_claim_from, value) { + return + } + } + if x.Period != nil { + value := protoreflect.ValueOfMessage(x.Period.ProtoReflect()) + if !f(fd_QueryUnclaimedBudgetResponse_period, value) { + return + } + } + if x.TranchesLeft != uint64(0) { + value := protoreflect.ValueOfUint64(x.TranchesLeft) + if !f(fd_QueryUnclaimedBudgetResponse_tranches_left, 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_QueryUnclaimedBudgetResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.total_budget": + return x.TotalBudget != nil + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.claimed_amount": + return x.ClaimedAmount != nil + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.unclaimed_amount": + return x.UnclaimedAmount != nil + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.next_claim_from": + return x.NextClaimFrom != nil + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.period": + return x.Period != nil + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.tranches_left": + return x.TranchesLeft != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse 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_QueryUnclaimedBudgetResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.total_budget": + x.TotalBudget = nil + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.claimed_amount": + x.ClaimedAmount = nil + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.unclaimed_amount": + x.UnclaimedAmount = nil + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.next_claim_from": + x.NextClaimFrom = nil + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.period": + x.Period = nil + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.tranches_left": + x.TranchesLeft = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse 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_QueryUnclaimedBudgetResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.total_budget": + value := x.TotalBudget + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.claimed_amount": + value := x.ClaimedAmount + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.unclaimed_amount": + value := x.UnclaimedAmount + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.next_claim_from": + value := x.NextClaimFrom + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.period": + value := x.Period + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.tranches_left": + value := x.TranchesLeft + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse 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_QueryUnclaimedBudgetResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.total_budget": + x.TotalBudget = value.Message().Interface().(*v1beta1.Coin) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.claimed_amount": + x.ClaimedAmount = value.Message().Interface().(*v1beta1.Coin) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.unclaimed_amount": + x.UnclaimedAmount = value.Message().Interface().(*v1beta1.Coin) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.next_claim_from": + x.NextClaimFrom = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.period": + x.Period = value.Message().Interface().(*durationpb.Duration) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.tranches_left": + x.TranchesLeft = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse 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_QueryUnclaimedBudgetResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.total_budget": + if x.TotalBudget == nil { + x.TotalBudget = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.TotalBudget.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.claimed_amount": + if x.ClaimedAmount == nil { + x.ClaimedAmount = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedAmount.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.unclaimed_amount": + if x.UnclaimedAmount == nil { + x.UnclaimedAmount = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.UnclaimedAmount.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.next_claim_from": + if x.NextClaimFrom == nil { + x.NextClaimFrom = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.NextClaimFrom.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.period": + if x.Period == nil { + x.Period = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.Period.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.tranches_left": + panic(fmt.Errorf("field tranches_left of message cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse 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_QueryUnclaimedBudgetResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.total_budget": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.claimed_amount": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.unclaimed_amount": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.next_claim_from": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.period": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.tranches_left": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse 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_QueryUnclaimedBudgetResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse", 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_QueryUnclaimedBudgetResponse) 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_QueryUnclaimedBudgetResponse) 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_QueryUnclaimedBudgetResponse) 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_QueryUnclaimedBudgetResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryUnclaimedBudgetResponse) + 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.TotalBudget != nil { + l = options.Size(x.TotalBudget) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ClaimedAmount != nil { + l = options.Size(x.ClaimedAmount) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.UnclaimedAmount != nil { + l = options.Size(x.UnclaimedAmount) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.NextClaimFrom != nil { + l = options.Size(x.NextClaimFrom) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Period != nil { + l = options.Size(x.Period) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TranchesLeft != 0 { + n += 1 + runtime.Sov(uint64(x.TranchesLeft)) + } + 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().(*QueryUnclaimedBudgetResponse) + 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 x.TranchesLeft != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TranchesLeft)) + i-- + dAtA[i] = 0x30 + } + if x.Period != nil { + encoded, err := options.Marshal(x.Period) + 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] = 0x2a + } + if x.NextClaimFrom != nil { + encoded, err := options.Marshal(x.NextClaimFrom) + 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] = 0x22 + } + if x.UnclaimedAmount != nil { + encoded, err := options.Marshal(x.UnclaimedAmount) + 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] = 0x1a + } + if x.ClaimedAmount != nil { + encoded, err := options.Marshal(x.ClaimedAmount) + 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.TotalBudget != nil { + encoded, err := options.Marshal(x.TotalBudget) + 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] = 0xa + } + 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().(*QueryUnclaimedBudgetResponse) + 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: QueryUnclaimedBudgetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryUnclaimedBudgetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalBudget", 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.TotalBudget == nil { + x.TotalBudget = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TotalBudget); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmount", 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.ClaimedAmount == nil { + x.ClaimedAmount = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmount); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnclaimedAmount", 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.UnclaimedAmount == nil { + x.UnclaimedAmount = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UnclaimedAmount); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NextClaimFrom", 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.NextClaimFrom == nil { + x.NextClaimFrom = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.NextClaimFrom); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Period", 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.Period == nil { + x.Period = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Period); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TranchesLeft", wireType) + } + x.TranchesLeft = 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.TranchesLeft |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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, + } +} // Code generated by protoc-gen-go. DO NOT EDIT. // versions: @@ -946,6 +2166,128 @@ func (x *QueryCommunityPoolResponse) GetPool() []*v1beta1.DecCoin { return nil } +// QueryUnclaimedBudgetRequest is the request type for the Query/UnclaimedBudgetRequest +// RPC method. +type QueryUnclaimedBudgetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address is the recipient address to query unclaimed budget amount for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *QueryUnclaimedBudgetRequest) Reset() { + *x = QueryUnclaimedBudgetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryUnclaimedBudgetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryUnclaimedBudgetRequest) ProtoMessage() {} + +// Deprecated: Use QueryUnclaimedBudgetRequest.ProtoReflect.Descriptor instead. +func (*QueryUnclaimedBudgetRequest) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryUnclaimedBudgetRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +// QueryUnclaimedBudgetResponse is the response type for the Query/UnclaimedBudget +// RPC method. +type QueryUnclaimedBudgetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // total_budget is the total budget allocated to the recipient + TotalBudget *v1beta1.Coin `protobuf:"bytes,1,opt,name=total_budget,json=totalBudget,proto3" json:"total_budget,omitempty"` + // claimed_amount is the budget amount already claimed by the recipient + ClaimedAmount *v1beta1.Coin `protobuf:"bytes,2,opt,name=claimed_amount,json=claimedAmount,proto3" json:"claimed_amount,omitempty"` + // unclaimed_amount is the remaining budget amount that is unclaimed by the recipient + UnclaimedAmount *v1beta1.Coin `protobuf:"bytes,3,opt,name=unclaimed_amount,json=unclaimedAmount,proto3" json:"unclaimed_amount,omitempty"` + // next_claim_from is the next starting claim time for fund distribution. + // It represents the time when we can claim funds after the period time interval has passed. + NextClaimFrom *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=next_claim_from,json=nextClaimFrom,proto3" json:"next_claim_from,omitempty"` + // period is the time interval for fund distribution + Period *durationpb.Duration `protobuf:"bytes,5,opt,name=period,proto3" json:"period,omitempty"` + // tranches_left is the number of tranches left for the amount to be distributed + TranchesLeft uint64 `protobuf:"varint,6,opt,name=tranches_left,json=tranchesLeft,proto3" json:"tranches_left,omitempty"` +} + +func (x *QueryUnclaimedBudgetResponse) Reset() { + *x = QueryUnclaimedBudgetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryUnclaimedBudgetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryUnclaimedBudgetResponse) ProtoMessage() {} + +// Deprecated: Use QueryUnclaimedBudgetResponse.ProtoReflect.Descriptor instead. +func (*QueryUnclaimedBudgetResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryUnclaimedBudgetResponse) GetTotalBudget() *v1beta1.Coin { + if x != nil { + return x.TotalBudget + } + return nil +} + +func (x *QueryUnclaimedBudgetResponse) GetClaimedAmount() *v1beta1.Coin { + if x != nil { + return x.ClaimedAmount + } + return nil +} + +func (x *QueryUnclaimedBudgetResponse) GetUnclaimedAmount() *v1beta1.Coin { + if x != nil { + return x.UnclaimedAmount + } + return nil +} + +func (x *QueryUnclaimedBudgetResponse) GetNextClaimFrom() *timestamppb.Timestamp { + if x != nil { + return x.NextClaimFrom + } + return nil +} + +func (x *QueryUnclaimedBudgetResponse) GetPeriod() *durationpb.Duration { + if x != nil { + return x.Period + } + return nil +} + +func (x *QueryUnclaimedBudgetResponse) GetTranchesLeft() uint64 { + if x != nil { + return x.TranchesLeft + } + return 0 +} + var File_cosmos_protocolpool_v1_query_proto protoreflect.FileDescriptor var file_cosmos_protocolpool_v1_query_proto_rawDesc = []byte{ @@ -958,42 +2300,90 @@ var file_cosmos_protocolpool_v1_query_proto_rawDesc = []byte{ 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x1b, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, - 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x83, 0x01, - 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, - 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x04, - 0x70, 0x6f, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x33, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, - 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x04, 0x70, - 0x6f, 0x6f, 0x6c, 0x32, 0xb0, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0xa6, 0x01, - 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, - 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, - 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, - 0x79, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x42, 0xda, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, - 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x50, - 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0x1a, 0x1e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1b, 0x0a, 0x19, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, + 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x83, 0x01, 0x0a, 0x1a, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x04, 0x70, 0x6f, 0x6f, 0x6c, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x63, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x33, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x2b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x44, 0x65, 0x63, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x22, + 0x51, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, + 0x64, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 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, 0x8c, 0x03, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x75, 0x64, + 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 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, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x12, 0x40, 0x0a, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 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, 0x52, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x44, 0x0a, 0x10, 0x75, 0x6e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 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, 0x52, 0x0f, 0x75, 0x6e, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 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, 0x04, + 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, + 0x72, 0x6f, 0x6d, 0x12, 0x37, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x05, 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, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x23, 0x0a, 0x0d, + 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x4c, 0x65, 0x66, + 0x74, 0x32, 0xeb, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0xa6, 0x01, 0x0a, 0x0d, + 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x31, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, + 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, + 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, + 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, + 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x5f, + 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0xb8, 0x01, 0x0a, 0x0f, 0x55, 0x6e, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x65, 0x64, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, + 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, + 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x6e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, + 0x75, 0x64, 0x67, 0x65, 0x74, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x42, + 0xda, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, + 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, + 0x6f, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x50, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, + 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1008,21 +2398,33 @@ func file_cosmos_protocolpool_v1_query_proto_rawDescGZIP() []byte { return file_cosmos_protocolpool_v1_query_proto_rawDescData } -var file_cosmos_protocolpool_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_protocolpool_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_cosmos_protocolpool_v1_query_proto_goTypes = []interface{}{ - (*QueryCommunityPoolRequest)(nil), // 0: cosmos.protocolpool.v1.QueryCommunityPoolRequest - (*QueryCommunityPoolResponse)(nil), // 1: cosmos.protocolpool.v1.QueryCommunityPoolResponse - (*v1beta1.DecCoin)(nil), // 2: cosmos.base.v1beta1.DecCoin + (*QueryCommunityPoolRequest)(nil), // 0: cosmos.protocolpool.v1.QueryCommunityPoolRequest + (*QueryCommunityPoolResponse)(nil), // 1: cosmos.protocolpool.v1.QueryCommunityPoolResponse + (*QueryUnclaimedBudgetRequest)(nil), // 2: cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest + (*QueryUnclaimedBudgetResponse)(nil), // 3: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse + (*v1beta1.DecCoin)(nil), // 4: cosmos.base.v1beta1.DecCoin + (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 7: google.protobuf.Duration } var file_cosmos_protocolpool_v1_query_proto_depIdxs = []int32{ - 2, // 0: cosmos.protocolpool.v1.QueryCommunityPoolResponse.pool:type_name -> cosmos.base.v1beta1.DecCoin - 0, // 1: cosmos.protocolpool.v1.Query.CommunityPool:input_type -> cosmos.protocolpool.v1.QueryCommunityPoolRequest - 1, // 2: cosmos.protocolpool.v1.Query.CommunityPool:output_type -> cosmos.protocolpool.v1.QueryCommunityPoolResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 4, // 0: cosmos.protocolpool.v1.QueryCommunityPoolResponse.pool:type_name -> cosmos.base.v1beta1.DecCoin + 5, // 1: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.total_budget:type_name -> cosmos.base.v1beta1.Coin + 5, // 2: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.claimed_amount:type_name -> cosmos.base.v1beta1.Coin + 5, // 3: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.unclaimed_amount:type_name -> cosmos.base.v1beta1.Coin + 6, // 4: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.next_claim_from:type_name -> google.protobuf.Timestamp + 7, // 5: cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse.period:type_name -> google.protobuf.Duration + 0, // 6: cosmos.protocolpool.v1.Query.CommunityPool:input_type -> cosmos.protocolpool.v1.QueryCommunityPoolRequest + 2, // 7: cosmos.protocolpool.v1.Query.UnclaimedBudget:input_type -> cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest + 1, // 8: cosmos.protocolpool.v1.Query.CommunityPool:output_type -> cosmos.protocolpool.v1.QueryCommunityPoolResponse + 3, // 9: cosmos.protocolpool.v1.Query.UnclaimedBudget:output_type -> cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse + 8, // [8:10] is the sub-list for method output_type + 6, // [6:8] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_protocolpool_v1_query_proto_init() } @@ -1055,6 +2457,30 @@ func file_cosmos_protocolpool_v1_query_proto_init() { return nil } } + file_cosmos_protocolpool_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryUnclaimedBudgetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_protocolpool_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryUnclaimedBudgetResponse); 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{ @@ -1062,7 +2488,7 @@ func file_cosmos_protocolpool_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_protocolpool_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/protocolpool/v1/query_grpc.pb.go b/api/cosmos/protocolpool/v1/query_grpc.pb.go index f3d5020db973..b48692427dd9 100644 --- a/api/cosmos/protocolpool/v1/query_grpc.pb.go +++ b/api/cosmos/protocolpool/v1/query_grpc.pb.go @@ -1,5 +1,3 @@ -// Since: cosmos-sdk 0.50 - // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 @@ -21,7 +19,8 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_CommunityPool_FullMethodName = "/cosmos.protocolpool.v1.Query/CommunityPool" + Query_CommunityPool_FullMethodName = "/cosmos.protocolpool.v1.Query/CommunityPool" + Query_UnclaimedBudget_FullMethodName = "/cosmos.protocolpool.v1.Query/UnclaimedBudget" ) // QueryClient is the client API for Query service. @@ -30,6 +29,8 @@ const ( type QueryClient interface { // CommunityPool queries the community pool coins. CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) + // UnclaimedBudget queries the remaining budget left to be claimed and it gives overall budget allocation view. + UnclaimedBudget(ctx context.Context, in *QueryUnclaimedBudgetRequest, opts ...grpc.CallOption) (*QueryUnclaimedBudgetResponse, error) } type queryClient struct { @@ -49,12 +50,23 @@ func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolR return out, nil } +func (c *queryClient) UnclaimedBudget(ctx context.Context, in *QueryUnclaimedBudgetRequest, opts ...grpc.CallOption) (*QueryUnclaimedBudgetResponse, error) { + out := new(QueryUnclaimedBudgetResponse) + err := c.cc.Invoke(ctx, Query_UnclaimedBudget_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility type QueryServer interface { // CommunityPool queries the community pool coins. CommunityPool(context.Context, *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) + // UnclaimedBudget queries the remaining budget left to be claimed and it gives overall budget allocation view. + UnclaimedBudget(context.Context, *QueryUnclaimedBudgetRequest) (*QueryUnclaimedBudgetResponse, error) mustEmbedUnimplementedQueryServer() } @@ -65,6 +77,9 @@ type UnimplementedQueryServer struct { func (UnimplementedQueryServer) CommunityPool(context.Context, *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CommunityPool not implemented") } +func (UnimplementedQueryServer) UnclaimedBudget(context.Context, *QueryUnclaimedBudgetRequest) (*QueryUnclaimedBudgetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnclaimedBudget not implemented") +} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -96,6 +111,24 @@ func _Query_CommunityPool_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Query_UnclaimedBudget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryUnclaimedBudgetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).UnclaimedBudget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_UnclaimedBudget_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).UnclaimedBudget(ctx, req.(*QueryUnclaimedBudgetRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -107,6 +140,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "CommunityPool", Handler: _Query_CommunityPool_Handler, }, + { + MethodName: "UnclaimedBudget", + Handler: _Query_UnclaimedBudget_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/protocolpool/v1/query.proto", diff --git a/api/cosmos/protocolpool/v1/tx.pulsar.go b/api/cosmos/protocolpool/v1/tx.pulsar.go index c770e4e69c01..1c0ce6000dfc 100644 --- a/api/cosmos/protocolpool/v1/tx.pulsar.go +++ b/api/cosmos/protocolpool/v1/tx.pulsar.go @@ -11,6 +11,8 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" sync "sync" @@ -1908,7 +1910,1985 @@ func (x *fastReflection_MsgCommunityPoolSpendResponse) ProtoMethods() *protoifac } } -// Since: cosmos-sdk 0.50 +var ( + md_MsgSubmitBudgetProposal protoreflect.MessageDescriptor + fd_MsgSubmitBudgetProposal_authority protoreflect.FieldDescriptor + fd_MsgSubmitBudgetProposal_recipient_address protoreflect.FieldDescriptor + fd_MsgSubmitBudgetProposal_total_budget protoreflect.FieldDescriptor + fd_MsgSubmitBudgetProposal_start_time protoreflect.FieldDescriptor + fd_MsgSubmitBudgetProposal_tranches protoreflect.FieldDescriptor + fd_MsgSubmitBudgetProposal_period protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgSubmitBudgetProposal = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgSubmitBudgetProposal") + fd_MsgSubmitBudgetProposal_authority = md_MsgSubmitBudgetProposal.Fields().ByName("authority") + fd_MsgSubmitBudgetProposal_recipient_address = md_MsgSubmitBudgetProposal.Fields().ByName("recipient_address") + fd_MsgSubmitBudgetProposal_total_budget = md_MsgSubmitBudgetProposal.Fields().ByName("total_budget") + fd_MsgSubmitBudgetProposal_start_time = md_MsgSubmitBudgetProposal.Fields().ByName("start_time") + fd_MsgSubmitBudgetProposal_tranches = md_MsgSubmitBudgetProposal.Fields().ByName("tranches") + fd_MsgSubmitBudgetProposal_period = md_MsgSubmitBudgetProposal.Fields().ByName("period") +} + +var _ protoreflect.Message = (*fastReflection_MsgSubmitBudgetProposal)(nil) + +type fastReflection_MsgSubmitBudgetProposal MsgSubmitBudgetProposal + +func (x *MsgSubmitBudgetProposal) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSubmitBudgetProposal)(x) +} + +func (x *MsgSubmitBudgetProposal) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[4] + 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_MsgSubmitBudgetProposal_messageType fastReflection_MsgSubmitBudgetProposal_messageType +var _ protoreflect.MessageType = fastReflection_MsgSubmitBudgetProposal_messageType{} + +type fastReflection_MsgSubmitBudgetProposal_messageType struct{} + +func (x fastReflection_MsgSubmitBudgetProposal_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSubmitBudgetProposal)(nil) +} +func (x fastReflection_MsgSubmitBudgetProposal_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSubmitBudgetProposal) +} +func (x fastReflection_MsgSubmitBudgetProposal_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSubmitBudgetProposal +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSubmitBudgetProposal) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSubmitBudgetProposal +} + +// 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_MsgSubmitBudgetProposal) Type() protoreflect.MessageType { + return _fastReflection_MsgSubmitBudgetProposal_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSubmitBudgetProposal) New() protoreflect.Message { + return new(fastReflection_MsgSubmitBudgetProposal) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSubmitBudgetProposal) Interface() protoreflect.ProtoMessage { + return (*MsgSubmitBudgetProposal)(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_MsgSubmitBudgetProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgSubmitBudgetProposal_authority, value) { + return + } + } + if x.RecipientAddress != "" { + value := protoreflect.ValueOfString(x.RecipientAddress) + if !f(fd_MsgSubmitBudgetProposal_recipient_address, value) { + return + } + } + if x.TotalBudget != nil { + value := protoreflect.ValueOfMessage(x.TotalBudget.ProtoReflect()) + if !f(fd_MsgSubmitBudgetProposal_total_budget, value) { + return + } + } + if x.StartTime != nil { + value := protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + if !f(fd_MsgSubmitBudgetProposal_start_time, value) { + return + } + } + if x.Tranches != uint64(0) { + value := protoreflect.ValueOfUint64(x.Tranches) + if !f(fd_MsgSubmitBudgetProposal_tranches, value) { + return + } + } + if x.Period != nil { + value := protoreflect.ValueOfMessage(x.Period.ProtoReflect()) + if !f(fd_MsgSubmitBudgetProposal_period, 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_MsgSubmitBudgetProposal) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.authority": + return x.Authority != "" + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.recipient_address": + return x.RecipientAddress != "" + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.total_budget": + return x.TotalBudget != nil + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.start_time": + return x.StartTime != nil + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.tranches": + return x.Tranches != uint64(0) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.period": + return x.Period != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposal")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposal 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_MsgSubmitBudgetProposal) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.authority": + x.Authority = "" + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.recipient_address": + x.RecipientAddress = "" + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.total_budget": + x.TotalBudget = nil + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.start_time": + x.StartTime = nil + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.tranches": + x.Tranches = uint64(0) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.period": + x.Period = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposal")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposal 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_MsgSubmitBudgetProposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.recipient_address": + value := x.RecipientAddress + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.total_budget": + value := x.TotalBudget + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.start_time": + value := x.StartTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.tranches": + value := x.Tranches + return protoreflect.ValueOfUint64(value) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.period": + value := x.Period + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposal")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposal 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_MsgSubmitBudgetProposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.authority": + x.Authority = value.Interface().(string) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.recipient_address": + x.RecipientAddress = value.Interface().(string) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.total_budget": + x.TotalBudget = value.Message().Interface().(*v1beta1.Coin) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.start_time": + x.StartTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.tranches": + x.Tranches = value.Uint() + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.period": + x.Period = value.Message().Interface().(*durationpb.Duration) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposal")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposal 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_MsgSubmitBudgetProposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.total_budget": + if x.TotalBudget == nil { + x.TotalBudget = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.TotalBudget.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.start_time": + if x.StartTime == nil { + x.StartTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.period": + if x.Period == nil { + x.Period = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.Period.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.authority": + panic(fmt.Errorf("field authority of message cosmos.protocolpool.v1.MsgSubmitBudgetProposal is not mutable")) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.recipient_address": + panic(fmt.Errorf("field recipient_address of message cosmos.protocolpool.v1.MsgSubmitBudgetProposal is not mutable")) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.tranches": + panic(fmt.Errorf("field tranches of message cosmos.protocolpool.v1.MsgSubmitBudgetProposal is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposal")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposal 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_MsgSubmitBudgetProposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.authority": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.recipient_address": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.total_budget": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.start_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.tranches": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.protocolpool.v1.MsgSubmitBudgetProposal.period": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposal")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposal 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_MsgSubmitBudgetProposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgSubmitBudgetProposal", 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_MsgSubmitBudgetProposal) 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_MsgSubmitBudgetProposal) 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_MsgSubmitBudgetProposal) 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_MsgSubmitBudgetProposal) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSubmitBudgetProposal) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.RecipientAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TotalBudget != nil { + l = options.Size(x.TotalBudget) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.StartTime != nil { + l = options.Size(x.StartTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Tranches != 0 { + n += 1 + runtime.Sov(uint64(x.Tranches)) + } + if x.Period != nil { + l = options.Size(x.Period) + 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().(*MsgSubmitBudgetProposal) + 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 x.Period != nil { + encoded, err := options.Marshal(x.Period) + 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] = 0x32 + } + if x.Tranches != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Tranches)) + i-- + dAtA[i] = 0x28 + } + if x.StartTime != nil { + encoded, err := options.Marshal(x.StartTime) + 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] = 0x22 + } + if x.TotalBudget != nil { + encoded, err := options.Marshal(x.TotalBudget) + 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] = 0x1a + } + if len(x.RecipientAddress) > 0 { + i -= len(x.RecipientAddress) + copy(dAtA[i:], x.RecipientAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RecipientAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + 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().(*MsgSubmitBudgetProposal) + 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: MsgSubmitBudgetProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSubmitBudgetProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RecipientAddress", 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.RecipientAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalBudget", 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.TotalBudget == nil { + x.TotalBudget = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TotalBudget); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartTime", 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.StartTime == nil { + x.StartTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StartTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tranches", wireType) + } + x.Tranches = 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.Tranches |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Period", 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.Period == nil { + x.Period = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Period); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + 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_MsgSubmitBudgetProposalResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgSubmitBudgetProposalResponse = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgSubmitBudgetProposalResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgSubmitBudgetProposalResponse)(nil) + +type fastReflection_MsgSubmitBudgetProposalResponse MsgSubmitBudgetProposalResponse + +func (x *MsgSubmitBudgetProposalResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSubmitBudgetProposalResponse)(x) +} + +func (x *MsgSubmitBudgetProposalResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[5] + 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_MsgSubmitBudgetProposalResponse_messageType fastReflection_MsgSubmitBudgetProposalResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgSubmitBudgetProposalResponse_messageType{} + +type fastReflection_MsgSubmitBudgetProposalResponse_messageType struct{} + +func (x fastReflection_MsgSubmitBudgetProposalResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSubmitBudgetProposalResponse)(nil) +} +func (x fastReflection_MsgSubmitBudgetProposalResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSubmitBudgetProposalResponse) +} +func (x fastReflection_MsgSubmitBudgetProposalResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSubmitBudgetProposalResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSubmitBudgetProposalResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSubmitBudgetProposalResponse +} + +// 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_MsgSubmitBudgetProposalResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgSubmitBudgetProposalResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSubmitBudgetProposalResponse) New() protoreflect.Message { + return new(fastReflection_MsgSubmitBudgetProposalResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSubmitBudgetProposalResponse) Interface() protoreflect.ProtoMessage { + return (*MsgSubmitBudgetProposalResponse)(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_MsgSubmitBudgetProposalResponse) 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_MsgSubmitBudgetProposalResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse 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_MsgSubmitBudgetProposalResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse 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_MsgSubmitBudgetProposalResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse 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_MsgSubmitBudgetProposalResponse) 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.protocolpool.v1.MsgSubmitBudgetProposalResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse 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_MsgSubmitBudgetProposalResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse 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_MsgSubmitBudgetProposalResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse 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_MsgSubmitBudgetProposalResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse", 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_MsgSubmitBudgetProposalResponse) 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_MsgSubmitBudgetProposalResponse) 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_MsgSubmitBudgetProposalResponse) 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_MsgSubmitBudgetProposalResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSubmitBudgetProposalResponse) + 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().(*MsgSubmitBudgetProposalResponse) + 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().(*MsgSubmitBudgetProposalResponse) + 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: MsgSubmitBudgetProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSubmitBudgetProposalResponse: 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, + } +} + +var ( + md_MsgClaimBudget protoreflect.MessageDescriptor + fd_MsgClaimBudget_recipient_address protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgClaimBudget = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgClaimBudget") + fd_MsgClaimBudget_recipient_address = md_MsgClaimBudget.Fields().ByName("recipient_address") +} + +var _ protoreflect.Message = (*fastReflection_MsgClaimBudget)(nil) + +type fastReflection_MsgClaimBudget MsgClaimBudget + +func (x *MsgClaimBudget) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimBudget)(x) +} + +func (x *MsgClaimBudget) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[6] + 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_MsgClaimBudget_messageType fastReflection_MsgClaimBudget_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimBudget_messageType{} + +type fastReflection_MsgClaimBudget_messageType struct{} + +func (x fastReflection_MsgClaimBudget_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimBudget)(nil) +} +func (x fastReflection_MsgClaimBudget_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimBudget) +} +func (x fastReflection_MsgClaimBudget_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimBudget +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClaimBudget) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimBudget +} + +// 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_MsgClaimBudget) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimBudget_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClaimBudget) New() protoreflect.Message { + return new(fastReflection_MsgClaimBudget) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaimBudget) Interface() protoreflect.ProtoMessage { + return (*MsgClaimBudget)(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_MsgClaimBudget) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RecipientAddress != "" { + value := protoreflect.ValueOfString(x.RecipientAddress) + if !f(fd_MsgClaimBudget_recipient_address, 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_MsgClaimBudget) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudget.recipient_address": + return x.RecipientAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudget 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_MsgClaimBudget) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudget.recipient_address": + x.RecipientAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudget 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_MsgClaimBudget) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudget.recipient_address": + value := x.RecipientAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudget 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_MsgClaimBudget) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudget.recipient_address": + x.RecipientAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudget 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_MsgClaimBudget) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudget.recipient_address": + panic(fmt.Errorf("field recipient_address of message cosmos.protocolpool.v1.MsgClaimBudget is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudget 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_MsgClaimBudget) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudget.recipient_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudget 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_MsgClaimBudget) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgClaimBudget", 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_MsgClaimBudget) 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_MsgClaimBudget) 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_MsgClaimBudget) 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_MsgClaimBudget) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClaimBudget) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.RecipientAddress) + 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().(*MsgClaimBudget) + 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.RecipientAddress) > 0 { + i -= len(x.RecipientAddress) + copy(dAtA[i:], x.RecipientAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RecipientAddress))) + i-- + dAtA[i] = 0xa + } + 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().(*MsgClaimBudget) + 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: MsgClaimBudget: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimBudget: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RecipientAddress", 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.RecipientAddress = 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_MsgClaimBudgetResponse protoreflect.MessageDescriptor + fd_MsgClaimBudgetResponse_amount protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgClaimBudgetResponse = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgClaimBudgetResponse") + fd_MsgClaimBudgetResponse_amount = md_MsgClaimBudgetResponse.Fields().ByName("amount") +} + +var _ protoreflect.Message = (*fastReflection_MsgClaimBudgetResponse)(nil) + +type fastReflection_MsgClaimBudgetResponse MsgClaimBudgetResponse + +func (x *MsgClaimBudgetResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClaimBudgetResponse)(x) +} + +func (x *MsgClaimBudgetResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[7] + 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_MsgClaimBudgetResponse_messageType fastReflection_MsgClaimBudgetResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgClaimBudgetResponse_messageType{} + +type fastReflection_MsgClaimBudgetResponse_messageType struct{} + +func (x fastReflection_MsgClaimBudgetResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClaimBudgetResponse)(nil) +} +func (x fastReflection_MsgClaimBudgetResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClaimBudgetResponse) +} +func (x fastReflection_MsgClaimBudgetResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimBudgetResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClaimBudgetResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClaimBudgetResponse +} + +// 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_MsgClaimBudgetResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgClaimBudgetResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClaimBudgetResponse) New() protoreflect.Message { + return new(fastReflection_MsgClaimBudgetResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClaimBudgetResponse) Interface() protoreflect.ProtoMessage { + return (*MsgClaimBudgetResponse)(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_MsgClaimBudgetResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Amount != nil { + value := protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + if !f(fd_MsgClaimBudgetResponse_amount, 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_MsgClaimBudgetResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudgetResponse.amount": + return x.Amount != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudgetResponse 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_MsgClaimBudgetResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudgetResponse.amount": + x.Amount = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudgetResponse 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_MsgClaimBudgetResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudgetResponse.amount": + value := x.Amount + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudgetResponse 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_MsgClaimBudgetResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudgetResponse.amount": + x.Amount = value.Message().Interface().(*v1beta1.Coin) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudgetResponse 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_MsgClaimBudgetResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudgetResponse.amount": + if x.Amount == nil { + x.Amount = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudgetResponse 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_MsgClaimBudgetResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgClaimBudgetResponse.amount": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgClaimBudgetResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgClaimBudgetResponse 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_MsgClaimBudgetResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgClaimBudgetResponse", 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_MsgClaimBudgetResponse) 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_MsgClaimBudgetResponse) 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_MsgClaimBudgetResponse) 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_MsgClaimBudgetResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClaimBudgetResponse) + 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.Amount != nil { + l = options.Size(x.Amount) + 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().(*MsgClaimBudgetResponse) + 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 x.Amount != nil { + encoded, err := options.Marshal(x.Amount) + 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] = 0xa + } + 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().(*MsgClaimBudgetResponse) + 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: MsgClaimBudgetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClaimBudgetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount == nil { + x.Amount = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + 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, + } +} // Code generated by protoc-gen-go. DO NOT EDIT. // versions: @@ -1998,8 +3978,6 @@ func (*MsgFundCommunityPoolResponse) Descriptor() ([]byte, []int) { // MsgCommunityPoolSpend defines a message for sending tokens from the community // pool to another account. This message is typically executed via a governance // proposal with the governance module being the executing authority. -// -// Since: cosmos-sdk 0.50 type MsgCommunityPoolSpend struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2054,8 +4032,6 @@ func (x *MsgCommunityPoolSpend) GetAmount() []*v1beta1.Coin { // MsgCommunityPoolSpendResponse defines the response to executing a // MsgCommunityPoolSpend message. -// -// Since: cosmos-sdk 0.50 type MsgCommunityPoolSpendResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2082,6 +4058,192 @@ func (*MsgCommunityPoolSpendResponse) Descriptor() ([]byte, []int) { return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{3} } +// MsgSubmitBudgetProposal defines budget proposal type. +type MsgSubmitBudgetProposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // recipient_address is the address of the recipient who can claim the budget. + RecipientAddress string `protobuf:"bytes,2,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + // total_budget is the total amount allocated for the budget. + TotalBudget *v1beta1.Coin `protobuf:"bytes,3,opt,name=total_budget,json=totalBudget,proto3" json:"total_budget,omitempty"` + // start_time is the time when the budget becomes claimable. + // If start_time is less than the current block time, proposal will not be accepted. + StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // tranches is the number of times the total budget amount is to be distributed. + Tranches uint64 `protobuf:"varint,5,opt,name=tranches,proto3" json:"tranches,omitempty"` + // Period is the time interval(number of seconds) at which funds distribution should be performed. + // For example, if a period is set to 3600, it represents an action that + // should occur every hour (3600 seconds). + Period *durationpb.Duration `protobuf:"bytes,6,opt,name=period,proto3" json:"period,omitempty"` +} + +func (x *MsgSubmitBudgetProposal) Reset() { + *x = MsgSubmitBudgetProposal{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSubmitBudgetProposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSubmitBudgetProposal) ProtoMessage() {} + +// Deprecated: Use MsgSubmitBudgetProposal.ProtoReflect.Descriptor instead. +func (*MsgSubmitBudgetProposal) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgSubmitBudgetProposal) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgSubmitBudgetProposal) GetRecipientAddress() string { + if x != nil { + return x.RecipientAddress + } + return "" +} + +func (x *MsgSubmitBudgetProposal) GetTotalBudget() *v1beta1.Coin { + if x != nil { + return x.TotalBudget + } + return nil +} + +func (x *MsgSubmitBudgetProposal) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *MsgSubmitBudgetProposal) GetTranches() uint64 { + if x != nil { + return x.Tranches + } + return 0 +} + +func (x *MsgSubmitBudgetProposal) GetPeriod() *durationpb.Duration { + if x != nil { + return x.Period + } + return nil +} + +// MsgSubmitBudgetProposalResponse defines the response to executing a +// MsgSubmitBudgetProposal message. +type MsgSubmitBudgetProposalResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgSubmitBudgetProposalResponse) Reset() { + *x = MsgSubmitBudgetProposalResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSubmitBudgetProposalResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSubmitBudgetProposalResponse) ProtoMessage() {} + +// Deprecated: Use MsgSubmitBudgetProposalResponse.ProtoReflect.Descriptor instead. +func (*MsgSubmitBudgetProposalResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{5} +} + +// MsgClaimBudget defines a message for claiming the distributed budget. +type MsgClaimBudget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RecipientAddress string `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` +} + +func (x *MsgClaimBudget) Reset() { + *x = MsgClaimBudget{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimBudget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimBudget) ProtoMessage() {} + +// Deprecated: Use MsgClaimBudget.ProtoReflect.Descriptor instead. +func (*MsgClaimBudget) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgClaimBudget) GetRecipientAddress() string { + if x != nil { + return x.RecipientAddress + } + return "" +} + +// MsgClaimBudgetResponse defines the response to executing a +// MsgClaimBudget message. +type MsgClaimBudgetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Amount *v1beta1.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *MsgClaimBudgetResponse) Reset() { + *x = MsgClaimBudgetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClaimBudgetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClaimBudgetResponse) ProtoMessage() {} + +// Deprecated: Use MsgClaimBudgetResponse.ProtoReflect.Descriptor instead. +func (*MsgClaimBudgetResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{7} +} + +func (x *MsgClaimBudgetResponse) GetAmount() *v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + var File_cosmos_protocolpool_v1_tx_proto protoreflect.FileDescriptor var file_cosmos_protocolpool_v1_tx_proto_rawDesc = []byte{ @@ -2095,68 +4257,128 @@ var file_cosmos_protocolpool_v1_tx_proto_rawDesc = []byte{ 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 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, 0xcb, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, - 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x63, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, - 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 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, 0x3a, 0x16, 0x88, 0xa0, 0x1f, 0x00, 0xe8, - 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x22, 0x1e, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, - 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0xe2, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, - 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 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, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, - 0x74, 0x12, 0x63, 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, 0x30, 0xc8, 0xde, - 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, - 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, + 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, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcb, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, + 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x63, 0x0a, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, + 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 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, 0x3a, 0x16, 0x88, 0xa0, 0x1f, 0x00, + 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x22, 0x1e, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, + 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0xe2, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, + 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 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, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x12, 0x63, 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, 0x30, 0xc8, + 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x43, 0x6f, + 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xfc, 0x02, 0x0a, 0x17, 0x4d, 0x73, 0x67, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 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, 0x45, 0x0a, 0x11, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 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, 0x10, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x75, 0x64, + 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 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, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x04, 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, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x37, + 0x0a, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x06, 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, + 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x21, 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x53, 0x75, + 0x62, 0x6d, 0x69, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0x0a, 0x0e, 0x4d, 0x73, + 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x45, 0x0a, 0x11, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 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, 0x10, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x3a, 0x16, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x7d, 0x0a, 0x16, 0x4d, + 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x73, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xeb, 0x03, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x77, 0x0a, 0x11, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, + 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, + 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, + 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7a, 0x0a, 0x12, 0x43, + 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, + 0x64, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, + 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, + 0x1a, 0x35, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x81, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, - 0x77, 0x0a, 0x11, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, - 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, - 0x6f, 0x6c, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, - 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7a, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, - 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x2d, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x14, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, + 0x62, 0x6d, 0x69, 0x74, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x0b, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x75, 0x64, 0x67, 0x65, + 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xd7, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, - 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x1a, 0x35, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, - 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, - 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xd7, 0x01, 0x0a, 0x1a, - 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x43, 0x50, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, - 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, - 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x50, 0x58, + 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2171,26 +4393,40 @@ func file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP() []byte { return file_cosmos_protocolpool_v1_tx_proto_rawDescData } -var file_cosmos_protocolpool_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_protocolpool_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_cosmos_protocolpool_v1_tx_proto_goTypes = []interface{}{ - (*MsgFundCommunityPool)(nil), // 0: cosmos.protocolpool.v1.MsgFundCommunityPool - (*MsgFundCommunityPoolResponse)(nil), // 1: cosmos.protocolpool.v1.MsgFundCommunityPoolResponse - (*MsgCommunityPoolSpend)(nil), // 2: cosmos.protocolpool.v1.MsgCommunityPoolSpend - (*MsgCommunityPoolSpendResponse)(nil), // 3: cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse - (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin + (*MsgFundCommunityPool)(nil), // 0: cosmos.protocolpool.v1.MsgFundCommunityPool + (*MsgFundCommunityPoolResponse)(nil), // 1: cosmos.protocolpool.v1.MsgFundCommunityPoolResponse + (*MsgCommunityPoolSpend)(nil), // 2: cosmos.protocolpool.v1.MsgCommunityPoolSpend + (*MsgCommunityPoolSpendResponse)(nil), // 3: cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse + (*MsgSubmitBudgetProposal)(nil), // 4: cosmos.protocolpool.v1.MsgSubmitBudgetProposal + (*MsgSubmitBudgetProposalResponse)(nil), // 5: cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse + (*MsgClaimBudget)(nil), // 6: cosmos.protocolpool.v1.MsgClaimBudget + (*MsgClaimBudgetResponse)(nil), // 7: cosmos.protocolpool.v1.MsgClaimBudgetResponse + (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 10: google.protobuf.Duration } var file_cosmos_protocolpool_v1_tx_proto_depIdxs = []int32{ - 4, // 0: cosmos.protocolpool.v1.MsgFundCommunityPool.amount:type_name -> cosmos.base.v1beta1.Coin - 4, // 1: cosmos.protocolpool.v1.MsgCommunityPoolSpend.amount:type_name -> cosmos.base.v1beta1.Coin - 0, // 2: cosmos.protocolpool.v1.Msg.FundCommunityPool:input_type -> cosmos.protocolpool.v1.MsgFundCommunityPool - 2, // 3: cosmos.protocolpool.v1.Msg.CommunityPoolSpend:input_type -> cosmos.protocolpool.v1.MsgCommunityPoolSpend - 1, // 4: cosmos.protocolpool.v1.Msg.FundCommunityPool:output_type -> cosmos.protocolpool.v1.MsgFundCommunityPoolResponse - 3, // 5: cosmos.protocolpool.v1.Msg.CommunityPoolSpend:output_type -> cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 8, // 0: cosmos.protocolpool.v1.MsgFundCommunityPool.amount:type_name -> cosmos.base.v1beta1.Coin + 8, // 1: cosmos.protocolpool.v1.MsgCommunityPoolSpend.amount:type_name -> cosmos.base.v1beta1.Coin + 8, // 2: cosmos.protocolpool.v1.MsgSubmitBudgetProposal.total_budget:type_name -> cosmos.base.v1beta1.Coin + 9, // 3: cosmos.protocolpool.v1.MsgSubmitBudgetProposal.start_time:type_name -> google.protobuf.Timestamp + 10, // 4: cosmos.protocolpool.v1.MsgSubmitBudgetProposal.period:type_name -> google.protobuf.Duration + 8, // 5: cosmos.protocolpool.v1.MsgClaimBudgetResponse.amount:type_name -> cosmos.base.v1beta1.Coin + 0, // 6: cosmos.protocolpool.v1.Msg.FundCommunityPool:input_type -> cosmos.protocolpool.v1.MsgFundCommunityPool + 2, // 7: cosmos.protocolpool.v1.Msg.CommunityPoolSpend:input_type -> cosmos.protocolpool.v1.MsgCommunityPoolSpend + 4, // 8: cosmos.protocolpool.v1.Msg.SubmitBudgetProposal:input_type -> cosmos.protocolpool.v1.MsgSubmitBudgetProposal + 6, // 9: cosmos.protocolpool.v1.Msg.ClaimBudget:input_type -> cosmos.protocolpool.v1.MsgClaimBudget + 1, // 10: cosmos.protocolpool.v1.Msg.FundCommunityPool:output_type -> cosmos.protocolpool.v1.MsgFundCommunityPoolResponse + 3, // 11: cosmos.protocolpool.v1.Msg.CommunityPoolSpend:output_type -> cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse + 5, // 12: cosmos.protocolpool.v1.Msg.SubmitBudgetProposal:output_type -> cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse + 7, // 13: cosmos.protocolpool.v1.Msg.ClaimBudget:output_type -> cosmos.protocolpool.v1.MsgClaimBudgetResponse + 10, // [10:14] is the sub-list for method output_type + 6, // [6:10] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_protocolpool_v1_tx_proto_init() } @@ -2247,6 +4483,54 @@ func file_cosmos_protocolpool_v1_tx_proto_init() { return nil } } + file_cosmos_protocolpool_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSubmitBudgetProposal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_protocolpool_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSubmitBudgetProposalResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_protocolpool_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClaimBudget); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_protocolpool_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClaimBudgetResponse); 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{ @@ -2254,7 +4538,7 @@ func file_cosmos_protocolpool_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_protocolpool_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/protocolpool/v1/tx_grpc.pb.go b/api/cosmos/protocolpool/v1/tx_grpc.pb.go index 9b1644a1d474..38ab855506b2 100644 --- a/api/cosmos/protocolpool/v1/tx_grpc.pb.go +++ b/api/cosmos/protocolpool/v1/tx_grpc.pb.go @@ -1,5 +1,3 @@ -// Since: cosmos-sdk 0.50 - // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 @@ -21,8 +19,10 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_FundCommunityPool_FullMethodName = "/cosmos.protocolpool.v1.Msg/FundCommunityPool" - Msg_CommunityPoolSpend_FullMethodName = "/cosmos.protocolpool.v1.Msg/CommunityPoolSpend" + Msg_FundCommunityPool_FullMethodName = "/cosmos.protocolpool.v1.Msg/FundCommunityPool" + Msg_CommunityPoolSpend_FullMethodName = "/cosmos.protocolpool.v1.Msg/CommunityPoolSpend" + Msg_SubmitBudgetProposal_FullMethodName = "/cosmos.protocolpool.v1.Msg/SubmitBudgetProposal" + Msg_ClaimBudget_FullMethodName = "/cosmos.protocolpool.v1.Msg/ClaimBudget" ) // MsgClient is the client API for Msg service. @@ -31,16 +31,16 @@ const ( type MsgClient interface { // FundCommunityPool defines a method to allow an account to directly // fund the community pool. - // - // Since: cosmos-sdk 0.50 FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) // CommunityPoolSpend defines a governance operation for sending tokens from // the community pool in the x/protocolpool module to another account, which // could be the governance module itself. The authority is defined in the // keeper. - // - // Since: cosmos-sdk 0.50 CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) + // SubmitBudgetProposal defines a method to set a budget proposal. + SubmitBudgetProposal(ctx context.Context, in *MsgSubmitBudgetProposal, opts ...grpc.CallOption) (*MsgSubmitBudgetProposalResponse, error) + // ClaimBudget defines a method to claim the distributed budget. + ClaimBudget(ctx context.Context, in *MsgClaimBudget, opts ...grpc.CallOption) (*MsgClaimBudgetResponse, error) } type msgClient struct { @@ -69,22 +69,40 @@ func (c *msgClient) CommunityPoolSpend(ctx context.Context, in *MsgCommunityPool return out, nil } +func (c *msgClient) SubmitBudgetProposal(ctx context.Context, in *MsgSubmitBudgetProposal, opts ...grpc.CallOption) (*MsgSubmitBudgetProposalResponse, error) { + out := new(MsgSubmitBudgetProposalResponse) + err := c.cc.Invoke(ctx, Msg_SubmitBudgetProposal_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ClaimBudget(ctx context.Context, in *MsgClaimBudget, opts ...grpc.CallOption) (*MsgClaimBudgetResponse, error) { + out := new(MsgClaimBudgetResponse) + err := c.cc.Invoke(ctx, Msg_ClaimBudget_FullMethodName, 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 type MsgServer interface { // FundCommunityPool defines a method to allow an account to directly // fund the community pool. - // - // Since: cosmos-sdk 0.50 FundCommunityPool(context.Context, *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) // CommunityPoolSpend defines a governance operation for sending tokens from // the community pool in the x/protocolpool module to another account, which // could be the governance module itself. The authority is defined in the // keeper. - // - // Since: cosmos-sdk 0.50 CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) + // SubmitBudgetProposal defines a method to set a budget proposal. + SubmitBudgetProposal(context.Context, *MsgSubmitBudgetProposal) (*MsgSubmitBudgetProposalResponse, error) + // ClaimBudget defines a method to claim the distributed budget. + ClaimBudget(context.Context, *MsgClaimBudget) (*MsgClaimBudgetResponse, error) mustEmbedUnimplementedMsgServer() } @@ -98,6 +116,12 @@ func (UnimplementedMsgServer) FundCommunityPool(context.Context, *MsgFundCommuni func (UnimplementedMsgServer) CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CommunityPoolSpend not implemented") } +func (UnimplementedMsgServer) SubmitBudgetProposal(context.Context, *MsgSubmitBudgetProposal) (*MsgSubmitBudgetProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitBudgetProposal not implemented") +} +func (UnimplementedMsgServer) ClaimBudget(context.Context, *MsgClaimBudget) (*MsgClaimBudgetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimBudget not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -147,6 +171,42 @@ func _Msg_CommunityPoolSpend_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Msg_SubmitBudgetProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitBudgetProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitBudgetProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_SubmitBudgetProposal_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitBudgetProposal(ctx, req.(*MsgSubmitBudgetProposal)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ClaimBudget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimBudget) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClaimBudget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_ClaimBudget_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClaimBudget(ctx, req.(*MsgClaimBudget)) + } + 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) @@ -162,6 +222,14 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "CommunityPoolSpend", Handler: _Msg_CommunityPoolSpend_Handler, }, + { + MethodName: "SubmitBudgetProposal", + Handler: _Msg_SubmitBudgetProposal_Handler, + }, + { + MethodName: "ClaimBudget", + Handler: _Msg_ClaimBudget_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/protocolpool/v1/tx.proto", diff --git a/api/cosmos/protocolpool/v1/types.pulsar.go b/api/cosmos/protocolpool/v1/types.pulsar.go new file mode 100644 index 000000000000..90e099e44c0f --- /dev/null +++ b/api/cosmos/protocolpool/v1/types.pulsar.go @@ -0,0 +1,1178 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package protocolpoolv1 + +import ( + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Budget protoreflect.MessageDescriptor + fd_Budget_recipient_address protoreflect.FieldDescriptor + fd_Budget_total_budget protoreflect.FieldDescriptor + fd_Budget_claimed_amount protoreflect.FieldDescriptor + fd_Budget_start_time protoreflect.FieldDescriptor + fd_Budget_next_claim_from protoreflect.FieldDescriptor + fd_Budget_tranches protoreflect.FieldDescriptor + fd_Budget_tranches_left protoreflect.FieldDescriptor + fd_Budget_period protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_types_proto_init() + md_Budget = File_cosmos_protocolpool_v1_types_proto.Messages().ByName("Budget") + fd_Budget_recipient_address = md_Budget.Fields().ByName("recipient_address") + fd_Budget_total_budget = md_Budget.Fields().ByName("total_budget") + fd_Budget_claimed_amount = md_Budget.Fields().ByName("claimed_amount") + fd_Budget_start_time = md_Budget.Fields().ByName("start_time") + fd_Budget_next_claim_from = md_Budget.Fields().ByName("next_claim_from") + fd_Budget_tranches = md_Budget.Fields().ByName("tranches") + fd_Budget_tranches_left = md_Budget.Fields().ByName("tranches_left") + fd_Budget_period = md_Budget.Fields().ByName("period") +} + +var _ protoreflect.Message = (*fastReflection_Budget)(nil) + +type fastReflection_Budget Budget + +func (x *Budget) ProtoReflect() protoreflect.Message { + return (*fastReflection_Budget)(x) +} + +func (x *Budget) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_types_proto_msgTypes[0] + 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_Budget_messageType fastReflection_Budget_messageType +var _ protoreflect.MessageType = fastReflection_Budget_messageType{} + +type fastReflection_Budget_messageType struct{} + +func (x fastReflection_Budget_messageType) Zero() protoreflect.Message { + return (*fastReflection_Budget)(nil) +} +func (x fastReflection_Budget_messageType) New() protoreflect.Message { + return new(fastReflection_Budget) +} +func (x fastReflection_Budget_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Budget +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Budget) Descriptor() protoreflect.MessageDescriptor { + return md_Budget +} + +// 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_Budget) Type() protoreflect.MessageType { + return _fastReflection_Budget_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Budget) New() protoreflect.Message { + return new(fastReflection_Budget) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Budget) Interface() protoreflect.ProtoMessage { + return (*Budget)(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_Budget) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RecipientAddress != "" { + value := protoreflect.ValueOfString(x.RecipientAddress) + if !f(fd_Budget_recipient_address, value) { + return + } + } + if x.TotalBudget != nil { + value := protoreflect.ValueOfMessage(x.TotalBudget.ProtoReflect()) + if !f(fd_Budget_total_budget, value) { + return + } + } + if x.ClaimedAmount != nil { + value := protoreflect.ValueOfMessage(x.ClaimedAmount.ProtoReflect()) + if !f(fd_Budget_claimed_amount, value) { + return + } + } + if x.StartTime != nil { + value := protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + if !f(fd_Budget_start_time, value) { + return + } + } + if x.NextClaimFrom != nil { + value := protoreflect.ValueOfMessage(x.NextClaimFrom.ProtoReflect()) + if !f(fd_Budget_next_claim_from, value) { + return + } + } + if x.Tranches != uint64(0) { + value := protoreflect.ValueOfUint64(x.Tranches) + if !f(fd_Budget_tranches, value) { + return + } + } + if x.TranchesLeft != uint64(0) { + value := protoreflect.ValueOfUint64(x.TranchesLeft) + if !f(fd_Budget_tranches_left, value) { + return + } + } + if x.Period != nil { + value := protoreflect.ValueOfMessage(x.Period.ProtoReflect()) + if !f(fd_Budget_period, 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_Budget) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.Budget.recipient_address": + return x.RecipientAddress != "" + case "cosmos.protocolpool.v1.Budget.total_budget": + return x.TotalBudget != nil + case "cosmos.protocolpool.v1.Budget.claimed_amount": + return x.ClaimedAmount != nil + case "cosmos.protocolpool.v1.Budget.start_time": + return x.StartTime != nil + case "cosmos.protocolpool.v1.Budget.next_claim_from": + return x.NextClaimFrom != nil + case "cosmos.protocolpool.v1.Budget.tranches": + return x.Tranches != uint64(0) + case "cosmos.protocolpool.v1.Budget.tranches_left": + return x.TranchesLeft != uint64(0) + case "cosmos.protocolpool.v1.Budget.period": + return x.Period != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Budget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Budget 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_Budget) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.Budget.recipient_address": + x.RecipientAddress = "" + case "cosmos.protocolpool.v1.Budget.total_budget": + x.TotalBudget = nil + case "cosmos.protocolpool.v1.Budget.claimed_amount": + x.ClaimedAmount = nil + case "cosmos.protocolpool.v1.Budget.start_time": + x.StartTime = nil + case "cosmos.protocolpool.v1.Budget.next_claim_from": + x.NextClaimFrom = nil + case "cosmos.protocolpool.v1.Budget.tranches": + x.Tranches = uint64(0) + case "cosmos.protocolpool.v1.Budget.tranches_left": + x.TranchesLeft = uint64(0) + case "cosmos.protocolpool.v1.Budget.period": + x.Period = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Budget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Budget 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_Budget) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.Budget.recipient_address": + value := x.RecipientAddress + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.Budget.total_budget": + value := x.TotalBudget + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.claimed_amount": + value := x.ClaimedAmount + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.start_time": + value := x.StartTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.next_claim_from": + value := x.NextClaimFrom + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.tranches": + value := x.Tranches + return protoreflect.ValueOfUint64(value) + case "cosmos.protocolpool.v1.Budget.tranches_left": + value := x.TranchesLeft + return protoreflect.ValueOfUint64(value) + case "cosmos.protocolpool.v1.Budget.period": + value := x.Period + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Budget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Budget 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_Budget) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.Budget.recipient_address": + x.RecipientAddress = value.Interface().(string) + case "cosmos.protocolpool.v1.Budget.total_budget": + x.TotalBudget = value.Message().Interface().(*v1beta1.Coin) + case "cosmos.protocolpool.v1.Budget.claimed_amount": + x.ClaimedAmount = value.Message().Interface().(*v1beta1.Coin) + case "cosmos.protocolpool.v1.Budget.start_time": + x.StartTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.protocolpool.v1.Budget.next_claim_from": + x.NextClaimFrom = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.protocolpool.v1.Budget.tranches": + x.Tranches = value.Uint() + case "cosmos.protocolpool.v1.Budget.tranches_left": + x.TranchesLeft = value.Uint() + case "cosmos.protocolpool.v1.Budget.period": + x.Period = value.Message().Interface().(*durationpb.Duration) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Budget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Budget 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_Budget) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.Budget.total_budget": + if x.TotalBudget == nil { + x.TotalBudget = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.TotalBudget.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.claimed_amount": + if x.ClaimedAmount == nil { + x.ClaimedAmount = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedAmount.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.start_time": + if x.StartTime == nil { + x.StartTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.next_claim_from": + if x.NextClaimFrom == nil { + x.NextClaimFrom = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.NextClaimFrom.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.period": + if x.Period == nil { + x.Period = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.Period.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.recipient_address": + panic(fmt.Errorf("field recipient_address of message cosmos.protocolpool.v1.Budget is not mutable")) + case "cosmos.protocolpool.v1.Budget.tranches": + panic(fmt.Errorf("field tranches of message cosmos.protocolpool.v1.Budget is not mutable")) + case "cosmos.protocolpool.v1.Budget.tranches_left": + panic(fmt.Errorf("field tranches_left of message cosmos.protocolpool.v1.Budget is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Budget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Budget 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_Budget) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.Budget.recipient_address": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.Budget.total_budget": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.claimed_amount": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.start_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.next_claim_from": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.Budget.tranches": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.protocolpool.v1.Budget.tranches_left": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.protocolpool.v1.Budget.period": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Budget")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Budget 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_Budget) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.Budget", 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_Budget) 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_Budget) 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_Budget) 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_Budget) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Budget) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.RecipientAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TotalBudget != nil { + l = options.Size(x.TotalBudget) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ClaimedAmount != nil { + l = options.Size(x.ClaimedAmount) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.StartTime != nil { + l = options.Size(x.StartTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.NextClaimFrom != nil { + l = options.Size(x.NextClaimFrom) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Tranches != 0 { + n += 1 + runtime.Sov(uint64(x.Tranches)) + } + if x.TranchesLeft != 0 { + n += 1 + runtime.Sov(uint64(x.TranchesLeft)) + } + if x.Period != nil { + l = options.Size(x.Period) + 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().(*Budget) + 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 x.Period != nil { + encoded, err := options.Marshal(x.Period) + 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] = 0x42 + } + if x.TranchesLeft != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TranchesLeft)) + i-- + dAtA[i] = 0x38 + } + if x.Tranches != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Tranches)) + i-- + dAtA[i] = 0x30 + } + if x.NextClaimFrom != nil { + encoded, err := options.Marshal(x.NextClaimFrom) + 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] = 0x2a + } + if x.StartTime != nil { + encoded, err := options.Marshal(x.StartTime) + 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] = 0x22 + } + if x.ClaimedAmount != nil { + encoded, err := options.Marshal(x.ClaimedAmount) + 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] = 0x1a + } + if x.TotalBudget != nil { + encoded, err := options.Marshal(x.TotalBudget) + 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 len(x.RecipientAddress) > 0 { + i -= len(x.RecipientAddress) + copy(dAtA[i:], x.RecipientAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RecipientAddress))) + i-- + dAtA[i] = 0xa + } + 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().(*Budget) + 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: Budget: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Budget: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RecipientAddress", 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.RecipientAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalBudget", 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.TotalBudget == nil { + x.TotalBudget = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TotalBudget); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmount", 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.ClaimedAmount == nil { + x.ClaimedAmount = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmount); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartTime", 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.StartTime == nil { + x.StartTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StartTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NextClaimFrom", 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.NextClaimFrom == nil { + x.NextClaimFrom = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.NextClaimFrom); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tranches", wireType) + } + x.Tranches = 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.Tranches |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TranchesLeft", wireType) + } + x.TranchesLeft = 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.TranchesLeft |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Period", 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.Period == nil { + x.Period = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Period); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/protocolpool/v1/types.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Budget defines the fields of a budget proposal. +type Budget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // recipient_address is the address of the recipient who can claim the budget. + RecipientAddress string `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + // total_budget is the total amount allocated for the budget. + TotalBudget *v1beta1.Coin `protobuf:"bytes,2,opt,name=total_budget,json=totalBudget,proto3" json:"total_budget,omitempty"` + // claimed_amount is the total amount claimed from the total budget amount requested. + ClaimedAmount *v1beta1.Coin `protobuf:"bytes,3,opt,name=claimed_amount,json=claimedAmount,proto3" json:"claimed_amount,omitempty"` + // start_time is the time when the budget becomes claimable. + StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // next_claim_from is the time when the budget was last successfully claimed or distributed. + // It is used to track the next starting claim time for fund distribution. If set, it cannot be less than start_time. + NextClaimFrom *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=next_claim_from,json=nextClaimFrom,proto3" json:"next_claim_from,omitempty"` + // tranches is the number of times the total budget amount is to be distributed. + Tranches uint64 `protobuf:"varint,6,opt,name=tranches,proto3" json:"tranches,omitempty"` + // tranches_left is the number of tranches left for the amount to be distributed. + TranchesLeft uint64 `protobuf:"varint,7,opt,name=tranches_left,json=tranchesLeft,proto3" json:"tranches_left,omitempty"` + // Period is the time interval(number of seconds) at which funds distribution should be performed. + // For example, if a period is set to 3600, it represents an action that + // should occur every hour (3600 seconds). + Period *durationpb.Duration `protobuf:"bytes,8,opt,name=period,proto3" json:"period,omitempty"` +} + +func (x *Budget) Reset() { + *x = Budget{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Budget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Budget) ProtoMessage() {} + +// Deprecated: Use Budget.ProtoReflect.Descriptor instead. +func (*Budget) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Budget) GetRecipientAddress() string { + if x != nil { + return x.RecipientAddress + } + return "" +} + +func (x *Budget) GetTotalBudget() *v1beta1.Coin { + if x != nil { + return x.TotalBudget + } + return nil +} + +func (x *Budget) GetClaimedAmount() *v1beta1.Coin { + if x != nil { + return x.ClaimedAmount + } + return nil +} + +func (x *Budget) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *Budget) GetNextClaimFrom() *timestamppb.Timestamp { + if x != nil { + return x.NextClaimFrom + } + return nil +} + +func (x *Budget) GetTranches() uint64 { + if x != nil { + return x.Tranches + } + return 0 +} + +func (x *Budget) GetTranchesLeft() uint64 { + if x != nil { + return x.TranchesLeft + } + return 0 +} + +func (x *Budget) GetPeriod() *durationpb.Duration { + if x != nil { + return x.Period + } + return nil +} + +var File_cosmos_protocolpool_v1_types_proto protoreflect.FileDescriptor + +var file_cosmos_protocolpool_v1_types_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 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, 0x1a, 0x1e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd4, + 0x03, 0x0a, 0x06, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x45, 0x0a, 0x11, 0x72, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 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, 0x10, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x3c, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, + 0x18, 0x02, 0x20, 0x01, 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, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x40, + 0x0a, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 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, 0x52, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x3f, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, + 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, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x48, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, + 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x05, 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, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x6e, 0x65, + 0x78, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x74, + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x74, + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x63, + 0x68, 0x65, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, + 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x12, 0x37, 0x0a, 0x06, + 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x08, 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, 0x06, 0x70, + 0x65, 0x72, 0x69, 0x6f, 0x64, 0x42, 0xda, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, + 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x50, 0x58, + 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_protocolpool_v1_types_proto_rawDescOnce sync.Once + file_cosmos_protocolpool_v1_types_proto_rawDescData = file_cosmos_protocolpool_v1_types_proto_rawDesc +) + +func file_cosmos_protocolpool_v1_types_proto_rawDescGZIP() []byte { + file_cosmos_protocolpool_v1_types_proto_rawDescOnce.Do(func() { + file_cosmos_protocolpool_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_protocolpool_v1_types_proto_rawDescData) + }) + return file_cosmos_protocolpool_v1_types_proto_rawDescData +} + +var file_cosmos_protocolpool_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_protocolpool_v1_types_proto_goTypes = []interface{}{ + (*Budget)(nil), // 0: cosmos.protocolpool.v1.Budget + (*v1beta1.Coin)(nil), // 1: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration +} +var file_cosmos_protocolpool_v1_types_proto_depIdxs = []int32{ + 1, // 0: cosmos.protocolpool.v1.Budget.total_budget:type_name -> cosmos.base.v1beta1.Coin + 1, // 1: cosmos.protocolpool.v1.Budget.claimed_amount:type_name -> cosmos.base.v1beta1.Coin + 2, // 2: cosmos.protocolpool.v1.Budget.start_time:type_name -> google.protobuf.Timestamp + 2, // 3: cosmos.protocolpool.v1.Budget.next_claim_from:type_name -> google.protobuf.Timestamp + 3, // 4: cosmos.protocolpool.v1.Budget.period:type_name -> google.protobuf.Duration + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_cosmos_protocolpool_v1_types_proto_init() } +func file_cosmos_protocolpool_v1_types_proto_init() { + if File_cosmos_protocolpool_v1_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_protocolpool_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Budget); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_protocolpool_v1_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_protocolpool_v1_types_proto_goTypes, + DependencyIndexes: file_cosmos_protocolpool_v1_types_proto_depIdxs, + MessageInfos: file_cosmos_protocolpool_v1_types_proto_msgTypes, + }.Build() + File_cosmos_protocolpool_v1_types_proto = out.File + file_cosmos_protocolpool_v1_types_proto_rawDesc = nil + file_cosmos_protocolpool_v1_types_proto_goTypes = nil + file_cosmos_protocolpool_v1_types_proto_depIdxs = nil +} diff --git a/proto/cosmos/protocolpool/v1/query.proto b/proto/cosmos/protocolpool/v1/query.proto index 462851c390e2..9bcfa73170e2 100644 --- a/proto/cosmos/protocolpool/v1/query.proto +++ b/proto/cosmos/protocolpool/v1/query.proto @@ -1,4 +1,3 @@ -// Since: cosmos-sdk 0.50 syntax = "proto3"; package cosmos.protocolpool.v1; @@ -7,6 +6,9 @@ option go_package = "cosmossdk.io/x/protocolpool/types"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; // Query defines the gRPC querier service for community pool module. service Query { @@ -14,6 +16,11 @@ service Query { rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) { option (google.api.http).get = "/cosmos/protocolpool/v1/community_pool"; } + + // UnclaimedBudget queries the remaining budget left to be claimed and it gives overall budget allocation view. + rpc UnclaimedBudget(QueryUnclaimedBudgetRequest) returns (QueryUnclaimedBudgetResponse) { + option (google.api.http).get = "/cosmos/protocolpool/v1/unclaimed_budget/{address}"; + } } // QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC @@ -27,3 +34,28 @@ message QueryCommunityPoolResponse { repeated cosmos.base.v1beta1.DecCoin pool = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; } + +// QueryUnclaimedBudgetRequest is the request type for the Query/UnclaimedBudgetRequest +// RPC method. +message QueryUnclaimedBudgetRequest { + // address is the recipient address to query unclaimed budget amount for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryUnclaimedBudgetResponse is the response type for the Query/UnclaimedBudget +// RPC method. +message QueryUnclaimedBudgetResponse { + // total_budget is the total budget allocated to the recipient + cosmos.base.v1beta1.Coin total_budget = 1; + // claimed_amount is the budget amount already claimed by the recipient + cosmos.base.v1beta1.Coin claimed_amount = 2; + // unclaimed_amount is the remaining budget amount that is unclaimed by the recipient + cosmos.base.v1beta1.Coin unclaimed_amount = 3; + // next_claim_from is the next starting claim time for fund distribution. + // It represents the time when we can claim funds after the period time interval has passed. + google.protobuf.Timestamp next_claim_from = 4 [(gogoproto.stdtime) = true]; + // period is the time interval for fund distribution + google.protobuf.Duration period = 5 [(gogoproto.stdduration) = true]; + // tranches_left is the number of tranches left for the amount to be distributed + uint64 tranches_left = 6; +} \ No newline at end of file diff --git a/proto/cosmos/protocolpool/v1/tx.proto b/proto/cosmos/protocolpool/v1/tx.proto index cf4c61954b46..78da8cdbdc4a 100644 --- a/proto/cosmos/protocolpool/v1/tx.proto +++ b/proto/cosmos/protocolpool/v1/tx.proto @@ -1,4 +1,3 @@ -// Since: cosmos-sdk 0.50 syntax = "proto3"; package cosmos.protocolpool.v1; @@ -8,6 +7,8 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; // Msg defines the pool Msg service. service Msg { @@ -15,17 +16,19 @@ service Msg { // FundCommunityPool defines a method to allow an account to directly // fund the community pool. - // - // Since: cosmos-sdk 0.50 rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); // CommunityPoolSpend defines a governance operation for sending tokens from // the community pool in the x/protocolpool module to another account, which // could be the governance module itself. The authority is defined in the // keeper. - // - // Since: cosmos-sdk 0.50 rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); + + // SubmitBudgetProposal defines a method to set a budget proposal. + rpc SubmitBudgetProposal(MsgSubmitBudgetProposal) returns (MsgSubmitBudgetProposalResponse); + + // ClaimBudget defines a method to claim the distributed budget. + rpc ClaimBudget(MsgClaimBudget) returns (MsgClaimBudgetResponse); } // MsgFundCommunityPool allows an account to directly @@ -46,8 +49,6 @@ message MsgFundCommunityPoolResponse {} // MsgCommunityPoolSpend defines a message for sending tokens from the community // pool to another account. This message is typically executed via a governance // proposal with the governance module being the executing authority. -// -// Since: cosmos-sdk 0.50 message MsgCommunityPoolSpend { option (cosmos.msg.v1.signer) = "authority"; @@ -60,6 +61,43 @@ message MsgCommunityPoolSpend { // MsgCommunityPoolSpendResponse defines the response to executing a // MsgCommunityPoolSpend message. -// -// Since: cosmos-sdk 0.50 -message MsgCommunityPoolSpendResponse {} \ No newline at end of file +message MsgCommunityPoolSpendResponse {} + +// MsgSubmitBudgetProposal defines budget proposal type. +message MsgSubmitBudgetProposal { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // recipient_address is the address of the recipient who can claim the budget. + string recipient_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // total_budget is the total amount allocated for the budget. + cosmos.base.v1beta1.Coin total_budget = 3; + // start_time is the time when the budget becomes claimable. + // If start_time is less than the current block time, proposal will not be accepted. + google.protobuf.Timestamp start_time = 4 [(gogoproto.stdtime) = true]; + // tranches is the number of times the total budget amount is to be distributed. + uint64 tranches = 5; + // Period is the time interval(number of seconds) at which funds distribution should be performed. + // For example, if a period is set to 3600, it represents an action that + // should occur every hour (3600 seconds). + google.protobuf.Duration period = 6 [(gogoproto.stdduration) = true]; +} + +// MsgSubmitBudgetProposalResponse defines the response to executing a +// MsgSubmitBudgetProposal message. +message MsgSubmitBudgetProposalResponse {} + +// MsgClaimBudget defines a message for claiming the distributed budget. +message MsgClaimBudget { + option (cosmos.msg.v1.signer) = "recipient_address"; + string recipient_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgClaimBudgetResponse defines the response to executing a +// MsgClaimBudget message. +message MsgClaimBudgetResponse { + cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + ; +} diff --git a/proto/cosmos/protocolpool/v1/types.proto b/proto/cosmos/protocolpool/v1/types.proto new file mode 100644 index 000000000000..d7c98fed7f3f --- /dev/null +++ b/proto/cosmos/protocolpool/v1/types.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +package cosmos.protocolpool.v1; + +option go_package = "cosmossdk.io/x/protocolpool/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +// Budget defines the fields of a budget proposal. +message Budget { + // recipient_address is the address of the recipient who can claim the budget. + string recipient_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // total_budget is the total amount allocated for the budget. + cosmos.base.v1beta1.Coin total_budget = 2; + // claimed_amount is the total amount claimed from the total budget amount requested. + cosmos.base.v1beta1.Coin claimed_amount = 3; + // start_time is the time when the budget becomes claimable. + google.protobuf.Timestamp start_time = 4 [(gogoproto.stdtime) = true]; + // next_claim_from is the time when the budget was last successfully claimed or distributed. + // It is used to track the next starting claim time for fund distribution. If set, it cannot be less than start_time. + google.protobuf.Timestamp next_claim_from = 5 [(gogoproto.stdtime) = true]; + // tranches is the number of times the total budget amount is to be distributed. + uint64 tranches = 6; + // tranches_left is the number of tranches left for the amount to be distributed. + uint64 tranches_left = 7; + // Period is the time interval(number of seconds) at which funds distribution should be performed. + // For example, if a period is set to 3600, it represents an action that + // should occur every hour (3600 seconds). + google.protobuf.Duration period = 8 [(gogoproto.stdduration) = true]; +} \ No newline at end of file diff --git a/simapp/app.go b/simapp/app.go index 59bb34f50677..68ea6923f51c 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -476,6 +476,7 @@ func NewSimApp( genutiltypes.ModuleName, feegrant.ModuleName, group.ModuleName, + pooltypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are diff --git a/simapp/app_config.go b/simapp/app_config.go index 2f0164f651ed..8b5883df5cc5 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -128,6 +128,7 @@ var ( stakingtypes.ModuleName, feegrant.ModuleName, group.ModuleName, + pooltypes.ModuleName, }, OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{ { diff --git a/testutil/configurator/configurator.go b/testutil/configurator/configurator.go index d2a7c30851c1..08f577b8ab8a 100644 --- a/testutil/configurator/configurator.go +++ b/testutil/configurator/configurator.go @@ -81,6 +81,7 @@ func defaultConfig() *Config { "upgrade", "vesting", "circuit", + "protocolpool", }, InitGenesisOrder: []string{ "auth", diff --git a/x/gov/client/cli/prompt.go b/x/gov/client/cli/prompt.go index de213cc4e786..5d6ea3372c8d 100644 --- a/x/gov/client/cli/prompt.go +++ b/x/gov/client/cli/prompt.go @@ -45,6 +45,10 @@ var suggestedProposalTypes = []proposalType{ Name: "cancel-software-upgrade", MsgType: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", }, + { + Name: "submit-budget-proposal", + MsgType: "/cosmos.protocolpool.v1.MsgSubmitBudgetProposal", + }, { Name: proposalOther, MsgType: "", // user will input the message type diff --git a/x/protocolpool/README.md b/x/protocolpool/README.md index ec05e64a89a7..3b250f0f9e88 100644 --- a/x/protocolpool/README.md +++ b/x/protocolpool/README.md @@ -8,6 +8,8 @@ sidebar_position: 1 Protopool is a module that handle functionality around community pool funds. This provides a separate module account for community pool making it easier to track the pool assets. We no longer track community pool assets in distribution module, but instead in this protocolpool module. Funds are migrated from the distribution module's community pool to protocolpool's module account. +The module is also designed with a lazy "claim-based" system, which means that users are required to actively claim allocated funds from allocated budget if any budget proposal has been submitted and passed. The module does not automatically distribute funds to recipients. This design choice allows for more flexibility and control over fund distribution. + ## State Transitions ### FundCommunityPool @@ -32,6 +34,27 @@ CommunityPoolSpend can be called by the module authority (default governance mod rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); ``` +### SubmitBudgetProposal + +SubmitBudgetProposal is a message used to propose a budget allocation for a specific recipient. The proposed funds will be distributed periodically over a specified time frame. + +It's the responsibility of users to actively claim their allocated funds based on the terms of the approved budget proposals. + +```protobuf + // SubmitBudgetProposal defines a method to set a budget proposal. + rpc SubmitBudgetProposal(MsgSubmitBudgetProposal) returns (MsgSubmitBudgetProposalResponse); +``` + +### ClaimBudget + +ClaimBudget is a message used to claim funds from a previously submitted budget proposal. When a budget proposal is approved and funds are allocated, recipients can use this message to claim their share of the budget. Funds are distributed in tranches over specific periods, and users can claim their share of budget at the appropriate time. + +```protobuf + // ClaimBudget defines a method to claim the distributed budget. + rpc ClaimBudget(MsgClaimBudget) returns (MsgClaimBudgetResponse); + +``` + ## Messages ### MsgFundCommunityPool @@ -43,7 +66,7 @@ If you know the protocolpool module account address, you can directly use bank ` :::: ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/9dd34510e27376005e7e7ff3628eab9dbc8ad6dc/proto/cosmos/protocolpool/v1/tx.proto#L31-L41 +https://github.com/cosmos/cosmos-sdk/blob/97724493d792517ba2be8969078b5f92ad04d79c/proto/cosmos/protocolpool/v1/tx.proto#L32-L42 ``` * The msg will fail if the amount cannot be transferred from the sender to the protocolpool module account. @@ -59,7 +82,7 @@ func (k Keeper) FundCommunityPool(ctx context.Context, amount sdk.Coins, sender This message distributes funds from the protocolpool module account to the recipient using `DistributeFromFeePool` keeper method. ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/9dd34510e27376005e7e7ff3628eab9dbc8ad6dc/proto/cosmos/protocolpool/v1/tx.proto#L46-L59 +https://github.com/cosmos/cosmos-sdk/blob/97724493d792517ba2be8969078b5f92ad04d79c/proto/cosmos/protocolpool/v1/tx.proto#L47-L58 ``` The message will fail under the following conditions: @@ -73,6 +96,50 @@ func (k Keeper) DistributeFromFeePool(ctx context.Context, amount sdk.Coins, rec } ``` +### MsgSubmitBudgetProposal + +This message is used to submit a budget proposal to allocate funds for a specific recipient. The proposed funds will be distributed periodically over a specified time frame. + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/97724493d792517ba2be8969078b5f92ad04d79c/proto/cosmos/protocolpool/v1/tx.proto#L64-L82 +``` + +The message will fail under the following conditions: + +* The total budget is zero. +* The recipient address is empty or restricted. +* The start time is less than current block time. +* The number of tranches is not a positive integer. +* The period length is not a positive integer. + +:::warning +If two budgets to the same address are created, the budget would be updated with the new budget. +::: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/97724493d792517ba2be8969078b5f92ad04d79c/x/protocolpool/keeper/msg_server.go#L39-l61 +``` + +### MsgClaimBudget + +This message is used to claim funds from a previously submitted budget proposal. When a budget proposal is passed and funds are allocated, recipients can use this message to claim their share of the budget. + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/97724493d792517ba2be8969078b5f92ad04d79c/proto/cosmos/protocolpool/v1/tx.proto#L88-L92 +``` + +The message will fail under the following conditions: + +- The recipient address is empty or restricted. +- The budget proposal for the recipient does not exist. +- The budget proposal has not reached its distribution start time. +- The budget proposal's distribution period has not passed yet. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/97724493d792517ba2be8969078b5f92ad04d79c/x/protocolpool/keeper/msg_server.go#L25-L37 +``` + + ## Client It takes the advantage of `AutoCLI` diff --git a/x/protocolpool/autocli.go b/x/protocolpool/autocli.go index f8fbaa4c6139..619aa36fbd88 100644 --- a/x/protocolpool/autocli.go +++ b/x/protocolpool/autocli.go @@ -19,7 +19,14 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcMethod: "CommunityPool", Use: "community-pool", Short: "Query the amount of coins in the community pool", - Example: fmt.Sprintf(`$ %s query pool community-pool`, version.AppName), + Example: fmt.Sprintf(`$ %s query protocolpool community-pool`, version.AppName), + }, + { + RpcMethod: "UnclaimedBudget", + Use: "unclaimed-budget [recipient-address]", + Short: "Query the remaining budget left to be claimed", + Example: fmt.Sprintf(`$ %s query protocolpool unclaimed-budget cosmos1...`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}}, }, }, }, @@ -33,6 +40,26 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Example: fmt.Sprintf(`$ %s tx protocolpool fund-community-pool 100uatom --from mykey`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "amount"}}, }, + { + RpcMethod: "SubmitBudgetProposal", + Use: "submit-budget-proposal [recipient] [total-budget] [start-time] [tranches] [period]", + Short: "Submit a budget proposal", + Example: fmt.Sprintf(`$ %s tx protocolpool submit-budget-proposal cosmos1... 1000000uatom 1600000000 10 1000 --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "recipient_address"}, + {ProtoField: "total_budget"}, + {ProtoField: "start_time"}, + {ProtoField: "tranches"}, + {ProtoField: "period"}, + }, + }, + { + RpcMethod: "ClaimBudget", + Use: "claim-budget [recipient]", + Short: "Claim the distributed budget", + Example: fmt.Sprintf(`$ %s tx protocolpool claim-budget cosmos1... --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "recipient_address"}}, + }, }, }, } diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index f8c88a3e7969..4dde8013933a 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -4,10 +4,13 @@ go 1.21 require ( cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 + cosmossdk.io/collections v0.4.0 cosmossdk.io/core v0.12.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.0 cosmossdk.io/log v1.2.1 + cosmossdk.io/math v1.1.3-rc.1 + cosmossdk.io/store v1.0.0 cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 cosmossdk.io/x/distribution v0.0.0-20230925135524-a1bc045b3190 cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190 @@ -22,13 +25,11 @@ require ( github.com/stretchr/testify v1.8.4 google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a google.golang.org/grpc v1.59.0 + google.golang.org/protobuf v1.31.0 gotest.tools/v3 v3.5.1 ) require ( - cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/math v1.1.3-rc.1 // indirect - cosmossdk.io/store v1.0.0 // indirect cosmossdk.io/x/tx v0.12.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -153,7 +154,6 @@ require ( golang.org/x/text v0.13.0 // indirect google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect - google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/x/protocolpool/keeper/grpc_query.go b/x/protocolpool/keeper/grpc_query.go index d1e9abcb760e..2786fd72eb3f 100644 --- a/x/protocolpool/keeper/grpc_query.go +++ b/x/protocolpool/keeper/grpc_query.go @@ -2,7 +2,13 @@ package keeper import ( "context" + "errors" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "cosmossdk.io/collections" + "cosmossdk.io/math" "cosmossdk.io/x/protocolpool/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -27,3 +33,46 @@ func (k Querier) CommunityPool(ctx context.Context, req *types.QueryCommunityPoo decCoins := sdk.NewDecCoinsFromCoins(amount...) return &types.QueryCommunityPoolResponse{Pool: decCoins}, nil } + +// UnclaimedBudget queries the unclaimed budget for given recipient +func (k Querier) UnclaimedBudget(ctx context.Context, req *types.QueryUnclaimedBudgetRequest) (*types.QueryUnclaimedBudgetResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + address, err := k.Keeper.authKeeper.AddressCodec().StringToBytes(req.Address) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid recipient address: %s", err.Error()) + } + budget, err := k.Keeper.BudgetProposal.Get(ctx, address) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, status.Errorf(codes.NotFound, "no budget proposal found for address: %s", req.Address) + } + return nil, err + } + var unclaimedBudget sdk.Coin + if budget.ClaimedAmount == nil { + unclaimedBudget = *budget.TotalBudget + zeroCoin := sdk.NewCoin(budget.TotalBudget.Denom, math.ZeroInt()) + budget.ClaimedAmount = &zeroCoin + } else { + unclaimedBudget = budget.TotalBudget.Sub(*budget.ClaimedAmount) + } + + if budget.NextClaimFrom == nil { + budget.NextClaimFrom = budget.StartTime + } + + if budget.TranchesLeft == 0 { + budget.TranchesLeft = budget.Tranches + } + + return &types.QueryUnclaimedBudgetResponse{ + TotalBudget: budget.TotalBudget, + ClaimedAmount: budget.ClaimedAmount, + UnclaimedAmount: &unclaimedBudget, + NextClaimFrom: budget.NextClaimFrom, + Period: budget.Period, + TranchesLeft: budget.TranchesLeft, + }, nil +} diff --git a/x/protocolpool/keeper/grpc_query_test.go b/x/protocolpool/keeper/grpc_query_test.go new file mode 100644 index 000000000000..0781f447bc4f --- /dev/null +++ b/x/protocolpool/keeper/grpc_query_test.go @@ -0,0 +1,125 @@ +package keeper_test + +import ( + "time" + + "cosmossdk.io/math" + "cosmossdk.io/x/protocolpool/keeper" + "cosmossdk.io/x/protocolpool/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (suite *KeeperTestSuite) TestUnclaimedBudget() { + queryServer := keeper.NewQuerier(suite.poolKeeper) + startTime := suite.ctx.BlockTime().Add(-70 * time.Second) + period := time.Duration(60) * time.Second + zeroCoin := sdk.NewCoin("foo", math.ZeroInt()) + nextClaimFrom := startTime.Add(period) + testCases := []struct { + name string + preRun func() + req *types.QueryUnclaimedBudgetRequest + expErr bool + expErrMsg string + unclaimedFunds *sdk.Coin + resp *types.QueryUnclaimedBudgetResponse + }{ + { + name: "empty recipient address", + req: &types.QueryUnclaimedBudgetRequest{ + Address: "", + }, + expErr: true, + expErrMsg: "empty address string is not allowed", + }, + { + name: "no budget proposal found", + req: &types.QueryUnclaimedBudgetRequest{ + Address: recipientAddr.String(), + }, + expErr: true, + expErrMsg: "no budget proposal found for address", + }, + { + name: "valid case", + preRun: func() { + // Prepare a valid budget proposal + budget := types.Budget{ + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + } + err := suite.poolKeeper.BudgetProposal.Set(suite.ctx, recipientAddr, budget) + suite.Require().NoError(err) + }, + req: &types.QueryUnclaimedBudgetRequest{ + Address: recipientAddr.String(), + }, + expErr: false, + unclaimedFunds: &fooCoin, + resp: &types.QueryUnclaimedBudgetResponse{ + TotalBudget: &fooCoin, + ClaimedAmount: &zeroCoin, + UnclaimedAmount: &fooCoin, + NextClaimFrom: &startTime, + Period: &period, + TranchesLeft: 2, + }, + }, + { + name: "valid case with claim", + preRun: func() { + // Prepare a valid budget proposal + budget := types.Budget{ + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + } + err := suite.poolKeeper.BudgetProposal.Set(suite.ctx, recipientAddr, budget) + suite.Require().NoError(err) + + // Claim the funds once + msg := &types.MsgClaimBudget{ + RecipientAddress: recipientAddr.String(), + } + suite.mockSendCoinsFromModuleToAccount(recipientAddr) + _, err = suite.msgServer.ClaimBudget(suite.ctx, msg) + suite.Require().NoError(err) + }, + + req: &types.QueryUnclaimedBudgetRequest{ + Address: recipientAddr.String(), + }, + expErr: false, + unclaimedFunds: &fooCoin2, + resp: &types.QueryUnclaimedBudgetResponse{ + TotalBudget: &fooCoin, + ClaimedAmount: &fooCoin2, + UnclaimedAmount: &fooCoin2, + NextClaimFrom: &nextClaimFrom, + Period: &period, + TranchesLeft: 1, + }, + }, + } + for _, tc := range testCases { + suite.Run(tc.name, func() { + if tc.preRun != nil { + tc.preRun() + } + resp, err := queryServer.UnclaimedBudget(suite.ctx, tc.req) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().Equal(tc.resp, resp) + } + }) + } +} diff --git a/x/protocolpool/keeper/keeper.go b/x/protocolpool/keeper/keeper.go index 2275634b884f..5af89f45fb60 100644 --- a/x/protocolpool/keeper/keeper.go +++ b/x/protocolpool/keeper/keeper.go @@ -2,11 +2,15 @@ package keeper import ( "context" + "errors" "fmt" + "time" + "cosmossdk.io/collections" storetypes "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" + "cosmossdk.io/math" "cosmossdk.io/x/protocolpool/types" "github.com/cosmos/cosmos-sdk/codec" @@ -19,7 +23,13 @@ type Keeper struct { authKeeper types.AccountKeeper bankKeeper types.BankKeeper + cdc codec.BinaryCodec + authority string + + // State + Schema collections.Schema + BudgetProposal collections.Map[sdk.AccAddress, types.Budget] } func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, @@ -29,12 +39,24 @@ func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, if addr := ak.GetModuleAddress(types.ModuleName); addr == nil { panic(fmt.Sprintf("%s module account has not been set", types.ModuleName)) } - return Keeper{ - storeService: storeService, - authKeeper: ak, - bankKeeper: bk, - authority: authority, + sb := collections.NewSchemaBuilder(storeService) + + keeper := Keeper{ + storeService: storeService, + authKeeper: ak, + bankKeeper: bk, + cdc: cdc, + authority: authority, + BudgetProposal: collections.NewMap(sb, types.BudgetKey, "budget", sdk.AccAddressKey, codec.CollValue[types.Budget](cdc)), } + + schema, err := sb.Build() + if err != nil { + panic(err) + } + keeper.Schema = schema + + return keeper } // GetAuthority returns the x/protocolpool module's authority. @@ -67,3 +89,140 @@ func (k Keeper) GetCommunityPool(ctx context.Context) (sdk.Coins, error) { } return k.bankKeeper.GetAllBalances(ctx, moduleAccount.GetAddress()), nil } + +func (k Keeper) claimFunds(ctx context.Context, recipient sdk.AccAddress) (amount sdk.Coin, err error) { + // get claimable funds from distribution info + amount, err = k.getClaimableFunds(ctx, recipient) + if err != nil { + return sdk.Coin{}, fmt.Errorf("error getting claimable funds: %w", err) + } + + // distribute amount from feepool + err = k.DistributeFromFeePool(ctx, sdk.NewCoins(amount), recipient) + if err != nil { + return sdk.Coin{}, fmt.Errorf("error distributing from fee pool: %w", err) + } + + return amount, nil +} + +func (k Keeper) getClaimableFunds(ctx context.Context, recipient sdk.AccAddress) (amount sdk.Coin, err error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + budget, err := k.BudgetProposal.Get(ctx, recipient) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return sdk.Coin{}, fmt.Errorf("no budget found for recipient: %s", recipient.String()) + } + return sdk.Coin{}, err + } + + // check if the distribution is completed + if budget.TranchesLeft == 0 && budget.ClaimedAmount != nil { + // check that claimed amount is equal to total budget + if budget.ClaimedAmount.Equal(budget.TotalBudget) { + // remove the entry of budget ended recipient + if err := k.BudgetProposal.Remove(ctx, recipient); err != nil { + return sdk.Coin{}, err + } + // Return the end of the budget + return sdk.Coin{}, fmt.Errorf("budget ended for recipient: %s", recipient.String()) + } + } + + currentTime := sdkCtx.BlockTime() + startTime := budget.StartTime + + // Check if the start time is reached + if currentTime.Before(*startTime) { + return sdk.Coin{}, fmt.Errorf("distribution has not started yet") + } + + if budget.NextClaimFrom == nil || budget.NextClaimFrom.IsZero() { + budget.NextClaimFrom = budget.StartTime + } + + if budget.TranchesLeft == 0 && budget.ClaimedAmount == nil { + budget.TranchesLeft = budget.Tranches + zeroCoin := sdk.NewCoin(budget.TotalBudget.Denom, math.ZeroInt()) + budget.ClaimedAmount = &zeroCoin + } + + return k.calculateClaimableFunds(ctx, recipient, budget, currentTime) +} + +func (k Keeper) calculateClaimableFunds(ctx context.Context, recipient sdk.AccAddress, budget types.Budget, currentTime time.Time) (amount sdk.Coin, err error) { + // Calculate the time elapsed since the last claim time + timeElapsed := currentTime.Sub(*budget.NextClaimFrom) + + // Check the time elapsed has passed period length + if timeElapsed < *budget.Period { + return sdk.Coin{}, fmt.Errorf("budget period has not passed yet") + } + + // Calculate how many periods have passed + periodsPassed := int64(timeElapsed) / int64(*budget.Period) + + // Calculate the amount to distribute for all passed periods + coinsToDistribute := math.NewInt(periodsPassed).Mul(budget.TotalBudget.Amount.QuoRaw(int64(budget.Tranches))) + amount = sdk.NewCoin(budget.TotalBudget.Denom, coinsToDistribute) + + // update the budget's remaining tranches + budget.TranchesLeft -= uint64(periodsPassed) + + // update the ClaimedAmount + claimedAmount := budget.ClaimedAmount.Add(amount) + budget.ClaimedAmount = &claimedAmount + + // Update the last claim time for the budget + nextClaimFrom := budget.NextClaimFrom.Add(*budget.Period) + budget.NextClaimFrom = &nextClaimFrom + + k.Logger(ctx).Debug(fmt.Sprintf("Processing budget for recipient: %s. Amount: %s", budget.RecipientAddress, coinsToDistribute.String())) + + // Save the updated budget in the state + if err := k.BudgetProposal.Set(ctx, recipient, budget); err != nil { + return sdk.Coin{}, fmt.Errorf("error while updating the budget for recipient %s", budget.RecipientAddress) + } + + return amount, nil +} + +func (k Keeper) validateAndUpdateBudgetProposal(ctx context.Context, bp types.MsgSubmitBudgetProposal) (*types.Budget, error) { + if bp.TotalBudget.IsZero() { + return nil, fmt.Errorf("invalid budget proposal: total budget cannot be zero") + } + + if err := validateAmount(sdk.NewCoins(*bp.TotalBudget)); err != nil { + return nil, fmt.Errorf("invalid budget proposal: %w", err) + } + + currentTime := sdk.UnwrapSDKContext(ctx).BlockTime() + if bp.StartTime.IsZero() || bp.StartTime == nil { + bp.StartTime = ¤tTime + } + + // if bp.StartTime < uint64(currentTime) { + if currentTime.After(*bp.StartTime) { + return nil, fmt.Errorf("invalid budget proposal: start time cannot be less than the current block time") + } + + if bp.Tranches == 0 { + return nil, fmt.Errorf("invalid budget proposal: tranches must be greater than zero") + } + + if bp.Period == nil || *bp.Period == 0 { + return nil, fmt.Errorf("invalid budget proposal: period length should be greater than zero") + } + + // Create and return an updated budget proposal + updatedBudget := types.Budget{ + RecipientAddress: bp.RecipientAddress, + TotalBudget: bp.TotalBudget, + StartTime: bp.StartTime, + Tranches: bp.Tranches, + Period: bp.Period, + } + + return &updatedBudget, nil +} diff --git a/x/protocolpool/keeper/keeper_test.go b/x/protocolpool/keeper/keeper_test.go new file mode 100644 index 000000000000..84419a65bc2c --- /dev/null +++ b/x/protocolpool/keeper/keeper_test.go @@ -0,0 +1,71 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/suite" + + "cosmossdk.io/core/header" + storetypes "cosmossdk.io/store/types" + poolkeeper "cosmossdk.io/x/protocolpool/keeper" + pooltestutil "cosmossdk.io/x/protocolpool/testutil" + pooltypes "cosmossdk.io/x/protocolpool/types" + + "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +var poolAcc = authtypes.NewEmptyModuleAccount(pooltypes.ModuleName) + +type KeeperTestSuite struct { + suite.Suite + + ctx sdk.Context + poolKeeper poolkeeper.Keeper + bankKeeper *pooltestutil.MockBankKeeper + msgServer pooltypes.MsgServer +} + +func (s *KeeperTestSuite) SetupTest() { + key := storetypes.NewKVStoreKey(pooltypes.StoreKey) + storeService := runtime.NewKVStoreService(key) + testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) + ctx := testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now()}) + encCfg := moduletestutil.MakeTestEncodingConfig() + + // gomock initializations + ctrl := gomock.NewController(s.T()) + accountKeeper := pooltestutil.NewMockAccountKeeper(ctrl) + accountKeeper.EXPECT().GetModuleAddress(pooltypes.ModuleName).Return(poolAcc.GetAddress()) + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + + bankKeeper := pooltestutil.NewMockBankKeeper(ctrl) + s.bankKeeper = bankKeeper + + poolKeeper := poolkeeper.NewKeeper( + encCfg.Codec, + storeService, + accountKeeper, + bankKeeper, + authtypes.NewModuleAddress(pooltypes.GovModuleName).String(), + ) + s.ctx = ctx + s.poolKeeper = poolKeeper + + pooltypes.RegisterInterfaces(encCfg.InterfaceRegistry) + s.msgServer = poolkeeper.NewMsgServerImpl(poolKeeper) +} + +func (s *KeeperTestSuite) mockSendCoinsFromModuleToAccount(accAddr sdk.AccAddress) { + s.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(s.ctx, pooltypes.ModuleName, accAddr, gomock.Any()).AnyTimes() +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} diff --git a/x/protocolpool/keeper/msg_server.go b/x/protocolpool/keeper/msg_server.go index f297539ea25f..ba5af532e423 100644 --- a/x/protocolpool/keeper/msg_server.go +++ b/x/protocolpool/keeper/msg_server.go @@ -22,6 +22,44 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &MsgServer{Keeper: keeper} } +func (k MsgServer) ClaimBudget(ctx context.Context, msg *types.MsgClaimBudget) (*types.MsgClaimBudgetResponse, error) { + recipient, err := k.Keeper.authKeeper.AddressCodec().StringToBytes(msg.RecipientAddress) + if err != nil { + return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid recipient address: %s", err) + } + + amount, err := k.claimFunds(ctx, recipient) + if err != nil { + return nil, err + } + + return &types.MsgClaimBudgetResponse{Amount: amount}, nil +} + +func (k MsgServer) SubmitBudgetProposal(ctx context.Context, msg *types.MsgSubmitBudgetProposal) (*types.MsgSubmitBudgetProposalResponse, error) { + if err := k.validateAuthority(msg.GetAuthority()); err != nil { + return nil, err + } + + recipient, err := k.Keeper.authKeeper.AddressCodec().StringToBytes(msg.RecipientAddress) + if err != nil { + return nil, err + } + + budgetProposal, err := k.validateAndUpdateBudgetProposal(ctx, *msg) + if err != nil { + return nil, err + } + + // set budget proposal in state + // Note: If two budgets to the same address are created, the budget would be updated with the new budget. + err = k.BudgetProposal.Set(ctx, recipient, *budgetProposal) + if err != nil { + return nil, err + } + return &types.MsgSubmitBudgetProposalResponse{}, nil +} + func (k MsgServer) FundCommunityPool(ctx context.Context, msg *types.MsgFundCommunityPool) (*types.MsgFundCommunityPoolResponse, error) { depositor, err := k.authKeeper.AddressCodec().StringToBytes(msg.Depositor) if err != nil { diff --git a/x/protocolpool/keeper/msg_server_test.go b/x/protocolpool/keeper/msg_server_test.go new file mode 100644 index 000000000000..1f72e2d2c305 --- /dev/null +++ b/x/protocolpool/keeper/msg_server_test.go @@ -0,0 +1,339 @@ +package keeper_test + +import ( + "time" + + "cosmossdk.io/core/header" + "cosmossdk.io/x/protocolpool/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + recipientAddr = sdk.AccAddress([]byte("to1__________________")) + + fooCoin = sdk.NewInt64Coin("foo", 100) + fooCoin2 = sdk.NewInt64Coin("foo", 50) +) + +func (suite *KeeperTestSuite) TestMsgSubmitBudgetProposal() { + invalidCoin := sdk.NewInt64Coin("foo", 0) + startTime := suite.ctx.BlockTime().Add(10 * time.Second) + invalidStartTime := suite.ctx.BlockTime().Add(-15 * time.Second) + period := time.Duration(60) * time.Second + zeroPeriod := time.Duration(0) * time.Second + testCases := map[string]struct { + preRun func() + input *types.MsgSubmitBudgetProposal + expErr bool + expErrMsg string + }{ + "empty recipient address": { + input: &types.MsgSubmitBudgetProposal{ + Authority: suite.poolKeeper.GetAuthority(), + RecipientAddress: "", + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + }, + expErr: true, + expErrMsg: "empty address string is not allowed", + }, + "empty authority": { + input: &types.MsgSubmitBudgetProposal{ + Authority: "", + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + }, + expErr: true, + expErrMsg: "empty address string is not allowed", + }, + "invalid authority": { + input: &types.MsgSubmitBudgetProposal{ + Authority: "invalid_authority", + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + }, + expErr: true, + expErrMsg: "invalid authority", + }, + "invalid budget": { + input: &types.MsgSubmitBudgetProposal{ + Authority: suite.poolKeeper.GetAuthority(), + RecipientAddress: recipientAddr.String(), + TotalBudget: &invalidCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + }, + expErr: true, + expErrMsg: "total budget cannot be zero", + }, + "invalid start time": { + input: &types.MsgSubmitBudgetProposal{ + Authority: suite.poolKeeper.GetAuthority(), + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &invalidStartTime, + Tranches: 2, + Period: &period, + }, + expErr: true, + expErrMsg: "start time cannot be less than the current block time", + }, + "invalid tranches": { + input: &types.MsgSubmitBudgetProposal{ + Authority: suite.poolKeeper.GetAuthority(), + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 0, + Period: &period, + }, + expErr: true, + expErrMsg: "tranches must be greater than zero", + }, + "invalid period": { + input: &types.MsgSubmitBudgetProposal{ + Authority: suite.poolKeeper.GetAuthority(), + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &zeroPeriod, + }, + expErr: true, + expErrMsg: "period length should be greater than zero", + }, + "all good": { + input: &types.MsgSubmitBudgetProposal{ + Authority: suite.poolKeeper.GetAuthority(), + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + }, + expErr: false, + }, + } + + for name, tc := range testCases { + suite.Run(name, func() { + suite.SetupTest() + if tc.preRun != nil { + tc.preRun() + } + _, err := suite.msgServer.SubmitBudgetProposal(suite.ctx, tc.input) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + } + }) + } +} + +func (suite *KeeperTestSuite) TestMsgClaimBudget() { + startTime := suite.ctx.BlockTime().Add(-70 * time.Second) + period := time.Duration(60) * time.Second + + testCases := map[string]struct { + preRun func() + recipientAddress sdk.AccAddress + expErr bool + expErrMsg string + claimableFunds sdk.Coin + }{ + "empty recipient addr": { + recipientAddress: sdk.AccAddress(""), + expErr: true, + expErrMsg: "invalid recipient address: empty address string is not allowed", + }, + "no budget found": { + recipientAddress: sdk.AccAddress([]byte("acc1__________")), + expErr: true, + expErrMsg: "no budget found for recipient", + }, + "claiming before start time": { + preRun: func() { + startTime := suite.ctx.BlockTime().Add(3600 * time.Second) + // Prepare the budget proposal with a future start time + budget := types.Budget{ + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + } + err := suite.poolKeeper.BudgetProposal.Set(suite.ctx, recipientAddr, budget) + suite.Require().NoError(err) + }, + recipientAddress: recipientAddr, + expErr: true, + expErrMsg: "distribution has not started yet", + }, + "budget period has not passed": { + preRun: func() { + startTime := suite.ctx.BlockTime().Add(-50 * time.Second) + // Prepare the budget proposal with start time and a short period + budget := types.Budget{ + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 1, + Period: &period, + } + err := suite.poolKeeper.BudgetProposal.Set(suite.ctx, recipientAddr, budget) + suite.Require().NoError(err) + }, + recipientAddress: recipientAddr, + expErr: true, + expErrMsg: "budget period has not passed yet", + }, + "valid claim": { + preRun: func() { + // Prepare the budget proposal with valid start time and period + budget := types.Budget{ + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + } + err := suite.poolKeeper.BudgetProposal.Set(suite.ctx, recipientAddr, budget) + suite.Require().NoError(err) + }, + recipientAddress: recipientAddr, + expErr: false, + claimableFunds: sdk.NewInt64Coin("foo", 50), + }, + "double claim attempt with budget period not passed": { + preRun: func() { + // Prepare the budget proposal with valid start time and period + budget := types.Budget{ + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + } + err := suite.poolKeeper.BudgetProposal.Set(suite.ctx, recipientAddr, budget) + suite.Require().NoError(err) + + // Claim the funds once + msg := &types.MsgClaimBudget{ + RecipientAddress: recipientAddr.String(), + } + suite.mockSendCoinsFromModuleToAccount(recipientAddr) + _, err = suite.msgServer.ClaimBudget(suite.ctx, msg) + suite.Require().NoError(err) + }, + recipientAddress: recipientAddr, + expErr: true, + expErrMsg: "budget period has not passed yet", + }, + "valid double claim attempt": { + preRun: func() { + oneMonthInSeconds := int64(30 * 24 * 60 * 60) // Approximate number of seconds in 1 month + startTimeBeforeMonth := suite.ctx.BlockTime().Add(time.Duration(-oneMonthInSeconds) * time.Second) + oneMonthPeriod := time.Duration(oneMonthInSeconds) * time.Second + // Prepare the budget proposal with valid start time and period of 1 month (in seconds) + budget := types.Budget{ + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTimeBeforeMonth, + Tranches: 2, + Period: &oneMonthPeriod, + } + err := suite.poolKeeper.BudgetProposal.Set(suite.ctx, recipientAddr, budget) + suite.Require().NoError(err) + + // Claim the funds once + msg := &types.MsgClaimBudget{ + RecipientAddress: recipientAddr.String(), + } + suite.mockSendCoinsFromModuleToAccount(recipientAddr) + _, err = suite.msgServer.ClaimBudget(suite.ctx, msg) + suite.Require().NoError(err) + + // Create a new context with an updated block time to simulate a delay + newBlockTime := suite.ctx.BlockTime().Add(time.Duration(oneMonthInSeconds) * time.Second) + suite.ctx = suite.ctx.WithHeaderInfo(header.Info{ + Time: newBlockTime, + }) + }, + recipientAddress: recipientAddr, + expErr: false, + claimableFunds: sdk.NewInt64Coin("foo", 50), + }, + "budget ended for recipient": { + preRun: func() { + // Prepare the budget proposal with valid start time and period + budget := types.Budget{ + RecipientAddress: recipientAddr.String(), + TotalBudget: &fooCoin, + StartTime: &startTime, + Tranches: 2, + Period: &period, + } + err := suite.poolKeeper.BudgetProposal.Set(suite.ctx, recipientAddr, budget) + suite.Require().NoError(err) + + // Claim the funds once + msg := &types.MsgClaimBudget{ + RecipientAddress: recipientAddr.String(), + } + suite.mockSendCoinsFromModuleToAccount(recipientAddr) + _, err = suite.msgServer.ClaimBudget(suite.ctx, msg) + suite.Require().NoError(err) + + // Create a new context with an updated block time to simulate a delay + newBlockTime := suite.ctx.BlockTime().Add(60 * time.Second) + suite.ctx = suite.ctx.WithHeaderInfo(header.Info{ + Time: newBlockTime, + }) + + // Claim the funds twice + msg = &types.MsgClaimBudget{ + RecipientAddress: recipientAddr.String(), + } + suite.mockSendCoinsFromModuleToAccount(recipientAddr) + _, err = suite.msgServer.ClaimBudget(suite.ctx, msg) + suite.Require().NoError(err) + }, + recipientAddress: recipientAddr, + expErr: true, + expErrMsg: "budget ended for recipient", + }, + } + + for name, tc := range testCases { + suite.Run(name, func() { + suite.SetupTest() + if tc.preRun != nil { + tc.preRun() + } + msg := &types.MsgClaimBudget{ + RecipientAddress: tc.recipientAddress.String(), + } + suite.mockSendCoinsFromModuleToAccount(tc.recipientAddress) + resp, err := suite.msgServer.ClaimBudget(suite.ctx, msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().Equal(tc.claimableFunds, resp.Amount) + } + }) + } +} diff --git a/x/protocolpool/types/codec.go b/x/protocolpool/types/codec.go index b54ccb1ddb00..461d1bbd10af 100644 --- a/x/protocolpool/types/codec.go +++ b/x/protocolpool/types/codec.go @@ -11,6 +11,8 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { (*sdk.Msg)(nil), &MsgFundCommunityPool{}, &MsgCommunityPoolSpend{}, + &MsgSubmitBudgetProposal{}, + &MsgClaimBudget{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/protocolpool/types/keys.go b/x/protocolpool/types/keys.go index 2c63627dc040..e9427489c754 100644 --- a/x/protocolpool/types/keys.go +++ b/x/protocolpool/types/keys.go @@ -1,5 +1,7 @@ package types +import "cosmossdk.io/collections" + const ( // ModuleName is the module name constant used in many places ModuleName = "protocolpool" @@ -13,3 +15,5 @@ const ( // GovModuleName is the name of the gov module GovModuleName = "gov" ) + +var BudgetKey = collections.NewPrefix(2) diff --git a/x/protocolpool/types/query.pb.go b/x/protocolpool/types/query.pb.go index d1fd1bb0c927..a40d29a2f637 100644 --- a/x/protocolpool/types/query.pb.go +++ b/x/protocolpool/types/query.pb.go @@ -6,24 +6,30 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "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" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "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. @@ -116,9 +122,151 @@ func (m *QueryCommunityPoolResponse) GetPool() github_com_cosmos_cosmos_sdk_type return nil } +// QueryUnclaimedBudgetRequest is the request type for the Query/UnclaimedBudgetRequest +// RPC method. +type QueryUnclaimedBudgetRequest struct { + // address is the recipient address to query unclaimed budget amount for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryUnclaimedBudgetRequest) Reset() { *m = QueryUnclaimedBudgetRequest{} } +func (m *QueryUnclaimedBudgetRequest) String() string { return proto.CompactTextString(m) } +func (*QueryUnclaimedBudgetRequest) ProtoMessage() {} +func (*QueryUnclaimedBudgetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51500a0a77d57843, []int{2} +} +func (m *QueryUnclaimedBudgetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUnclaimedBudgetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUnclaimedBudgetRequest.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 *QueryUnclaimedBudgetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUnclaimedBudgetRequest.Merge(m, src) +} +func (m *QueryUnclaimedBudgetRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryUnclaimedBudgetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUnclaimedBudgetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUnclaimedBudgetRequest proto.InternalMessageInfo + +func (m *QueryUnclaimedBudgetRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// QueryUnclaimedBudgetResponse is the response type for the Query/UnclaimedBudget +// RPC method. +type QueryUnclaimedBudgetResponse struct { + // total_budget is the total budget allocated to the recipient + TotalBudget *types.Coin `protobuf:"bytes,1,opt,name=total_budget,json=totalBudget,proto3" json:"total_budget,omitempty"` + // claimed_amount is the budget amount already claimed by the recipient + ClaimedAmount *types.Coin `protobuf:"bytes,2,opt,name=claimed_amount,json=claimedAmount,proto3" json:"claimed_amount,omitempty"` + // unclaimed_amount is the remaining budget amount that is unclaimed by the recipient + UnclaimedAmount *types.Coin `protobuf:"bytes,3,opt,name=unclaimed_amount,json=unclaimedAmount,proto3" json:"unclaimed_amount,omitempty"` + // next_claim_from is the next starting claim time for fund distribution. + // It represents the time when we can claim funds after the period time interval has passed. + NextClaimFrom *time.Time `protobuf:"bytes,4,opt,name=next_claim_from,json=nextClaimFrom,proto3,stdtime" json:"next_claim_from,omitempty"` + // period is the time interval for fund distribution + Period *time.Duration `protobuf:"bytes,5,opt,name=period,proto3,stdduration" json:"period,omitempty"` + // tranches_left is the number of tranches left for the amount to be distributed + TranchesLeft uint64 `protobuf:"varint,6,opt,name=tranches_left,json=tranchesLeft,proto3" json:"tranches_left,omitempty"` +} + +func (m *QueryUnclaimedBudgetResponse) Reset() { *m = QueryUnclaimedBudgetResponse{} } +func (m *QueryUnclaimedBudgetResponse) String() string { return proto.CompactTextString(m) } +func (*QueryUnclaimedBudgetResponse) ProtoMessage() {} +func (*QueryUnclaimedBudgetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51500a0a77d57843, []int{3} +} +func (m *QueryUnclaimedBudgetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUnclaimedBudgetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUnclaimedBudgetResponse.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 *QueryUnclaimedBudgetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUnclaimedBudgetResponse.Merge(m, src) +} +func (m *QueryUnclaimedBudgetResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryUnclaimedBudgetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUnclaimedBudgetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUnclaimedBudgetResponse proto.InternalMessageInfo + +func (m *QueryUnclaimedBudgetResponse) GetTotalBudget() *types.Coin { + if m != nil { + return m.TotalBudget + } + return nil +} + +func (m *QueryUnclaimedBudgetResponse) GetClaimedAmount() *types.Coin { + if m != nil { + return m.ClaimedAmount + } + return nil +} + +func (m *QueryUnclaimedBudgetResponse) GetUnclaimedAmount() *types.Coin { + if m != nil { + return m.UnclaimedAmount + } + return nil +} + +func (m *QueryUnclaimedBudgetResponse) GetNextClaimFrom() *time.Time { + if m != nil { + return m.NextClaimFrom + } + return nil +} + +func (m *QueryUnclaimedBudgetResponse) GetPeriod() *time.Duration { + if m != nil { + return m.Period + } + return nil +} + +func (m *QueryUnclaimedBudgetResponse) GetTranchesLeft() uint64 { + if m != nil { + return m.TranchesLeft + } + return 0 +} + func init() { proto.RegisterType((*QueryCommunityPoolRequest)(nil), "cosmos.protocolpool.v1.QueryCommunityPoolRequest") proto.RegisterType((*QueryCommunityPoolResponse)(nil), "cosmos.protocolpool.v1.QueryCommunityPoolResponse") + proto.RegisterType((*QueryUnclaimedBudgetRequest)(nil), "cosmos.protocolpool.v1.QueryUnclaimedBudgetRequest") + proto.RegisterType((*QueryUnclaimedBudgetResponse)(nil), "cosmos.protocolpool.v1.QueryUnclaimedBudgetResponse") } func init() { @@ -126,28 +274,47 @@ func init() { } var fileDescriptor_51500a0a77d57843 = []byte{ - // 335 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x51, 0x3f, 0x4e, 0xf3, 0x30, - 0x14, 0x8f, 0xbf, 0x0f, 0x18, 0x82, 0x58, 0x22, 0x84, 0x20, 0x54, 0x2e, 0x64, 0x40, 0x95, 0x10, - 0x7e, 0x4a, 0x3b, 0xb2, 0xb5, 0x1c, 0x00, 0x3a, 0xb2, 0xa0, 0x24, 0xb5, 0x82, 0xd5, 0xc4, 0x2f, - 0xad, 0x9d, 0x8a, 0xae, 0x70, 0x01, 0x24, 0xee, 0xc0, 0xc0, 0xc4, 0x31, 0x3a, 0x56, 0x62, 0x61, - 0x02, 0xd4, 0x72, 0x10, 0x94, 0x38, 0x95, 0xa8, 0xd4, 0x0e, 0x4c, 0xb6, 0x7e, 0xef, 0xfd, 0xfe, - 0xd9, 0xb6, 0x17, 0xa1, 0x4a, 0x51, 0x41, 0x36, 0x44, 0x8d, 0x11, 0x26, 0x19, 0x62, 0x02, 0x23, - 0x1f, 0x06, 0x39, 0x1f, 0x8e, 0x59, 0x89, 0x3a, 0x7b, 0x66, 0x87, 0xfd, 0xde, 0x61, 0x23, 0xdf, - 0xdd, 0x8d, 0x31, 0xc6, 0x12, 0x84, 0xe2, 0x66, 0xe6, 0x6e, 0x2d, 0x46, 0x8c, 0x13, 0x0e, 0x41, - 0x26, 0x20, 0x90, 0x12, 0x75, 0xa0, 0x05, 0xca, 0x8a, 0xed, 0xd2, 0xca, 0x2f, 0x0c, 0x14, 0x87, - 0x91, 0x1f, 0x72, 0x1d, 0xf8, 0x10, 0xa1, 0x90, 0x66, 0xee, 0x1d, 0xda, 0x07, 0x57, 0x85, 0x75, - 0x07, 0xd3, 0x34, 0x97, 0x42, 0x8f, 0x2f, 0x11, 0x93, 0x2e, 0x1f, 0xe4, 0x5c, 0x69, 0xef, 0x81, - 0xd8, 0xee, 0xaa, 0xa9, 0xca, 0x50, 0x2a, 0xee, 0x70, 0x7b, 0xa3, 0x88, 0xb6, 0x4f, 0x8e, 0xfe, - 0x37, 0xb6, 0x9b, 0x35, 0x56, 0xc5, 0x2e, 0xac, 0x58, 0x65, 0xc5, 0x2e, 0x78, 0xd4, 0x41, 0x21, - 0xdb, 0xad, 0xc9, 0x47, 0xdd, 0x7a, 0xf9, 0xac, 0x9f, 0xc6, 0x42, 0xdf, 0xe6, 0x21, 0x8b, 0x30, - 0x85, 0x2a, 0x9a, 0x39, 0xce, 0x54, 0xaf, 0x0f, 0x7a, 0x9c, 0x71, 0xb5, 0xe0, 0xa8, 0x6e, 0x29, - 0xdf, 0x7c, 0x25, 0xf6, 0x66, 0x99, 0xc2, 0x79, 0x26, 0xf6, 0xce, 0x52, 0x14, 0xc7, 0x67, 0xab, - 0xdf, 0x8a, 0xad, 0x2d, 0xe5, 0x36, 0xff, 0x42, 0x31, 0x4d, 0x3d, 0x76, 0xff, 0xf6, 0xfd, 0xf4, - 0xaf, 0xe1, 0x9c, 0xc0, 0x9a, 0xef, 0x8b, 0x16, 0xb4, 0x9b, 0x02, 0x69, 0x9f, 0x4f, 0x66, 0x94, - 0x4c, 0x67, 0x94, 0x7c, 0xcd, 0x28, 0x79, 0x9c, 0x53, 0x6b, 0x3a, 0xa7, 0xd6, 0xfb, 0x9c, 0x5a, - 0xd7, 0xc7, 0x46, 0x40, 0xf5, 0xfa, 0x4c, 0x20, 0xdc, 0x2d, 0x0b, 0x95, 0xf5, 0xc3, 0xad, 0x12, - 0x6b, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0x8a, 0xc7, 0xae, 0xa2, 0x2b, 0x02, 0x00, 0x00, + // 630 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x3f, 0x4f, 0x14, 0x41, + 0x18, 0xc6, 0x6f, 0xe1, 0xc0, 0x38, 0x70, 0x62, 0x26, 0xc4, 0x2c, 0x0b, 0xd9, 0xc3, 0x33, 0x31, + 0x97, 0x18, 0x66, 0x72, 0x07, 0x89, 0x89, 0x5a, 0xc8, 0x41, 0x8c, 0x85, 0x85, 0x9c, 0xda, 0xd8, + 0x6c, 0xf6, 0xcf, 0xdc, 0xb2, 0x61, 0x77, 0xde, 0x65, 0x67, 0x96, 0x40, 0x8c, 0x8d, 0xb6, 0x16, + 0x24, 0x36, 0x7e, 0x02, 0x0b, 0x6b, 0x0b, 0x3f, 0x02, 0x25, 0xd1, 0xc6, 0x4a, 0x0c, 0xd8, 0xf9, + 0x25, 0xcc, 0xce, 0xce, 0x2a, 0x5c, 0x0e, 0x09, 0xd5, 0xdd, 0xbe, 0xef, 0xfb, 0xfc, 0xe6, 0x79, + 0x33, 0xcf, 0xa0, 0x96, 0x0f, 0x22, 0x01, 0x41, 0xd3, 0x0c, 0x24, 0xf8, 0x10, 0xa7, 0x00, 0x31, + 0xdd, 0xe9, 0xd0, 0xed, 0x9c, 0x65, 0x7b, 0x44, 0x55, 0xf1, 0x8d, 0x72, 0x86, 0x9c, 0x9e, 0x21, + 0x3b, 0x1d, 0x6b, 0x36, 0x84, 0x10, 0x54, 0x91, 0x16, 0xff, 0xca, 0xbe, 0xb5, 0x10, 0x02, 0x84, + 0x31, 0xa3, 0x6e, 0x1a, 0x51, 0x97, 0x73, 0x90, 0xae, 0x8c, 0x80, 0x6b, 0xb5, 0x65, 0xeb, 0xf3, + 0x3c, 0x57, 0x30, 0xba, 0xd3, 0xf1, 0x98, 0x74, 0x3b, 0xd4, 0x87, 0x88, 0xeb, 0xfe, 0x5c, 0xd9, + 0x77, 0x4a, 0xec, 0xe9, 0x83, 0xad, 0xa6, 0x06, 0xab, 0x2f, 0x2f, 0x1f, 0x50, 0x19, 0x25, 0x4c, + 0x48, 0x37, 0x49, 0x2b, 0xf6, 0xf0, 0x40, 0x90, 0x67, 0xea, 0xf0, 0xb2, 0xdf, 0x9a, 0x47, 0x73, + 0x1b, 0xc5, 0x5a, 0x6b, 0x90, 0x24, 0x39, 0x8f, 0xe4, 0xde, 0x53, 0x80, 0xb8, 0xcf, 0xb6, 0x73, + 0x26, 0x64, 0xeb, 0xad, 0x81, 0xac, 0x51, 0x5d, 0x91, 0x02, 0x17, 0x0c, 0x33, 0x54, 0x2f, 0xd6, + 0x36, 0x8d, 0xc5, 0xf1, 0xf6, 0x54, 0x77, 0x81, 0x68, 0x67, 0xc5, 0x1a, 0x44, 0xaf, 0x41, 0xd6, + 0x99, 0xbf, 0x06, 0x11, 0xef, 0x2d, 0x1f, 0xfc, 0x68, 0xd6, 0x3e, 0x1d, 0x35, 0xef, 0x84, 0x91, + 0xdc, 0xcc, 0x3d, 0xe2, 0x43, 0xa2, 0x37, 0xd1, 0x3f, 0x4b, 0x22, 0xd8, 0xa2, 0x72, 0x2f, 0x65, + 0xa2, 0xd2, 0x88, 0xbe, 0xc2, 0xb7, 0x36, 0xd0, 0xbc, 0x32, 0xf1, 0x82, 0xfb, 0xb1, 0x1b, 0x25, + 0x2c, 0xe8, 0xe5, 0x41, 0xc8, 0xa4, 0x36, 0x89, 0xbb, 0xe8, 0x8a, 0x1b, 0x04, 0x19, 0x13, 0xc2, + 0x34, 0x16, 0x8d, 0xf6, 0xd5, 0x9e, 0xf9, 0xf5, 0xf3, 0xd2, 0xac, 0xf6, 0xb2, 0x5a, 0x76, 0x9e, + 0xc9, 0x2c, 0xe2, 0x61, 0xbf, 0x1a, 0x6c, 0xbd, 0x1b, 0x47, 0x0b, 0xa3, 0x99, 0x7a, 0xb5, 0x07, + 0x68, 0x5a, 0x82, 0x74, 0x63, 0xc7, 0x53, 0x75, 0x45, 0x9e, 0xea, 0xce, 0x8d, 0x5c, 0xb1, 0xf0, + 0xda, 0x9f, 0x52, 0xe3, 0x25, 0x05, 0x3f, 0x44, 0xd7, 0x34, 0xd6, 0x71, 0x13, 0xc8, 0xb9, 0x34, + 0xc7, 0x2e, 0xd2, 0x37, 0xb4, 0x60, 0x55, 0xcd, 0xe3, 0x75, 0x74, 0x3d, 0xe7, 0x43, 0x8c, 0xf1, + 0x8b, 0x18, 0x33, 0x7f, 0x25, 0x9a, 0xf2, 0x18, 0xcd, 0x70, 0xb6, 0x2b, 0x1d, 0x55, 0x75, 0x06, + 0x19, 0x24, 0x66, 0x5d, 0x41, 0x2c, 0x52, 0xc6, 0x82, 0x54, 0xb1, 0x20, 0xcf, 0xab, 0xdc, 0xf4, + 0xea, 0xfb, 0x47, 0x4d, 0xa3, 0xdf, 0x28, 0x84, 0x6b, 0x85, 0xee, 0x51, 0x06, 0x09, 0xbe, 0x8b, + 0x26, 0x53, 0x96, 0x45, 0x10, 0x98, 0x13, 0xda, 0xc5, 0x30, 0x60, 0x5d, 0xe7, 0xaa, 0x57, 0xff, + 0x50, 0xe8, 0xf5, 0x38, 0xbe, 0x85, 0x1a, 0x32, 0x73, 0xb9, 0xbf, 0xc9, 0x84, 0x13, 0xb3, 0x81, + 0x34, 0x27, 0x17, 0x8d, 0x76, 0xbd, 0x3f, 0x5d, 0x15, 0x9f, 0xb0, 0x81, 0xec, 0xfe, 0x1e, 0x43, + 0x13, 0xea, 0x3a, 0xf0, 0x47, 0x03, 0x35, 0xce, 0x84, 0x0d, 0x77, 0xc8, 0xe8, 0x97, 0x46, 0xce, + 0x8d, 0xad, 0xd5, 0xbd, 0x8c, 0xa4, 0xbc, 0xf0, 0x16, 0x79, 0xf3, 0xed, 0xd7, 0xfb, 0xb1, 0x36, + 0xbe, 0x4d, 0xcf, 0x79, 0xfc, 0x7e, 0x25, 0x73, 0x8a, 0x0a, 0xfe, 0x62, 0xa0, 0x99, 0xa1, 0xf0, + 0xe0, 0xe5, 0xff, 0x9e, 0x3b, 0x3a, 0xbe, 0xd6, 0xca, 0xe5, 0x44, 0xda, 0xee, 0x3d, 0x65, 0x77, + 0x05, 0x77, 0xcf, 0xb3, 0xfb, 0x2f, 0x3d, 0x65, 0x82, 0xe9, 0x2b, 0x9d, 0xfd, 0xd7, 0xbd, 0xfb, + 0x07, 0xc7, 0xb6, 0x71, 0x78, 0x6c, 0x1b, 0x3f, 0x8f, 0x6d, 0x63, 0xff, 0xc4, 0xae, 0x1d, 0x9e, + 0xd8, 0xb5, 0xef, 0x27, 0x76, 0xed, 0xe5, 0xcd, 0x12, 0x26, 0x82, 0x2d, 0x12, 0x01, 0xdd, 0x3d, + 0x0b, 0x55, 0x6f, 0xd3, 0x9b, 0x54, 0xb5, 0xe5, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5a, 0xe5, + 0xc6, 0x53, 0x24, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -164,6 +331,8 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // CommunityPool queries the community pool coins. CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) + // UnclaimedBudget queries the remaining budget left to be claimed and it gives overall budget allocation view. + UnclaimedBudget(ctx context.Context, in *QueryUnclaimedBudgetRequest, opts ...grpc.CallOption) (*QueryUnclaimedBudgetResponse, error) } type queryClient struct { @@ -183,10 +352,21 @@ func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolR return out, nil } +func (c *queryClient) UnclaimedBudget(ctx context.Context, in *QueryUnclaimedBudgetRequest, opts ...grpc.CallOption) (*QueryUnclaimedBudgetResponse, error) { + out := new(QueryUnclaimedBudgetResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Query/UnclaimedBudget", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // CommunityPool queries the community pool coins. CommunityPool(context.Context, *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) + // UnclaimedBudget queries the remaining budget left to be claimed and it gives overall budget allocation view. + UnclaimedBudget(context.Context, *QueryUnclaimedBudgetRequest) (*QueryUnclaimedBudgetResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -196,6 +376,9 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) CommunityPool(ctx context.Context, req *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CommunityPool not implemented") } +func (*UnimplementedQueryServer) UnclaimedBudget(ctx context.Context, req *QueryUnclaimedBudgetRequest) (*QueryUnclaimedBudgetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnclaimedBudget not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -219,6 +402,24 @@ func _Query_CommunityPool_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Query_UnclaimedBudget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryUnclaimedBudgetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).UnclaimedBudget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Query/UnclaimedBudget", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).UnclaimedBudget(ctx, req.(*QueryUnclaimedBudgetRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.protocolpool.v1.Query", HandlerType: (*QueryServer)(nil), @@ -227,6 +428,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "CommunityPool", Handler: _Query_CommunityPool_Handler, }, + { + MethodName: "UnclaimedBudget", + Handler: _Query_UnclaimedBudget_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/protocolpool/v1/query.proto", @@ -292,6 +497,120 @@ func (m *QueryCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *QueryUnclaimedBudgetRequest) 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 *QueryUnclaimedBudgetRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryUnclaimedBudgetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryUnclaimedBudgetResponse) 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 *QueryUnclaimedBudgetResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryUnclaimedBudgetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TranchesLeft != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TranchesLeft)) + i-- + dAtA[i] = 0x30 + } + if m.Period != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.Period, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.Period):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintQuery(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x2a + } + if m.NextClaimFrom != nil { + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.NextClaimFrom, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.NextClaimFrom):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintQuery(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x22 + } + if m.UnclaimedAmount != nil { + { + size, err := m.UnclaimedAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.ClaimedAmount != nil { + { + size, err := m.ClaimedAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.TotalBudget != nil { + { + size, err := m.TotalBudget.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -327,6 +646,51 @@ func (m *QueryCommunityPoolResponse) Size() (n int) { return n } +func (m *QueryUnclaimedBudgetRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryUnclaimedBudgetResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TotalBudget != nil { + l = m.TotalBudget.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.ClaimedAmount != nil { + l = m.ClaimedAmount.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.UnclaimedAmount != nil { + l = m.UnclaimedAmount.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.NextClaimFrom != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.NextClaimFrom) + n += 1 + l + sovQuery(uint64(l)) + } + if m.Period != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.Period) + n += 1 + l + sovQuery(uint64(l)) + } + if m.TranchesLeft != 0 { + n += 1 + sovQuery(uint64(m.TranchesLeft)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -467,6 +831,337 @@ func (m *QueryCommunityPoolResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryUnclaimedBudgetRequest) 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 ErrIntOverflowQuery + } + 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: QueryUnclaimedBudgetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryUnclaimedBudgetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryUnclaimedBudgetResponse) 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 ErrIntOverflowQuery + } + 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: QueryUnclaimedBudgetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryUnclaimedBudgetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalBudget", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TotalBudget == nil { + m.TotalBudget = &types.Coin{} + } + if err := m.TotalBudget.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClaimedAmount == nil { + m.ClaimedAmount = &types.Coin{} + } + if err := m.ClaimedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnclaimedAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UnclaimedAmount == nil { + m.UnclaimedAmount = &types.Coin{} + } + if err := m.UnclaimedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextClaimFrom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NextClaimFrom == nil { + m.NextClaimFrom = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.NextClaimFrom, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Period == nil { + m.Period = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.Period, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TranchesLeft", wireType) + } + m.TranchesLeft = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TranchesLeft |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/protocolpool/types/query.pb.gw.go b/x/protocolpool/types/query.pb.gw.go index 589b60aa8b40..a107cd3de92e 100644 --- a/x/protocolpool/types/query.pb.gw.go +++ b/x/protocolpool/types/query.pb.gw.go @@ -51,6 +51,60 @@ func local_request_Query_CommunityPool_0(ctx context.Context, marshaler runtime. } +func request_Query_UnclaimedBudget_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUnclaimedBudgetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := client.UnclaimedBudget(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_UnclaimedBudget_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryUnclaimedBudgetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := server.UnclaimedBudget(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -80,6 +134,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_UnclaimedBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_UnclaimedBudget_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_UnclaimedBudget_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -141,13 +218,37 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_UnclaimedBudget_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_UnclaimedBudget_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_UnclaimedBudget_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_Query_CommunityPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "protocolpool", "v1", "community_pool"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_UnclaimedBudget_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "protocolpool", "v1", "unclaimed_budget", "address"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_CommunityPool_0 = runtime.ForwardResponseMessage + + forward_Query_UnclaimedBudget_0 = runtime.ForwardResponseMessage ) diff --git a/x/protocolpool/types/tx.pb.go b/x/protocolpool/types/tx.pb.go index 732288ead31c..6359f599cd0a 100644 --- a/x/protocolpool/types/tx.pb.go +++ b/x/protocolpool/types/tx.pb.go @@ -13,18 +13,23 @@ 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" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "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. @@ -112,8 +117,6 @@ var xxx_messageInfo_MsgFundCommunityPoolResponse proto.InternalMessageInfo // MsgCommunityPoolSpend defines a message for sending tokens from the community // pool to another account. This message is typically executed via a governance // proposal with the governance module being the executing authority. -// -// Since: cosmos-sdk 0.50 type MsgCommunityPoolSpend struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` @@ -177,8 +180,6 @@ func (m *MsgCommunityPoolSpend) GetAmount() github_com_cosmos_cosmos_sdk_types.C // MsgCommunityPoolSpendResponse defines the response to executing a // MsgCommunityPoolSpend message. -// -// Since: cosmos-sdk 0.50 type MsgCommunityPoolSpendResponse struct { } @@ -215,47 +216,290 @@ func (m *MsgCommunityPoolSpendResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCommunityPoolSpendResponse proto.InternalMessageInfo +// MsgSubmitBudgetProposal defines budget proposal type. +type MsgSubmitBudgetProposal struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // recipient_address is the address of the recipient who can claim the budget. + RecipientAddress string `protobuf:"bytes,2,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + // total_budget is the total amount allocated for the budget. + TotalBudget *types.Coin `protobuf:"bytes,3,opt,name=total_budget,json=totalBudget,proto3" json:"total_budget,omitempty"` + // start_time is the time when the budget becomes claimable. + // If start_time is less than the current block time, proposal will not be accepted. + StartTime *time.Time `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time,omitempty"` + // tranches is the number of times the total budget amount is to be distributed. + Tranches uint64 `protobuf:"varint,5,opt,name=tranches,proto3" json:"tranches,omitempty"` + // Period is the time interval(number of seconds) at which funds distribution should be performed. + // For example, if a period is set to 3600, it represents an action that + // should occur every hour (3600 seconds). + Period *time.Duration `protobuf:"bytes,6,opt,name=period,proto3,stdduration" json:"period,omitempty"` +} + +func (m *MsgSubmitBudgetProposal) Reset() { *m = MsgSubmitBudgetProposal{} } +func (m *MsgSubmitBudgetProposal) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitBudgetProposal) ProtoMessage() {} +func (*MsgSubmitBudgetProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{4} +} +func (m *MsgSubmitBudgetProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitBudgetProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitBudgetProposal.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 *MsgSubmitBudgetProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitBudgetProposal.Merge(m, src) +} +func (m *MsgSubmitBudgetProposal) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitBudgetProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitBudgetProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitBudgetProposal proto.InternalMessageInfo + +func (m *MsgSubmitBudgetProposal) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgSubmitBudgetProposal) GetRecipientAddress() string { + if m != nil { + return m.RecipientAddress + } + return "" +} + +func (m *MsgSubmitBudgetProposal) GetTotalBudget() *types.Coin { + if m != nil { + return m.TotalBudget + } + return nil +} + +func (m *MsgSubmitBudgetProposal) GetStartTime() *time.Time { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *MsgSubmitBudgetProposal) GetTranches() uint64 { + if m != nil { + return m.Tranches + } + return 0 +} + +func (m *MsgSubmitBudgetProposal) GetPeriod() *time.Duration { + if m != nil { + return m.Period + } + return nil +} + +// MsgSubmitBudgetProposalResponse defines the response to executing a +// MsgSubmitBudgetProposal message. +type MsgSubmitBudgetProposalResponse struct { +} + +func (m *MsgSubmitBudgetProposalResponse) Reset() { *m = MsgSubmitBudgetProposalResponse{} } +func (m *MsgSubmitBudgetProposalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitBudgetProposalResponse) ProtoMessage() {} +func (*MsgSubmitBudgetProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{5} +} +func (m *MsgSubmitBudgetProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitBudgetProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitBudgetProposalResponse.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 *MsgSubmitBudgetProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitBudgetProposalResponse.Merge(m, src) +} +func (m *MsgSubmitBudgetProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitBudgetProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitBudgetProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitBudgetProposalResponse proto.InternalMessageInfo + +// MsgClaimBudget defines a message for claiming the distributed budget. +type MsgClaimBudget struct { + RecipientAddress string `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` +} + +func (m *MsgClaimBudget) Reset() { *m = MsgClaimBudget{} } +func (m *MsgClaimBudget) String() string { return proto.CompactTextString(m) } +func (*MsgClaimBudget) ProtoMessage() {} +func (*MsgClaimBudget) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{6} +} +func (m *MsgClaimBudget) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimBudget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClaimBudget.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 *MsgClaimBudget) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimBudget.Merge(m, src) +} +func (m *MsgClaimBudget) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimBudget) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimBudget.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimBudget proto.InternalMessageInfo + +func (m *MsgClaimBudget) GetRecipientAddress() string { + if m != nil { + return m.RecipientAddress + } + return "" +} + +// MsgClaimBudgetResponse defines the response to executing a +// MsgClaimBudget message. +type MsgClaimBudgetResponse struct { + Amount types.Coin `protobuf:"bytes,1,opt,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` +} + +func (m *MsgClaimBudgetResponse) Reset() { *m = MsgClaimBudgetResponse{} } +func (m *MsgClaimBudgetResponse) String() string { return proto.CompactTextString(m) } +func (*MsgClaimBudgetResponse) ProtoMessage() {} +func (*MsgClaimBudgetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{7} +} +func (m *MsgClaimBudgetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimBudgetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClaimBudgetResponse.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 *MsgClaimBudgetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimBudgetResponse.Merge(m, src) +} +func (m *MsgClaimBudgetResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimBudgetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimBudgetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimBudgetResponse proto.InternalMessageInfo + +func (m *MsgClaimBudgetResponse) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + func init() { proto.RegisterType((*MsgFundCommunityPool)(nil), "cosmos.protocolpool.v1.MsgFundCommunityPool") proto.RegisterType((*MsgFundCommunityPoolResponse)(nil), "cosmos.protocolpool.v1.MsgFundCommunityPoolResponse") proto.RegisterType((*MsgCommunityPoolSpend)(nil), "cosmos.protocolpool.v1.MsgCommunityPoolSpend") proto.RegisterType((*MsgCommunityPoolSpendResponse)(nil), "cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse") + proto.RegisterType((*MsgSubmitBudgetProposal)(nil), "cosmos.protocolpool.v1.MsgSubmitBudgetProposal") + proto.RegisterType((*MsgSubmitBudgetProposalResponse)(nil), "cosmos.protocolpool.v1.MsgSubmitBudgetProposalResponse") + proto.RegisterType((*MsgClaimBudget)(nil), "cosmos.protocolpool.v1.MsgClaimBudget") + proto.RegisterType((*MsgClaimBudgetResponse)(nil), "cosmos.protocolpool.v1.MsgClaimBudgetResponse") } func init() { proto.RegisterFile("cosmos/protocolpool/v1/tx.proto", fileDescriptor_09efe14517e7f6dc) } var fileDescriptor_09efe14517e7f6dc = []byte{ - // 466 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xbf, 0x6f, 0xd3, 0x40, - 0x18, 0xf5, 0x35, 0xa2, 0x52, 0x0e, 0x09, 0x09, 0x2b, 0x94, 0xd4, 0x2a, 0x76, 0xc9, 0x14, 0x55, - 0xe4, 0x8e, 0x94, 0x1f, 0x43, 0x99, 0x48, 0x25, 0xb6, 0x48, 0x28, 0xdd, 0x58, 0x50, 0x62, 0x9f, - 0xae, 0xa7, 0xc6, 0xf7, 0x59, 0xfe, 0xce, 0xa1, 0x61, 0x02, 0x26, 0x46, 0xfe, 0x84, 0xce, 0x4c, - 0x1d, 0xf8, 0x23, 0x2a, 0xb1, 0x54, 0x4c, 0x4c, 0x80, 0x92, 0xa1, 0xfc, 0x19, 0x28, 0xf6, 0xa5, - 0x49, 0x55, 0x0b, 0x94, 0x81, 0xc9, 0xd6, 0xf7, 0xde, 0xbd, 0xf7, 0xbe, 0x77, 0x36, 0x0d, 0x42, - 0xc0, 0x18, 0x90, 0x27, 0x29, 0x18, 0x08, 0x61, 0x98, 0x00, 0x0c, 0xf9, 0xa8, 0xcd, 0xcd, 0x31, - 0xcb, 0x47, 0xee, 0x46, 0x41, 0x60, 0xcb, 0x04, 0x36, 0x6a, 0x7b, 0x35, 0x09, 0x12, 0xf2, 0x21, - 0x9f, 0xbd, 0x15, 0xb8, 0xe7, 0x5b, 0xb9, 0x41, 0x1f, 0x05, 0x1f, 0xb5, 0x07, 0xc2, 0xf4, 0xdb, - 0x3c, 0x04, 0xa5, 0x2d, 0xbe, 0x59, 0xe0, 0xaf, 0x8b, 0x83, 0xcb, 0xd2, 0xde, 0x5d, 0x7b, 0x34, - 0x46, 0x39, 0x0b, 0x10, 0xa3, 0x2c, 0x80, 0xc6, 0x57, 0x42, 0x6b, 0x5d, 0x94, 0x2f, 0x32, 0x1d, - 0xed, 0x43, 0x1c, 0x67, 0x5a, 0x99, 0xf1, 0x4b, 0x80, 0xa1, 0x1b, 0xd2, 0xf5, 0x7e, 0x0c, 0x99, - 0x36, 0x75, 0xb2, 0x5d, 0x69, 0xde, 0xdc, 0xdd, 0x64, 0x56, 0x70, 0xe6, 0xce, 0xac, 0x3b, 0xdb, - 0x07, 0xa5, 0x3b, 0x0f, 0xcf, 0x7e, 0x04, 0xce, 0xe7, 0x9f, 0x41, 0x53, 0x2a, 0x73, 0x98, 0x0d, - 0x58, 0x08, 0xb1, 0x75, 0xb7, 0x8f, 0x16, 0x46, 0x47, 0xdc, 0x8c, 0x13, 0x81, 0xf9, 0x01, 0xec, - 0x59, 0x69, 0xf7, 0x29, 0xad, 0x46, 0x22, 0x01, 0x54, 0x06, 0xd2, 0xfa, 0xda, 0x36, 0x69, 0x56, - 0x3b, 0xf5, 0x6f, 0x5f, 0x5a, 0x35, 0x6b, 0xf5, 0x3c, 0x8a, 0x52, 0x81, 0x78, 0x60, 0x52, 0xa5, - 0x65, 0x6f, 0x41, 0xdd, 0xdb, 0xf8, 0x78, 0x12, 0x38, 0xbf, 0x4f, 0x02, 0xe7, 0xc3, 0xc5, 0xe9, - 0xce, 0x62, 0xde, 0xf0, 0xe9, 0x56, 0xd9, 0x32, 0x3d, 0x81, 0x09, 0x68, 0x14, 0x8d, 0x09, 0xa1, - 0x77, 0xba, 0x28, 0xaf, 0x80, 0x07, 0x89, 0xd0, 0xd1, 0x2c, 0x49, 0x3f, 0x33, 0x87, 0x90, 0x2a, - 0x33, 0xae, 0x93, 0x7f, 0x25, 0xb9, 0xa4, 0xba, 0x5b, 0xb4, 0x9a, 0x8a, 0x50, 0x25, 0x4a, 0x68, - 0x53, 0x6c, 0xd0, 0x5b, 0x0c, 0x96, 0x4a, 0xac, 0xfc, 0xb7, 0x12, 0xf7, 0x6e, 0xe5, 0x25, 0x5c, - 0x46, 0x6a, 0x04, 0xf4, 0x5e, 0xe9, 0x8e, 0xf3, 0x16, 0x76, 0xdf, 0xaf, 0xd1, 0x4a, 0x17, 0xa5, - 0xfb, 0x86, 0xde, 0xbe, 0x7e, 0xef, 0x0f, 0x58, 0xf9, 0x37, 0xc9, 0xca, 0x8a, 0xf5, 0x1e, 0xaf, - 0xc2, 0x9e, 0x07, 0x70, 0xdf, 0x52, 0xb7, 0xe4, 0x0a, 0x5a, 0x7f, 0xd1, 0xba, 0x4e, 0xf7, 0x9e, - 0xac, 0x44, 0x9f, 0x7b, 0x7b, 0x37, 0xde, 0x5d, 0x9c, 0xee, 0x90, 0xce, 0xb3, 0xb3, 0x89, 0x4f, - 0xce, 0x27, 0x3e, 0xf9, 0x35, 0xf1, 0xc9, 0xa7, 0xa9, 0xef, 0x9c, 0x4f, 0x7d, 0xe7, 0xfb, 0xd4, - 0x77, 0x5e, 0xdd, 0x2f, 0x64, 0x31, 0x3a, 0x62, 0x0a, 0xf8, 0xf1, 0xd5, 0x9f, 0x37, 0xef, 0x7f, - 0xb0, 0x9e, 0xcf, 0x1e, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x54, 0x0b, 0xeb, 0xe0, 0x03, - 0x00, 0x00, + // 721 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x4f, 0xdb, 0x48, + 0x14, 0xce, 0x90, 0x10, 0x6d, 0x86, 0x15, 0x5a, 0xac, 0x6c, 0x30, 0x16, 0x6b, 0x87, 0x1c, 0x56, + 0x11, 0x5a, 0xec, 0x0d, 0xfb, 0x03, 0x89, 0x56, 0xaa, 0x1a, 0xda, 0xde, 0x22, 0xa1, 0xd0, 0x53, + 0x2f, 0x91, 0x13, 0x4f, 0xcd, 0x88, 0xd8, 0xcf, 0xf2, 0x8c, 0x29, 0x54, 0xaa, 0x84, 0x7a, 0xea, + 0x91, 0x63, 0x8f, 0x9c, 0x7b, 0xe2, 0xd0, 0x3f, 0x02, 0xa9, 0x17, 0xd4, 0x53, 0x4f, 0xa5, 0x0a, + 0x07, 0x2a, 0xf5, 0x5f, 0xe8, 0xa1, 0xb2, 0x3d, 0x71, 0x12, 0xe2, 0x86, 0xa6, 0x12, 0xa7, 0x24, + 0xef, 0x7d, 0xef, 0x7b, 0xdf, 0xfb, 0x66, 0xde, 0x04, 0x6b, 0x1d, 0x60, 0x0e, 0x30, 0xc3, 0xf3, + 0x81, 0x43, 0x07, 0xba, 0x1e, 0x40, 0xd7, 0xd8, 0xaf, 0x19, 0xfc, 0x40, 0x8f, 0x42, 0x52, 0x29, + 0x06, 0xe8, 0xc3, 0x00, 0x7d, 0xbf, 0xa6, 0x14, 0x6d, 0xb0, 0x21, 0x0a, 0x1a, 0xe1, 0xb7, 0x38, + 0xaf, 0xa8, 0x82, 0xae, 0x6d, 0x32, 0x62, 0xec, 0xd7, 0xda, 0x84, 0x9b, 0x35, 0xa3, 0x03, 0xd4, + 0x15, 0xf9, 0xa5, 0x38, 0xdf, 0x8a, 0x0b, 0x87, 0xa9, 0x95, 0x45, 0x51, 0xea, 0x30, 0x3b, 0x14, + 0xe0, 0x30, 0x5b, 0x24, 0x34, 0x1b, 0xc0, 0xee, 0x92, 0x58, 0x62, 0x3b, 0x78, 0x6a, 0x70, 0xea, + 0x10, 0xc6, 0x4d, 0xc7, 0xeb, 0x37, 0xbd, 0x0e, 0xb0, 0x02, 0xdf, 0xe4, 0x14, 0x44, 0xd3, 0xca, + 0x3b, 0x84, 0x8b, 0x0d, 0x66, 0x3f, 0x0a, 0x5c, 0x6b, 0x0b, 0x1c, 0x27, 0x70, 0x29, 0x3f, 0xdc, + 0x06, 0xe8, 0x4a, 0x1d, 0x9c, 0x37, 0x1d, 0x08, 0x5c, 0x2e, 0xa3, 0x72, 0xb6, 0x3a, 0xb7, 0xbe, + 0xa4, 0x0b, 0x45, 0xa1, 0x7c, 0x5d, 0xc8, 0xd7, 0xb7, 0x80, 0xba, 0xf5, 0xbf, 0xcf, 0x3e, 0x6a, + 0x99, 0x37, 0x17, 0x5a, 0xd5, 0xa6, 0x7c, 0x37, 0x68, 0xeb, 0x1d, 0x70, 0x84, 0x7c, 0xf1, 0xb1, + 0xc6, 0xac, 0x3d, 0x83, 0x1f, 0x7a, 0x84, 0x45, 0x05, 0xac, 0x29, 0xa8, 0xa5, 0xff, 0x71, 0xc1, + 0x22, 0x1e, 0x30, 0xca, 0xc1, 0x97, 0x67, 0xca, 0xa8, 0x5a, 0xa8, 0xcb, 0xef, 0xdf, 0xae, 0x15, + 0x45, 0xab, 0xfb, 0x96, 0xe5, 0x13, 0xc6, 0x76, 0xb8, 0x4f, 0x5d, 0xbb, 0x39, 0x80, 0x6e, 0x96, + 0x5e, 0x9d, 0x68, 0x99, 0xcf, 0x27, 0x5a, 0xe6, 0xe5, 0xd5, 0xe9, 0xea, 0x20, 0x5e, 0x51, 0xf1, + 0x72, 0xda, 0x30, 0x4d, 0xc2, 0x3c, 0x70, 0x19, 0xa9, 0xf4, 0x10, 0xfe, 0xbd, 0xc1, 0xec, 0x91, + 0xe4, 0x8e, 0x47, 0x5c, 0x2b, 0x54, 0x62, 0x06, 0x7c, 0x17, 0x7c, 0xca, 0x0f, 0x65, 0x74, 0x93, + 0x92, 0x04, 0x2a, 0x2d, 0xe3, 0x82, 0x4f, 0x3a, 0xd4, 0xa3, 0xc4, 0xe5, 0xf1, 0x04, 0xcd, 0x41, + 0x60, 0xc8, 0xc4, 0xec, 0xad, 0x99, 0xb8, 0x39, 0x1f, 0x99, 0x90, 0x48, 0xaa, 0x68, 0xf8, 0x8f, + 0xd4, 0x19, 0x13, 0x17, 0xbe, 0xce, 0xe0, 0xc5, 0x06, 0xb3, 0x77, 0x82, 0xb6, 0x43, 0x79, 0x3d, + 0xb0, 0x6c, 0xc2, 0xb7, 0x7d, 0xf0, 0x80, 0x99, 0xdd, 0x9f, 0xf6, 0xe1, 0x21, 0x5e, 0x48, 0xc6, + 0x6e, 0x99, 0x31, 0xea, 0xc6, 0x13, 0xfd, 0x2d, 0x29, 0x11, 0x71, 0xe9, 0x2e, 0xfe, 0x95, 0x03, + 0x37, 0xbb, 0xad, 0x76, 0x24, 0x4b, 0xce, 0x96, 0xd1, 0x44, 0xdb, 0x9a, 0x73, 0x11, 0x3c, 0x1e, + 0x42, 0xba, 0x87, 0x31, 0xe3, 0xa6, 0xcf, 0x5b, 0xe1, 0x16, 0xc8, 0xb9, 0xa8, 0x56, 0xd1, 0xe3, + 0x0d, 0xd0, 0xfb, 0x1b, 0xa0, 0x3f, 0xee, 0xaf, 0x48, 0x3d, 0x77, 0x7c, 0xa1, 0xa1, 0x66, 0x21, + 0xaa, 0x09, 0xa3, 0x92, 0x82, 0x7f, 0xe1, 0xbe, 0xe9, 0x76, 0x76, 0x09, 0x93, 0x67, 0xcb, 0xa8, + 0x9a, 0x6b, 0x26, 0xbf, 0xa5, 0x0d, 0x9c, 0xf7, 0x88, 0x4f, 0xc1, 0x92, 0xf3, 0x42, 0xd4, 0x75, + 0xe2, 0x07, 0x62, 0xb5, 0xea, 0xb9, 0xd7, 0x21, 0xaf, 0x80, 0x8f, 0x9d, 0xcf, 0x0a, 0xd6, 0xbe, + 0xe3, 0x7e, 0x72, 0x42, 0x80, 0xe7, 0xc3, 0x23, 0xec, 0x9a, 0xd4, 0x11, 0xa3, 0xa5, 0xfa, 0x8b, + 0xa6, 0xf5, 0x77, 0xb3, 0x14, 0x6a, 0x19, 0x67, 0xaa, 0xbc, 0xc0, 0xa5, 0xd1, 0x86, 0x7d, 0x29, + 0x23, 0xef, 0x00, 0xba, 0xa5, 0x2b, 0xbc, 0xfe, 0x25, 0x8b, 0xb3, 0x0d, 0x66, 0x4b, 0xcf, 0xf0, + 0xc2, 0xf8, 0x4b, 0xf4, 0x97, 0x9e, 0xfe, 0xcc, 0xea, 0x69, 0xab, 0xae, 0xfc, 0x3b, 0x0d, 0x3a, + 0x99, 0xf2, 0x39, 0x96, 0x52, 0x1e, 0x85, 0xb5, 0x09, 0x5c, 0xe3, 0x70, 0xe5, 0xbf, 0xa9, 0xe0, + 0x49, 0xef, 0x23, 0x84, 0x8b, 0xa9, 0xbb, 0x68, 0x4c, 0xe0, 0x4b, 0x2b, 0x50, 0x36, 0xa6, 0x2c, + 0x48, 0x24, 0x10, 0x3c, 0x37, 0x7c, 0xd9, 0xfe, 0x9c, 0x34, 0xc8, 0x00, 0xa7, 0xe8, 0x3f, 0x86, + 0xeb, 0xb7, 0x51, 0x66, 0x8f, 0xae, 0x4e, 0x57, 0x51, 0xfd, 0xce, 0x59, 0x4f, 0x45, 0xe7, 0x3d, + 0x15, 0x7d, 0xea, 0xa9, 0xe8, 0xf8, 0x52, 0xcd, 0x9c, 0x5f, 0xaa, 0x99, 0x0f, 0x97, 0x6a, 0xe6, + 0xc9, 0x4a, 0xcc, 0xc7, 0xac, 0x3d, 0x9d, 0x82, 0x71, 0x30, 0xfa, 0xcf, 0x1b, 0x5d, 0x9c, 0x76, + 0x3e, 0x8a, 0xfd, 0xf3, 0x2d, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x57, 0x45, 0x9e, 0x9d, 0x07, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -272,16 +516,16 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // FundCommunityPool defines a method to allow an account to directly // fund the community pool. - // - // Since: cosmos-sdk 0.50 FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) // CommunityPoolSpend defines a governance operation for sending tokens from // the community pool in the x/protocolpool module to another account, which // could be the governance module itself. The authority is defined in the // keeper. - // - // Since: cosmos-sdk 0.50 CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) + // SubmitBudgetProposal defines a method to set a budget proposal. + SubmitBudgetProposal(ctx context.Context, in *MsgSubmitBudgetProposal, opts ...grpc.CallOption) (*MsgSubmitBudgetProposalResponse, error) + // ClaimBudget defines a method to claim the distributed budget. + ClaimBudget(ctx context.Context, in *MsgClaimBudget, opts ...grpc.CallOption) (*MsgClaimBudgetResponse, error) } type msgClient struct { @@ -310,20 +554,38 @@ func (c *msgClient) CommunityPoolSpend(ctx context.Context, in *MsgCommunityPool return out, nil } +func (c *msgClient) SubmitBudgetProposal(ctx context.Context, in *MsgSubmitBudgetProposal, opts ...grpc.CallOption) (*MsgSubmitBudgetProposalResponse, error) { + out := new(MsgSubmitBudgetProposalResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Msg/SubmitBudgetProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ClaimBudget(ctx context.Context, in *MsgClaimBudget, opts ...grpc.CallOption) (*MsgClaimBudgetResponse, error) { + out := new(MsgClaimBudgetResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Msg/ClaimBudget", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // FundCommunityPool defines a method to allow an account to directly // fund the community pool. - // - // Since: cosmos-sdk 0.50 FundCommunityPool(context.Context, *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) // CommunityPoolSpend defines a governance operation for sending tokens from // the community pool in the x/protocolpool module to another account, which // could be the governance module itself. The authority is defined in the // keeper. - // - // Since: cosmos-sdk 0.50 CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) + // SubmitBudgetProposal defines a method to set a budget proposal. + SubmitBudgetProposal(context.Context, *MsgSubmitBudgetProposal) (*MsgSubmitBudgetProposalResponse, error) + // ClaimBudget defines a method to claim the distributed budget. + ClaimBudget(context.Context, *MsgClaimBudget) (*MsgClaimBudgetResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -336,6 +598,12 @@ func (*UnimplementedMsgServer) FundCommunityPool(ctx context.Context, req *MsgFu func (*UnimplementedMsgServer) CommunityPoolSpend(ctx context.Context, req *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CommunityPoolSpend not implemented") } +func (*UnimplementedMsgServer) SubmitBudgetProposal(ctx context.Context, req *MsgSubmitBudgetProposal) (*MsgSubmitBudgetProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitBudgetProposal not implemented") +} +func (*UnimplementedMsgServer) ClaimBudget(ctx context.Context, req *MsgClaimBudget) (*MsgClaimBudgetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimBudget not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -377,6 +645,42 @@ func _Msg_CommunityPoolSpend_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Msg_SubmitBudgetProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitBudgetProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitBudgetProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Msg/SubmitBudgetProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitBudgetProposal(ctx, req.(*MsgSubmitBudgetProposal)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ClaimBudget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimBudget) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClaimBudget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Msg/ClaimBudget", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClaimBudget(ctx, req.(*MsgClaimBudget)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.protocolpool.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -389,6 +693,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CommunityPoolSpend", Handler: _Msg_CommunityPoolSpend_Handler, }, + { + MethodName: "SubmitBudgetProposal", + Handler: _Msg_SubmitBudgetProposal_Handler, + }, + { + MethodName: "ClaimBudget", + Handler: _Msg_ClaimBudget_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/protocolpool/v1/tx.proto", @@ -535,51 +847,211 @@ func (m *MsgCommunityPoolSpendResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgSubmitBudgetProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgFundCommunityPool) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgSubmitBudgetProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitBudgetProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) + if m.Period != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.Period, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.Period):]) + if err1 != nil { + return 0, err1 } + i -= n1 + i = encodeVarintTx(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.Tranches != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Tranches)) + i-- + dAtA[i] = 0x28 } - return n + if m.StartTime != nil { + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.StartTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintTx(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x22 + } + if m.TotalBudget != nil { + { + size, err := m.TotalBudget.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.RecipientAddress) > 0 { + i -= len(m.RecipientAddress) + copy(dAtA[i:], m.RecipientAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.RecipientAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *MsgFundCommunityPoolResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgSubmitBudgetProposalResponse) 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 *MsgSubmitBudgetProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitBudgetProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + return len(dAtA) - i, nil } -func (m *MsgCommunityPoolSpend) Size() (n int) { - if m == nil { - return 0 +func (m *MsgClaimBudget) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l + return dAtA[:n], nil +} + +func (m *MsgClaimBudget) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimBudget) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RecipientAddress) > 0 { + i -= len(m.RecipientAddress) + copy(dAtA[i:], m.RecipientAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.RecipientAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgClaimBudgetResponse) 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 *MsgClaimBudgetResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimBudgetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgFundCommunityPool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgFundCommunityPoolResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCommunityPoolSpend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l l = len(m.Authority) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -606,6 +1078,71 @@ func (m *MsgCommunityPoolSpendResponse) Size() (n int) { return n } +func (m *MsgSubmitBudgetProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RecipientAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.TotalBudget != nil { + l = m.TotalBudget.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.StartTime != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.StartTime) + n += 1 + l + sovTx(uint64(l)) + } + if m.Tranches != 0 { + n += 1 + sovTx(uint64(m.Tranches)) + } + if m.Period != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.Period) + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitBudgetProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgClaimBudget) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RecipientAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgClaimBudgetResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -976,6 +1513,462 @@ func (m *MsgCommunityPoolSpendResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSubmitBudgetProposal) 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: MsgSubmitBudgetProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitBudgetProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecipientAddress", 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.RecipientAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalBudget", 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 m.TotalBudget == nil { + m.TotalBudget = &types.Coin{} + } + if err := m.TotalBudget.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", 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 m.StartTime == nil { + m.StartTime = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Tranches", wireType) + } + m.Tranches = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Tranches |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", 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 m.Period == nil { + m.Period = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.Period, dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *MsgSubmitBudgetProposalResponse) 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: MsgSubmitBudgetProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitBudgetProposalResponse: 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 (m *MsgClaimBudget) 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: MsgClaimBudget: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimBudget: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecipientAddress", 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.RecipientAddress = 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 *MsgClaimBudgetResponse) 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: MsgClaimBudgetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimBudgetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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 := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/protocolpool/types/types.pb.go b/x/protocolpool/types/types.pb.go new file mode 100644 index 000000000000..ce3bf504aa9a --- /dev/null +++ b/x/protocolpool/types/types.pb.go @@ -0,0 +1,718 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/protocolpool/v1/types.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "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. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Budget defines the fields of a budget proposal. +type Budget struct { + // recipient_address is the address of the recipient who can claim the budget. + RecipientAddress string `protobuf:"bytes,1,opt,name=recipient_address,json=recipientAddress,proto3" json:"recipient_address,omitempty"` + // total_budget is the total amount allocated for the budget. + TotalBudget *types.Coin `protobuf:"bytes,2,opt,name=total_budget,json=totalBudget,proto3" json:"total_budget,omitempty"` + // claimed_amount is the total amount claimed from the total budget amount requested. + ClaimedAmount *types.Coin `protobuf:"bytes,3,opt,name=claimed_amount,json=claimedAmount,proto3" json:"claimed_amount,omitempty"` + // start_time is the time when the budget becomes claimable. + StartTime *time.Time `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time,omitempty"` + // next_claim_from is the time when the budget was last successfully claimed or distributed. + // It is used to track the next starting claim time for fund distribution. If set, it cannot be less than start_time. + NextClaimFrom *time.Time `protobuf:"bytes,5,opt,name=next_claim_from,json=nextClaimFrom,proto3,stdtime" json:"next_claim_from,omitempty"` + // tranches is the number of times the total budget amount is to be distributed. + Tranches uint64 `protobuf:"varint,6,opt,name=tranches,proto3" json:"tranches,omitempty"` + // tranches_left is the number of tranches left for the amount to be distributed. + TranchesLeft uint64 `protobuf:"varint,7,opt,name=tranches_left,json=tranchesLeft,proto3" json:"tranches_left,omitempty"` + // Period is the time interval(number of seconds) at which funds distribution should be performed. + // For example, if a period is set to 3600, it represents an action that + // should occur every hour (3600 seconds). + Period *time.Duration `protobuf:"bytes,8,opt,name=period,proto3,stdduration" json:"period,omitempty"` +} + +func (m *Budget) Reset() { *m = Budget{} } +func (m *Budget) String() string { return proto.CompactTextString(m) } +func (*Budget) ProtoMessage() {} +func (*Budget) Descriptor() ([]byte, []int) { + return fileDescriptor_c1b7d0ea246d7f44, []int{0} +} +func (m *Budget) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Budget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Budget.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 *Budget) XXX_Merge(src proto.Message) { + xxx_messageInfo_Budget.Merge(m, src) +} +func (m *Budget) XXX_Size() int { + return m.Size() +} +func (m *Budget) XXX_DiscardUnknown() { + xxx_messageInfo_Budget.DiscardUnknown(m) +} + +var xxx_messageInfo_Budget proto.InternalMessageInfo + +func (m *Budget) GetRecipientAddress() string { + if m != nil { + return m.RecipientAddress + } + return "" +} + +func (m *Budget) GetTotalBudget() *types.Coin { + if m != nil { + return m.TotalBudget + } + return nil +} + +func (m *Budget) GetClaimedAmount() *types.Coin { + if m != nil { + return m.ClaimedAmount + } + return nil +} + +func (m *Budget) GetStartTime() *time.Time { + if m != nil { + return m.StartTime + } + return nil +} + +func (m *Budget) GetNextClaimFrom() *time.Time { + if m != nil { + return m.NextClaimFrom + } + return nil +} + +func (m *Budget) GetTranches() uint64 { + if m != nil { + return m.Tranches + } + return 0 +} + +func (m *Budget) GetTranchesLeft() uint64 { + if m != nil { + return m.TranchesLeft + } + return 0 +} + +func (m *Budget) GetPeriod() *time.Duration { + if m != nil { + return m.Period + } + return nil +} + +func init() { + proto.RegisterType((*Budget)(nil), "cosmos.protocolpool.v1.Budget") +} + +func init() { + proto.RegisterFile("cosmos/protocolpool/v1/types.proto", fileDescriptor_c1b7d0ea246d7f44) +} + +var fileDescriptor_c1b7d0ea246d7f44 = []byte{ + // 444 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x3f, 0x6f, 0xd4, 0x30, + 0x1c, 0xbd, 0xd0, 0xe3, 0x68, 0xdd, 0x1e, 0x7f, 0xa2, 0x0a, 0xb9, 0x19, 0xd2, 0xa3, 0x2c, 0xb7, + 0xe0, 0xe8, 0x60, 0x60, 0x00, 0x09, 0x9a, 0x02, 0x62, 0x60, 0x3a, 0x98, 0x58, 0x2c, 0x27, 0xf1, + 0x05, 0x8b, 0x24, 0xbf, 0xc8, 0xfe, 0xdd, 0xa9, 0x7c, 0x8b, 0x8e, 0x7c, 0x10, 0x3e, 0x04, 0x63, + 0x85, 0x18, 0xd8, 0x40, 0x77, 0x5f, 0x04, 0xc5, 0x76, 0xaa, 0xd2, 0x85, 0x6e, 0xce, 0xfb, 0xbd, + 0xf7, 0xf2, 0xfc, 0xfc, 0x23, 0x47, 0x39, 0x98, 0x1a, 0x4c, 0xd2, 0x6a, 0x40, 0xc8, 0xa1, 0x6a, + 0x01, 0xaa, 0x64, 0x35, 0x4b, 0xf0, 0x4b, 0x2b, 0x0d, 0xb3, 0x68, 0x78, 0xdf, 0x71, 0xd8, 0x65, + 0x0e, 0x5b, 0xcd, 0xa2, 0xfd, 0x12, 0x4a, 0xb0, 0x60, 0xd2, 0x9d, 0xdc, 0x3c, 0x3a, 0x70, 0x6c, + 0xee, 0x06, 0x97, 0xa5, 0x51, 0xec, 0x7f, 0x96, 0x09, 0x23, 0x93, 0xd5, 0x2c, 0x93, 0x28, 0x66, + 0x49, 0x0e, 0xaa, 0xf1, 0xf3, 0xc3, 0x12, 0xa0, 0xac, 0xa4, 0x0b, 0x93, 0x2d, 0x17, 0x09, 0xaa, + 0x5a, 0x1a, 0x14, 0x75, 0xdb, 0x1b, 0x5c, 0x25, 0x14, 0x4b, 0x2d, 0x50, 0x81, 0x37, 0x38, 0xfa, + 0xb9, 0x45, 0x46, 0xe9, 0xb2, 0x28, 0x25, 0x86, 0xaf, 0xc9, 0x3d, 0x2d, 0x73, 0xd5, 0x2a, 0xd9, + 0x20, 0x17, 0x45, 0xa1, 0xa5, 0x31, 0x34, 0x98, 0x04, 0xd3, 0x9d, 0x94, 0xfe, 0xf8, 0xf6, 0x68, + 0xdf, 0x07, 0x3b, 0x76, 0x93, 0xf7, 0xa8, 0x55, 0x53, 0xce, 0xef, 0x5e, 0x48, 0x3c, 0x1e, 0x3e, + 0x27, 0x7b, 0x08, 0x28, 0x2a, 0x9e, 0x59, 0x5b, 0x7a, 0x63, 0x12, 0x4c, 0x77, 0x1f, 0x1f, 0x30, + 0x2f, 0xef, 0x6e, 0xc2, 0xfc, 0x4d, 0xd8, 0x09, 0xa8, 0x66, 0xbe, 0x6b, 0xe9, 0x3e, 0xc4, 0x4b, + 0x72, 0x3b, 0xaf, 0x84, 0xaa, 0x65, 0xc1, 0x45, 0x0d, 0xcb, 0x06, 0xe9, 0xd6, 0xff, 0xf4, 0x63, + 0x2f, 0x38, 0xb6, 0xfc, 0xf0, 0x05, 0x21, 0x06, 0x85, 0x46, 0xde, 0x55, 0x41, 0x87, 0x56, 0x1d, + 0x31, 0x57, 0x03, 0xeb, 0x6b, 0x60, 0x1f, 0xfa, 0x9e, 0xd2, 0xe1, 0xd9, 0xef, 0xc3, 0x60, 0xbe, + 0x63, 0x35, 0x1d, 0x1a, 0xbe, 0x25, 0x77, 0x1a, 0x79, 0x8a, 0xdc, 0xda, 0xf2, 0x85, 0x86, 0x9a, + 0xde, 0xbc, 0xa6, 0xcb, 0xb8, 0x13, 0x9e, 0x74, 0xba, 0x37, 0x1a, 0xea, 0x30, 0x22, 0xdb, 0xa8, + 0x45, 0x93, 0x7f, 0x92, 0x86, 0x8e, 0x26, 0xc1, 0x74, 0x38, 0xbf, 0xf8, 0x0e, 0x1f, 0x92, 0x71, + 0x7f, 0xe6, 0x95, 0x5c, 0x20, 0xbd, 0x65, 0x09, 0x7b, 0x3d, 0xf8, 0x4e, 0x2e, 0x30, 0x7c, 0x4a, + 0x46, 0xad, 0xd4, 0x0a, 0x0a, 0xba, 0xed, 0x5b, 0xb8, 0x9a, 0xe0, 0x95, 0x7f, 0xce, 0x74, 0xf8, + 0xb5, 0x0b, 0xe0, 0xe9, 0xe9, 0xb3, 0xef, 0xeb, 0x38, 0x38, 0x5f, 0xc7, 0xc1, 0x9f, 0x75, 0x1c, + 0x9c, 0x6d, 0xe2, 0xc1, 0xf9, 0x26, 0x1e, 0xfc, 0xda, 0xc4, 0x83, 0x8f, 0x0f, 0x5c, 0x8f, 0xa6, + 0xf8, 0xcc, 0x14, 0x24, 0xa7, 0xff, 0xae, 0xb1, 0xdd, 0xe1, 0x6c, 0x64, 0xb1, 0x27, 0x7f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x07, 0x16, 0x5b, 0x67, 0xea, 0x02, 0x00, 0x00, +} + +func (m *Budget) 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 *Budget) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Budget) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Period != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.Period, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.Period):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintTypes(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x42 + } + if m.TranchesLeft != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.TranchesLeft)) + i-- + dAtA[i] = 0x38 + } + if m.Tranches != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Tranches)) + i-- + dAtA[i] = 0x30 + } + if m.NextClaimFrom != nil { + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.NextClaimFrom, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.NextClaimFrom):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintTypes(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x2a + } + if m.StartTime != nil { + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.StartTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintTypes(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x22 + } + if m.ClaimedAmount != nil { + { + size, err := m.ClaimedAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.TotalBudget != nil { + { + size, err := m.TotalBudget.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RecipientAddress) > 0 { + i -= len(m.RecipientAddress) + copy(dAtA[i:], m.RecipientAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.RecipientAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Budget) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RecipientAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.TotalBudget != nil { + l = m.TotalBudget.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ClaimedAmount != nil { + l = m.ClaimedAmount.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.StartTime != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.StartTime) + n += 1 + l + sovTypes(uint64(l)) + } + if m.NextClaimFrom != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.NextClaimFrom) + n += 1 + l + sovTypes(uint64(l)) + } + if m.Tranches != 0 { + n += 1 + sovTypes(uint64(m.Tranches)) + } + if m.TranchesLeft != 0 { + n += 1 + sovTypes(uint64(m.TranchesLeft)) + } + if m.Period != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.Period) + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Budget) 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 ErrIntOverflowTypes + } + 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: Budget: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Budget: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecipientAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecipientAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalBudget", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TotalBudget == nil { + m.TotalBudget = &types.Coin{} + } + if err := m.TotalBudget.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClaimedAmount == nil { + m.ClaimedAmount = &types.Coin{} + } + if err := m.ClaimedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StartTime == nil { + m.StartTime = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextClaimFrom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NextClaimFrom == nil { + m.NextClaimFrom = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.NextClaimFrom, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Tranches", wireType) + } + m.Tranches = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Tranches |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TranchesLeft", wireType) + } + m.TranchesLeft = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TranchesLeft |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Period == nil { + m.Period = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.Period, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +)