diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d2d137bef..8032588097 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (client) [#18557](https://github.com/cosmos/cosmos-sdk/pull/18557) Add `--qrcode` flag to `keys show` command to support displaying keys address QR code. * (x/auth) [#24030](https://github.com/cosmos/cosmos-sdk/pull/24030) Allow usage of ed25519 keys for transaction signing. * (baseapp) [#24163](https://github.com/cosmos/cosmos-sdk/pull/24163) Add `StreamingManager` to baseapp to extend the abci listeners. +* (x/protocolpool) [#23933](https://github.com/cosmos/cosmos-sdk/pull/23933) Add x/protocolpool module. + * x/distribution can now utilize an externally managed community pool. NOTE: this will make the message handlers for FundCommunityPool and CommunityPoolSpend error, as well as the query handler for CommunityPool. ### Improvements diff --git a/api/cosmos/distribution/v1beta1/query_grpc.pb.go b/api/cosmos/distribution/v1beta1/query_grpc.pb.go index 7b4d9569be..cc95561987 100644 --- a/api/cosmos/distribution/v1beta1/query_grpc.pb.go +++ b/api/cosmos/distribution/v1beta1/query_grpc.pb.go @@ -57,6 +57,8 @@ type QueryClient interface { // DelegatorWithdrawAddress queries withdraw address of a delegator. DelegatorWithdrawAddress(ctx context.Context, in *QueryDelegatorWithdrawAddressRequest, opts ...grpc.CallOption) (*QueryDelegatorWithdrawAddressResponse, error) // CommunityPool queries the community pool coins. + // + // WARNING: This query will fail if an external community pool is used. CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) } @@ -194,6 +196,8 @@ type QueryServer interface { // DelegatorWithdrawAddress queries withdraw address of a delegator. DelegatorWithdrawAddress(context.Context, *QueryDelegatorWithdrawAddressRequest) (*QueryDelegatorWithdrawAddressResponse, error) // CommunityPool queries the community pool coins. + // + // WARNING: This query will fail if an external community pool is used. CommunityPool(context.Context, *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) mustEmbedUnimplementedQueryServer() } diff --git a/api/cosmos/distribution/v1beta1/tx_grpc.pb.go b/api/cosmos/distribution/v1beta1/tx_grpc.pb.go index 2979118209..0f10989cbb 100644 --- a/api/cosmos/distribution/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/distribution/v1beta1/tx_grpc.pb.go @@ -45,6 +45,8 @@ type MsgClient interface { WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) // FundCommunityPool defines a method to allow an account to directly // fund the community pool. + // + // WARNING: This method will fail if an external community pool is used. FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) // UpdateParams defines a governance operation for updating the x/distribution // module parameters. The authority is defined in the keeper. @@ -53,6 +55,8 @@ type MsgClient interface { // the community pool in the x/distribution module to another account, which // could be the governance module itself. The authority is defined in the // keeper. + // + // WARNING: This method will fail if an external community pool is used. CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) // DepositValidatorRewardsPool defines a method to provide additional rewards // to delegators to a specific validator. @@ -154,6 +158,8 @@ type MsgServer interface { WithdrawValidatorCommission(context.Context, *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) // FundCommunityPool defines a method to allow an account to directly // fund the community pool. + // + // WARNING: This method will fail if an external community pool is used. FundCommunityPool(context.Context, *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) // UpdateParams defines a governance operation for updating the x/distribution // module parameters. The authority is defined in the keeper. @@ -162,6 +168,8 @@ type MsgServer interface { // the community pool in the x/distribution module to another account, which // could be the governance module itself. The authority is defined in the // keeper. + // + // WARNING: This method will fail if an external community pool is used. CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) // DepositValidatorRewardsPool defines a method to provide additional rewards // to delegators to a specific validator. diff --git a/api/cosmos/protocolpool/module/v1/module.pulsar.go b/api/cosmos/protocolpool/module/v1/module.pulsar.go new file mode 100644 index 0000000000..05c5b7810b --- /dev/null +++ b/api/cosmos/protocolpool/module/v1/module.pulsar.go @@ -0,0 +1,582 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_module_v1_module_proto_init() + md_Module = File_cosmos_protocolpool_module_v1_module_proto.Messages().ByName("Module") + fd_Module_authority = md_Module.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_module_v1_module_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_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// 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_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, 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_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.module.v1.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.protocolpool.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.module.v1.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.protocolpool.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.module.v1.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.protocolpool.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.module.v1.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.protocolpool.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.module.v1.Module.authority": + panic(fmt.Errorf("field authority of message cosmos.protocolpool.module.v1.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.protocolpool.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.module.v1.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.protocolpool.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + 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)) + } + 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().(*Module) + 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.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().(*Module) + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: 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 + 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/module/v1/module.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) +) + +// Module is the config object of the consensus module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority defines the custom module authority. If not set, defaults to the governance module. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_cosmos_protocolpool_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_protocolpool_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, + 0x6c, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b, 0x0a, + 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x33, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2d, 0x0a, 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, 0x78, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x42, 0x80, 0x02, 0x0a, 0x21, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x37, 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, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x50, 0x4d, 0xaa, 0x02, + 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x29, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x20, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, + 0x6c, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_protocolpool_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_protocolpool_module_v1_module_proto_rawDescData = file_cosmos_protocolpool_module_v1_module_proto_rawDesc +) + +func file_cosmos_protocolpool_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_protocolpool_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_protocolpool_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_protocolpool_module_v1_module_proto_rawDescData) + }) + return file_cosmos_protocolpool_module_v1_module_proto_rawDescData +} + +var file_cosmos_protocolpool_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_protocolpool_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.protocolpool.module.v1.Module +} +var file_cosmos_protocolpool_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_protocolpool_module_v1_module_proto_init() } +func file_cosmos_protocolpool_module_v1_module_proto_init() { + if File_cosmos_protocolpool_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_protocolpool_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); 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_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_protocolpool_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_protocolpool_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_protocolpool_module_v1_module_proto_msgTypes, + }.Build() + File_cosmos_protocolpool_module_v1_module_proto = out.File + file_cosmos_protocolpool_module_v1_module_proto_rawDesc = nil + file_cosmos_protocolpool_module_v1_module_proto_goTypes = nil + file_cosmos_protocolpool_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/protocolpool/v1/genesis.pulsar.go b/api/cosmos/protocolpool/v1/genesis.pulsar.go new file mode 100644 index 0000000000..c87a2bfc4c --- /dev/null +++ b/api/cosmos/protocolpool/v1/genesis.pulsar.go @@ -0,0 +1,753 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package protocolpoolv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_GenesisState_1_list)(nil) + +type _GenesisState_1_list struct { + list *[]*ContinuousFund +} + +func (x *_GenesisState_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ContinuousFund) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ContinuousFund) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_1_list) AppendMutable() protoreflect.Value { + v := new(ContinuousFund) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_1_list) NewElement() protoreflect.Value { + v := new(ContinuousFund) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_continuous_funds protoreflect.FieldDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_genesis_proto_init() + md_GenesisState = File_cosmos_protocolpool_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_continuous_funds = md_GenesisState.Fields().ByName("continuous_funds") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_genesis_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_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// 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_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(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_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.ContinuousFunds) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_1_list{list: &x.ContinuousFunds}) + if !f(fd_GenesisState_continuous_funds, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, 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_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.GenesisState.continuous_funds": + return len(x.ContinuousFunds) != 0 + case "cosmos.protocolpool.v1.GenesisState.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.GenesisState 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_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.GenesisState.continuous_funds": + x.ContinuousFunds = nil + case "cosmos.protocolpool.v1.GenesisState.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.GenesisState 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_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.GenesisState.continuous_funds": + if len(x.ContinuousFunds) == 0 { + return protoreflect.ValueOfList(&_GenesisState_1_list{}) + } + listValue := &_GenesisState_1_list{list: &x.ContinuousFunds} + return protoreflect.ValueOfList(listValue) + case "cosmos.protocolpool.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.GenesisState 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_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.GenesisState.continuous_funds": + lv := value.List() + clv := lv.(*_GenesisState_1_list) + x.ContinuousFunds = *clv.list + case "cosmos.protocolpool.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.GenesisState 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_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.GenesisState.continuous_funds": + if x.ContinuousFunds == nil { + x.ContinuousFunds = []*ContinuousFund{} + } + value := &_GenesisState_1_list{list: &x.ContinuousFunds} + return protoreflect.ValueOfList(value) + case "cosmos.protocolpool.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.GenesisState 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_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.GenesisState.continuous_funds": + list := []*ContinuousFund{} + return protoreflect.ValueOfList(&_GenesisState_1_list{list: &list}) + case "cosmos.protocolpool.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.GenesisState 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_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.GenesisState", 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_GenesisState) 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_GenesisState) 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_GenesisState) 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_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.ContinuousFunds) > 0 { + for _, e := range x.ContinuousFunds { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Params != nil { + l = options.Size(x.Params) + 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().(*GenesisState) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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.ContinuousFunds) > 0 { + for iNdEx := len(x.ContinuousFunds) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ContinuousFunds[iNdEx]) + 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().(*GenesisState) + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: 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 ContinuousFunds", 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 + } + x.ContinuousFunds = append(x.ContinuousFunds, &ContinuousFund{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ContinuousFunds[len(x.ContinuousFunds)-1]); 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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/genesis.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) +) + +// GenesisState defines the protocolpool module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ContinuousFunds defines the continuous funds at genesis. + ContinuousFunds []*ContinuousFund `protobuf:"bytes,1,rep,name=continuous_funds,json=continuousFunds,proto3" json:"continuous_funds,omitempty"` + // Params defines the parameters of this module, currently only contains the + // denoms that will be used for continuous fund distributions. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetContinuousFunds() []*ContinuousFund { + if x != nil { + return x.ContinuousFunds + } + return nil +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_cosmos_protocolpool_v1_genesis_proto protoreflect.FileDescriptor + +var file_cosmos_protocolpool_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 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, 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, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x57, 0x0a, 0x10, 0x63, 0x6f, 0x6e, + 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 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, 0x43, 0x6f, 0x6e, + 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, + 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, + 0x64, 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0xdc, 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, + 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 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_genesis_proto_rawDescOnce sync.Once + file_cosmos_protocolpool_v1_genesis_proto_rawDescData = file_cosmos_protocolpool_v1_genesis_proto_rawDesc +) + +func file_cosmos_protocolpool_v1_genesis_proto_rawDescGZIP() []byte { + file_cosmos_protocolpool_v1_genesis_proto_rawDescOnce.Do(func() { + file_cosmos_protocolpool_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_protocolpool_v1_genesis_proto_rawDescData) + }) + return file_cosmos_protocolpool_v1_genesis_proto_rawDescData +} + +var file_cosmos_protocolpool_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_protocolpool_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: cosmos.protocolpool.v1.GenesisState + (*ContinuousFund)(nil), // 1: cosmos.protocolpool.v1.ContinuousFund + (*Params)(nil), // 2: cosmos.protocolpool.v1.Params +} +var file_cosmos_protocolpool_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: cosmos.protocolpool.v1.GenesisState.continuous_funds:type_name -> cosmos.protocolpool.v1.ContinuousFund + 2, // 1: cosmos.protocolpool.v1.GenesisState.params:type_name -> cosmos.protocolpool.v1.Params + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] 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 +} + +func init() { file_cosmos_protocolpool_v1_genesis_proto_init() } +func file_cosmos_protocolpool_v1_genesis_proto_init() { + if File_cosmos_protocolpool_v1_genesis_proto != nil { + return + } + file_cosmos_protocolpool_v1_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_protocolpool_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); 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_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_protocolpool_v1_genesis_proto_goTypes, + DependencyIndexes: file_cosmos_protocolpool_v1_genesis_proto_depIdxs, + MessageInfos: file_cosmos_protocolpool_v1_genesis_proto_msgTypes, + }.Build() + File_cosmos_protocolpool_v1_genesis_proto = out.File + file_cosmos_protocolpool_v1_genesis_proto_rawDesc = nil + file_cosmos_protocolpool_v1_genesis_proto_goTypes = nil + file_cosmos_protocolpool_v1_genesis_proto_depIdxs = nil +} diff --git a/api/cosmos/protocolpool/v1/query.pulsar.go b/api/cosmos/protocolpool/v1/query.pulsar.go new file mode 100644 index 0000000000..e260d1abee --- /dev/null +++ b/api/cosmos/protocolpool/v1/query.pulsar.go @@ -0,0 +1,3931 @@ +// 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" + _ "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" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryCommunityPoolRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_query_proto_init() + md_QueryCommunityPoolRequest = File_cosmos_protocolpool_v1_query_proto.Messages().ByName("QueryCommunityPoolRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryCommunityPoolRequest)(nil) + +type fastReflection_QueryCommunityPoolRequest QueryCommunityPoolRequest + +func (x *QueryCommunityPoolRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCommunityPoolRequest)(x) +} + +func (x *QueryCommunityPoolRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_query_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_QueryCommunityPoolRequest_messageType fastReflection_QueryCommunityPoolRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryCommunityPoolRequest_messageType{} + +type fastReflection_QueryCommunityPoolRequest_messageType struct{} + +func (x fastReflection_QueryCommunityPoolRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCommunityPoolRequest)(nil) +} +func (x fastReflection_QueryCommunityPoolRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCommunityPoolRequest) +} +func (x fastReflection_QueryCommunityPoolRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCommunityPoolRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCommunityPoolRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCommunityPoolRequest +} + +// 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_QueryCommunityPoolRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryCommunityPoolRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCommunityPoolRequest) New() protoreflect.Message { + return new(fastReflection_QueryCommunityPoolRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCommunityPoolRequest) Interface() protoreflect.ProtoMessage { + return (*QueryCommunityPoolRequest)(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_QueryCommunityPoolRequest) 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_QueryCommunityPoolRequest) 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.QueryCommunityPoolRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolRequest 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_QueryCommunityPoolRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryCommunityPoolRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolRequest 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_QueryCommunityPoolRequest) 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.QueryCommunityPoolRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolRequest 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_QueryCommunityPoolRequest) 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.QueryCommunityPoolRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolRequest 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_QueryCommunityPoolRequest) 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.QueryCommunityPoolRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolRequest 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_QueryCommunityPoolRequest) 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.QueryCommunityPoolRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolRequest 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_QueryCommunityPoolRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.QueryCommunityPoolRequest", 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_QueryCommunityPoolRequest) 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_QueryCommunityPoolRequest) 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_QueryCommunityPoolRequest) 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_QueryCommunityPoolRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCommunityPoolRequest) + 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().(*QueryCommunityPoolRequest) + 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().(*QueryCommunityPoolRequest) + 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: QueryCommunityPoolRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCommunityPoolRequest: 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 _ protoreflect.List = (*_QueryCommunityPoolResponse_1_list)(nil) + +type _QueryCommunityPoolResponse_1_list struct { + list *[]*v1beta1.Coin +} + +func (x *_QueryCommunityPoolResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryCommunityPoolResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryCommunityPoolResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_QueryCommunityPoolResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryCommunityPoolResponse_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryCommunityPoolResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryCommunityPoolResponse_1_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryCommunityPoolResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryCommunityPoolResponse protoreflect.MessageDescriptor + fd_QueryCommunityPoolResponse_pool protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_query_proto_init() + md_QueryCommunityPoolResponse = File_cosmos_protocolpool_v1_query_proto.Messages().ByName("QueryCommunityPoolResponse") + fd_QueryCommunityPoolResponse_pool = md_QueryCommunityPoolResponse.Fields().ByName("pool") +} + +var _ protoreflect.Message = (*fastReflection_QueryCommunityPoolResponse)(nil) + +type fastReflection_QueryCommunityPoolResponse QueryCommunityPoolResponse + +func (x *QueryCommunityPoolResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCommunityPoolResponse)(x) +} + +func (x *QueryCommunityPoolResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[1] + 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_QueryCommunityPoolResponse_messageType fastReflection_QueryCommunityPoolResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryCommunityPoolResponse_messageType{} + +type fastReflection_QueryCommunityPoolResponse_messageType struct{} + +func (x fastReflection_QueryCommunityPoolResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCommunityPoolResponse)(nil) +} +func (x fastReflection_QueryCommunityPoolResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCommunityPoolResponse) +} +func (x fastReflection_QueryCommunityPoolResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCommunityPoolResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCommunityPoolResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCommunityPoolResponse +} + +// 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_QueryCommunityPoolResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryCommunityPoolResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCommunityPoolResponse) New() protoreflect.Message { + return new(fastReflection_QueryCommunityPoolResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCommunityPoolResponse) Interface() protoreflect.ProtoMessage { + return (*QueryCommunityPoolResponse)(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_QueryCommunityPoolResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Pool) != 0 { + value := protoreflect.ValueOfList(&_QueryCommunityPoolResponse_1_list{list: &x.Pool}) + if !f(fd_QueryCommunityPoolResponse_pool, 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_QueryCommunityPoolResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryCommunityPoolResponse.pool": + return len(x.Pool) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolResponse 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_QueryCommunityPoolResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryCommunityPoolResponse.pool": + x.Pool = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolResponse 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_QueryCommunityPoolResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.QueryCommunityPoolResponse.pool": + if len(x.Pool) == 0 { + return protoreflect.ValueOfList(&_QueryCommunityPoolResponse_1_list{}) + } + listValue := &_QueryCommunityPoolResponse_1_list{list: &x.Pool} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolResponse 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_QueryCommunityPoolResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryCommunityPoolResponse.pool": + lv := value.List() + clv := lv.(*_QueryCommunityPoolResponse_1_list) + x.Pool = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolResponse 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_QueryCommunityPoolResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryCommunityPoolResponse.pool": + if x.Pool == nil { + x.Pool = []*v1beta1.Coin{} + } + value := &_QueryCommunityPoolResponse_1_list{list: &x.Pool} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolResponse 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_QueryCommunityPoolResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryCommunityPoolResponse.pool": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_QueryCommunityPoolResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryCommunityPoolResponse 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_QueryCommunityPoolResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.QueryCommunityPoolResponse", 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_QueryCommunityPoolResponse) 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_QueryCommunityPoolResponse) 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_QueryCommunityPoolResponse) 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_QueryCommunityPoolResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCommunityPoolResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Pool) > 0 { + for _, e := range x.Pool { + l = options.Size(e) + 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().(*QueryCommunityPoolResponse) + 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.Pool) > 0 { + for iNdEx := len(x.Pool) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Pool[iNdEx]) + 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().(*QueryCommunityPoolResponse) + 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: QueryCommunityPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCommunityPoolResponse: 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 Pool", 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 + } + x.Pool = append(x.Pool, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pool[len(x.Pool)-1]); 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_QueryContinuousFundRequest protoreflect.MessageDescriptor + fd_QueryContinuousFundRequest_recipient protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_query_proto_init() + md_QueryContinuousFundRequest = File_cosmos_protocolpool_v1_query_proto.Messages().ByName("QueryContinuousFundRequest") + fd_QueryContinuousFundRequest_recipient = md_QueryContinuousFundRequest.Fields().ByName("recipient") +} + +var _ protoreflect.Message = (*fastReflection_QueryContinuousFundRequest)(nil) + +type fastReflection_QueryContinuousFundRequest QueryContinuousFundRequest + +func (x *QueryContinuousFundRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryContinuousFundRequest)(x) +} + +func (x *QueryContinuousFundRequest) 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_QueryContinuousFundRequest_messageType fastReflection_QueryContinuousFundRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryContinuousFundRequest_messageType{} + +type fastReflection_QueryContinuousFundRequest_messageType struct{} + +func (x fastReflection_QueryContinuousFundRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryContinuousFundRequest)(nil) +} +func (x fastReflection_QueryContinuousFundRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryContinuousFundRequest) +} +func (x fastReflection_QueryContinuousFundRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryContinuousFundRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryContinuousFundRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryContinuousFundRequest +} + +// 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_QueryContinuousFundRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryContinuousFundRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryContinuousFundRequest) New() protoreflect.Message { + return new(fastReflection_QueryContinuousFundRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryContinuousFundRequest) Interface() protoreflect.ProtoMessage { + return (*QueryContinuousFundRequest)(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_QueryContinuousFundRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Recipient != "" { + value := protoreflect.ValueOfString(x.Recipient) + if !f(fd_QueryContinuousFundRequest_recipient, 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_QueryContinuousFundRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundRequest.recipient": + return x.Recipient != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundRequest 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_QueryContinuousFundRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundRequest.recipient": + x.Recipient = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundRequest 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_QueryContinuousFundRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundRequest.recipient": + value := x.Recipient + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundRequest 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_QueryContinuousFundRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundRequest.recipient": + x.Recipient = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundRequest 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_QueryContinuousFundRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundRequest.recipient": + panic(fmt.Errorf("field recipient of message cosmos.protocolpool.v1.QueryContinuousFundRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundRequest 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_QueryContinuousFundRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundRequest.recipient": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundRequest 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_QueryContinuousFundRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.QueryContinuousFundRequest", 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_QueryContinuousFundRequest) 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_QueryContinuousFundRequest) 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_QueryContinuousFundRequest) 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_QueryContinuousFundRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryContinuousFundRequest) + 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.Recipient) + 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().(*QueryContinuousFundRequest) + 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.Recipient) > 0 { + i -= len(x.Recipient) + copy(dAtA[i:], x.Recipient) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Recipient))) + 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().(*QueryContinuousFundRequest) + 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: QueryContinuousFundRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryContinuousFundRequest: 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 Recipient", 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.Recipient = 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_QueryContinuousFundResponse protoreflect.MessageDescriptor + fd_QueryContinuousFundResponse_continuous_fund protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_query_proto_init() + md_QueryContinuousFundResponse = File_cosmos_protocolpool_v1_query_proto.Messages().ByName("QueryContinuousFundResponse") + fd_QueryContinuousFundResponse_continuous_fund = md_QueryContinuousFundResponse.Fields().ByName("continuous_fund") +} + +var _ protoreflect.Message = (*fastReflection_QueryContinuousFundResponse)(nil) + +type fastReflection_QueryContinuousFundResponse QueryContinuousFundResponse + +func (x *QueryContinuousFundResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryContinuousFundResponse)(x) +} + +func (x *QueryContinuousFundResponse) 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_QueryContinuousFundResponse_messageType fastReflection_QueryContinuousFundResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryContinuousFundResponse_messageType{} + +type fastReflection_QueryContinuousFundResponse_messageType struct{} + +func (x fastReflection_QueryContinuousFundResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryContinuousFundResponse)(nil) +} +func (x fastReflection_QueryContinuousFundResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryContinuousFundResponse) +} +func (x fastReflection_QueryContinuousFundResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryContinuousFundResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryContinuousFundResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryContinuousFundResponse +} + +// 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_QueryContinuousFundResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryContinuousFundResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryContinuousFundResponse) New() protoreflect.Message { + return new(fastReflection_QueryContinuousFundResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryContinuousFundResponse) Interface() protoreflect.ProtoMessage { + return (*QueryContinuousFundResponse)(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_QueryContinuousFundResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ContinuousFund != nil { + value := protoreflect.ValueOfMessage(x.ContinuousFund.ProtoReflect()) + if !f(fd_QueryContinuousFundResponse_continuous_fund, 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_QueryContinuousFundResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundResponse.continuous_fund": + return x.ContinuousFund != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundResponse 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_QueryContinuousFundResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundResponse.continuous_fund": + x.ContinuousFund = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundResponse 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_QueryContinuousFundResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundResponse.continuous_fund": + value := x.ContinuousFund + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundResponse 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_QueryContinuousFundResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundResponse.continuous_fund": + x.ContinuousFund = value.Message().Interface().(*ContinuousFund) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundResponse 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_QueryContinuousFundResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundResponse.continuous_fund": + if x.ContinuousFund == nil { + x.ContinuousFund = new(ContinuousFund) + } + return protoreflect.ValueOfMessage(x.ContinuousFund.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundResponse 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_QueryContinuousFundResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundResponse.continuous_fund": + m := new(ContinuousFund) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundResponse 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_QueryContinuousFundResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.QueryContinuousFundResponse", 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_QueryContinuousFundResponse) 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_QueryContinuousFundResponse) 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_QueryContinuousFundResponse) 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_QueryContinuousFundResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryContinuousFundResponse) + 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.ContinuousFund != nil { + l = options.Size(x.ContinuousFund) + 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().(*QueryContinuousFundResponse) + 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.ContinuousFund != nil { + encoded, err := options.Marshal(x.ContinuousFund) + 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().(*QueryContinuousFundResponse) + 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: QueryContinuousFundResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryContinuousFundResponse: 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 ContinuousFund", 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.ContinuousFund == nil { + x.ContinuousFund = &ContinuousFund{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ContinuousFund); 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_QueryContinuousFundsRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_query_proto_init() + md_QueryContinuousFundsRequest = File_cosmos_protocolpool_v1_query_proto.Messages().ByName("QueryContinuousFundsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryContinuousFundsRequest)(nil) + +type fastReflection_QueryContinuousFundsRequest QueryContinuousFundsRequest + +func (x *QueryContinuousFundsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryContinuousFundsRequest)(x) +} + +func (x *QueryContinuousFundsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_query_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_QueryContinuousFundsRequest_messageType fastReflection_QueryContinuousFundsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryContinuousFundsRequest_messageType{} + +type fastReflection_QueryContinuousFundsRequest_messageType struct{} + +func (x fastReflection_QueryContinuousFundsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryContinuousFundsRequest)(nil) +} +func (x fastReflection_QueryContinuousFundsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryContinuousFundsRequest) +} +func (x fastReflection_QueryContinuousFundsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryContinuousFundsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryContinuousFundsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryContinuousFundsRequest +} + +// 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_QueryContinuousFundsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryContinuousFundsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryContinuousFundsRequest) New() protoreflect.Message { + return new(fastReflection_QueryContinuousFundsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryContinuousFundsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryContinuousFundsRequest)(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_QueryContinuousFundsRequest) 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_QueryContinuousFundsRequest) 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.QueryContinuousFundsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsRequest 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_QueryContinuousFundsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsRequest 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_QueryContinuousFundsRequest) 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.QueryContinuousFundsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsRequest 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_QueryContinuousFundsRequest) 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.QueryContinuousFundsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsRequest 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_QueryContinuousFundsRequest) 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.QueryContinuousFundsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsRequest 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_QueryContinuousFundsRequest) 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.QueryContinuousFundsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsRequest 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_QueryContinuousFundsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.QueryContinuousFundsRequest", 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_QueryContinuousFundsRequest) 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_QueryContinuousFundsRequest) 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_QueryContinuousFundsRequest) 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_QueryContinuousFundsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryContinuousFundsRequest) + 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().(*QueryContinuousFundsRequest) + 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().(*QueryContinuousFundsRequest) + 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: QueryContinuousFundsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryContinuousFundsRequest: 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 _ protoreflect.List = (*_QueryContinuousFundsResponse_1_list)(nil) + +type _QueryContinuousFundsResponse_1_list struct { + list *[]*ContinuousFund +} + +func (x *_QueryContinuousFundsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryContinuousFundsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryContinuousFundsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ContinuousFund) + (*x.list)[i] = concreteValue +} + +func (x *_QueryContinuousFundsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ContinuousFund) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryContinuousFundsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(ContinuousFund) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryContinuousFundsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryContinuousFundsResponse_1_list) NewElement() protoreflect.Value { + v := new(ContinuousFund) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryContinuousFundsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryContinuousFundsResponse protoreflect.MessageDescriptor + fd_QueryContinuousFundsResponse_continuous_funds protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_query_proto_init() + md_QueryContinuousFundsResponse = File_cosmos_protocolpool_v1_query_proto.Messages().ByName("QueryContinuousFundsResponse") + fd_QueryContinuousFundsResponse_continuous_funds = md_QueryContinuousFundsResponse.Fields().ByName("continuous_funds") +} + +var _ protoreflect.Message = (*fastReflection_QueryContinuousFundsResponse)(nil) + +type fastReflection_QueryContinuousFundsResponse QueryContinuousFundsResponse + +func (x *QueryContinuousFundsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryContinuousFundsResponse)(x) +} + +func (x *QueryContinuousFundsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_query_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_QueryContinuousFundsResponse_messageType fastReflection_QueryContinuousFundsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryContinuousFundsResponse_messageType{} + +type fastReflection_QueryContinuousFundsResponse_messageType struct{} + +func (x fastReflection_QueryContinuousFundsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryContinuousFundsResponse)(nil) +} +func (x fastReflection_QueryContinuousFundsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryContinuousFundsResponse) +} +func (x fastReflection_QueryContinuousFundsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryContinuousFundsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryContinuousFundsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryContinuousFundsResponse +} + +// 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_QueryContinuousFundsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryContinuousFundsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryContinuousFundsResponse) New() protoreflect.Message { + return new(fastReflection_QueryContinuousFundsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryContinuousFundsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryContinuousFundsResponse)(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_QueryContinuousFundsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.ContinuousFunds) != 0 { + value := protoreflect.ValueOfList(&_QueryContinuousFundsResponse_1_list{list: &x.ContinuousFunds}) + if !f(fd_QueryContinuousFundsResponse_continuous_funds, 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_QueryContinuousFundsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundsResponse.continuous_funds": + return len(x.ContinuousFunds) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsResponse 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_QueryContinuousFundsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundsResponse.continuous_funds": + x.ContinuousFunds = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsResponse 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_QueryContinuousFundsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundsResponse.continuous_funds": + if len(x.ContinuousFunds) == 0 { + return protoreflect.ValueOfList(&_QueryContinuousFundsResponse_1_list{}) + } + listValue := &_QueryContinuousFundsResponse_1_list{list: &x.ContinuousFunds} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsResponse 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_QueryContinuousFundsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundsResponse.continuous_funds": + lv := value.List() + clv := lv.(*_QueryContinuousFundsResponse_1_list) + x.ContinuousFunds = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsResponse 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_QueryContinuousFundsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundsResponse.continuous_funds": + if x.ContinuousFunds == nil { + x.ContinuousFunds = []*ContinuousFund{} + } + value := &_QueryContinuousFundsResponse_1_list{list: &x.ContinuousFunds} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsResponse 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_QueryContinuousFundsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryContinuousFundsResponse.continuous_funds": + list := []*ContinuousFund{} + return protoreflect.ValueOfList(&_QueryContinuousFundsResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryContinuousFundsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryContinuousFundsResponse 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_QueryContinuousFundsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.QueryContinuousFundsResponse", 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_QueryContinuousFundsResponse) 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_QueryContinuousFundsResponse) 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_QueryContinuousFundsResponse) 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_QueryContinuousFundsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryContinuousFundsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.ContinuousFunds) > 0 { + for _, e := range x.ContinuousFunds { + l = options.Size(e) + 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().(*QueryContinuousFundsResponse) + 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.ContinuousFunds) > 0 { + for iNdEx := len(x.ContinuousFunds) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ContinuousFunds[iNdEx]) + 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().(*QueryContinuousFundsResponse) + 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: QueryContinuousFundsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryContinuousFundsResponse: 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 ContinuousFunds", 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 + } + x.ContinuousFunds = append(x.ContinuousFunds, &ContinuousFund{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ContinuousFunds[len(x.ContinuousFunds)-1]); 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_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_query_proto_init() + md_QueryParamsRequest = File_cosmos_protocolpool_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_query_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_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// 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_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(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_QueryParamsRequest) 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_QueryParamsRequest) 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.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsRequest 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_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsRequest 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_QueryParamsRequest) 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.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsRequest 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_QueryParamsRequest) 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.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsRequest 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_QueryParamsRequest) 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.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsRequest 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_QueryParamsRequest) 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.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsRequest 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_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.QueryParamsRequest", 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + 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().(*QueryParamsRequest) + 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().(*QueryParamsRequest) + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: 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_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_query_proto_init() + md_QueryParamsResponse = File_cosmos_protocolpool_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_query_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_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// 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_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(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_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, 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_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsResponse 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_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsResponse 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_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsResponse 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_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsResponse 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_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsResponse 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_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.QueryParamsResponse 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_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.QueryParamsResponse", 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + 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.Params != nil { + l = options.Size(x.Params) + 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().(*QueryParamsResponse) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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().(*QueryParamsResponse) + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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/query.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) +) + +// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC +// method. +type QueryCommunityPoolRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryCommunityPoolRequest) Reset() { + *x = QueryCommunityPoolRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCommunityPoolRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCommunityPoolRequest) ProtoMessage() {} + +// Deprecated: Use QueryCommunityPoolRequest.ProtoReflect.Descriptor instead. +func (*QueryCommunityPoolRequest) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryCommunityPoolResponse is the response type for the Query/CommunityPool +// RPC method. +type QueryCommunityPoolResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pool defines community pool's coins. + Pool []*v1beta1.Coin `protobuf:"bytes,1,rep,name=pool,proto3" json:"pool,omitempty"` +} + +func (x *QueryCommunityPoolResponse) Reset() { + *x = QueryCommunityPoolResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCommunityPoolResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCommunityPoolResponse) ProtoMessage() {} + +// Deprecated: Use QueryCommunityPoolResponse.ProtoReflect.Descriptor instead. +func (*QueryCommunityPoolResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryCommunityPoolResponse) GetPool() []*v1beta1.Coin { + if x != nil { + return x.Pool + } + return nil +} + +// QueryContinuousFundRequest is the request type for the Query/ContinuousFund +// RPC method. +type QueryContinuousFundRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // recipient is the recipient address to query unclaimed budget amount for. + Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (x *QueryContinuousFundRequest) Reset() { + *x = QueryContinuousFundRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryContinuousFundRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryContinuousFundRequest) ProtoMessage() {} + +// Deprecated: Use QueryContinuousFundRequest.ProtoReflect.Descriptor instead. +func (*QueryContinuousFundRequest) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryContinuousFundRequest) GetRecipient() string { + if x != nil { + return x.Recipient + } + return "" +} + +// QueryUnclaimedBudgetResponse is the response type for the Query/ContinuousFund +// RPC method. +type QueryContinuousFundResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ContinuousFunds is the given continuous fund returned in the query. + ContinuousFund *ContinuousFund `protobuf:"bytes,1,opt,name=continuous_fund,json=continuousFund,proto3" json:"continuous_fund,omitempty"` +} + +func (x *QueryContinuousFundResponse) Reset() { + *x = QueryContinuousFundResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryContinuousFundResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryContinuousFundResponse) ProtoMessage() {} + +// Deprecated: Use QueryContinuousFundResponse.ProtoReflect.Descriptor instead. +func (*QueryContinuousFundResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryContinuousFundResponse) GetContinuousFund() *ContinuousFund { + if x != nil { + return x.ContinuousFund + } + return nil +} + +// QueryContinuousFundRequest is the request type for the Query/ContinuousFunds +// RPC method. +type QueryContinuousFundsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryContinuousFundsRequest) Reset() { + *x = QueryContinuousFundsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryContinuousFundsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryContinuousFundsRequest) ProtoMessage() {} + +// Deprecated: Use QueryContinuousFundsRequest.ProtoReflect.Descriptor instead. +func (*QueryContinuousFundsRequest) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_query_proto_rawDescGZIP(), []int{4} +} + +// QueryUnclaimedBudgetResponse is the response type for the Query/ContinuousFunds +// RPC method. +type QueryContinuousFundsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ContinuousFunds defines all continuous funds in state. + ContinuousFunds []*ContinuousFund `protobuf:"bytes,1,rep,name=continuous_funds,json=continuousFunds,proto3" json:"continuous_funds,omitempty"` +} + +func (x *QueryContinuousFundsResponse) Reset() { + *x = QueryContinuousFundsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryContinuousFundsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryContinuousFundsResponse) ProtoMessage() {} + +// Deprecated: Use QueryContinuousFundsResponse.ProtoReflect.Descriptor instead. +func (*QueryContinuousFundsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryContinuousFundsResponse) GetContinuousFunds() []*ContinuousFund { + if x != nil { + return x.ContinuousFunds + } + return nil +} + +// QueryParamsRequest is the response type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_query_proto_rawDescGZIP(), []int{6} +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_cosmos_protocolpool_v1_query_proto protoreflect.FileDescriptor + +var file_cosmos_protocolpool_v1_query_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, 0x71, 0x75, 0x65, 0x72, 0x79, 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, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 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, + 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, 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, 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, 0x7d, 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, 0x5f, 0x0a, 0x04, 0x70, 0x6f, + 0x6f, 0x6c, 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, 0x04, 0x70, 0x6f, 0x6f, 0x6c, 0x22, 0x54, 0x0a, 0x1a, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x72, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 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, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x22, 0x74, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, + 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x55, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x5f, 0x66, + 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 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, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, + 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, + 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x22, 0x1d, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x77, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, + 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, + 0x75, 0x6f, 0x75, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 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, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, + 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0f, + 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x73, 0x22, + 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x53, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, + 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xa7, 0x05, 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, 0xb7, 0x01, + 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, + 0x12, 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, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 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, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x36, 0x12, 0x34, 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, 0x6e, 0x74, 0x69, + 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x7d, 0x12, 0xae, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, + 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x73, 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, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, + 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x73, 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, 0x43, + 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, + 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, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, + 0x75, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x89, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x2a, 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, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2b, 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, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 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 ( + file_cosmos_protocolpool_v1_query_proto_rawDescOnce sync.Once + file_cosmos_protocolpool_v1_query_proto_rawDescData = file_cosmos_protocolpool_v1_query_proto_rawDesc +) + +func file_cosmos_protocolpool_v1_query_proto_rawDescGZIP() []byte { + file_cosmos_protocolpool_v1_query_proto_rawDescOnce.Do(func() { + file_cosmos_protocolpool_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_protocolpool_v1_query_proto_rawDescData) + }) + return file_cosmos_protocolpool_v1_query_proto_rawDescData +} + +var file_cosmos_protocolpool_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_cosmos_protocolpool_v1_query_proto_goTypes = []interface{}{ + (*QueryCommunityPoolRequest)(nil), // 0: cosmos.protocolpool.v1.QueryCommunityPoolRequest + (*QueryCommunityPoolResponse)(nil), // 1: cosmos.protocolpool.v1.QueryCommunityPoolResponse + (*QueryContinuousFundRequest)(nil), // 2: cosmos.protocolpool.v1.QueryContinuousFundRequest + (*QueryContinuousFundResponse)(nil), // 3: cosmos.protocolpool.v1.QueryContinuousFundResponse + (*QueryContinuousFundsRequest)(nil), // 4: cosmos.protocolpool.v1.QueryContinuousFundsRequest + (*QueryContinuousFundsResponse)(nil), // 5: cosmos.protocolpool.v1.QueryContinuousFundsResponse + (*QueryParamsRequest)(nil), // 6: cosmos.protocolpool.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 7: cosmos.protocolpool.v1.QueryParamsResponse + (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin + (*ContinuousFund)(nil), // 9: cosmos.protocolpool.v1.ContinuousFund + (*Params)(nil), // 10: cosmos.protocolpool.v1.Params +} +var file_cosmos_protocolpool_v1_query_proto_depIdxs = []int32{ + 8, // 0: cosmos.protocolpool.v1.QueryCommunityPoolResponse.pool:type_name -> cosmos.base.v1beta1.Coin + 9, // 1: cosmos.protocolpool.v1.QueryContinuousFundResponse.continuous_fund:type_name -> cosmos.protocolpool.v1.ContinuousFund + 9, // 2: cosmos.protocolpool.v1.QueryContinuousFundsResponse.continuous_funds:type_name -> cosmos.protocolpool.v1.ContinuousFund + 10, // 3: cosmos.protocolpool.v1.QueryParamsResponse.params:type_name -> cosmos.protocolpool.v1.Params + 0, // 4: cosmos.protocolpool.v1.Query.CommunityPool:input_type -> cosmos.protocolpool.v1.QueryCommunityPoolRequest + 2, // 5: cosmos.protocolpool.v1.Query.ContinuousFund:input_type -> cosmos.protocolpool.v1.QueryContinuousFundRequest + 4, // 6: cosmos.protocolpool.v1.Query.ContinuousFunds:input_type -> cosmos.protocolpool.v1.QueryContinuousFundsRequest + 6, // 7: cosmos.protocolpool.v1.Query.Params:input_type -> cosmos.protocolpool.v1.QueryParamsRequest + 1, // 8: cosmos.protocolpool.v1.Query.CommunityPool:output_type -> cosmos.protocolpool.v1.QueryCommunityPoolResponse + 3, // 9: cosmos.protocolpool.v1.Query.ContinuousFund:output_type -> cosmos.protocolpool.v1.QueryContinuousFundResponse + 5, // 10: cosmos.protocolpool.v1.Query.ContinuousFunds:output_type -> cosmos.protocolpool.v1.QueryContinuousFundsResponse + 7, // 11: cosmos.protocolpool.v1.Query.Params:output_type -> cosmos.protocolpool.v1.QueryParamsResponse + 8, // [8:12] is the sub-list for method output_type + 4, // [4:8] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_cosmos_protocolpool_v1_query_proto_init() } +func file_cosmos_protocolpool_v1_query_proto_init() { + if File_cosmos_protocolpool_v1_query_proto != nil { + return + } + file_cosmos_protocolpool_v1_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_protocolpool_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCommunityPoolRequest); 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[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCommunityPoolResponse); 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[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryContinuousFundRequest); 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.(*QueryContinuousFundResponse); 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[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryContinuousFundsRequest); 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[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryContinuousFundsResponse); 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[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); 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[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); 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_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_protocolpool_v1_query_proto_goTypes, + DependencyIndexes: file_cosmos_protocolpool_v1_query_proto_depIdxs, + MessageInfos: file_cosmos_protocolpool_v1_query_proto_msgTypes, + }.Build() + File_cosmos_protocolpool_v1_query_proto = out.File + file_cosmos_protocolpool_v1_query_proto_rawDesc = nil + file_cosmos_protocolpool_v1_query_proto_goTypes = nil + file_cosmos_protocolpool_v1_query_proto_depIdxs = nil +} diff --git a/api/cosmos/protocolpool/v1/query_grpc.pb.go b/api/cosmos/protocolpool/v1/query_grpc.pb.go new file mode 100644 index 0000000000..56ea9f2d1e --- /dev/null +++ b/api/cosmos/protocolpool/v1/query_grpc.pb.go @@ -0,0 +1,247 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: cosmos/protocolpool/v1/query.proto + +package protocolpoolv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Query_CommunityPool_FullMethodName = "/cosmos.protocolpool.v1.Query/CommunityPool" + Query_ContinuousFund_FullMethodName = "/cosmos.protocolpool.v1.Query/ContinuousFund" + Query_ContinuousFunds_FullMethodName = "/cosmos.protocolpool.v1.Query/ContinuousFunds" + Query_Params_FullMethodName = "/cosmos.protocolpool.v1.Query/Params" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service for community pool module. +type QueryClient interface { + // CommunityPool queries the community pool coins. + CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) + // ContinuousFund queries a continuous fund by the recipient is is associated with. + ContinuousFund(ctx context.Context, in *QueryContinuousFundRequest, opts ...grpc.CallOption) (*QueryContinuousFundResponse, error) + // ContinuousFunds queries all continuous funds in the store. + ContinuousFunds(ctx context.Context, in *QueryContinuousFundsRequest, opts ...grpc.CallOption) (*QueryContinuousFundsResponse, error) + // Params returns the total set of x/protocolpool parameters. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryCommunityPoolResponse) + err := c.cc.Invoke(ctx, Query_CommunityPool_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ContinuousFund(ctx context.Context, in *QueryContinuousFundRequest, opts ...grpc.CallOption) (*QueryContinuousFundResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryContinuousFundResponse) + err := c.cc.Invoke(ctx, Query_ContinuousFund_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ContinuousFunds(ctx context.Context, in *QueryContinuousFundsRequest, opts ...grpc.CallOption) (*QueryContinuousFundsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryContinuousFundsResponse) + err := c.cc.Invoke(ctx, Query_ContinuousFunds_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + 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. +// +// Query defines the gRPC querier service for community pool module. +type QueryServer interface { + // CommunityPool queries the community pool coins. + CommunityPool(context.Context, *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) + // ContinuousFund queries a continuous fund by the recipient is is associated with. + ContinuousFund(context.Context, *QueryContinuousFundRequest) (*QueryContinuousFundResponse, error) + // ContinuousFunds queries all continuous funds in the store. + ContinuousFunds(context.Context, *QueryContinuousFundsRequest) (*QueryContinuousFundsResponse, error) + // Params returns the total set of x/protocolpool parameters. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} + +func (UnimplementedQueryServer) CommunityPool(context.Context, *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CommunityPool not implemented") +} +func (UnimplementedQueryServer) ContinuousFund(context.Context, *QueryContinuousFundRequest) (*QueryContinuousFundResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ContinuousFund not implemented") +} +func (UnimplementedQueryServer) ContinuousFunds(context.Context, *QueryContinuousFundsRequest) (*QueryContinuousFundsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ContinuousFunds not implemented") +} +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_CommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCommunityPoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CommunityPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_CommunityPool_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CommunityPool(ctx, req.(*QueryCommunityPoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ContinuousFund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryContinuousFundRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ContinuousFund(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ContinuousFund_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ContinuousFund(ctx, req.(*QueryContinuousFundRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ContinuousFunds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryContinuousFundsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ContinuousFunds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ContinuousFunds_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ContinuousFunds(ctx, req.(*QueryContinuousFundsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + 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) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.protocolpool.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CommunityPool", + Handler: _Query_CommunityPool_Handler, + }, + { + MethodName: "ContinuousFund", + Handler: _Query_ContinuousFund_Handler, + }, + { + MethodName: "ContinuousFunds", + Handler: _Query_ContinuousFunds_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_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 new file mode 100644 index 0000000000..2bb1834f5d --- /dev/null +++ b/api/cosmos/protocolpool/v1/tx.pulsar.go @@ -0,0 +1,5575 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package protocolpoolv1 + +import ( + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "cosmossdk.io/api/cosmos/msg/v1" + 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" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_MsgFundCommunityPool_2_list)(nil) + +type _MsgFundCommunityPool_2_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgFundCommunityPool_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgFundCommunityPool_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgFundCommunityPool_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgFundCommunityPool_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgFundCommunityPool_2_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgFundCommunityPool_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgFundCommunityPool_2_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgFundCommunityPool_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgFundCommunityPool protoreflect.MessageDescriptor + fd_MsgFundCommunityPool_depositor protoreflect.FieldDescriptor + fd_MsgFundCommunityPool_amount protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgFundCommunityPool = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgFundCommunityPool") + fd_MsgFundCommunityPool_depositor = md_MsgFundCommunityPool.Fields().ByName("depositor") + fd_MsgFundCommunityPool_amount = md_MsgFundCommunityPool.Fields().ByName("amount") +} + +var _ protoreflect.Message = (*fastReflection_MsgFundCommunityPool)(nil) + +type fastReflection_MsgFundCommunityPool MsgFundCommunityPool + +func (x *MsgFundCommunityPool) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgFundCommunityPool)(x) +} + +func (x *MsgFundCommunityPool) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_tx_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_MsgFundCommunityPool_messageType fastReflection_MsgFundCommunityPool_messageType +var _ protoreflect.MessageType = fastReflection_MsgFundCommunityPool_messageType{} + +type fastReflection_MsgFundCommunityPool_messageType struct{} + +func (x fastReflection_MsgFundCommunityPool_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgFundCommunityPool)(nil) +} +func (x fastReflection_MsgFundCommunityPool_messageType) New() protoreflect.Message { + return new(fastReflection_MsgFundCommunityPool) +} +func (x fastReflection_MsgFundCommunityPool_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundCommunityPool +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgFundCommunityPool) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundCommunityPool +} + +// 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_MsgFundCommunityPool) Type() protoreflect.MessageType { + return _fastReflection_MsgFundCommunityPool_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgFundCommunityPool) New() protoreflect.Message { + return new(fastReflection_MsgFundCommunityPool) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgFundCommunityPool) Interface() protoreflect.ProtoMessage { + return (*MsgFundCommunityPool)(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_MsgFundCommunityPool) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Depositor != "" { + value := protoreflect.ValueOfString(x.Depositor) + if !f(fd_MsgFundCommunityPool_depositor, value) { + return + } + } + if len(x.Amount) != 0 { + value := protoreflect.ValueOfList(&_MsgFundCommunityPool_2_list{list: &x.Amount}) + if !f(fd_MsgFundCommunityPool_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_MsgFundCommunityPool) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgFundCommunityPool.depositor": + return x.Depositor != "" + case "cosmos.protocolpool.v1.MsgFundCommunityPool.amount": + return len(x.Amount) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgFundCommunityPool")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPool 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_MsgFundCommunityPool) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgFundCommunityPool.depositor": + x.Depositor = "" + case "cosmos.protocolpool.v1.MsgFundCommunityPool.amount": + x.Amount = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgFundCommunityPool")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPool 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_MsgFundCommunityPool) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.MsgFundCommunityPool.depositor": + value := x.Depositor + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.MsgFundCommunityPool.amount": + if len(x.Amount) == 0 { + return protoreflect.ValueOfList(&_MsgFundCommunityPool_2_list{}) + } + listValue := &_MsgFundCommunityPool_2_list{list: &x.Amount} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgFundCommunityPool")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPool 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_MsgFundCommunityPool) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgFundCommunityPool.depositor": + x.Depositor = value.Interface().(string) + case "cosmos.protocolpool.v1.MsgFundCommunityPool.amount": + lv := value.List() + clv := lv.(*_MsgFundCommunityPool_2_list) + x.Amount = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgFundCommunityPool")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPool 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_MsgFundCommunityPool) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgFundCommunityPool.amount": + if x.Amount == nil { + x.Amount = []*v1beta1.Coin{} + } + value := &_MsgFundCommunityPool_2_list{list: &x.Amount} + return protoreflect.ValueOfList(value) + case "cosmos.protocolpool.v1.MsgFundCommunityPool.depositor": + panic(fmt.Errorf("field depositor of message cosmos.protocolpool.v1.MsgFundCommunityPool is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgFundCommunityPool")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPool 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_MsgFundCommunityPool) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgFundCommunityPool.depositor": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.MsgFundCommunityPool.amount": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgFundCommunityPool_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgFundCommunityPool")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPool 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_MsgFundCommunityPool) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgFundCommunityPool", 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_MsgFundCommunityPool) 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_MsgFundCommunityPool) 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_MsgFundCommunityPool) 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_MsgFundCommunityPool) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgFundCommunityPool) + 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.Depositor) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Amount) > 0 { + for _, e := range x.Amount { + l = options.Size(e) + 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().(*MsgFundCommunityPool) + 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.Amount) > 0 { + for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Amount[iNdEx]) + 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.Depositor) > 0 { + i -= len(x.Depositor) + copy(dAtA[i:], x.Depositor) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Depositor))) + 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().(*MsgFundCommunityPool) + 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: MsgFundCommunityPool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgFundCommunityPool: 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 Depositor", 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.Depositor = 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 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 + } + x.Amount = append(x.Amount, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-1]); 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_MsgFundCommunityPoolResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgFundCommunityPoolResponse = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgFundCommunityPoolResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgFundCommunityPoolResponse)(nil) + +type fastReflection_MsgFundCommunityPoolResponse MsgFundCommunityPoolResponse + +func (x *MsgFundCommunityPoolResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgFundCommunityPoolResponse)(x) +} + +func (x *MsgFundCommunityPoolResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[1] + 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_MsgFundCommunityPoolResponse_messageType fastReflection_MsgFundCommunityPoolResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgFundCommunityPoolResponse_messageType{} + +type fastReflection_MsgFundCommunityPoolResponse_messageType struct{} + +func (x fastReflection_MsgFundCommunityPoolResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgFundCommunityPoolResponse)(nil) +} +func (x fastReflection_MsgFundCommunityPoolResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgFundCommunityPoolResponse) +} +func (x fastReflection_MsgFundCommunityPoolResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundCommunityPoolResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgFundCommunityPoolResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundCommunityPoolResponse +} + +// 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_MsgFundCommunityPoolResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgFundCommunityPoolResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgFundCommunityPoolResponse) New() protoreflect.Message { + return new(fastReflection_MsgFundCommunityPoolResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgFundCommunityPoolResponse) Interface() protoreflect.ProtoMessage { + return (*MsgFundCommunityPoolResponse)(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_MsgFundCommunityPoolResponse) 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_MsgFundCommunityPoolResponse) 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.MsgFundCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPoolResponse 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_MsgFundCommunityPoolResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgFundCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPoolResponse 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_MsgFundCommunityPoolResponse) 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.MsgFundCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPoolResponse 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_MsgFundCommunityPoolResponse) 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.MsgFundCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPoolResponse 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_MsgFundCommunityPoolResponse) 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.MsgFundCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPoolResponse 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_MsgFundCommunityPoolResponse) 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.MsgFundCommunityPoolResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgFundCommunityPoolResponse 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_MsgFundCommunityPoolResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgFundCommunityPoolResponse", 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_MsgFundCommunityPoolResponse) 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_MsgFundCommunityPoolResponse) 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_MsgFundCommunityPoolResponse) 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_MsgFundCommunityPoolResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgFundCommunityPoolResponse) + 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().(*MsgFundCommunityPoolResponse) + 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().(*MsgFundCommunityPoolResponse) + 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: MsgFundCommunityPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgFundCommunityPoolResponse: 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 _ protoreflect.List = (*_MsgCommunityPoolSpend_3_list)(nil) + +type _MsgCommunityPoolSpend_3_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgCommunityPoolSpend_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCommunityPoolSpend_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCommunityPoolSpend_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCommunityPoolSpend_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCommunityPoolSpend_3_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCommunityPoolSpend_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCommunityPoolSpend_3_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCommunityPoolSpend_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgCommunityPoolSpend protoreflect.MessageDescriptor + fd_MsgCommunityPoolSpend_authority protoreflect.FieldDescriptor + fd_MsgCommunityPoolSpend_recipient protoreflect.FieldDescriptor + fd_MsgCommunityPoolSpend_amount protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgCommunityPoolSpend = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgCommunityPoolSpend") + fd_MsgCommunityPoolSpend_authority = md_MsgCommunityPoolSpend.Fields().ByName("authority") + fd_MsgCommunityPoolSpend_recipient = md_MsgCommunityPoolSpend.Fields().ByName("recipient") + fd_MsgCommunityPoolSpend_amount = md_MsgCommunityPoolSpend.Fields().ByName("amount") +} + +var _ protoreflect.Message = (*fastReflection_MsgCommunityPoolSpend)(nil) + +type fastReflection_MsgCommunityPoolSpend MsgCommunityPoolSpend + +func (x *MsgCommunityPoolSpend) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCommunityPoolSpend)(x) +} + +func (x *MsgCommunityPoolSpend) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_tx_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_MsgCommunityPoolSpend_messageType fastReflection_MsgCommunityPoolSpend_messageType +var _ protoreflect.MessageType = fastReflection_MsgCommunityPoolSpend_messageType{} + +type fastReflection_MsgCommunityPoolSpend_messageType struct{} + +func (x fastReflection_MsgCommunityPoolSpend_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCommunityPoolSpend)(nil) +} +func (x fastReflection_MsgCommunityPoolSpend_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCommunityPoolSpend) +} +func (x fastReflection_MsgCommunityPoolSpend_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCommunityPoolSpend +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCommunityPoolSpend) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCommunityPoolSpend +} + +// 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_MsgCommunityPoolSpend) Type() protoreflect.MessageType { + return _fastReflection_MsgCommunityPoolSpend_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCommunityPoolSpend) New() protoreflect.Message { + return new(fastReflection_MsgCommunityPoolSpend) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCommunityPoolSpend) Interface() protoreflect.ProtoMessage { + return (*MsgCommunityPoolSpend)(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_MsgCommunityPoolSpend) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgCommunityPoolSpend_authority, value) { + return + } + } + if x.Recipient != "" { + value := protoreflect.ValueOfString(x.Recipient) + if !f(fd_MsgCommunityPoolSpend_recipient, value) { + return + } + } + if len(x.Amount) != 0 { + value := protoreflect.ValueOfList(&_MsgCommunityPoolSpend_3_list{list: &x.Amount}) + if !f(fd_MsgCommunityPoolSpend_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_MsgCommunityPoolSpend) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.authority": + return x.Authority != "" + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.recipient": + return x.Recipient != "" + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.amount": + return len(x.Amount) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCommunityPoolSpend")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpend 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_MsgCommunityPoolSpend) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.authority": + x.Authority = "" + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.recipient": + x.Recipient = "" + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.amount": + x.Amount = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCommunityPoolSpend")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpend 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_MsgCommunityPoolSpend) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.recipient": + value := x.Recipient + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.amount": + if len(x.Amount) == 0 { + return protoreflect.ValueOfList(&_MsgCommunityPoolSpend_3_list{}) + } + listValue := &_MsgCommunityPoolSpend_3_list{list: &x.Amount} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCommunityPoolSpend")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpend 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_MsgCommunityPoolSpend) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.authority": + x.Authority = value.Interface().(string) + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.recipient": + x.Recipient = value.Interface().(string) + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.amount": + lv := value.List() + clv := lv.(*_MsgCommunityPoolSpend_3_list) + x.Amount = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCommunityPoolSpend")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpend 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_MsgCommunityPoolSpend) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.amount": + if x.Amount == nil { + x.Amount = []*v1beta1.Coin{} + } + value := &_MsgCommunityPoolSpend_3_list{list: &x.Amount} + return protoreflect.ValueOfList(value) + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.authority": + panic(fmt.Errorf("field authority of message cosmos.protocolpool.v1.MsgCommunityPoolSpend is not mutable")) + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.recipient": + panic(fmt.Errorf("field recipient of message cosmos.protocolpool.v1.MsgCommunityPoolSpend is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCommunityPoolSpend")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpend 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_MsgCommunityPoolSpend) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.authority": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.recipient": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.MsgCommunityPoolSpend.amount": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgCommunityPoolSpend_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCommunityPoolSpend")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpend 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_MsgCommunityPoolSpend) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgCommunityPoolSpend", 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_MsgCommunityPoolSpend) 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_MsgCommunityPoolSpend) 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_MsgCommunityPoolSpend) 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_MsgCommunityPoolSpend) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCommunityPoolSpend) + 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.Recipient) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Amount) > 0 { + for _, e := range x.Amount { + l = options.Size(e) + 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().(*MsgCommunityPoolSpend) + 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.Amount) > 0 { + for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Amount[iNdEx]) + 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.Recipient) > 0 { + i -= len(x.Recipient) + copy(dAtA[i:], x.Recipient) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Recipient))) + 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().(*MsgCommunityPoolSpend) + 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: MsgCommunityPoolSpend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCommunityPoolSpend: 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 Recipient", 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.Recipient = 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 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 + } + x.Amount = append(x.Amount, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-1]); 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_MsgCommunityPoolSpendResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgCommunityPoolSpendResponse = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgCommunityPoolSpendResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgCommunityPoolSpendResponse)(nil) + +type fastReflection_MsgCommunityPoolSpendResponse MsgCommunityPoolSpendResponse + +func (x *MsgCommunityPoolSpendResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCommunityPoolSpendResponse)(x) +} + +func (x *MsgCommunityPoolSpendResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_tx_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_MsgCommunityPoolSpendResponse_messageType fastReflection_MsgCommunityPoolSpendResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCommunityPoolSpendResponse_messageType{} + +type fastReflection_MsgCommunityPoolSpendResponse_messageType struct{} + +func (x fastReflection_MsgCommunityPoolSpendResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCommunityPoolSpendResponse)(nil) +} +func (x fastReflection_MsgCommunityPoolSpendResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCommunityPoolSpendResponse) +} +func (x fastReflection_MsgCommunityPoolSpendResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCommunityPoolSpendResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCommunityPoolSpendResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCommunityPoolSpendResponse +} + +// 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_MsgCommunityPoolSpendResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCommunityPoolSpendResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCommunityPoolSpendResponse) New() protoreflect.Message { + return new(fastReflection_MsgCommunityPoolSpendResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCommunityPoolSpendResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCommunityPoolSpendResponse)(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_MsgCommunityPoolSpendResponse) 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_MsgCommunityPoolSpendResponse) 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.MsgCommunityPoolSpendResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse 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_MsgCommunityPoolSpendResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse 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_MsgCommunityPoolSpendResponse) 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.MsgCommunityPoolSpendResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse 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_MsgCommunityPoolSpendResponse) 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.MsgCommunityPoolSpendResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse 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_MsgCommunityPoolSpendResponse) 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.MsgCommunityPoolSpendResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse 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_MsgCommunityPoolSpendResponse) 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.MsgCommunityPoolSpendResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse 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_MsgCommunityPoolSpendResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse", 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_MsgCommunityPoolSpendResponse) 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_MsgCommunityPoolSpendResponse) 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_MsgCommunityPoolSpendResponse) 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_MsgCommunityPoolSpendResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCommunityPoolSpendResponse) + 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().(*MsgCommunityPoolSpendResponse) + 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().(*MsgCommunityPoolSpendResponse) + 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: MsgCommunityPoolSpendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCommunityPoolSpendResponse: 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_MsgCreateContinuousFund protoreflect.MessageDescriptor + fd_MsgCreateContinuousFund_authority protoreflect.FieldDescriptor + fd_MsgCreateContinuousFund_recipient protoreflect.FieldDescriptor + fd_MsgCreateContinuousFund_percentage protoreflect.FieldDescriptor + fd_MsgCreateContinuousFund_expiry protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgCreateContinuousFund = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgCreateContinuousFund") + fd_MsgCreateContinuousFund_authority = md_MsgCreateContinuousFund.Fields().ByName("authority") + fd_MsgCreateContinuousFund_recipient = md_MsgCreateContinuousFund.Fields().ByName("recipient") + fd_MsgCreateContinuousFund_percentage = md_MsgCreateContinuousFund.Fields().ByName("percentage") + fd_MsgCreateContinuousFund_expiry = md_MsgCreateContinuousFund.Fields().ByName("expiry") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateContinuousFund)(nil) + +type fastReflection_MsgCreateContinuousFund MsgCreateContinuousFund + +func (x *MsgCreateContinuousFund) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateContinuousFund)(x) +} + +func (x *MsgCreateContinuousFund) 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_MsgCreateContinuousFund_messageType fastReflection_MsgCreateContinuousFund_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateContinuousFund_messageType{} + +type fastReflection_MsgCreateContinuousFund_messageType struct{} + +func (x fastReflection_MsgCreateContinuousFund_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateContinuousFund)(nil) +} +func (x fastReflection_MsgCreateContinuousFund_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateContinuousFund) +} +func (x fastReflection_MsgCreateContinuousFund_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateContinuousFund +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateContinuousFund) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateContinuousFund +} + +// 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_MsgCreateContinuousFund) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateContinuousFund_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateContinuousFund) New() protoreflect.Message { + return new(fastReflection_MsgCreateContinuousFund) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateContinuousFund) Interface() protoreflect.ProtoMessage { + return (*MsgCreateContinuousFund)(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_MsgCreateContinuousFund) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgCreateContinuousFund_authority, value) { + return + } + } + if x.Recipient != "" { + value := protoreflect.ValueOfString(x.Recipient) + if !f(fd_MsgCreateContinuousFund_recipient, value) { + return + } + } + if x.Percentage != "" { + value := protoreflect.ValueOfString(x.Percentage) + if !f(fd_MsgCreateContinuousFund_percentage, value) { + return + } + } + if x.Expiry != nil { + value := protoreflect.ValueOfMessage(x.Expiry.ProtoReflect()) + if !f(fd_MsgCreateContinuousFund_expiry, 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_MsgCreateContinuousFund) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.authority": + return x.Authority != "" + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.recipient": + return x.Recipient != "" + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.percentage": + return x.Percentage != "" + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.expiry": + return x.Expiry != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCreateContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFund 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_MsgCreateContinuousFund) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.authority": + x.Authority = "" + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.recipient": + x.Recipient = "" + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.percentage": + x.Percentage = "" + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.expiry": + x.Expiry = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCreateContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFund 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_MsgCreateContinuousFund) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.recipient": + value := x.Recipient + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.percentage": + value := x.Percentage + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.expiry": + value := x.Expiry + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCreateContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFund 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_MsgCreateContinuousFund) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.authority": + x.Authority = value.Interface().(string) + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.recipient": + x.Recipient = value.Interface().(string) + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.percentage": + x.Percentage = value.Interface().(string) + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.expiry": + x.Expiry = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCreateContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFund 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_MsgCreateContinuousFund) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.expiry": + if x.Expiry == nil { + x.Expiry = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Expiry.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.authority": + panic(fmt.Errorf("field authority of message cosmos.protocolpool.v1.MsgCreateContinuousFund is not mutable")) + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.recipient": + panic(fmt.Errorf("field recipient of message cosmos.protocolpool.v1.MsgCreateContinuousFund is not mutable")) + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.percentage": + panic(fmt.Errorf("field percentage of message cosmos.protocolpool.v1.MsgCreateContinuousFund is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCreateContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFund 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_MsgCreateContinuousFund) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.authority": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.recipient": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.percentage": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.MsgCreateContinuousFund.expiry": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCreateContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFund 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_MsgCreateContinuousFund) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgCreateContinuousFund", 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_MsgCreateContinuousFund) 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_MsgCreateContinuousFund) 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_MsgCreateContinuousFund) 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_MsgCreateContinuousFund) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateContinuousFund) + 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.Recipient) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Percentage) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Expiry != nil { + l = options.Size(x.Expiry) + 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().(*MsgCreateContinuousFund) + 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.Expiry != nil { + encoded, err := options.Marshal(x.Expiry) + 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 len(x.Percentage) > 0 { + i -= len(x.Percentage) + copy(dAtA[i:], x.Percentage) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Percentage))) + i-- + dAtA[i] = 0x1a + } + if len(x.Recipient) > 0 { + i -= len(x.Recipient) + copy(dAtA[i:], x.Recipient) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Recipient))) + 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().(*MsgCreateContinuousFund) + 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: MsgCreateContinuousFund: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateContinuousFund: 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 Recipient", 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.Recipient = 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 Percentage", 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.Percentage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Expiry", 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.Expiry == nil { + x.Expiry = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Expiry); 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_MsgCreateContinuousFundResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgCreateContinuousFundResponse = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgCreateContinuousFundResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateContinuousFundResponse)(nil) + +type fastReflection_MsgCreateContinuousFundResponse MsgCreateContinuousFundResponse + +func (x *MsgCreateContinuousFundResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateContinuousFundResponse)(x) +} + +func (x *MsgCreateContinuousFundResponse) 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_MsgCreateContinuousFundResponse_messageType fastReflection_MsgCreateContinuousFundResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateContinuousFundResponse_messageType{} + +type fastReflection_MsgCreateContinuousFundResponse_messageType struct{} + +func (x fastReflection_MsgCreateContinuousFundResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateContinuousFundResponse)(nil) +} +func (x fastReflection_MsgCreateContinuousFundResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateContinuousFundResponse) +} +func (x fastReflection_MsgCreateContinuousFundResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateContinuousFundResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateContinuousFundResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateContinuousFundResponse +} + +// 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_MsgCreateContinuousFundResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateContinuousFundResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateContinuousFundResponse) New() protoreflect.Message { + return new(fastReflection_MsgCreateContinuousFundResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateContinuousFundResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCreateContinuousFundResponse)(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_MsgCreateContinuousFundResponse) 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_MsgCreateContinuousFundResponse) 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.MsgCreateContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFundResponse 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_MsgCreateContinuousFundResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCreateContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFundResponse 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_MsgCreateContinuousFundResponse) 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.MsgCreateContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFundResponse 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_MsgCreateContinuousFundResponse) 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.MsgCreateContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFundResponse 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_MsgCreateContinuousFundResponse) 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.MsgCreateContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFundResponse 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_MsgCreateContinuousFundResponse) 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.MsgCreateContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCreateContinuousFundResponse 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_MsgCreateContinuousFundResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgCreateContinuousFundResponse", 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_MsgCreateContinuousFundResponse) 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_MsgCreateContinuousFundResponse) 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_MsgCreateContinuousFundResponse) 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_MsgCreateContinuousFundResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateContinuousFundResponse) + 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().(*MsgCreateContinuousFundResponse) + 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().(*MsgCreateContinuousFundResponse) + 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: MsgCreateContinuousFundResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateContinuousFundResponse: 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_MsgCancelContinuousFund protoreflect.MessageDescriptor + fd_MsgCancelContinuousFund_authority protoreflect.FieldDescriptor + fd_MsgCancelContinuousFund_recipient protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgCancelContinuousFund = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgCancelContinuousFund") + fd_MsgCancelContinuousFund_authority = md_MsgCancelContinuousFund.Fields().ByName("authority") + fd_MsgCancelContinuousFund_recipient = md_MsgCancelContinuousFund.Fields().ByName("recipient") +} + +var _ protoreflect.Message = (*fastReflection_MsgCancelContinuousFund)(nil) + +type fastReflection_MsgCancelContinuousFund MsgCancelContinuousFund + +func (x *MsgCancelContinuousFund) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCancelContinuousFund)(x) +} + +func (x *MsgCancelContinuousFund) 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_MsgCancelContinuousFund_messageType fastReflection_MsgCancelContinuousFund_messageType +var _ protoreflect.MessageType = fastReflection_MsgCancelContinuousFund_messageType{} + +type fastReflection_MsgCancelContinuousFund_messageType struct{} + +func (x fastReflection_MsgCancelContinuousFund_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCancelContinuousFund)(nil) +} +func (x fastReflection_MsgCancelContinuousFund_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCancelContinuousFund) +} +func (x fastReflection_MsgCancelContinuousFund_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelContinuousFund +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCancelContinuousFund) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelContinuousFund +} + +// 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_MsgCancelContinuousFund) Type() protoreflect.MessageType { + return _fastReflection_MsgCancelContinuousFund_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCancelContinuousFund) New() protoreflect.Message { + return new(fastReflection_MsgCancelContinuousFund) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCancelContinuousFund) Interface() protoreflect.ProtoMessage { + return (*MsgCancelContinuousFund)(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_MsgCancelContinuousFund) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgCancelContinuousFund_authority, value) { + return + } + } + if x.Recipient != "" { + value := protoreflect.ValueOfString(x.Recipient) + if !f(fd_MsgCancelContinuousFund_recipient, 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_MsgCancelContinuousFund) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.authority": + return x.Authority != "" + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.recipient": + return x.Recipient != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFund 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_MsgCancelContinuousFund) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.authority": + x.Authority = "" + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.recipient": + x.Recipient = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFund 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_MsgCancelContinuousFund) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.recipient": + value := x.Recipient + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFund 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_MsgCancelContinuousFund) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.authority": + x.Authority = value.Interface().(string) + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.recipient": + x.Recipient = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFund 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_MsgCancelContinuousFund) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.authority": + panic(fmt.Errorf("field authority of message cosmos.protocolpool.v1.MsgCancelContinuousFund is not mutable")) + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.recipient": + panic(fmt.Errorf("field recipient of message cosmos.protocolpool.v1.MsgCancelContinuousFund is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFund 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_MsgCancelContinuousFund) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.authority": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.MsgCancelContinuousFund.recipient": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFund 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_MsgCancelContinuousFund) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgCancelContinuousFund", 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_MsgCancelContinuousFund) 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_MsgCancelContinuousFund) 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_MsgCancelContinuousFund) 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_MsgCancelContinuousFund) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCancelContinuousFund) + 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.Recipient) + 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().(*MsgCancelContinuousFund) + 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.Recipient) > 0 { + i -= len(x.Recipient) + copy(dAtA[i:], x.Recipient) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Recipient))) + 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().(*MsgCancelContinuousFund) + 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: MsgCancelContinuousFund: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelContinuousFund: 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 Recipient", 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.Recipient = 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_MsgCancelContinuousFundResponse protoreflect.MessageDescriptor + fd_MsgCancelContinuousFundResponse_canceled_time protoreflect.FieldDescriptor + fd_MsgCancelContinuousFundResponse_canceled_height protoreflect.FieldDescriptor + fd_MsgCancelContinuousFundResponse_recipient protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgCancelContinuousFundResponse = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgCancelContinuousFundResponse") + fd_MsgCancelContinuousFundResponse_canceled_time = md_MsgCancelContinuousFundResponse.Fields().ByName("canceled_time") + fd_MsgCancelContinuousFundResponse_canceled_height = md_MsgCancelContinuousFundResponse.Fields().ByName("canceled_height") + fd_MsgCancelContinuousFundResponse_recipient = md_MsgCancelContinuousFundResponse.Fields().ByName("recipient") +} + +var _ protoreflect.Message = (*fastReflection_MsgCancelContinuousFundResponse)(nil) + +type fastReflection_MsgCancelContinuousFundResponse MsgCancelContinuousFundResponse + +func (x *MsgCancelContinuousFundResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCancelContinuousFundResponse)(x) +} + +func (x *MsgCancelContinuousFundResponse) 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_MsgCancelContinuousFundResponse_messageType fastReflection_MsgCancelContinuousFundResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCancelContinuousFundResponse_messageType{} + +type fastReflection_MsgCancelContinuousFundResponse_messageType struct{} + +func (x fastReflection_MsgCancelContinuousFundResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCancelContinuousFundResponse)(nil) +} +func (x fastReflection_MsgCancelContinuousFundResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCancelContinuousFundResponse) +} +func (x fastReflection_MsgCancelContinuousFundResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelContinuousFundResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCancelContinuousFundResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCancelContinuousFundResponse +} + +// 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_MsgCancelContinuousFundResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCancelContinuousFundResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCancelContinuousFundResponse) New() protoreflect.Message { + return new(fastReflection_MsgCancelContinuousFundResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCancelContinuousFundResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCancelContinuousFundResponse)(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_MsgCancelContinuousFundResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CanceledTime != nil { + value := protoreflect.ValueOfMessage(x.CanceledTime.ProtoReflect()) + if !f(fd_MsgCancelContinuousFundResponse_canceled_time, value) { + return + } + } + if x.CanceledHeight != uint64(0) { + value := protoreflect.ValueOfUint64(x.CanceledHeight) + if !f(fd_MsgCancelContinuousFundResponse_canceled_height, value) { + return + } + } + if x.Recipient != "" { + value := protoreflect.ValueOfString(x.Recipient) + if !f(fd_MsgCancelContinuousFundResponse_recipient, 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_MsgCancelContinuousFundResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_time": + return x.CanceledTime != nil + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_height": + return x.CanceledHeight != uint64(0) + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.recipient": + return x.Recipient != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFundResponse 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_MsgCancelContinuousFundResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_time": + x.CanceledTime = nil + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_height": + x.CanceledHeight = uint64(0) + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.recipient": + x.Recipient = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFundResponse 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_MsgCancelContinuousFundResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_time": + value := x.CanceledTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_height": + value := x.CanceledHeight + return protoreflect.ValueOfUint64(value) + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.recipient": + value := x.Recipient + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFundResponse 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_MsgCancelContinuousFundResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_time": + x.CanceledTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_height": + x.CanceledHeight = value.Uint() + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.recipient": + x.Recipient = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFundResponse 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_MsgCancelContinuousFundResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_time": + if x.CanceledTime == nil { + x.CanceledTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.CanceledTime.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_height": + panic(fmt.Errorf("field canceled_height of message cosmos.protocolpool.v1.MsgCancelContinuousFundResponse is not mutable")) + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.recipient": + panic(fmt.Errorf("field recipient of message cosmos.protocolpool.v1.MsgCancelContinuousFundResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFundResponse 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_MsgCancelContinuousFundResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_height": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.recipient": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgCancelContinuousFundResponse 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_MsgCancelContinuousFundResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgCancelContinuousFundResponse", 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_MsgCancelContinuousFundResponse) 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_MsgCancelContinuousFundResponse) 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_MsgCancelContinuousFundResponse) 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_MsgCancelContinuousFundResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCancelContinuousFundResponse) + 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.CanceledTime != nil { + l = options.Size(x.CanceledTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.CanceledHeight != 0 { + n += 1 + runtime.Sov(uint64(x.CanceledHeight)) + } + l = len(x.Recipient) + 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().(*MsgCancelContinuousFundResponse) + 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.Recipient) > 0 { + i -= len(x.Recipient) + copy(dAtA[i:], x.Recipient) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Recipient))) + i-- + dAtA[i] = 0x1a + } + if x.CanceledHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CanceledHeight)) + i-- + dAtA[i] = 0x10 + } + if x.CanceledTime != nil { + encoded, err := options.Marshal(x.CanceledTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 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().(*MsgCancelContinuousFundResponse) + 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: MsgCancelContinuousFundResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCancelContinuousFundResponse: 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 CanceledTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.CanceledTime == nil { + x.CanceledTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CanceledTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CanceledHeight", wireType) + } + x.CanceledHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.CanceledHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Recipient", 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.Recipient = 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_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgUpdateParams = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[8] + 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_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// 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_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(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_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, 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_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "cosmos.protocolpool.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParams 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_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgUpdateParams.authority": + x.Authority = "" + case "cosmos.protocolpool.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParams 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_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParams 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_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "cosmos.protocolpool.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParams 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_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "cosmos.protocolpool.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message cosmos.protocolpool.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParams 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_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParams 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_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgUpdateParams", 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + 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)) + } + if x.Params != nil { + l = options.Size(x.Params) + 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().(*MsgUpdateParams) + 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.Params != nil { + encoded, err := options.Marshal(x.Params) + 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.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().(*MsgUpdateParams) + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: 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 Params", 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.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_cosmos_protocolpool_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[9] + 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_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// 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_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) 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.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) 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.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) 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.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) 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.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.MsgUpdateParamsResponse", 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + 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().(*MsgUpdateParamsResponse) + 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().(*MsgUpdateParamsResponse) + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: 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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/protocolpool/v1/tx.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) +) + +// MsgFundCommunityPool allows an account to directly +// fund the community pool. +type MsgFundCommunityPool struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty"` + Amount []*v1beta1.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *MsgFundCommunityPool) Reset() { + *x = MsgFundCommunityPool{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgFundCommunityPool) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgFundCommunityPool) ProtoMessage() {} + +// Deprecated: Use MsgFundCommunityPool.ProtoReflect.Descriptor instead. +func (*MsgFundCommunityPool) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgFundCommunityPool) GetDepositor() string { + if x != nil { + return x.Depositor + } + return "" +} + +func (x *MsgFundCommunityPool) GetAmount() []*v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +type MsgFundCommunityPoolResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgFundCommunityPoolResponse) Reset() { + *x = MsgFundCommunityPoolResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgFundCommunityPoolResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgFundCommunityPoolResponse) ProtoMessage() {} + +// Deprecated: Use MsgFundCommunityPoolResponse.ProtoReflect.Descriptor instead. +func (*MsgFundCommunityPoolResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{1} +} + +// 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. +type MsgCommunityPoolSpend 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 string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + Amount []*v1beta1.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *MsgCommunityPoolSpend) Reset() { + *x = MsgCommunityPoolSpend{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCommunityPoolSpend) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCommunityPoolSpend) ProtoMessage() {} + +// Deprecated: Use MsgCommunityPoolSpend.ProtoReflect.Descriptor instead. +func (*MsgCommunityPoolSpend) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgCommunityPoolSpend) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgCommunityPoolSpend) GetRecipient() string { + if x != nil { + return x.Recipient + } + return "" +} + +func (x *MsgCommunityPoolSpend) GetAmount() []*v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + +// MsgCommunityPoolSpendResponse defines the response to executing a +// MsgCommunityPoolSpend message. +type MsgCommunityPoolSpendResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgCommunityPoolSpendResponse) Reset() { + *x = MsgCommunityPoolSpendResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCommunityPoolSpendResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCommunityPoolSpendResponse) ProtoMessage() {} + +// Deprecated: Use MsgCommunityPoolSpendResponse.ProtoReflect.Descriptor instead. +func (*MsgCommunityPoolSpendResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{3} +} + +// MsgCreateContinuousFund defines a message for adding continuous funds. +type MsgCreateContinuousFund 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 of the account receiving funds. + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + // Percentage is the percentage of funds to be allocated from Community pool. + Percentage string `protobuf:"bytes,3,opt,name=percentage,proto3" json:"percentage,omitempty"` + // Optional, if expiry is set, removes the state object when expired. + Expiry *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expiry,proto3" json:"expiry,omitempty"` +} + +func (x *MsgCreateContinuousFund) Reset() { + *x = MsgCreateContinuousFund{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateContinuousFund) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateContinuousFund) ProtoMessage() {} + +// Deprecated: Use MsgCreateContinuousFund.ProtoReflect.Descriptor instead. +func (*MsgCreateContinuousFund) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgCreateContinuousFund) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgCreateContinuousFund) GetRecipient() string { + if x != nil { + return x.Recipient + } + return "" +} + +func (x *MsgCreateContinuousFund) GetPercentage() string { + if x != nil { + return x.Percentage + } + return "" +} + +func (x *MsgCreateContinuousFund) GetExpiry() *timestamppb.Timestamp { + if x != nil { + return x.Expiry + } + return nil +} + +// MsgCreateContinuousFundResponse defines the response to executing a +// MsgCreateContinuousFund message. +type MsgCreateContinuousFundResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgCreateContinuousFundResponse) Reset() { + *x = MsgCreateContinuousFundResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateContinuousFundResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateContinuousFundResponse) ProtoMessage() {} + +// Deprecated: Use MsgCreateContinuousFundResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateContinuousFundResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{5} +} + +// MsgCancelContinuousFund defines a message to cancel continuous funds for a specific recipient. +type MsgCancelContinuousFund struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Authority is the account address of authority. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // Recipient is the account address string of the recipient whose funds are to be cancelled. + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (x *MsgCancelContinuousFund) Reset() { + *x = MsgCancelContinuousFund{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCancelContinuousFund) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCancelContinuousFund) ProtoMessage() {} + +// Deprecated: Use MsgCancelContinuousFund.ProtoReflect.Descriptor instead. +func (*MsgCancelContinuousFund) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgCancelContinuousFund) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgCancelContinuousFund) GetRecipient() string { + if x != nil { + return x.Recipient + } + return "" +} + +// MsgCancelContinuousFundResponse defines the response to executing a +// MsgCancelContinuousFund message. +type MsgCancelContinuousFundResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // CanceledTime is the canceled time. + CanceledTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=canceled_time,json=canceledTime,proto3" json:"canceled_time,omitempty"` + // CanceledHeight defines the canceled block height. + CanceledHeight uint64 `protobuf:"varint,2,opt,name=canceled_height,json=canceledHeight,proto3" json:"canceled_height,omitempty"` + // Recipient is the account address string of the recipient whose funds are cancelled. + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (x *MsgCancelContinuousFundResponse) Reset() { + *x = MsgCancelContinuousFundResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCancelContinuousFundResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCancelContinuousFundResponse) ProtoMessage() {} + +// Deprecated: Use MsgCancelContinuousFundResponse.ProtoReflect.Descriptor instead. +func (*MsgCancelContinuousFundResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{7} +} + +func (x *MsgCancelContinuousFundResponse) GetCanceledTime() *timestamppb.Timestamp { + if x != nil { + return x.CanceledTime + } + return nil +} + +func (x *MsgCancelContinuousFundResponse) GetCanceledHeight() uint64 { + if x != nil { + return x.CanceledHeight + } + return 0 +} + +func (x *MsgCancelContinuousFundResponse) GetRecipient() string { + if x != nil { + return x.Recipient + } + return "" +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams 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"` + // params defines the x/protocolpool parameters to update. + // + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{9} +} + +var File_cosmos_protocolpool_v1_tx_proto protoreflect.FileDescriptor + +var file_cosmos_protocolpool_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 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, 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, 0x1a, 0x14, 0x67, + 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 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, 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, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x63, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 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, 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, 0xa6, 0x02, 0x0a, + 0x17, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, + 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 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, 0x36, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 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, 0x72, + 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, + 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, + 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, + 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, + 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x79, 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, 0x06, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x79, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x21, 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x99, 0x01, 0x0a, 0x17, 0x4d, 0x73, 0x67, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, + 0x46, 0x75, 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, 0x36, 0x0a, 0x09, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 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, 0x72, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x22, 0xcd, 0x01, 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0d, 0x63, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, + 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x5f, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x63, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x36, 0x0a, 0x09, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x22, 0x97, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, + 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, + 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf1, 0x04, 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, 0x12, 0x80, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 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, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, + 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, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x14, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, + 0x6e, 0x64, 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, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, + 0x75, 0x6e, 0x64, 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, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, + 0x46, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 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, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 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, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 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, +} + +var ( + file_cosmos_protocolpool_v1_tx_proto_rawDescOnce sync.Once + file_cosmos_protocolpool_v1_tx_proto_rawDescData = file_cosmos_protocolpool_v1_tx_proto_rawDesc +) + +func file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP() []byte { + file_cosmos_protocolpool_v1_tx_proto_rawDescOnce.Do(func() { + file_cosmos_protocolpool_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_protocolpool_v1_tx_proto_rawDescData) + }) + return file_cosmos_protocolpool_v1_tx_proto_rawDescData +} + +var file_cosmos_protocolpool_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +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 + (*MsgCreateContinuousFund)(nil), // 4: cosmos.protocolpool.v1.MsgCreateContinuousFund + (*MsgCreateContinuousFundResponse)(nil), // 5: cosmos.protocolpool.v1.MsgCreateContinuousFundResponse + (*MsgCancelContinuousFund)(nil), // 6: cosmos.protocolpool.v1.MsgCancelContinuousFund + (*MsgCancelContinuousFundResponse)(nil), // 7: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse + (*MsgUpdateParams)(nil), // 8: cosmos.protocolpool.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 9: cosmos.protocolpool.v1.MsgUpdateParamsResponse + (*v1beta1.Coin)(nil), // 10: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + (*Params)(nil), // 12: cosmos.protocolpool.v1.Params +} +var file_cosmos_protocolpool_v1_tx_proto_depIdxs = []int32{ + 10, // 0: cosmos.protocolpool.v1.MsgFundCommunityPool.amount:type_name -> cosmos.base.v1beta1.Coin + 10, // 1: cosmos.protocolpool.v1.MsgCommunityPoolSpend.amount:type_name -> cosmos.base.v1beta1.Coin + 11, // 2: cosmos.protocolpool.v1.MsgCreateContinuousFund.expiry:type_name -> google.protobuf.Timestamp + 11, // 3: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_time:type_name -> google.protobuf.Timestamp + 12, // 4: cosmos.protocolpool.v1.MsgUpdateParams.params:type_name -> cosmos.protocolpool.v1.Params + 0, // 5: cosmos.protocolpool.v1.Msg.FundCommunityPool:input_type -> cosmos.protocolpool.v1.MsgFundCommunityPool + 2, // 6: cosmos.protocolpool.v1.Msg.CommunityPoolSpend:input_type -> cosmos.protocolpool.v1.MsgCommunityPoolSpend + 4, // 7: cosmos.protocolpool.v1.Msg.CreateContinuousFund:input_type -> cosmos.protocolpool.v1.MsgCreateContinuousFund + 6, // 8: cosmos.protocolpool.v1.Msg.CancelContinuousFund:input_type -> cosmos.protocolpool.v1.MsgCancelContinuousFund + 8, // 9: cosmos.protocolpool.v1.Msg.UpdateParams:input_type -> cosmos.protocolpool.v1.MsgUpdateParams + 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.CreateContinuousFund:output_type -> cosmos.protocolpool.v1.MsgCreateContinuousFundResponse + 7, // 13: cosmos.protocolpool.v1.Msg.CancelContinuousFund:output_type -> cosmos.protocolpool.v1.MsgCancelContinuousFundResponse + 9, // 14: cosmos.protocolpool.v1.Msg.UpdateParams:output_type -> cosmos.protocolpool.v1.MsgUpdateParamsResponse + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] 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_tx_proto_init() } +func file_cosmos_protocolpool_v1_tx_proto_init() { + if File_cosmos_protocolpool_v1_tx_proto != nil { + return + } + file_cosmos_protocolpool_v1_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_protocolpool_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgFundCommunityPool); 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[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgFundCommunityPoolResponse); 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[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCommunityPoolSpend); 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[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCommunityPoolSpendResponse); 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[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateContinuousFund); 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.(*MsgCreateContinuousFundResponse); 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.(*MsgCancelContinuousFund); 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.(*MsgCancelContinuousFundResponse); 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[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); 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[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); 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_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_protocolpool_v1_tx_proto_goTypes, + DependencyIndexes: file_cosmos_protocolpool_v1_tx_proto_depIdxs, + MessageInfos: file_cosmos_protocolpool_v1_tx_proto_msgTypes, + }.Build() + File_cosmos_protocolpool_v1_tx_proto = out.File + file_cosmos_protocolpool_v1_tx_proto_rawDesc = nil + file_cosmos_protocolpool_v1_tx_proto_goTypes = nil + file_cosmos_protocolpool_v1_tx_proto_depIdxs = nil +} diff --git a/api/cosmos/protocolpool/v1/tx_grpc.pb.go b/api/cosmos/protocolpool/v1/tx_grpc.pb.go new file mode 100644 index 0000000000..76d8adbaaf --- /dev/null +++ b/api/cosmos/protocolpool/v1/tx_grpc.pb.go @@ -0,0 +1,303 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: cosmos/protocolpool/v1/tx.proto + +package protocolpoolv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Msg_FundCommunityPool_FullMethodName = "/cosmos.protocolpool.v1.Msg/FundCommunityPool" + Msg_CommunityPoolSpend_FullMethodName = "/cosmos.protocolpool.v1.Msg/CommunityPoolSpend" + Msg_CreateContinuousFund_FullMethodName = "/cosmos.protocolpool.v1.Msg/CreateContinuousFund" + Msg_CancelContinuousFund_FullMethodName = "/cosmos.protocolpool.v1.Msg/CancelContinuousFund" + Msg_UpdateParams_FullMethodName = "/cosmos.protocolpool.v1.Msg/UpdateParams" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the pool Msg service. +type MsgClient interface { + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + 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. + CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) + // CreateContinuousFund defines a method to distribute a percentage of funds to an address continuously. + // This ContinuousFund can be indefinite or run until a given expiry time. + // Funds come from validator block rewards from x/distribution, but may also come from + // any user who funds the ProtocolPoolEscrow module account directly through x/bank. + CreateContinuousFund(ctx context.Context, in *MsgCreateContinuousFund, opts ...grpc.CallOption) (*MsgCreateContinuousFundResponse, error) + // CancelContinuousFund defines a method for cancelling continuous fund. + CancelContinuousFund(ctx context.Context, in *MsgCancelContinuousFund, opts ...grpc.CallOption) (*MsgCancelContinuousFundResponse, error) + // UpdateParams defines a governance operation for updating the x/protocolpool module parameters. + // The authority is defined in the keeper. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgFundCommunityPoolResponse) + err := c.cc.Invoke(ctx, Msg_FundCommunityPool_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgCommunityPoolSpendResponse) + err := c.cc.Invoke(ctx, Msg_CommunityPoolSpend_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateContinuousFund(ctx context.Context, in *MsgCreateContinuousFund, opts ...grpc.CallOption) (*MsgCreateContinuousFundResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgCreateContinuousFundResponse) + err := c.cc.Invoke(ctx, Msg_CreateContinuousFund_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CancelContinuousFund(ctx context.Context, in *MsgCancelContinuousFund, opts ...grpc.CallOption) (*MsgCancelContinuousFundResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgCancelContinuousFundResponse) + err := c.cc.Invoke(ctx, Msg_CancelContinuousFund_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + 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. +// +// Msg defines the pool Msg service. +type MsgServer interface { + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + 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. + CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) + // CreateContinuousFund defines a method to distribute a percentage of funds to an address continuously. + // This ContinuousFund can be indefinite or run until a given expiry time. + // Funds come from validator block rewards from x/distribution, but may also come from + // any user who funds the ProtocolPoolEscrow module account directly through x/bank. + CreateContinuousFund(context.Context, *MsgCreateContinuousFund) (*MsgCreateContinuousFundResponse, error) + // CancelContinuousFund defines a method for cancelling continuous fund. + CancelContinuousFund(context.Context, *MsgCancelContinuousFund) (*MsgCancelContinuousFundResponse, error) + // UpdateParams defines a governance operation for updating the x/protocolpool module parameters. + // The authority is defined in the keeper. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} + +func (UnimplementedMsgServer) FundCommunityPool(context.Context, *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundCommunityPool not implemented") +} +func (UnimplementedMsgServer) CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CommunityPoolSpend not implemented") +} +func (UnimplementedMsgServer) CreateContinuousFund(context.Context, *MsgCreateContinuousFund) (*MsgCreateContinuousFundResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateContinuousFund not implemented") +} +func (UnimplementedMsgServer) CancelContinuousFund(context.Context, *MsgCancelContinuousFund) (*MsgCancelContinuousFundResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelContinuousFund not implemented") +} +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_FundCommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFundCommunityPool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FundCommunityPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_FundCommunityPool_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FundCommunityPool(ctx, req.(*MsgFundCommunityPool)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CommunityPoolSpend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCommunityPoolSpend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CommunityPoolSpend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CommunityPoolSpend_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CommunityPoolSpend(ctx, req.(*MsgCommunityPoolSpend)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateContinuousFund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateContinuousFund) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateContinuousFund(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CreateContinuousFund_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateContinuousFund(ctx, req.(*MsgCreateContinuousFund)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CancelContinuousFund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelContinuousFund) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CancelContinuousFund(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CancelContinuousFund_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CancelContinuousFund(ctx, req.(*MsgCancelContinuousFund)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + 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) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.protocolpool.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "FundCommunityPool", + Handler: _Msg_FundCommunityPool_Handler, + }, + { + MethodName: "CommunityPoolSpend", + Handler: _Msg_CommunityPoolSpend_Handler, + }, + { + MethodName: "CreateContinuousFund", + Handler: _Msg_CreateContinuousFund_Handler, + }, + { + MethodName: "CancelContinuousFund", + Handler: _Msg_CancelContinuousFund_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_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 0000000000..186559450a --- /dev/null +++ b/api/cosmos/protocolpool/v1/types.pulsar.go @@ -0,0 +1,1351 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package protocolpoolv1 + +import ( + 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" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_ContinuousFund protoreflect.MessageDescriptor + fd_ContinuousFund_recipient protoreflect.FieldDescriptor + fd_ContinuousFund_percentage protoreflect.FieldDescriptor + fd_ContinuousFund_expiry protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_types_proto_init() + md_ContinuousFund = File_cosmos_protocolpool_v1_types_proto.Messages().ByName("ContinuousFund") + fd_ContinuousFund_recipient = md_ContinuousFund.Fields().ByName("recipient") + fd_ContinuousFund_percentage = md_ContinuousFund.Fields().ByName("percentage") + fd_ContinuousFund_expiry = md_ContinuousFund.Fields().ByName("expiry") +} + +var _ protoreflect.Message = (*fastReflection_ContinuousFund)(nil) + +type fastReflection_ContinuousFund ContinuousFund + +func (x *ContinuousFund) ProtoReflect() protoreflect.Message { + return (*fastReflection_ContinuousFund)(x) +} + +func (x *ContinuousFund) 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_ContinuousFund_messageType fastReflection_ContinuousFund_messageType +var _ protoreflect.MessageType = fastReflection_ContinuousFund_messageType{} + +type fastReflection_ContinuousFund_messageType struct{} + +func (x fastReflection_ContinuousFund_messageType) Zero() protoreflect.Message { + return (*fastReflection_ContinuousFund)(nil) +} +func (x fastReflection_ContinuousFund_messageType) New() protoreflect.Message { + return new(fastReflection_ContinuousFund) +} +func (x fastReflection_ContinuousFund_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ContinuousFund +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ContinuousFund) Descriptor() protoreflect.MessageDescriptor { + return md_ContinuousFund +} + +// 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_ContinuousFund) Type() protoreflect.MessageType { + return _fastReflection_ContinuousFund_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ContinuousFund) New() protoreflect.Message { + return new(fastReflection_ContinuousFund) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ContinuousFund) Interface() protoreflect.ProtoMessage { + return (*ContinuousFund)(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_ContinuousFund) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Recipient != "" { + value := protoreflect.ValueOfString(x.Recipient) + if !f(fd_ContinuousFund_recipient, value) { + return + } + } + if x.Percentage != "" { + value := protoreflect.ValueOfString(x.Percentage) + if !f(fd_ContinuousFund_percentage, value) { + return + } + } + if x.Expiry != nil { + value := protoreflect.ValueOfMessage(x.Expiry.ProtoReflect()) + if !f(fd_ContinuousFund_expiry, 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_ContinuousFund) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.ContinuousFund.recipient": + return x.Recipient != "" + case "cosmos.protocolpool.v1.ContinuousFund.percentage": + return x.Percentage != "" + case "cosmos.protocolpool.v1.ContinuousFund.expiry": + return x.Expiry != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.ContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.ContinuousFund 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_ContinuousFund) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.ContinuousFund.recipient": + x.Recipient = "" + case "cosmos.protocolpool.v1.ContinuousFund.percentage": + x.Percentage = "" + case "cosmos.protocolpool.v1.ContinuousFund.expiry": + x.Expiry = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.ContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.ContinuousFund 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_ContinuousFund) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.ContinuousFund.recipient": + value := x.Recipient + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.ContinuousFund.percentage": + value := x.Percentage + return protoreflect.ValueOfString(value) + case "cosmos.protocolpool.v1.ContinuousFund.expiry": + value := x.Expiry + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.ContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.ContinuousFund 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_ContinuousFund) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.ContinuousFund.recipient": + x.Recipient = value.Interface().(string) + case "cosmos.protocolpool.v1.ContinuousFund.percentage": + x.Percentage = value.Interface().(string) + case "cosmos.protocolpool.v1.ContinuousFund.expiry": + x.Expiry = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.ContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.ContinuousFund 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_ContinuousFund) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.ContinuousFund.expiry": + if x.Expiry == nil { + x.Expiry = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Expiry.ProtoReflect()) + case "cosmos.protocolpool.v1.ContinuousFund.recipient": + panic(fmt.Errorf("field recipient of message cosmos.protocolpool.v1.ContinuousFund is not mutable")) + case "cosmos.protocolpool.v1.ContinuousFund.percentage": + panic(fmt.Errorf("field percentage of message cosmos.protocolpool.v1.ContinuousFund is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.ContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.ContinuousFund 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_ContinuousFund) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.ContinuousFund.recipient": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.ContinuousFund.percentage": + return protoreflect.ValueOfString("") + case "cosmos.protocolpool.v1.ContinuousFund.expiry": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.ContinuousFund")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.ContinuousFund 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_ContinuousFund) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.ContinuousFund", 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_ContinuousFund) 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_ContinuousFund) 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_ContinuousFund) 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_ContinuousFund) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ContinuousFund) + 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.Recipient) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Percentage) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Expiry != nil { + l = options.Size(x.Expiry) + 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().(*ContinuousFund) + 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.Expiry != nil { + encoded, err := options.Marshal(x.Expiry) + 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.Percentage) > 0 { + i -= len(x.Percentage) + copy(dAtA[i:], x.Percentage) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Percentage))) + i-- + dAtA[i] = 0x12 + } + if len(x.Recipient) > 0 { + i -= len(x.Recipient) + copy(dAtA[i:], x.Recipient) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Recipient))) + 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().(*ContinuousFund) + 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: ContinuousFund: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ContinuousFund: 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 Recipient", 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.Recipient = 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 Percentage", 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.Percentage = 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 Expiry", 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.Expiry == nil { + x.Expiry = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Expiry); 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 _ protoreflect.List = (*_Params_1_list)(nil) + +type _Params_1_list struct { + list *[]string +} + +func (x *_Params_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field EnabledDistributionDenoms as it is not of Message kind")) +} + +func (x *_Params_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_enabled_distribution_denoms protoreflect.FieldDescriptor + fd_Params_distribution_frequency protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_types_proto_init() + md_Params = File_cosmos_protocolpool_v1_types_proto.Messages().ByName("Params") + fd_Params_enabled_distribution_denoms = md_Params.Fields().ByName("enabled_distribution_denoms") + fd_Params_distribution_frequency = md_Params.Fields().ByName("distribution_frequency") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_types_proto_msgTypes[1] + 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_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// 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_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(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_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.EnabledDistributionDenoms) != 0 { + value := protoreflect.ValueOfList(&_Params_1_list{list: &x.EnabledDistributionDenoms}) + if !f(fd_Params_enabled_distribution_denoms, value) { + return + } + } + if x.DistributionFrequency != uint64(0) { + value := protoreflect.ValueOfUint64(x.DistributionFrequency) + if !f(fd_Params_distribution_frequency, 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_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.Params.enabled_distribution_denoms": + return len(x.EnabledDistributionDenoms) != 0 + case "cosmos.protocolpool.v1.Params.distribution_frequency": + return x.DistributionFrequency != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Params")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Params 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_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.Params.enabled_distribution_denoms": + x.EnabledDistributionDenoms = nil + case "cosmos.protocolpool.v1.Params.distribution_frequency": + x.DistributionFrequency = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Params")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Params 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_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.Params.enabled_distribution_denoms": + if len(x.EnabledDistributionDenoms) == 0 { + return protoreflect.ValueOfList(&_Params_1_list{}) + } + listValue := &_Params_1_list{list: &x.EnabledDistributionDenoms} + return protoreflect.ValueOfList(listValue) + case "cosmos.protocolpool.v1.Params.distribution_frequency": + value := x.DistributionFrequency + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Params")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Params 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_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.Params.enabled_distribution_denoms": + lv := value.List() + clv := lv.(*_Params_1_list) + x.EnabledDistributionDenoms = *clv.list + case "cosmos.protocolpool.v1.Params.distribution_frequency": + x.DistributionFrequency = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Params")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Params 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_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.Params.enabled_distribution_denoms": + if x.EnabledDistributionDenoms == nil { + x.EnabledDistributionDenoms = []string{} + } + value := &_Params_1_list{list: &x.EnabledDistributionDenoms} + return protoreflect.ValueOfList(value) + case "cosmos.protocolpool.v1.Params.distribution_frequency": + panic(fmt.Errorf("field distribution_frequency of message cosmos.protocolpool.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Params")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Params 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_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.Params.enabled_distribution_denoms": + list := []string{} + return protoreflect.ValueOfList(&_Params_1_list{list: &list}) + case "cosmos.protocolpool.v1.Params.distribution_frequency": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Params")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.Params 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_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.Params", 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_Params) 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_Params) 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_Params) 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_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.EnabledDistributionDenoms) > 0 { + for _, s := range x.EnabledDistributionDenoms { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.DistributionFrequency != 0 { + n += 1 + runtime.Sov(uint64(x.DistributionFrequency)) + } + 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().(*Params) + 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.DistributionFrequency != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.DistributionFrequency)) + i-- + dAtA[i] = 0x10 + } + if len(x.EnabledDistributionDenoms) > 0 { + for iNdEx := len(x.EnabledDistributionDenoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.EnabledDistributionDenoms[iNdEx]) + copy(dAtA[i:], x.EnabledDistributionDenoms[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EnabledDistributionDenoms[iNdEx]))) + 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().(*Params) + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: 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 EnabledDistributionDenoms", 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.EnabledDistributionDenoms = append(x.EnabledDistributionDenoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DistributionFrequency", wireType) + } + x.DistributionFrequency = 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.DistributionFrequency |= 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: +// 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) +) + +// ContinuousFund defines the fields of continuous fund proposal. +type ContinuousFund struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Recipient is the address string of the account receiving funds. + Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + // Percentage is the percentage of funds to be allocated from Community pool. + Percentage string `protobuf:"bytes,2,opt,name=percentage,proto3" json:"percentage,omitempty"` + // Optional, if expiry is set, removes the state object when expired. + Expiry *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expiry,proto3" json:"expiry,omitempty"` +} + +func (x *ContinuousFund) Reset() { + *x = ContinuousFund{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContinuousFund) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContinuousFund) ProtoMessage() {} + +// Deprecated: Use ContinuousFund.ProtoReflect.Descriptor instead. +func (*ContinuousFund) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_types_proto_rawDescGZIP(), []int{0} +} + +func (x *ContinuousFund) GetRecipient() string { + if x != nil { + return x.Recipient + } + return "" +} + +func (x *ContinuousFund) GetPercentage() string { + if x != nil { + return x.Percentage + } + return "" +} + +func (x *ContinuousFund) GetExpiry() *timestamppb.Timestamp { + if x != nil { + return x.Expiry + } + return nil +} + +// Params defines the parameters for the protocolpool module. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // EnabledDistributionDenoms lists the denoms that are allowed to be distributed. + // This is to avoid spending time distributing undesired tokens to continuous funds and budgets. + EnabledDistributionDenoms []string `protobuf:"bytes,1,rep,name=enabled_distribution_denoms,json=enabledDistributionDenoms,proto3" json:"enabled_distribution_denoms,omitempty"` + // DistributionFrequency is the frequency (in terms of blocks) that funds are distributed out from the + // x/protocolpool module. + DistributionFrequency uint64 `protobuf:"varint,2,opt,name=distribution_frequency,json=distributionFrequency,proto3" json:"distribution_frequency,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_types_proto_rawDescGZIP(), []int{1} +} + +func (x *Params) GetEnabledDistributionDenoms() []string { + if x != nil { + return x.EnabledDistributionDenoms + } + return nil +} + +func (x *Params) GetDistributionFrequency() uint64 { + if x != nil { + return x.DistributionFrequency + } + return 0 +} + +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, 0x1f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd5, + 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, + 0x64, 0x12, 0x36, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 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, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x0a, 0x70, 0x65, 0x72, + 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, + 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, + 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, + 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x06, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x03, 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, 0x06, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x22, 0x7f, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x3e, 0x0a, 0x1b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x5f, 0x64, 0x69, 0x73, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x19, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x44, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, + 0x12, 0x35, 0x0a, 0x16, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x15, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 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, 2) +var file_cosmos_protocolpool_v1_types_proto_goTypes = []interface{}{ + (*ContinuousFund)(nil), // 0: cosmos.protocolpool.v1.ContinuousFund + (*Params)(nil), // 1: cosmos.protocolpool.v1.Params + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp +} +var file_cosmos_protocolpool_v1_types_proto_depIdxs = []int32{ + 2, // 0: cosmos.protocolpool.v1.ContinuousFund.expiry:type_name -> google.protobuf.Timestamp + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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 +} + +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.(*ContinuousFund); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_protocolpool_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); 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: 2, + 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/distribution/module/v1/module.proto b/proto/cosmos/distribution/module/v1/module.proto index accf920cb5..89be0c0a12 100644 --- a/proto/cosmos/distribution/module/v1/module.proto +++ b/proto/cosmos/distribution/module/v1/module.proto @@ -14,4 +14,4 @@ message Module { // authority defines the custom module authority. If not set, defaults to the governance module. string authority = 2; -} \ No newline at end of file +} diff --git a/proto/cosmos/distribution/v1beta1/query.proto b/proto/cosmos/distribution/v1beta1/query.proto index ffb8912135..6d7aad86d1 100644 --- a/proto/cosmos/distribution/v1beta1/query.proto +++ b/proto/cosmos/distribution/v1beta1/query.proto @@ -67,6 +67,8 @@ service Query { } // CommunityPool queries the community pool coins. + // + // WARNING: This query will fail if an external community pool is used. rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) { option (google.api.http).get = "/cosmos/distribution/v1beta1/community_pool"; } diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto index 88ef22671f..e2f556bd15 100644 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -29,6 +29,8 @@ service Msg { // FundCommunityPool defines a method to allow an account to directly // fund the community pool. + // + // WARNING: This method will fail if an external community pool is used. rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); // UpdateParams defines a governance operation for updating the x/distribution @@ -41,6 +43,8 @@ service Msg { // the community pool in the x/distribution module to another account, which // could be the governance module itself. The authority is defined in the // keeper. + // + // WARNING: This method will fail if an external community pool is used. rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse) { option (cosmos_proto.method_added_in) = "cosmos-sdk 0.47"; }; diff --git a/proto/cosmos/protocolpool/module/v1/module.proto b/proto/cosmos/protocolpool/module/v1/module.proto new file mode 100644 index 0000000000..5e3053c544 --- /dev/null +++ b/proto/cosmos/protocolpool/module/v1/module.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package cosmos.protocolpool.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the consensus module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/protocolpool" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} \ No newline at end of file diff --git a/proto/cosmos/protocolpool/v1/genesis.proto b/proto/cosmos/protocolpool/v1/genesis.proto new file mode 100644 index 0000000000..232fba678f --- /dev/null +++ b/proto/cosmos/protocolpool/v1/genesis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmos.protocolpool.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/protocolpool/types"; + +import "cosmos/protocolpool/v1/types.proto"; +import "gogoproto/gogo.proto"; + +// GenesisState defines the protocolpool module's genesis state. +message GenesisState { + // ContinuousFunds defines the continuous funds at genesis. + repeated ContinuousFund continuous_funds = 1 [(gogoproto.nullable) = false]; + + // Params defines the parameters of this module, currently only contains the + // denoms that will be used for continuous fund distributions. + Params params = 2 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/protocolpool/v1/query.proto b/proto/cosmos/protocolpool/v1/query.proto new file mode 100644 index 0000000000..6605697c9d --- /dev/null +++ b/proto/cosmos/protocolpool/v1/query.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package cosmos.protocolpool.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/protocolpool/types"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/protocolpool/v1/types.proto"; + +// Query defines the gRPC querier service for community pool module. +service Query { + // CommunityPool queries the community pool coins. + rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) { + option (google.api.http).get = "/cosmos/protocolpool/v1/community_pool"; + } + + // ContinuousFund queries a continuous fund by the recipient is is associated with. + rpc ContinuousFund(QueryContinuousFundRequest) returns (QueryContinuousFundResponse) { + option (google.api.http).get = "/cosmos/protocolpool/v1/continuous_funds/{recipient}"; + } + + // ContinuousFunds queries all continuous funds in the store. + rpc ContinuousFunds(QueryContinuousFundsRequest) returns (QueryContinuousFundsResponse) { + option (google.api.http).get = "/cosmos/protocolpool/v1/continuous_funds"; + } + + // Params returns the total set of x/protocolpool parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/protocolpool/v1/params"; + } +} + +// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC +// method. +message QueryCommunityPoolRequest {} + +// QueryCommunityPoolResponse is the response type for the Query/CommunityPool +// RPC method. +message QueryCommunityPoolResponse { + // pool defines community pool's coins. + repeated cosmos.base.v1beta1.Coin pool = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// QueryContinuousFundRequest is the request type for the Query/ContinuousFund +// RPC method. +message QueryContinuousFundRequest { + // recipient is the recipient address to query unclaimed budget amount for. + string recipient = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryUnclaimedBudgetResponse is the response type for the Query/ContinuousFund +// RPC method. +message QueryContinuousFundResponse { + // ContinuousFunds is the given continuous fund returned in the query. + ContinuousFund continuous_fund = 1 [(gogoproto.nullable) = false]; +} + +// QueryContinuousFundRequest is the request type for the Query/ContinuousFunds +// RPC method. +message QueryContinuousFundsRequest {} + +// QueryUnclaimedBudgetResponse is the response type for the Query/ContinuousFunds +// RPC method. +message QueryContinuousFundsResponse { + // ContinuousFunds defines all continuous funds in state. + repeated ContinuousFund continuous_funds = 1 [(gogoproto.nullable) = false]; +} + +// QueryParamsRequest is the response type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/proto/cosmos/protocolpool/v1/tx.proto b/proto/cosmos/protocolpool/v1/tx.proto new file mode 100644 index 0000000000..a344de74a9 --- /dev/null +++ b/proto/cosmos/protocolpool/v1/tx.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; +package cosmos.protocolpool.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/protocolpool/types"; + +import "cosmos/protocolpool/v1/types.proto"; +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"; + +// Msg defines the pool Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + 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. + rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); + + // CreateContinuousFund defines a method to distribute a percentage of funds to an address continuously. + // This ContinuousFund can be indefinite or run until a given expiry time. + // Funds come from validator block rewards from x/distribution, but may also come from + // any user who funds the ProtocolPoolEscrow module account directly through x/bank. + rpc CreateContinuousFund(MsgCreateContinuousFund) returns (MsgCreateContinuousFundResponse); + + // CancelContinuousFund defines a method for cancelling continuous fund. + rpc CancelContinuousFund(MsgCancelContinuousFund) returns (MsgCancelContinuousFundResponse); + + // UpdateParams defines a governance operation for updating the x/protocolpool module parameters. + // The authority is defined in the keeper. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgFundCommunityPool allows an account to directly +// fund the community pool. +message MsgFundCommunityPool { + option (cosmos.msg.v1.signer) = "depositor"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string depositor = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + repeated cosmos.base.v1beta1.Coin amount = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +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. +message MsgCommunityPoolSpend { + 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"]; + string recipient = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgCommunityPoolSpendResponse defines the response to executing a +// MsgCommunityPoolSpend message. +message MsgCommunityPoolSpendResponse {} + +// MsgCreateContinuousFund defines a message for adding continuous funds. +message MsgCreateContinuousFund { + 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 of the account receiving funds. + string recipient = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Percentage is the percentage of funds to be allocated from Community pool. + string percentage = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // Optional, if expiry is set, removes the state object when expired. + google.protobuf.Timestamp expiry = 4 [(gogoproto.stdtime) = true]; +} + +// MsgCreateContinuousFundResponse defines the response to executing a +// MsgCreateContinuousFund message. +message MsgCreateContinuousFundResponse {} + +// MsgCancelContinuousFund defines a message to cancel continuous funds for a specific recipient. +message MsgCancelContinuousFund { + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the account address of authority. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Recipient is the account address string of the recipient whose funds are to be cancelled. + string recipient = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgCancelContinuousFundResponse defines the response to executing a +// MsgCancelContinuousFund message. +message MsgCancelContinuousFundResponse { + // CanceledTime is the canceled time. + google.protobuf.Timestamp canceled_time = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // CanceledHeight defines the canceled block height. + uint64 canceled_height = 2; + // Recipient is the account address string of the recipient whose funds are cancelled. + string recipient = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + 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"]; + + // params defines the x/protocolpool parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/cosmos/protocolpool/v1/types.proto b/proto/cosmos/protocolpool/v1/types.proto new file mode 100644 index 0000000000..0f40ead56d --- /dev/null +++ b/proto/cosmos/protocolpool/v1/types.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +package cosmos.protocolpool.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/protocolpool/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; + +// ContinuousFund defines the fields of continuous fund proposal. +message ContinuousFund { + // Recipient is the address string of the account receiving funds. + string recipient = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Percentage is the percentage of funds to be allocated from Community pool. + string percentage = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // Optional, if expiry is set, removes the state object when expired. + google.protobuf.Timestamp expiry = 3 [(gogoproto.stdtime) = true]; +} + +// Params defines the parameters for the protocolpool module. +message Params { + // EnabledDistributionDenoms lists the denoms that are allowed to be distributed. + // This is to avoid spending time distributing undesired tokens to continuous funds and budgets. + repeated string enabled_distribution_denoms = 1; + + // DistributionFrequency is the frequency (in terms of blocks) that funds are distributed out from the + // x/protocolpool module. + uint64 distribution_frequency = 2; +} diff --git a/scripts/mockgen.sh b/scripts/mockgen.sh index 87c8ba387a..33df045019 100755 --- a/scripts/mockgen.sh +++ b/scripts/mockgen.sh @@ -26,3 +26,4 @@ $mockgen_cmd -source=x/genutil/types/expected_keepers.go -package testutil -dest $mockgen_cmd -source=x/gov/testutil/expected_keepers.go -package testutil -destination x/gov/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/staking/types/expected_keepers.go -package testutil -destination x/staking/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/auth/vesting/types/expected_keepers.go -package testutil -destination x/auth/vesting/testutil/expected_keepers_mocks.go +$mockgen_cmd -source=x/protocolpool/types/expected_keepers.go -package testutil -destination x/protocolpool/testutil/expected_keepers_mocks.go diff --git a/simapp/app.go b/simapp/app.go index 32b932e8c4..5929ea44b6 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -99,6 +99,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool" + protocolpoolkeeper "github.com/cosmos/cosmos-sdk/x/protocolpool/keeper" + protocolpooltypes "github.com/cosmos/cosmos-sdk/x/protocolpool/types" "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -115,14 +118,15 @@ var ( // module account permissions maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - nft.ModuleName: nil, - } + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + nft.ModuleName: nil, + protocolpooltypes.ModuleName: nil, + protocolpooltypes.ProtocolPoolEscrowAccount: nil} ) var ( @@ -157,11 +161,12 @@ type SimApp struct { CircuitKeeper circuitkeeper.Keeper // supplementary keepers - FeeGrantKeeper feegrantkeeper.Keeper - GroupKeeper groupkeeper.Keeper - AuthzKeeper authzkeeper.Keeper - NFTKeeper nftkeeper.Keeper - EpochsKeeper epochskeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + GroupKeeper groupkeeper.Keeper + AuthzKeeper authzkeeper.Keeper + NFTKeeper nftkeeper.Keeper + EpochsKeeper epochskeeper.Keeper + ProtocolPoolKeeper protocolpoolkeeper.Keeper // the module manager ModuleManager *module.Manager @@ -269,6 +274,7 @@ func NewSimApp( nftkeeper.StoreKey, group.StoreKey, epochstypes.StoreKey, + protocolpooltypes.StoreKey, ) // register streaming services @@ -348,6 +354,14 @@ func NewSimApp( authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + app.ProtocolPoolKeeper = protocolpoolkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[protocolpooltypes.StoreKey]), + app.AccountKeeper, + app.BankKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + app.DistrKeeper = distrkeeper.NewKeeper( appCodec, runtime.NewKVStoreService(keys[distrtypes.StoreKey]), @@ -356,6 +370,7 @@ func NewSimApp( app.StakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + distrkeeper.WithExternalCommunityPool(app.ProtocolPoolKeeper), ) app.SlashingKeeper = slashingkeeper.NewKeeper( @@ -513,6 +528,7 @@ func NewSimApp( consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), circuit.NewAppModule(appCodec, app.CircuitKeeper), epochs.NewAppModule(appCodec, app.EpochsKeeper), + protocolpool.NewAppModule(appCodec, app.ProtocolPoolKeeper, app.AccountKeeper, app.BankKeeper), ) // BasicModuleManager defines the module BasicManager is in charge of setting up basic, @@ -542,6 +558,7 @@ func NewSimApp( app.ModuleManager.SetOrderBeginBlockers( minttypes.ModuleName, distrtypes.ModuleName, + protocolpooltypes.ModuleName, slashingtypes.ModuleName, evidencetypes.ModuleName, stakingtypes.ModuleName, @@ -555,6 +572,7 @@ func NewSimApp( genutiltypes.ModuleName, feegrant.ModuleName, group.ModuleName, + protocolpooltypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -579,9 +597,33 @@ func NewSimApp( consensusparamtypes.ModuleName, circuittypes.ModuleName, epochstypes.ModuleName, + protocolpooltypes.ModuleName, } + + exportModuleOrder := []string{ + consensusparamtypes.ModuleName, + authtypes.ModuleName, + protocolpooltypes.ModuleName, // Must be exported before bank + banktypes.ModuleName, + distrtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + govtypes.ModuleName, + minttypes.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + authz.ModuleName, + feegrant.ModuleName, + nft.ModuleName, + group.ModuleName, + upgradetypes.ModuleName, + vestingtypes.ModuleName, + circuittypes.ModuleName, + epochstypes.ModuleName, + } + app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) - app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...) + app.ModuleManager.SetOrderExportGenesis(exportModuleOrder...) // Uncomment if you want to set a custom migration order here. // app.ModuleManager.SetOrderMigrations(custom order) diff --git a/simapp/app_config.go b/simapp/app_config.go index c2cc96ba34..174207c791 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -21,6 +21,7 @@ import ( groupmodulev1 "cosmossdk.io/api/cosmos/group/module/v1" mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" nftmodulev1 "cosmossdk.io/api/cosmos/nft/module/v1" + protocolpoolmodulev1 "cosmossdk.io/api/cosmos/protocolpool/module/v1" slashingmodulev1 "cosmossdk.io/api/cosmos/slashing/module/v1" stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" txconfigv1 "cosmossdk.io/api/cosmos/tx/config/v1" @@ -64,6 +65,8 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/group/module" // import for side-effects _ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + _ "github.com/cosmos/cosmos-sdk/x/protocolpool" // import for side-effects + protocolpooltypes "github.com/cosmos/cosmos-sdk/x/protocolpool/types" _ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" _ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects @@ -80,6 +83,8 @@ var ( {Account: stakingtypes.NotBondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}}, {Account: govtypes.ModuleName, Permissions: []string{authtypes.Burner}}, {Account: nft.ModuleName}, + {Account: protocolpooltypes.ModuleName}, + {Account: protocolpooltypes.ProtocolPoolEscrowAccount}, } // blocked account addresses @@ -94,167 +99,196 @@ var ( // govtypes.ModuleName } - // application configuration (used by depinject) - AppConfig = depinject.Configs(appconfig.Compose(&appv1alpha1.Config{ - Modules: []*appv1alpha1.ModuleConfig{ - { - Name: runtime.ModuleName, - Config: appconfig.WrapAny(&runtimev1alpha1.Module{ - AppName: "SimApp", - // NOTE: upgrade module is required to be prioritized - PreBlockers: []string{ - upgradetypes.ModuleName, - authtypes.ModuleName, + ModuleConfig = []*appv1alpha1.ModuleConfig{ + { + Name: runtime.ModuleName, + Config: appconfig.WrapAny(&runtimev1alpha1.Module{ + AppName: "SimApp", + // NOTE: upgrade module is required to be prioritized + PreBlockers: []string{ + upgradetypes.ModuleName, + authtypes.ModuleName, + }, + // During begin block slashing happens after distr.BeginBlocker so that + // there is nothing left over in the validator fee pool, so as to keep the + // CanWithdrawInvariant invariant. + // NOTE: staking module is required if HistoricalEntries param > 0 + BeginBlockers: []string{ + minttypes.ModuleName, + distrtypes.ModuleName, + protocolpooltypes.ModuleName, + slashingtypes.ModuleName, + evidencetypes.ModuleName, + stakingtypes.ModuleName, + authz.ModuleName, + epochstypes.ModuleName, + }, + EndBlockers: []string{ + govtypes.ModuleName, + stakingtypes.ModuleName, + feegrant.ModuleName, + group.ModuleName, + protocolpooltypes.ModuleName, + }, + OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{ + { + ModuleName: authtypes.ModuleName, + KvStoreKey: "acc", }, - // During begin block slashing happens after distr.BeginBlocker so that - // there is nothing left over in the validator fee pool, so as to keep the - // CanWithdrawInvariant invariant. - // NOTE: staking module is required if HistoricalEntries param > 0 - BeginBlockers: []string{ - minttypes.ModuleName, - distrtypes.ModuleName, - slashingtypes.ModuleName, - evidencetypes.ModuleName, - stakingtypes.ModuleName, - authz.ModuleName, - epochstypes.ModuleName, - }, - EndBlockers: []string{ - govtypes.ModuleName, - stakingtypes.ModuleName, - feegrant.ModuleName, - group.ModuleName, - }, - OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{ - { - ModuleName: authtypes.ModuleName, - KvStoreKey: "acc", - }, - }, - // NOTE: The genutils module must occur after staking so that pools are - // properly initialized with tokens from genesis accounts. - // NOTE: The genutils module must also occur after auth so that it can access the params from auth. - InitGenesis: []string{ - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - stakingtypes.ModuleName, - slashingtypes.ModuleName, - govtypes.ModuleName, - minttypes.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - authz.ModuleName, - feegrant.ModuleName, - nft.ModuleName, - group.ModuleName, - upgradetypes.ModuleName, - vestingtypes.ModuleName, - circuittypes.ModuleName, - epochstypes.ModuleName, - }, - // When ExportGenesis is not specified, the export genesis module order - // is equal to the init genesis order - // ExportGenesis: []string{}, - // Uncomment if you want to set a custom migration order here. - // OrderMigrations: []string{}, - }), - }, - { - Name: authtypes.ModuleName, - Config: appconfig.WrapAny(&authmodulev1.Module{ - Bech32Prefix: "cosmos", - ModuleAccountPermissions: moduleAccPerms, - // By default modules authority is the governance module. This is configurable with the following: - // Authority: "group", // A custom module authority can be set using a module name - // Authority: "cosmos1cwwv22j5ca08ggdv9c2uky355k908694z577tv", // or a specific address - }), - }, - { - Name: vestingtypes.ModuleName, - Config: appconfig.WrapAny(&vestingmodulev1.Module{}), - }, - { - Name: banktypes.ModuleName, - Config: appconfig.WrapAny(&bankmodulev1.Module{ - BlockedModuleAccountsOverride: blockAccAddrs, - }), - }, - { - Name: stakingtypes.ModuleName, - Config: appconfig.WrapAny(&stakingmodulev1.Module{ - // NOTE: specifying a prefix is only necessary when using bech32 addresses - // If not specfied, the auth Bech32Prefix appended with "valoper" and "valcons" is used by default - Bech32PrefixValidator: "cosmosvaloper", - Bech32PrefixConsensus: "cosmosvalcons", - }), - }, - { - Name: slashingtypes.ModuleName, - Config: appconfig.WrapAny(&slashingmodulev1.Module{}), - }, - { - Name: "tx", - Config: appconfig.WrapAny(&txconfigv1.Config{ - SkipAnteHandler: true, // Enable this to skip the default antehandlers and set custom ante handlers. - }), - }, - { - Name: genutiltypes.ModuleName, - Config: appconfig.WrapAny(&genutilmodulev1.Module{}), - }, - { - Name: authz.ModuleName, - Config: appconfig.WrapAny(&authzmodulev1.Module{}), - }, - { - Name: upgradetypes.ModuleName, - Config: appconfig.WrapAny(&upgrademodulev1.Module{}), - }, - { - Name: distrtypes.ModuleName, - Config: appconfig.WrapAny(&distrmodulev1.Module{}), - }, - { - Name: evidencetypes.ModuleName, - Config: appconfig.WrapAny(&evidencemodulev1.Module{}), - }, - { - Name: minttypes.ModuleName, - Config: appconfig.WrapAny(&mintmodulev1.Module{}), - }, - { - Name: group.ModuleName, - Config: appconfig.WrapAny(&groupmodulev1.Module{ - MaxExecutionPeriod: durationpb.New(time.Second * 1209600), - MaxMetadataLen: 255, - }), - }, - { - Name: nft.ModuleName, - Config: appconfig.WrapAny(&nftmodulev1.Module{}), - }, - { - Name: feegrant.ModuleName, - Config: appconfig.WrapAny(&feegrantmodulev1.Module{}), - }, - { - Name: govtypes.ModuleName, - Config: appconfig.WrapAny(&govmodulev1.Module{}), - }, - { - Name: consensustypes.ModuleName, - Config: appconfig.WrapAny(&consensusmodulev1.Module{}), - }, - { - Name: circuittypes.ModuleName, - Config: appconfig.WrapAny(&circuitmodulev1.Module{}), - }, - { - Name: epochstypes.ModuleName, - Config: appconfig.WrapAny(&epochsmodulev1.Module{}), - }, + }, + // NOTE: The genutils module must occur after staking so that pools are + // properly initialized with tokens from genesis accounts. + // NOTE: The genutils module must also occur after auth so that it can access the params from auth. + InitGenesis: []string{ + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + govtypes.ModuleName, + minttypes.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + authz.ModuleName, + feegrant.ModuleName, + nft.ModuleName, + group.ModuleName, + upgradetypes.ModuleName, + vestingtypes.ModuleName, + circuittypes.ModuleName, + epochstypes.ModuleName, + protocolpooltypes.ModuleName, + }, + // When ExportGenesis is not specified, the export genesis module order + // is equal to the init genesis order + ExportGenesis: []string{ + consensustypes.ModuleName, + authtypes.ModuleName, + protocolpooltypes.ModuleName, // Must be exported before bank + banktypes.ModuleName, + distrtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + govtypes.ModuleName, + minttypes.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + authz.ModuleName, + feegrant.ModuleName, + nft.ModuleName, + group.ModuleName, + upgradetypes.ModuleName, + vestingtypes.ModuleName, + circuittypes.ModuleName, + epochstypes.ModuleName, + }, + // Uncomment if you want to set a custom migration order here. + // OrderMigrations: []string{}, + }), }, + { + Name: authtypes.ModuleName, + Config: appconfig.WrapAny(&authmodulev1.Module{ + Bech32Prefix: "cosmos", + ModuleAccountPermissions: moduleAccPerms, + // By default modules authority is the governance module. This is configurable with the following: + // Authority: "group", // A custom module authority can be set using a module name + // Authority: "cosmos1cwwv22j5ca08ggdv9c2uky355k908694z577tv", // or a specific address + }), + }, + { + Name: vestingtypes.ModuleName, + Config: appconfig.WrapAny(&vestingmodulev1.Module{}), + }, + { + Name: banktypes.ModuleName, + Config: appconfig.WrapAny(&bankmodulev1.Module{ + BlockedModuleAccountsOverride: blockAccAddrs, + }), + }, + { + Name: stakingtypes.ModuleName, + Config: appconfig.WrapAny(&stakingmodulev1.Module{ + // NOTE: specifying a prefix is only necessary when using bech32 addresses + // If not specfied, the auth Bech32Prefix appended with "valoper" and "valcons" is used by default + Bech32PrefixValidator: "cosmosvaloper", + Bech32PrefixConsensus: "cosmosvalcons", + }), + }, + { + Name: slashingtypes.ModuleName, + Config: appconfig.WrapAny(&slashingmodulev1.Module{}), + }, + { + Name: "tx", + Config: appconfig.WrapAny(&txconfigv1.Config{ + SkipAnteHandler: true, // Enable this to skip the default antehandlers and set custom ante handlers. + }), + }, + { + Name: genutiltypes.ModuleName, + Config: appconfig.WrapAny(&genutilmodulev1.Module{}), + }, + { + Name: authz.ModuleName, + Config: appconfig.WrapAny(&authzmodulev1.Module{}), + }, + { + Name: upgradetypes.ModuleName, + Config: appconfig.WrapAny(&upgrademodulev1.Module{}), + }, + { + Name: distrtypes.ModuleName, + Config: appconfig.WrapAny(&distrmodulev1.Module{}), + }, + { + Name: evidencetypes.ModuleName, + Config: appconfig.WrapAny(&evidencemodulev1.Module{}), + }, + { + Name: minttypes.ModuleName, + Config: appconfig.WrapAny(&mintmodulev1.Module{}), + }, + { + Name: group.ModuleName, + Config: appconfig.WrapAny(&groupmodulev1.Module{ + MaxExecutionPeriod: durationpb.New(time.Second * 1209600), + MaxMetadataLen: 255, + }), + }, + { + Name: nft.ModuleName, + Config: appconfig.WrapAny(&nftmodulev1.Module{}), + }, + { + Name: feegrant.ModuleName, + Config: appconfig.WrapAny(&feegrantmodulev1.Module{}), + }, + { + Name: govtypes.ModuleName, + Config: appconfig.WrapAny(&govmodulev1.Module{}), + }, + { + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), + }, + { + Name: circuittypes.ModuleName, + Config: appconfig.WrapAny(&circuitmodulev1.Module{}), + }, + { + Name: epochstypes.ModuleName, + Config: appconfig.WrapAny(&epochsmodulev1.Module{}), + }, + { + Name: protocolpooltypes.ModuleName, + Config: appconfig.WrapAny(&protocolpoolmodulev1.Module{}), + }, + } + + // AppConfig is application configuration (used by depinject) + AppConfig = depinject.Configs(appconfig.Compose(&appv1alpha1.Config{ + Modules: ModuleConfig, }), depinject.Supply( // supply custom module basics @@ -264,5 +298,6 @@ var ( []govclient.ProposalHandler{}, ), }, - )) + ), + ) ) diff --git a/simapp/app_di.go b/simapp/app_di.go index 7565b1098d..bc168f76c4 100644 --- a/simapp/app_di.go +++ b/simapp/app_di.go @@ -41,6 +41,7 @@ import ( govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + protocolpoolkeeper "github.com/cosmos/cosmos-sdk/x/protocolpool/keeper" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) @@ -77,11 +78,12 @@ type SimApp struct { CircuitKeeper circuitkeeper.Keeper // supplementary keepers - FeeGrantKeeper feegrantkeeper.Keeper - GroupKeeper groupkeeper.Keeper - AuthzKeeper authzkeeper.Keeper - NFTKeeper nftkeeper.Keeper - EpochsKeeper epochskeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + GroupKeeper groupkeeper.Keeper + AuthzKeeper authzkeeper.Keeper + NFTKeeper nftkeeper.Keeper + EpochsKeeper epochskeeper.Keeper + ProtocolPoolKeeper protocolpoolkeeper.Keeper // simulation manager sm *module.SimulationManager @@ -182,6 +184,7 @@ func NewSimApp( &app.ConsensusParamsKeeper, &app.CircuitKeeper, &app.EpochsKeeper, + &app.ProtocolPoolKeeper, ); err != nil { panic(err) } diff --git a/simapp/app_test.go b/simapp/app_test.go index c19a1c03f4..d06b7df3a3 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -51,6 +51,8 @@ import ( group "github.com/cosmos/cosmos-sdk/x/group/module" "github.com/cosmos/cosmos-sdk/x/mint" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool" + protocolpooltypes "github.com/cosmos/cosmos-sdk/x/protocolpool/types" "github.com/cosmos/cosmos-sdk/x/slashing" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" @@ -210,21 +212,22 @@ func TestRunMigrations(t *testing.T) { _, err = app.ModuleManager.RunMigrations( app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()}), configurator, module.VersionMap{ - banktypes.ModuleName: 1, - authtypes.ModuleName: auth.AppModule{}.ConsensusVersion(), - authz.ModuleName: authzmodule.AppModule{}.ConsensusVersion(), - stakingtypes.ModuleName: staking.AppModule{}.ConsensusVersion(), - minttypes.ModuleName: mint.AppModule{}.ConsensusVersion(), - distrtypes.ModuleName: distribution.AppModule{}.ConsensusVersion(), - slashingtypes.ModuleName: slashing.AppModule{}.ConsensusVersion(), - govtypes.ModuleName: gov.AppModule{}.ConsensusVersion(), - grouptypes.ModuleName: group.AppModule{}.ConsensusVersion(), - upgradetypes.ModuleName: upgrade.AppModule{}.ConsensusVersion(), - vestingtypes.ModuleName: vesting.AppModule{}.ConsensusVersion(), - feegrant.ModuleName: feegrantmodule.AppModule{}.ConsensusVersion(), - evidencetypes.ModuleName: evidence.AppModule{}.ConsensusVersion(), - genutiltypes.ModuleName: genutil.AppModule{}.ConsensusVersion(), - epochstypes.ModuleName: epochs.AppModule{}.ConsensusVersion(), + banktypes.ModuleName: 1, + authtypes.ModuleName: auth.AppModule{}.ConsensusVersion(), + authz.ModuleName: authzmodule.AppModule{}.ConsensusVersion(), + stakingtypes.ModuleName: staking.AppModule{}.ConsensusVersion(), + minttypes.ModuleName: mint.AppModule{}.ConsensusVersion(), + distrtypes.ModuleName: distribution.AppModule{}.ConsensusVersion(), + slashingtypes.ModuleName: slashing.AppModule{}.ConsensusVersion(), + govtypes.ModuleName: gov.AppModule{}.ConsensusVersion(), + grouptypes.ModuleName: group.AppModule{}.ConsensusVersion(), + upgradetypes.ModuleName: upgrade.AppModule{}.ConsensusVersion(), + vestingtypes.ModuleName: vesting.AppModule{}.ConsensusVersion(), + feegrant.ModuleName: feegrantmodule.AppModule{}.ConsensusVersion(), + evidencetypes.ModuleName: evidence.AppModule{}.ConsensusVersion(), + genutiltypes.ModuleName: genutil.AppModule{}.ConsensusVersion(), + epochstypes.ModuleName: epochs.AppModule{}.ConsensusVersion(), + protocolpooltypes.ModuleName: protocolpool.AppModule{}.ConsensusVersion(), }, ) if tc.expRunErr { diff --git a/simapp/upgrades.go b/simapp/upgrades.go index f6443e7160..faa27a7c2d 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" epochstypes "github.com/cosmos/cosmos-sdk/x/epochs/types" + protocolpooltypes "github.com/cosmos/cosmos-sdk/x/protocolpool/types" ) // UpgradeName defines the on-chain upgrade name for the sample SimApp upgrade @@ -35,7 +36,7 @@ func (app SimApp) RegisterUpgradeHandlers() { storeUpgrades := storetypes.StoreUpgrades{ Added: []string{ epochstypes.ModuleName, - // protocolpooltypes.ModuleName, + protocolpooltypes.ModuleName, }, } diff --git a/systemtests/cli.go b/systemtests/cli.go index 0fae8a0f75..7791ef9b3f 100644 --- a/systemtests/cli.go +++ b/systemtests/cli.go @@ -228,14 +228,14 @@ func (c CLIWrapper) AwaitTxCommitted(submitResp string, timeout ...time.Duration return "", false } -// Keys wasmd keys CLI command +// Keys runs the keys CLI command func (c CLIWrapper) Keys(args ...string) string { args = c.WithKeyringFlags(args...) out, _ := c.run(args) return out } -// CustomQuery main entrypoint for wasmd CLI queries +// CustomQuery main entrypoint for CLI queries func (c CLIWrapper) CustomQuery(args ...string) string { args = c.WithQueryFlags(args...) out, _ := c.run(args) diff --git a/systemtests/system.go b/systemtests/system.go index fd14ee5fcf..b74e72bf9a 100644 --- a/systemtests/system.go +++ b/systemtests/system.go @@ -396,7 +396,7 @@ func (s *SystemUnderTest) AwaitBlockHeight(t *testing.T, targetHeight int64, tim if len(timeout) != 0 { maxWaitTime = timeout[0] } else { - maxWaitTime = time.Duration(targetHeight-s.currentHeight.Load()+3) * s.blockTime + maxWaitTime = time.Duration(targetHeight-s.currentHeight.Load()+4) * s.blockTime } abort := time.NewTimer(maxWaitTime).C for { diff --git a/systemtests/test_runner.go b/systemtests/test_runner.go index 2cd4fefbf4..e4b79483a1 100644 --- a/systemtests/test_runner.go +++ b/systemtests/test_runner.go @@ -22,7 +22,7 @@ var ( func RunTests(m *testing.M) { waitTime := flag.Duration("wait-time", DefaultWaitTime, "time to wait for chain events") nodesCount := flag.Int("nodes-count", 4, "number of nodes in the cluster") - blockTime := flag.Duration("block-time", 1000*time.Millisecond, "block creation time") + blockTime := flag.Duration("block-time", 3000*time.Millisecond, "block creation time") execBinary := flag.String("binary", "simd", "executable binary for server/ client side") bech32Prefix := flag.String("bech32", "cosmos", "bech32 prefix to be used with addresses") flag.BoolVar(&Verbose, "verbose", false, "verbose output") diff --git a/tests/e2e/distribution/cli_test.go b/tests/e2e/distribution/cli_test.go index 34d8cb0e05..09f0ecf134 100644 --- a/tests/e2e/distribution/cli_test.go +++ b/tests/e2e/distribution/cli_test.go @@ -10,13 +10,16 @@ import ( ) func TestE2ETestSuite(t *testing.T) { - suite.Run(t, new(E2ETestSuite)) + suite.Run(t, NewE2ETestSuite(false)) + suite.Run(t, NewE2ETestSuite(true)) } func TestGRPCQueryTestSuite(t *testing.T) { - suite.Run(t, new(GRPCQueryTestSuite)) + suite.Run(t, NewGRPCQueryTestSuite(false)) + suite.Run(t, NewGRPCQueryTestSuite(true)) } func TestWithdrawAllSuite(t *testing.T) { - suite.Run(t, new(WithdrawAllTestSuite)) + suite.Run(t, NewWithdrawAllTestSuite(false)) + suite.Run(t, NewWithdrawAllTestSuite(true)) } diff --git a/tests/e2e/distribution/grpc_query_suite.go b/tests/e2e/distribution/grpc_query_suite.go index 8ee8683b13..b544e15200 100644 --- a/tests/e2e/distribution/grpc_query_suite.go +++ b/tests/e2e/distribution/grpc_query_suite.go @@ -1,13 +1,12 @@ package distribution import ( + "encoding/json" "fmt" "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" - "cosmossdk.io/simapp" - sdktestutil "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,14 +18,20 @@ import ( type GRPCQueryTestSuite struct { suite.Suite - cfg network.Config - network *network.Network + externalPoolEnabled bool + cfg network.Config + network *network.Network +} + +func NewGRPCQueryTestSuite(externalPoolEnabled bool) *GRPCQueryTestSuite { + return &GRPCQueryTestSuite{externalPoolEnabled: externalPoolEnabled} } func (s *GRPCQueryTestSuite) SetupSuite() { - s.T().Log("setting up e2e test suite") + s.T().Log("setting up grpc e2e test suite") + + cfg := initNetworkConfig(s.T(), s.externalPoolEnabled) - cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) cfg.NumValidators = 1 s.cfg = cfg @@ -39,7 +44,7 @@ func (s *GRPCQueryTestSuite) SetupSuite() { // TearDownSuite cleans up the curret test network after _each_ test. func (s *GRPCQueryTestSuite) TearDownSuite() { - s.T().Log("tearing down e2e test suite1") + s.T().Log("tearing down grpc e2e test suite") s.network.Cleanup() } @@ -481,12 +486,19 @@ func (s *GRPCQueryTestSuite) TestQueryValidatorCommunityPoolGRPC() { } for _, tc := range testCases { - resp, err := sdktestutil.GetRequestWithHeaders(tc.url, tc.headers) - s.Run(tc.name, func() { - if tc.expErr { + resp, err := sdktestutil.GetRequestWithHeaders(tc.url, tc.headers) + + switch { + case tc.expErr: s.Require().Error(err) - } else { + case s.externalPoolEnabled: + s.Require().NoError(err) + var errMessage sdktestutil.ErrorResponse + s.Require().NoError(json.Unmarshal(resp, &errMessage)) + s.Require().Equal(2, errMessage.Code) + s.Require().Equal("external community pool is enabled - use the CommunityPool query exposed by the external community pool: invalid request: unknown request", errMessage.Message) + default: s.Require().NoError(err) s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(resp, tc.respType)) s.Require().Equal(tc.expected.String(), tc.respType.String()) diff --git a/tests/e2e/distribution/suite.go b/tests/e2e/distribution/suite.go index 28a982c145..a2cc0486fa 100644 --- a/tests/e2e/distribution/suite.go +++ b/tests/e2e/distribution/suite.go @@ -4,11 +4,16 @@ import ( "context" "encoding/hex" "fmt" + "testing" "time" "github.com/cosmos/gogoproto/proto" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" + "cosmossdk.io/depinject" + "cosmossdk.io/depinject/appconfig" "cosmossdk.io/math" "cosmossdk.io/simapp" @@ -19,20 +24,71 @@ import ( clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/distribution/client/cli" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + "github.com/cosmos/cosmos-sdk/x/gov" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + protocolpooltypes "github.com/cosmos/cosmos-sdk/x/protocolpool/types" ) type E2ETestSuite struct { suite.Suite - cfg network.Config - network *network.Network + externalPoolEnabled bool + cfg network.Config + network *network.Network } -func NewE2ETestSuite(cfg network.Config) *E2ETestSuite { - return &E2ETestSuite{cfg: cfg} +func NewE2ETestSuite(externalPoolEnabled bool) *E2ETestSuite { + return &E2ETestSuite{externalPoolEnabled: externalPoolEnabled} +} + +func removeModuleConfig(moduleConfig []*appv1alpha1.ModuleConfig, target string) []*appv1alpha1.ModuleConfig { + newConfig := make([]*appv1alpha1.ModuleConfig, 0, len(moduleConfig)) + for _, mod := range moduleConfig { + if mod.Name != target { + newConfig = append(newConfig, mod) + } + } + + return newConfig +} + +func initNetworkConfig(t *testing.T, externalPoolEnabled bool) network.Config { + t.Helper() + + moduleConfig := simapp.ModuleConfig + + // overwrite the module config so that protocolpool is removed "disabling" it + if !externalPoolEnabled { + moduleConfig = removeModuleConfig(moduleConfig, protocolpooltypes.ModuleName) + } + + t.Log("setting up the e2e test suite", "externalPoolEnabled", externalPoolEnabled) + + // application configuration (used by depinject) + AppConfig := depinject.Configs(appconfig.Compose(&appv1alpha1.Config{ + Modules: moduleConfig, + }), + depinject.Supply( + // supply custom module basics + map[string]module.AppModuleBasic{ + genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), + govtypes.ModuleName: gov.NewAppModuleBasic( + []govclient.ProposalHandler{}, + ), + }, + ), + ) + + cfg, err := network.DefaultConfigWithAppConfig(AppConfig) + require.NoError(t, err) + return cfg } // SetupSuite creates a new network for _each_ e2e test. We create a new @@ -42,7 +98,8 @@ func NewE2ETestSuite(cfg network.Config) *E2ETestSuite { func (s *E2ETestSuite) SetupSuite() { s.T().Log("setting up e2e test suite") - cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) + cfg := initNetworkConfig(s.T(), s.externalPoolEnabled) + cfg.NumValidators = 1 s.cfg = cfg @@ -363,9 +420,16 @@ func (s *E2ETestSuite) TestNewFundCommunityPoolCmd() { clientCtx := val.ClientCtx out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) - if tc.expectErr { + switch { + case tc.expectErr: s.Require().Error(err) - } else { + case s.externalPoolEnabled: + s.Require().NoError(err) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType)) + txResp := tc.respType.(*sdk.TxResponse) + // expect 18 because we cannot submit to distribution + s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, txResp.TxHash, 18)) + default: s.Require().NoError(err) s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) diff --git a/tests/e2e/distribution/withdraw_all_suite.go b/tests/e2e/distribution/withdraw_all_suite.go index 18a7a5b115..88567513ce 100644 --- a/tests/e2e/distribution/withdraw_all_suite.go +++ b/tests/e2e/distribution/withdraw_all_suite.go @@ -7,7 +7,6 @@ import ( "github.com/stretchr/testify/suite" "cosmossdk.io/math" - "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec/address" @@ -24,16 +23,22 @@ import ( type WithdrawAllTestSuite struct { suite.Suite - cfg network.Config - network *network.Network + externalPoolEnabled bool + cfg network.Config + network *network.Network +} + +func NewWithdrawAllTestSuite(externalPoolEnabled bool) *WithdrawAllTestSuite { + return &WithdrawAllTestSuite{externalPoolEnabled: externalPoolEnabled} } func (s *WithdrawAllTestSuite) SetupSuite() { - cfg := network.DefaultConfig(simapp.NewTestNetworkFixture) + s.T().Log("setting up withdraw all e2e test suite") + + cfg := initNetworkConfig(s.T(), s.externalPoolEnabled) cfg.NumValidators = 2 s.cfg = cfg - s.T().Log("setting up e2e test suite") network, err := network.New(s.T(), s.T().TempDir(), s.cfg) s.Require().NoError(err) s.network = network @@ -43,7 +48,7 @@ func (s *WithdrawAllTestSuite) SetupSuite() { // TearDownSuite cleans up the curret test network after _each_ test. func (s *WithdrawAllTestSuite) TearDownSuite() { - s.T().Log("tearing down e2e test suite") + s.T().Log("tearing down withdraw all e2e test suite") s.network.Cleanup() } diff --git a/tests/integration/protocolpool/module_test.go b/tests/integration/protocolpool/module_test.go new file mode 100644 index 0000000000..f721660c3a --- /dev/null +++ b/tests/integration/protocolpool/module_test.go @@ -0,0 +1,33 @@ +package protocolpool + +import ( + "testing" + + "gotest.tools/v3/assert" + + "cosmossdk.io/depinject" + "cosmossdk.io/log" + + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool/testutil" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +func TestCreateTestModule(t *testing.T) { + app, err := simtestutil.SetupAtGenesis( + depinject.Configs( + testutil.AppConfig, + depinject.Supply(log.NewNopLogger()), + ), + ) + assert.NilError(t, err) + + gotModule, found := app.ModuleManager.Modules[types.ModuleName] + assert.Assert(t, found) + assert.Assert(t, gotModule != nil) + + gotModule, found = app.ModuleManager.Modules[distrtypes.ModuleName] + assert.Assert(t, found) + assert.Assert(t, gotModule != nil) +} diff --git a/tests/systemtests/go.mod b/tests/systemtests/go.mod index 11beafd08a..b91de013ed 100644 --- a/tests/systemtests/go.mod +++ b/tests/systemtests/go.mod @@ -16,7 +16,7 @@ require ( github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.7.0 // indirect github.com/cosmos/iavl v1.2.2 // indirect - github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/dvsekhvalnov/jose2go v1.8.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect @@ -27,8 +27,11 @@ require ( github.com/spf13/pflag v1.0.6 // indirect github.com/stretchr/testify v1.10.0 github.com/tidwall/gjson v1.18.0 + github.com/tidwall/sjson v1.2.5 ) +require cosmossdk.io/math v1.5.0 + require ( cosmossdk.io/api v0.8.2 // indirect cosmossdk.io/collections v0.4.0 // indirect @@ -36,7 +39,6 @@ require ( cosmossdk.io/depinject v1.1.0 // indirect cosmossdk.io/errors v1.0.2 // indirect cosmossdk.io/log v1.5.1 // indirect - cosmossdk.io/math v1.5.0 // indirect cosmossdk.io/store v1.1.1 // indirect cosmossdk.io/x/tx v1.1.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect @@ -143,7 +145,6 @@ require ( github.com/tidwall/btree v1.7.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect - github.com/tidwall/sjson v1.2.5 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect diff --git a/tests/systemtests/go.sum b/tests/systemtests/go.sum index b5b3e546fb..b42d95f32d 100644 --- a/tests/systemtests/go.sum +++ b/tests/systemtests/go.sum @@ -190,8 +190,8 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= -github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dvsekhvalnov/jose2go v1.8.0 h1:LqkkVKAlHFfH9LOEl5fe4p/zL02OhWE7pCufMBG2jLA= +github.com/dvsekhvalnov/jose2go v1.8.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= diff --git a/tests/systemtests/protocolpool_test.go b/tests/systemtests/protocolpool_test.go new file mode 100644 index 0000000000..87420b04e5 --- /dev/null +++ b/tests/systemtests/protocolpool_test.go @@ -0,0 +1,462 @@ +//go:build system_test + +package systemtests + +import ( + "fmt" + "os" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/tidwall/gjson" + "github.com/tidwall/sjson" + + "cosmossdk.io/math" + "cosmossdk.io/systemtests" + + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" +) + +const ( + stakingModule = "staking" + distributionModule = "distribution" + protocolPoolModule = "protocolpool" + govModule = "gov" + authModule = "auth" + + genesisAmount = 1000000000000 + stakeAmount = 10000000000 + feeAmount = 1 + depositAmount = 50000000 + poolAmount = 100 +) + +func modifyGovParams(t *testing.T) { + t.Helper() + // set up params so that we should just auto pass + systemtests.Sut.ModifyGenesisJSON(t, + func(genesis []byte) []byte { + state, err := sjson.Set(string(genesis), "app_state.gov.params.max_deposit_period", (1 * time.Second).String()) + require.NoError(t, err) + return []byte(state) + }, + func(genesis []byte) []byte { + state, err := sjson.Set(string(genesis), "app_state.gov.params.voting_period", (11 * time.Second).String()) + require.NoError(t, err) + return []byte(state) + }, + func(genesis []byte) []byte { + state, err := sjson.Set(string(genesis), "app_state.gov.params.veto_threshold", "0.000001") + require.NoError(t, err) + return []byte(state) + }, + func(genesis []byte) []byte { + state, err := sjson.Set(string(genesis), "app_state.gov.params.threshold", "0.0000001") + require.NoError(t, err) + return []byte(state) + }, + func(genesis []byte) []byte { + state, err := sjson.Set(string(genesis), "app_state.gov.params.quorum", "0.0000001") + require.NoError(t, err) + return []byte(state) + }, + ) +} + +func submitGovProposal(t *testing.T, validatorAddress string, propFile *os.File) { + t.Helper() + + sut := systemtests.Sut + cli := systemtests.NewCLIWrapper(t, sut, systemtests.Verbose) + + args := []string{ + "tx", govModule, "submit-proposal", + propFile.Name(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, validatorAddress), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(feeAmount))).String()), + } + + rsp := cli.Run(args...) + txResult, found := cli.AwaitTxCommitted(rsp) + require.True(t, found) + systemtests.RequireTxSuccess(t, txResult) +} + +func voteAndEnsureProposalPassed(t *testing.T, validatorAddress string, propID int) { + t.Helper() + + sut := systemtests.Sut + cli := systemtests.NewCLIWrapper(t, sut, systemtests.Verbose) + + // check the proposal + proposalsResp := cli.CustomQuery("q", govModule, "proposals") + proposals := gjson.Get(proposalsResp, "proposals.#.id").Array() + require.NotEmpty(t, proposals) + + rsp := cli.CustomQuery("q", govModule, "proposal", fmt.Sprintf("%d", propID)) + status := gjson.Get(rsp, "proposal.status") + require.Equal(t, "PROPOSAL_STATUS_VOTING_PERIOD", status.String()) + + // vote on the proposal + args := []string{ + "tx", govModule, "vote", fmt.Sprintf("%d", propID), "yes", + fmt.Sprintf("--%s=%s", flags.FlagFrom, validatorAddress), + } + rsp = cli.Run(args...) + txResult, found := cli.AwaitTxCommitted(rsp) + require.True(t, found) + systemtests.RequireTxSuccess(t, txResult) + + time.Sleep(11 * time.Second) + systemtests.Sut.AwaitNextBlock(t) + + // ensure that vote has passed + rsp = cli.CustomQuery("q", "gov", "proposal", fmt.Sprintf("%d", propID)) + status = gjson.Get(rsp, "proposal.status") + require.Equal(t, "PROPOSAL_STATUS_PASSED", status.String()) +} + +func getGovAddress(t *testing.T) string { + t.Helper() + + sut := systemtests.Sut + cli := systemtests.NewCLIWrapper(t, sut, systemtests.Verbose) + + // get gov module address + resp := cli.CustomQuery("q", authModule, "module-account", "gov") + govAddress := gjson.Get(resp, "account.value.address").String() + _, bz, err := bech32.DecodeAndConvert(govAddress) + assert.NoError(t, err) + govAddress, err = bech32.ConvertAndEncode(sdk.Bech32MainPrefix, bz) + assert.NoError(t, err) + + return govAddress +} + +func TestQueryProtocolPool(t *testing.T) { + // Scenario: + // delegate tokens to validator + // check distribution + + sut := systemtests.Sut + sut.ResetChain(t) + + // set up gov params so we can pass props quickly + modifyGovParams(t) + + cli := systemtests.NewCLIWrapper(t, sut, systemtests.Verbose) + + // add genesis account with some tokens + account1Addr := cli.AddKey("account1") + sut.ModifyGenesisCLI(t, + []string{"genesis", "add-genesis-account", account1Addr, fmt.Sprintf("%d%s", genesisAmount, sdk.DefaultBondDenom)}, + ) + + sut.StartChain(t) + + // query validator address to delegate tokens + rsp := cli.CustomQuery("q", stakingModule, "validators") + valAddr := gjson.Get(rsp, "validators.#.operator_address").Array()[0].String() + + // get validator address + valSigner := gjson.Get(cli.Keys("keys", "list"), "0.address").String() + require.NotEmpty(t, valSigner) + + // stake tokens + rsp = cli.Run( + "tx", + stakingModule, + "delegate", + valAddr, + fmt.Sprintf("%d%s", stakeAmount, sdk.DefaultBondDenom), + "--from="+account1Addr, + fmt.Sprintf("--fees=%d%s", feeAmount, sdk.DefaultBondDenom), + ) + systemtests.RequireTxSuccess(t, rsp) + + beforeBalance := cli.QueryBalance(account1Addr, sdk.DefaultBondDenom) + assert.Equal(t, int64(genesisAmount-stakeAmount-feeAmount), beforeBalance) + + rsp = cli.CustomQuery("q", stakingModule, "delegation", account1Addr, valAddr) + assert.Equal(t, int64(stakeAmount), gjson.Get(rsp, "delegation_response.balance.amount").Int(), rsp) + assert.Equal(t, sdk.DefaultBondDenom, gjson.Get(rsp, "delegation_response.balance.denom").String(), rsp) + + t.Run("check x/distribution query does not work when using x/protocolpool", func(t *testing.T) { + failingCli := cli.WithRunErrorMatcher(func(t assert.TestingT, err error, msgAndArgs ...interface{}) (ok bool) { + assert.Error(t, err) + return false + }) + // query the community pool - should fail for x/distribution + _ = failingCli.CustomQuery("q", distributionModule, "community-pool") + }) + + t.Run("check x/protocolpool community pool query", func(t *testing.T) { + // query will work for x/protocolpool + rsp = cli.CustomQuery("q", protocolPoolModule, "community-pool") + poolAmount := gjson.Get(rsp, "pool.0.amount").Int() + assert.True(t, poolAmount > 0, rsp) + assert.Equal(t, sdk.DefaultBondDenom, gjson.Get(rsp, "pool.0.denom").String(), rsp) + + t.Log("block height", sut.CurrentHeight(), "\n") + sut.AwaitNBlocks(t, 1) + t.Log("block height", sut.CurrentHeight(), "\n") + + rsp = cli.CustomQuery("q", protocolPoolModule, "community-pool") + newPoolAmount := gjson.Get(rsp, "pool.0.amount").Int() + assert.Equal(t, sdk.DefaultBondDenom, gjson.Get(rsp, "pool.0.denom").String(), rsp) + // check that staking is continually rewarded + assert.True(t, newPoolAmount > poolAmount, rsp) + }) + + govAddress := getGovAddress(t) + + t.Run("valid proposal", func(t *testing.T) { + // Create a valid new proposal JSON. + validProp := fmt.Sprintf(` +{ + "messages": [ + { + "@type": "/cosmos.protocolpool.v1.MsgCommunityPoolSpend", + "authority": "%s", + "recipient": "%s", + "amount": [{ + "denom": "stake", + "amount": "%d" + }] + } + ], + "title": "My awesome title", + "summary": "My awesome description", + "deposit": "%s" +}`, + govAddress, + account1Addr, + poolAmount, + sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(depositAmount)), + ) + validPropFile := systemtests.StoreTempFile(t, []byte(validProp)) + defer validPropFile.Close() + + submitGovProposal(t, valSigner, validPropFile) + }) + + balanceBefore := cli.QueryBalance(account1Addr, sdk.DefaultBondDenom) + voteAndEnsureProposalPassed(t, valSigner, 1) + + // ensure that vote has passed + t.Run("ensure that the vote has passed", func(t *testing.T) { + // check that the funds were distributed + // should be previous balance plus amount from the pool (100) plus the deposit amount (50000000) + balanceAfter := cli.QueryBalance(account1Addr, sdk.DefaultBondDenom) + require.Equal(t, balanceBefore+poolAmount+depositAmount-feeAmount, balanceAfter) + }) +} + +// Create a continuous fund +// - submit prop and vote until passed +// Check that funds are distributed and continuous fund is cleaned up once expired +func TestContinuousFunds(t *testing.T) { + systemtests.Sut.ResetChain(t) + cli := systemtests.NewCLIWrapper(t, systemtests.Sut, systemtests.Verbose) + + // set up gov params so we can pass props quickly + modifyGovParams(t) + + // get validator address + valAddr := gjson.Get(cli.Keys("keys", "list"), "0.address").String() + require.NotEmpty(t, valAddr) + + // add genesis account with some tokens + account1Addr := cli.AddKey("account1") + systemtests.Sut.ModifyGenesisCLI(t, + []string{"genesis", "add-genesis-account", account1Addr, fmt.Sprintf("%d%s", genesisAmount, sdk.DefaultBondDenom)}, + ) + + systemtests.Sut.StartChain(t) + + govAddress := getGovAddress(t) + expiry := time.Now().Add(20 * time.Second).UTC() + + t.Run("valid proposal", func(t *testing.T) { + // Create a valid new proposal JSON. + validProp := fmt.Sprintf(` +{ + "messages": [ + { + "@type": "/cosmos.protocolpool.v1.MsgCreateContinuousFund", + "authority": "%s", + "recipient": "%s", + "percentage": "0.5", + "expiry": "%s" + } + ], + "title": "My awesome title", + "summary": "My awesome description", + "deposit": "%s" +}`, + govAddress, + account1Addr, + expiry.Format(time.RFC3339), + sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(depositAmount)), + ) + validPropFile := systemtests.StoreTempFile(t, []byte(validProp)) + defer validPropFile.Close() + + submitGovProposal(t, valAddr, validPropFile) + }) + + // get balance before any distribution + balanceBefore := cli.QueryBalance(account1Addr, sdk.DefaultBondDenom) + voteAndEnsureProposalPassed(t, valAddr, 1) + + // ensure that vote has passed + t.Run("ensure that the vote has passed", func(t *testing.T) { + // check that the fund exists + rsp := cli.CustomQuery("q", protocolPoolModule, "continuous-fund", account1Addr) + gotExpiry := gjson.Get(rsp, "continuous_fund.expiry").Time() + require.Equal(t, expiry.Truncate(time.Second), gotExpiry.Truncate(time.Second)) + recipient := gjson.Get(rsp, "continuous_fund.recipient").String() + require.Equal(t, account1Addr, recipient) + }) + + // wait long enough that it will be expired + time.Sleep(11 * time.Second) + systemtests.Sut.AwaitNextBlock(t) + + t.Run("check balance and that the fund is expired", func(t *testing.T) { + failingCli := cli.WithRunErrorMatcher(func(t assert.TestingT, err error, msgAndArgs ...interface{}) (ok bool) { + assert.Error(t, err) + return false + }) + // query the continuous fund - should be expired + _ = failingCli.CustomQuery("q", protocolPoolModule, "continuous-fund", account1Addr) + + // check that there is nothing in the store + rsp := cli.CustomQuery("q", protocolPoolModule, "continuous-funds") + require.Equal(t, "{}", rsp) + + balanceAfter := cli.QueryBalance(account1Addr, sdk.DefaultBondDenom) + + // check that our balance has increased due to fund accrual + require.True(t, balanceBefore < balanceAfter) + }) +} + +// Create a continuous fund +// - submit prop and vote until passed (no expiry) +// Create a cancellation prop +// - submit prop and vote until passed +// +// Check that some funds have been distributed and that the fund is canceled. +func TestCancelContinuousFunds(t *testing.T) { + systemtests.Sut.ResetChain(t) + cli := systemtests.NewCLIWrapper(t, systemtests.Sut, systemtests.Verbose) + + // set up gov params so we can pass props quickly + modifyGovParams(t) + + // get validator address + valAddr := gjson.Get(cli.Keys("keys", "list"), "0.address").String() + require.NotEmpty(t, valAddr) + + // add genesis account with some tokens + account1Addr := cli.AddKey("account1") + systemtests.Sut.ModifyGenesisCLI(t, + []string{"genesis", "add-genesis-account", account1Addr, fmt.Sprintf("%d%s", genesisAmount, sdk.DefaultBondDenom)}, + ) + + systemtests.Sut.StartChain(t) + + govAddress := getGovAddress(t) + + t.Run("valid proposal - create", func(t *testing.T) { + // Create a valid new proposal JSON. + validProp := fmt.Sprintf(` +{ + "messages": [ + { + "@type": "/cosmos.protocolpool.v1.MsgCreateContinuousFund", + "authority": "%s", + "recipient": "%s", + "percentage": "0.5" + } + ], + "title": "My awesome title", + "summary": "My awesome description", + "deposit": "%s" +}`, + govAddress, + account1Addr, + sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(depositAmount)), + ) + validPropFile := systemtests.StoreTempFile(t, []byte(validProp)) + defer validPropFile.Close() + + submitGovProposal(t, valAddr, validPropFile) + }) + + // get balance before any distribution + balanceBefore := cli.QueryBalance(account1Addr, sdk.DefaultBondDenom) + voteAndEnsureProposalPassed(t, valAddr, 1) + + // ensure that vote has passed + t.Run("ensure that the vote has passed - create", func(t *testing.T) { + // check that the fund exists + rsp := cli.CustomQuery("q", protocolPoolModule, "continuous-fund", account1Addr) + recipient := gjson.Get(rsp, "continuous_fund.recipient").String() + require.Equal(t, account1Addr, recipient) + }) + + t.Run("valid proposal - cancel", func(t *testing.T) { + // Create a valid new proposal JSON. + validProp := fmt.Sprintf(` +{ + "messages": [ + { + "@type": "/cosmos.protocolpool.v1.MsgCancelContinuousFund", + "authority": "%s", + "recipient": "%s" + } + ], + "title": "My awesome title", + "summary": "My awesome description", + "deposit": "%s" +}`, + govAddress, + account1Addr, + sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(depositAmount)), + ) + validPropFile := systemtests.StoreTempFile(t, []byte(validProp)) + defer validPropFile.Close() + + submitGovProposal(t, valAddr, validPropFile) + }) + + voteAndEnsureProposalPassed(t, valAddr, 2) + + // ensure that vote has passed + t.Run("ensure that the vote has passed - cancel", func(t *testing.T) { + // check that the fund does not exist + failingCli := cli.WithRunErrorMatcher(func(t assert.TestingT, err error, msgAndArgs ...interface{}) (ok bool) { + assert.Error(t, err) + return false + }) + // query the continuous fund - should be expired + _ = failingCli.CustomQuery("q", protocolPoolModule, "continuous-funds", account1Addr) + + // check that there is nothing in the store + rsp := cli.CustomQuery("q", protocolPoolModule, "continuous-funds") + require.Equal(t, "{}", rsp) + + balanceAfter := cli.QueryBalance(account1Addr, sdk.DefaultBondDenom) + + // balance should be balance greater than initial balance + require.True(t, balanceBefore < balanceAfter) + }) +} diff --git a/testutil/configurator/configurator.go b/testutil/configurator/configurator.go index 4359b57a5d..dc923bd5c0 100644 --- a/testutil/configurator/configurator.go +++ b/testutil/configurator/configurator.go @@ -17,12 +17,15 @@ import ( mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" nftmodulev1 "cosmossdk.io/api/cosmos/nft/module/v1" paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" + protocolpoolmodulev1 "cosmossdk.io/api/cosmos/protocolpool/module/v1" slashingmodulev1 "cosmossdk.io/api/cosmos/slashing/module/v1" stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" txconfigv1 "cosmossdk.io/api/cosmos/tx/config/v1" vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" "cosmossdk.io/core/appconfig" "cosmossdk.io/depinject" + + protocolpooltypes "github.com/cosmos/cosmos-sdk/x/protocolpool/types" ) // Config should never need to be instantiated manually and is solely used for ModuleOption. @@ -59,6 +62,7 @@ func defaultConfig() *Config { "consensus", "vesting", "circuit", + "protocolpool", }, EndBlockersOrder: []string{ "gov", @@ -79,6 +83,7 @@ func defaultConfig() *Config { "upgrade", "vesting", "circuit", + "protocolpool", }, InitGenesisOrder: []string{ "auth", @@ -99,6 +104,7 @@ func defaultConfig() *Config { "upgrade", "vesting", "circuit", + "protocolpool", }, setInitGenesis: true, } @@ -153,6 +159,8 @@ func AuthModule() ModuleOption { {Account: "not_bonded_tokens_pool", Permissions: []string{"burner", "staking"}}, {Account: "gov", Permissions: []string{"burner"}}, {Account: "nft"}, + {Account: protocolpooltypes.ModuleName}, + {Account: protocolpooltypes.ProtocolPoolEscrowAccount}, }, }), } @@ -309,6 +317,15 @@ func CircuitModule() ModuleOption { } } +func ProtocolPoolModule() ModuleOption { + return func(config *Config) { + config.ModuleConfigs[protocolpooltypes.ModuleName] = &appv1alpha1.ModuleConfig{ + Name: protocolpooltypes.ModuleName, + Config: appconfig.WrapAny(&protocolpoolmodulev1.Module{}), + } + } +} + func OmitInitGenesis() ModuleOption { return func(config *Config) { config.setInitGenesis = false diff --git a/testutil/rest.go b/testutil/rest.go index 6dc1c5792f..506923a15e 100644 --- a/testutil/rest.go +++ b/testutil/rest.go @@ -7,6 +7,11 @@ import ( "net/http" ) +type ErrorResponse struct { + Code int `json:"code"` + Message string `json:"message"` +} + // GetRequestWithHeaders defines a wrapper around an HTTP GET request with a provided URL // and custom headers // An error is returned if the request or reading the body fails. diff --git a/x/distribution/abci.go b/x/distribution/abci.go index 70fdb7eeb2..9598672e38 100644 --- a/x/distribution/abci.go +++ b/x/distribution/abci.go @@ -1,32 +1,17 @@ package distribution import ( - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - "github.com/cosmos/cosmos-sdk/x/distribution/types" ) // BeginBlocker sets the proposer for determining distribution during endblock // and distribute rewards for the previous block. func BeginBlocker(ctx sdk.Context, k keeper.Keeper) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) - - // determine the total power signing the block - var previousTotalPower int64 - for _, voteInfo := range ctx.VoteInfos() { - previousTotalPower += voteInfo.Validator.Power + if err := k.BeginBlocker(ctx); err != nil { + ctx.Logger().Error("BeginBlocker failed", "error", err) + return err } - // TODO this is Tendermint-dependent - // ref https://github.com/cosmos/cosmos-sdk/issues/3095 - if ctx.BlockHeight() > 1 { - if err := k.AllocateTokens(ctx, previousTotalPower, ctx.VoteInfos()); err != nil { - return err - } - } - - // record the proposer for when we payout on the next block - consAddr := sdk.ConsAddress(ctx.BlockHeader().ProposerAddress) - return k.SetPreviousProposerConsAddr(ctx, consAddr) + return nil } diff --git a/x/distribution/keeper/abci.go b/x/distribution/keeper/abci.go new file mode 100644 index 0000000000..534456d4b0 --- /dev/null +++ b/x/distribution/keeper/abci.go @@ -0,0 +1,41 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/distribution/types" +) + +// BeginBlocker sets the proposer for determining distribution during endblock +// and distribute rewards for the previous block. +func (k Keeper) BeginBlocker(ctx sdk.Context) error { + start := telemetry.Now() + defer telemetry.ModuleMeasureSince(types.ModuleName, start, telemetry.MetricKeyBeginBlocker) + + // determine the total power signing the block + var previousTotalPower int64 + // determine the total power signing the block + for _, voteInfo := range ctx.VoteInfos() { + previousTotalPower += voteInfo.Validator.Power + } + + // TODO this is Tendermint-dependent + // ref https://github.com/cosmos/cosmos-sdk/issues/3095 + height := ctx.BlockHeight() + if height > 1 { + if err := k.AllocateTokens(ctx, previousTotalPower, ctx.VoteInfos()); err != nil { + return err + } + + // send whole coins from community pool to x/protocolpool if enabled + if k.HasExternalCommunityPool() { + if err := k.sendCommunityPoolToExternalPool(ctx); err != nil { + return err + } + } + } + + // record the proposer for when we pay out on the next block + consAddr := sdk.ConsAddress(ctx.BlockHeader().ProposerAddress) + return k.SetPreviousProposerConsAddr(ctx, consAddr) +} diff --git a/x/distribution/keeper/abci_test.go b/x/distribution/keeper/abci_test.go new file mode 100644 index 0000000000..7fd82eaef1 --- /dev/null +++ b/x/distribution/keeper/abci_test.go @@ -0,0 +1,693 @@ +package keeper_test + +import ( + "fmt" + "testing" + "time" + + abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/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" + "github.com/cosmos/cosmos-sdk/x/distribution" + "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrtestutil "github.com/cosmos/cosmos-sdk/x/distribution/testutil" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + protocolpooltypes "github.com/cosmos/cosmos-sdk/x/protocolpool/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +var testProposerAddress = sdk.ConsAddress("test") + +var _ disttypes.ExternalCommunityPoolKeeper = &mockProtocolPoolKeeper{} + +type mockProtocolPoolKeeper struct{} + +func (m mockProtocolPoolKeeper) GetCommunityPoolModule() string { + return protocolpooltypes.ProtocolPoolEscrowAccount +} + +func (m mockProtocolPoolKeeper) FundCommunityPool(_ sdk.Context, _ sdk.Coins, _ sdk.AccAddress) error { + panic("do not use me") +} + +func (m mockProtocolPoolKeeper) DistributeFromCommunityPool(_ sdk.Context, _ sdk.Coins, _ sdk.AccAddress) error { + panic("do not use me") +} + +type testSetup struct { + testCtx testutil.TestContext + bankKeeper *distrtestutil.MockBankKeeper + stakingKeeper *distrtestutil.MockStakingKeeper + accountKeeper *distrtestutil.MockAccountKeeper + distrKeeper keeper.Keeper +} + +func setupTest(t *testing.T, protocolPoolEnabled bool) testSetup { + t.Helper() + + ctrl := gomock.NewController(t) + key := storetypes.NewKVStoreKey(disttypes.StoreKey) + storeService := runtime.NewKVStoreService(key) + testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) + encCfg := moduletestutil.MakeTestEncodingConfig(distribution.AppModuleBasic{}) + + bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) + stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) + accountKeeper := distrtestutil.NewMockAccountKeeper(ctrl) + + accountKeeper.EXPECT().GetModuleAccount(gomock.Any(), "fee_collector").Return(feeCollectorAcc).AnyTimes() + stakingKeeper.EXPECT().ValidatorAddressCodec().Return(address.NewBech32Codec("cosmosvaloper")).AnyTimes() + accountKeeper.EXPECT().GetModuleAddress(disttypes.ModuleName).Return(distrAcc.GetAddress()).AnyTimes() + + var opts []keeper.InitOption + if protocolPoolEnabled { + opts = append(opts, keeper.WithExternalCommunityPool(mockProtocolPoolKeeper{})) + // expect that we will verify that this module account is set + accountKeeper.EXPECT().GetModuleAddress(protocolpooltypes.ProtocolPoolEscrowAccount).Return(protocolPoolAcc.GetAddress()).AnyTimes() + } + + distrKeeper := keeper.NewKeeper( + encCfg.Codec, + storeService, + accountKeeper, + bankKeeper, + stakingKeeper, + "fee_collector", + authtypes.NewModuleAddress("gov").String(), + opts..., + ) + + // empty initialize + err := distrKeeper.FeePool.Set(testCtx.Ctx, disttypes.FeePool{ + CommunityPool: sdk.NewDecCoins(), + }) + require.NoError(t, err) + + return testSetup{ + testCtx: testCtx, + bankKeeper: bankKeeper, + distrKeeper: distrKeeper, + stakingKeeper: stakingKeeper, + accountKeeper: accountKeeper, + } +} + +// Scenario: +// check no distribution occurs after begin block with no extra validator state +func TestBeginBlockNoOp(t *testing.T) { + ts := setupTest(t, false) + ctx := ts.testCtx.Ctx. + WithBlockHeader(cmtproto.Header{ + ProposerAddress: testProposerAddress, + Time: time.Now(), + }). + WithBlockHeight(0) + + feePoolBefore, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + err = ts.distrKeeper.BeginBlocker(ctx) + require.NoError(t, err) + feePoolAfter, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + + require.True(t, feePoolBefore.CommunityPool.Equal(feePoolAfter.CommunityPool), fmt.Sprintf("before: %s, after: %s", feePoolBefore.CommunityPool.String(), feePoolAfter.CommunityPool.String())) + + // check cons address + got, err := ts.distrKeeper.GetPreviousProposerConsAddr(ctx) + require.NoError(t, err) + require.Equal(t, testProposerAddress, got) +} + +// Scenario: +// multiple validators with different commission and the same stake +// after the begin blocker, rewards should be distributed evenly based on their stake weight +// commission should differ based on their differing commission rates +// community pool should have portion of rewards distributed +func TestBeginBlockToMultipleValidators(t *testing.T) { + ts := setupTest(t, false) + + ctx := ts.testCtx.Ctx. + WithBlockHeader(cmtproto.Header{ + ProposerAddress: testProposerAddress, + Time: time.Now(), + }) + + // reset fee pool & set params + require.NoError(t, ts.distrKeeper.Params.Set(ctx, disttypes.DefaultParams())) + require.NoError(t, ts.distrKeeper.FeePool.Set(ctx, disttypes.InitialFeePool())) + + // create validator with 50% commission + valAddr0 := sdk.ValAddress(valConsAddr0) + val0, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + require.NoError(t, err) + val0.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + ts.stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val0, nil).AnyTimes() + + // create second validator with 0% commission + valAddr1 := sdk.ValAddress(valConsAddr1) + val1, err := distrtestutil.CreateValidator(valConsPk1, math.NewInt(100)) + require.NoError(t, err) + val1.Commission = stakingtypes.NewCommission(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) + ts.stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)).Return(val1, nil).AnyTimes() + + t.Run("assert initial state is zero", func(t *testing.T) { + // assert initial state: zero outstanding rewards, zero community pool, zero commission, zero current rewards + val0OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0OutstandingRewards.Rewards.IsZero()) + + val1OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1OutstandingRewards.Rewards.IsZero()) + + feePool, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + require.True(t, feePool.CommunityPool.IsZero()) + + val0Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0Commission.Commission.IsZero()) + + val1Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1Commission.Commission.IsZero()) + + val0CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0CurrentRewards.Rewards.IsZero()) + + val1CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1CurrentRewards.Rewards.IsZero()) + }) + + // allocate tokens as if both had voted and second was proposer + fees := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100))) + ts.bankKeeper.EXPECT().GetAllBalances(gomock.Any(), feeCollectorAcc.GetAddress()).Return(fees) + ts.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), "fee_collector", disttypes.ModuleName, fees) + + votes := []abci.VoteInfo{ + { + Validator: abci.Validator{ + Address: valConsPk0.Address(), + Power: 100, + }, + }, + { + Validator: abci.Validator{ + Address: valConsPk1.Address(), + Power: 100, + }, + }, + } + ctx = ctx.WithVoteInfos(votes).WithBlockHeight(2) + + feePoolBefore, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + err = ts.distrKeeper.BeginBlocker(ctx) + require.NoError(t, err) + feePoolAfter, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + + require.False(t, feePoolBefore.CommunityPool.Equal(feePoolAfter.CommunityPool), fmt.Sprintf("before: %s, after: %s", feePoolBefore.CommunityPool.String(), feePoolAfter.CommunityPool.String())) + + t.Run("assert rewards and commission distributed", func(t *testing.T) { + // 98 outstanding rewards (100 less 2 to community pool) - distributed among the two validators with the same stake weight + val0OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr0) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDecWithPrec(490, 1)}}, val0OutstandingRewards.Rewards) + + val1OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr1) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDecWithPrec(490, 1)}}, val1OutstandingRewards.Rewards) + + // 2 community pool coins + feePool, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDec(2)}}, feePool.CommunityPool) + + // 50% commission for first proposer, (0.5 * 98%) * 100 / 2 = 23.25 + val0Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr0) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDecWithPrec(2450, 2)}}, val0Commission.Commission) + + // zero commission for second proposer + val1Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1Commission.Commission.IsZero()) + + // just staking.proportional for first proposer less commission = (0.5 * 98%) * 100 / 2 = 24.50 + val0CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr0) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDecWithPrec(2450, 2)}}, val0CurrentRewards.Rewards) + + // proposer reward + staking.proportional for second proposer = (0.5 * (98%)) * 100 = 49 + val1CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr1) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDecWithPrec(490, 1)}}, val1CurrentRewards.Rewards) + }) + + // check cons address + got, err := ts.distrKeeper.GetPreviousProposerConsAddr(ctx) + require.NoError(t, err) + require.Equal(t, testProposerAddress, got) +} + +// Scenario: +// multiple validators with same commission and the same stake +// after the begin blocker, rewards should be distributed evenly based on their stake weight +// community pool should have portion of rewards distributed - should collect dust as decimal values +func TestBeginBlockCommunityPoolCollectsDust(t *testing.T) { + ts := setupTest(t, false) + ctx := ts.testCtx.Ctx. + WithBlockHeader(cmtproto.Header{ + ProposerAddress: testProposerAddress, + Time: time.Now(), + }) + + // reset fee pool + require.NoError(t, ts.distrKeeper.FeePool.Set(ctx, disttypes.InitialFeePool())) + require.NoError(t, ts.distrKeeper.Params.Set(ctx, disttypes.DefaultParams())) + + // create validator with 10% commission + valAddr0 := sdk.ValAddress(valConsAddr0) + val0, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + require.NoError(t, err) + val0.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) + ts.stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val0, nil).AnyTimes() + + // create second validator with 10% commission + valAddr1 := sdk.ValAddress(valConsAddr1) + val1, err := distrtestutil.CreateValidator(valConsPk1, math.NewInt(100)) + require.NoError(t, err) + val1.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) + ts.stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)).Return(val1, nil).AnyTimes() + + // create third validator with 10% commission + valAddr2 := sdk.ValAddress(valConsAddr2) + val2, err := stakingtypes.NewValidator(sdk.ValAddress(valConsAddr2).String(), valConsPk1, stakingtypes.Description{}) + require.NoError(t, err) + val2.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) + ts.stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk2)).Return(val2, nil).AnyTimes() + + t.Run("assert initial state is zero", func(t *testing.T) { + // assert initial state: zero outstanding rewards, zero community pool, zero commission, zero current rewards + val0OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0OutstandingRewards.Rewards.IsZero()) + + val1OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1OutstandingRewards.Rewards.IsZero()) + + val2OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr2) + require.NoError(t, err) + require.True(t, val2OutstandingRewards.Rewards.IsZero()) + + feePool, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + require.True(t, feePool.CommunityPool.IsZero()) + + val0Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0Commission.Commission.IsZero()) + + val1Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1Commission.Commission.IsZero()) + + val0CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0CurrentRewards.Rewards.IsZero()) + + val1CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1CurrentRewards.Rewards.IsZero()) + }) + + // allocate tokens as if both had voted and second was proposer + fees := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(634195840))) + expectedCommunityPool := sdk.NewDecCoins(sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyMustNewDecFromStr("12683916.800000001243023848"))) + ts.bankKeeper.EXPECT().GetAllBalances(gomock.Any(), feeCollectorAcc.GetAddress()).Return(fees) + ts.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), "fee_collector", disttypes.ModuleName, fees) + + votes := []abci.VoteInfo{ + { + Validator: abci.Validator{ + Address: valConsPk0.Address(), + Power: 11, + }, + }, + { + Validator: abci.Validator{ + Address: valConsPk1.Address(), + Power: 10, + }, + }, + { + Validator: abci.Validator{ + Address: valConsPk2.Address(), + Power: 10, + }, + }, + } + ctx = ctx.WithVoteInfos(votes).WithBlockHeight(2) + + feePoolBefore, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + err = ts.distrKeeper.BeginBlocker(ctx) + require.NoError(t, err) + feePoolAfter, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + + // check that the community pool has collected all the dust from truncating rewards to sdk.Ints + require.False(t, feePoolBefore.CommunityPool.Equal(feePoolAfter.CommunityPool), fmt.Sprintf("before: %s, after: %s", feePoolBefore.CommunityPool.String(), feePoolAfter.CommunityPool.String())) + require.True(t, feePoolAfter.CommunityPool.Equal(expectedCommunityPool)) + + t.Run("assert rewards distributed", func(t *testing.T) { + val0OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0OutstandingRewards.Rewards.IsValid()) + + val1OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1OutstandingRewards.Rewards.IsValid()) + + val2OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr2) + require.NoError(t, err) + require.True(t, val2OutstandingRewards.Rewards.IsValid()) + }) + + // check cons address + got, err := ts.distrKeeper.GetPreviousProposerConsAddr(ctx) + require.NoError(t, err) + require.Equal(t, testProposerAddress, got) +} + +// Scenario: +// check no distribution occurs after begin block with no extra validator state +// - protocol pool module is enabled +func TestBeginBlockNoOpProtocolPool(t *testing.T) { + ts := setupTest(t, true) + ctx := ts.testCtx.Ctx. + WithBlockHeader(cmtproto.Header{ + ProposerAddress: testProposerAddress, + Time: time.Now(), + }). + WithBlockHeight(0) + + feePoolBefore, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + err = ts.distrKeeper.BeginBlocker(ctx) + require.NoError(t, err) + feePoolAfter, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + + require.True(t, feePoolBefore.CommunityPool.Equal(feePoolAfter.CommunityPool), fmt.Sprintf("before: %s, after: %s", feePoolBefore.CommunityPool.String(), feePoolAfter.CommunityPool.String())) + + // check cons address + got, err := ts.distrKeeper.GetPreviousProposerConsAddr(ctx) + require.NoError(t, err) + require.Equal(t, testProposerAddress, got) +} + +// Scenario: +// multiple validators with different commission and the same stake +// after the begin blocker, rewards should be distributed evenly based on their stake weight +// commission should differ based on their differing commission rates +// community pool should have portion of rewards distributed +// protocol pool is enabled so funds should leave the module +func TestBeginBlockToMultipleValidatorsProtocolPool(t *testing.T) { + ts := setupTest(t, true) + + ctx := ts.testCtx.Ctx. + WithBlockHeader(cmtproto.Header{ + ProposerAddress: testProposerAddress, + Time: time.Now(), + }) + + // reset fee pool & set params + require.NoError(t, ts.distrKeeper.Params.Set(ctx, disttypes.DefaultParams())) + require.NoError(t, ts.distrKeeper.FeePool.Set(ctx, disttypes.InitialFeePool())) + + // create validator with 50% commission + valAddr0 := sdk.ValAddress(valConsAddr0) + val0, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + require.NoError(t, err) + val0.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + ts.stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val0, nil).AnyTimes() + + // create second validator with 0% commission + valAddr1 := sdk.ValAddress(valConsAddr1) + val1, err := distrtestutil.CreateValidator(valConsPk1, math.NewInt(100)) + require.NoError(t, err) + val1.Commission = stakingtypes.NewCommission(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) + ts.stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)).Return(val1, nil).AnyTimes() + + t.Run("assert initial state is zero", func(t *testing.T) { + // assert initial state: zero outstanding rewards, zero community pool, zero commission, zero current rewards + val0OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0OutstandingRewards.Rewards.IsZero()) + + val1OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1OutstandingRewards.Rewards.IsZero()) + + feePool, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + require.True(t, feePool.CommunityPool.IsZero()) + + val0Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0Commission.Commission.IsZero()) + + val1Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1Commission.Commission.IsZero()) + + val0CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0CurrentRewards.Rewards.IsZero()) + + val1CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1CurrentRewards.Rewards.IsZero()) + }) + + // allocate tokens as if both had voted and second was proposer + fees := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100))) + ts.bankKeeper.EXPECT().GetAllBalances(gomock.Any(), feeCollectorAcc.GetAddress()).Return(fees) + ts.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), "fee_collector", disttypes.ModuleName, fees).AnyTimes() + + votes := []abci.VoteInfo{ + { + Validator: abci.Validator{ + Address: valConsPk0.Address(), + Power: 100, + }, + }, + { + Validator: abci.Validator{ + Address: valConsPk1.Address(), + Power: 100, + }, + }, + } + + ctx = ctx.WithVoteInfos(votes).WithBlockHeight(1000) + + // we should fully remove everything that was in the community pool (2stake) + ts.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), disttypes.ModuleName, protocolpooltypes.ProtocolPoolEscrowAccount, sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 2))).Return(nil).Times(1) + + feePoolBefore, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + err = ts.distrKeeper.BeginBlocker(ctx) + require.NoError(t, err) + feePoolAfter, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + + // here we are checking if the balance is back to what it was originally (0) because we have distributed the funds to protocolpool + require.True(t, feePoolBefore.CommunityPool.Equal(feePoolAfter.CommunityPool), fmt.Sprintf("before: %s, after: %s", feePoolBefore.CommunityPool.String(), feePoolAfter.CommunityPool.String())) + + t.Run("assert rewards and commission distributed", func(t *testing.T) { + // 98 outstanding rewards (100 less 2 to community pool) + val0OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr0) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDecWithPrec(490, 1)}}, val0OutstandingRewards.Rewards) + + val1OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr1) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDecWithPrec(490, 1)}}, val1OutstandingRewards.Rewards) + + // 50% commission for first proposer, (0.5 * 98%) * 100 / 2 = 23.25 + val0Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr0) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDecWithPrec(2450, 2)}}, val0Commission.Commission) + + // zero commission for second proposer + val1Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1Commission.Commission.IsZero()) + + // just staking.proportional for first proposer less commission = (0.5 * 98%) * 100 / 2 = 24.50 + val0CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr0) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDecWithPrec(2450, 2)}}, val0CurrentRewards.Rewards) + + // proposer reward + staking.proportional for second proposer = (0.5 * (98%)) * 100 = 49 + val1CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr1) + require.NoError(t, err) + require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDecWithPrec(490, 1)}}, val1CurrentRewards.Rewards) + }) + + // check cons address + got, err := ts.distrKeeper.GetPreviousProposerConsAddr(ctx) + require.NoError(t, err) + require.Equal(t, testProposerAddress, got) +} + +// Scenario: +// multiple validators with same commission and the same stake +// after the begin blocker, rewards should be distributed evenly based on their stake weight +// community pool should have portion of rewards distributed - should collect dust as decimal values +// - the non-decimal portion of the funds should be distributed as sdk.Coins to the protocol pool module +// - the remaining dust should be in the distribution community pool +func TestBeginBlockCommunityPoolCollectsDustProtocolPool(t *testing.T) { + ts := setupTest(t, true) + ctx := ts.testCtx.Ctx. + WithBlockHeader(cmtproto.Header{ + ProposerAddress: testProposerAddress, + Time: time.Now(), + }) + + // reset fee pool + require.NoError(t, ts.distrKeeper.FeePool.Set(ctx, disttypes.InitialFeePool())) + require.NoError(t, ts.distrKeeper.Params.Set(ctx, disttypes.DefaultParams())) + + // create validator with 10% commission + valAddr0 := sdk.ValAddress(valConsAddr0) + val0, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + require.NoError(t, err) + val0.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) + ts.stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val0, nil).AnyTimes() + + // create second validator with 10% commission + valAddr1 := sdk.ValAddress(valConsAddr1) + val1, err := distrtestutil.CreateValidator(valConsPk1, math.NewInt(100)) + require.NoError(t, err) + val1.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) + ts.stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)).Return(val1, nil).AnyTimes() + + // create third validator with 10% commission + valAddr2 := sdk.ValAddress(valConsAddr2) + val2, err := stakingtypes.NewValidator(sdk.ValAddress(valConsAddr2).String(), valConsPk1, stakingtypes.Description{}) + require.NoError(t, err) + val2.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) + ts.stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk2)).Return(val2, nil).AnyTimes() + + t.Run("assert initial state is zero", func(t *testing.T) { + // assert initial state: zero outstanding rewards, zero community pool, zero commission, zero current rewards + val0OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0OutstandingRewards.Rewards.IsZero()) + + val1OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1OutstandingRewards.Rewards.IsZero()) + + feePool, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + require.True(t, feePool.CommunityPool.IsZero()) + + val0Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0Commission.Commission.IsZero()) + + val1Commission, err := ts.distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1Commission.Commission.IsZero()) + + val0CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0CurrentRewards.Rewards.IsZero()) + + val1CurrentRewards, err := ts.distrKeeper.GetValidatorCurrentRewards(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1CurrentRewards.Rewards.IsZero()) + }) + + // allocate tokens as if both had voted and second was proposer + fees := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(634195840))) + ts.bankKeeper.EXPECT().GetAllBalances(gomock.Any(), feeCollectorAcc.GetAddress()).Return(fees) + ts.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), "fee_collector", disttypes.ModuleName, fees) + + votes := []abci.VoteInfo{ + { + Validator: abci.Validator{ + Address: valConsPk0.Address(), + Power: 11, + }, + }, + { + Validator: abci.Validator{ + Address: valConsPk1.Address(), + Power: 10, + }, + }, + { + Validator: abci.Validator{ + Address: valConsPk2.Address(), + Power: 10, + }, + }, + } + ctx = ctx.WithVoteInfos(votes).WithBlockHeight(1000) + + // expect us to send the truncated amount + // total amount in pool should be 12683916.800000001243023848 before the + // integer portion will be sent to the protocol pool as sdk.Coins + // decimal version will remain as "dust" + expectedCommunityPool := sdk.NewDecCoins(sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, math.LegacyMustNewDecFromStr("0.800000001243023848"))) + ts.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), disttypes.ModuleName, protocolpooltypes.ProtocolPoolEscrowAccount, sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 12683916))).Return(nil).Times(1) + + feePoolBefore, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + err = ts.distrKeeper.BeginBlocker(ctx) + require.NoError(t, err) + feePoolAfter, err := ts.distrKeeper.FeePool.Get(ctx) + require.NoError(t, err) + + require.False(t, feePoolBefore.CommunityPool.Equal(feePoolAfter.CommunityPool), fmt.Sprintf("before: %s, after: %s", feePoolBefore.CommunityPool.String(), feePoolAfter.CommunityPool.String())) + require.True(t, feePoolAfter.CommunityPool.Equal(expectedCommunityPool)) + + t.Run("assert rewards distributed", func(t *testing.T) { + val0OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr0) + require.NoError(t, err) + require.True(t, val0OutstandingRewards.Rewards.IsValid()) + + val1OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr1) + require.NoError(t, err) + require.True(t, val1OutstandingRewards.Rewards.IsValid()) + + val2OutstandingRewards, err := ts.distrKeeper.GetValidatorOutstandingRewards(ctx, valAddr2) + require.NoError(t, err) + require.True(t, val2OutstandingRewards.Rewards.IsValid()) + }) + + // check cons address + got, err := ts.distrKeeper.GetPreviousProposerConsAddr(ctx) + require.NoError(t, err) + require.Equal(t, testProposerAddress, got) +} diff --git a/x/distribution/keeper/allocation.go b/x/distribution/keeper/allocation.go index 83db0ae72e..dc3cf671a7 100644 --- a/x/distribution/keeper/allocation.go +++ b/x/distribution/keeper/allocation.go @@ -141,3 +141,32 @@ func (k Keeper) AllocateTokensToValidator(ctx context.Context, val stakingtypes. outstanding.Rewards = outstanding.Rewards.Add(tokens...) return k.SetValidatorOutstandingRewards(ctx, valBz, outstanding) } + +// sendCommunityPoolToExternalPool does the following: +// +// truncate the community pool value (DecCoins) to sdk.Coins +// distribute from the distribution module account to the external community pool account +// update the bookkept value in x/distribution +func (k Keeper) sendCommunityPoolToExternalPool(ctx sdk.Context) error { + feePool, err := k.FeePool.Get(ctx) + if err != nil { + return err + } + + if feePool.CommunityPool.IsZero() { + return nil + } + + amt, remaining := feePool.CommunityPool.TruncateDecimal() + ctx.Logger().Debug( + "sending distribution community pool amount to external pool pool", + "pool", k.externalCommunityPool.GetCommunityPoolModule(), + "amount", amt.String(), + "remaining", remaining.String(), + ) + if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, k.externalCommunityPool.GetCommunityPoolModule(), amt); err != nil { + return err + } + + return k.FeePool.Set(ctx, types.FeePool{CommunityPool: remaining}) +} diff --git a/x/distribution/keeper/common_test.go b/x/distribution/keeper/common_test.go index 642cbe45cf..e6885a278d 100644 --- a/x/distribution/keeper/common_test.go +++ b/x/distribution/keeper/common_test.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" + protocolpooltypes "github.com/cosmos/cosmos-sdk/x/protocolpool/types" ) var ( @@ -18,5 +19,7 @@ var ( valConsAddr1 = sdk.ConsAddress(valConsPk1.Address()) valConsAddr2 = sdk.ConsAddress(valConsPk2.Address()) - distrAcc = authtypes.NewEmptyModuleAccount(types.ModuleName) + distrAcc = authtypes.NewEmptyModuleAccount(types.ModuleName) + protocolPoolAcc = authtypes.NewEmptyModuleAccount(protocolpooltypes.ProtocolPoolEscrowAccount) + feeCollectorAcc = authtypes.NewEmptyModuleAccount("fee_collector") ) diff --git a/x/distribution/keeper/grpc_query.go b/x/distribution/keeper/grpc_query.go index beb53e5892..ce9b1d6718 100644 --- a/x/distribution/keeper/grpc_query.go +++ b/x/distribution/keeper/grpc_query.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/distribution/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -27,7 +28,7 @@ func NewQuerier(keeper Keeper) Querier { } // Params queries params of distribution module -func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { +func (k Querier) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { params, err := k.Keeper.Params.Get(ctx) if err != nil { return nil, err @@ -255,7 +256,7 @@ func (k Querier) DelegationRewards(ctx context.Context, req *types.QueryDelegati return &types.QueryDelegationRewardsResponse{Rewards: rewards}, nil } -// DelegationTotalRewards the total rewards accrued by a each validator +// DelegationTotalRewards the total rewards accrued by each validator func (k Querier) DelegationTotalRewards(ctx context.Context, req *types.QueryDelegationTotalRewardsRequest) (*types.QueryDelegationTotalRewardsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") @@ -361,7 +362,11 @@ func (k Querier) DelegatorWithdrawAddress(ctx context.Context, req *types.QueryD } // CommunityPool queries the community pool coins -func (k Querier) CommunityPool(ctx context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error) { +func (k Querier) CommunityPool(ctx context.Context, _ *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error) { + if k.HasExternalCommunityPool() { + return nil, errors.Wrapf(sdkerrors.ErrInvalidRequest, "external community pool is enabled - use the CommunityPool query exposed by the external community pool") + } + pool, err := k.FeePool.Get(ctx) if err != nil { return nil, err diff --git a/x/distribution/keeper/keeper.go b/x/distribution/keeper/keeper.go index 7e277f12d9..ab43a7df2a 100644 --- a/x/distribution/keeper/keeper.go +++ b/x/distribution/keeper/keeper.go @@ -31,13 +31,34 @@ type Keeper struct { FeePool collections.Item[types.FeePool] feeCollectorName string // name of the FeeCollector ModuleAccount + + externalCommunityPool types.ExternalCommunityPoolKeeper +} + +type InitOption func(*Keeper) + +// WithExternalCommunityPool will enable the external pool functionality in x/distribution, directing +// community pool funds to the provided keeper. +// +// WARNING: using an external community pool will cause the following handlers to error when called: +// - FundCommunityPool tx +// - CommunityPoolSpend tx +// - CommunityPool query +func WithExternalCommunityPool(poolKeeper types.ExternalCommunityPoolKeeper) InitOption { + return func(k *Keeper) { + k.externalCommunityPool = poolKeeper + } } // NewKeeper creates a new distribution Keeper instance func NewKeeper( - cdc codec.BinaryCodec, storeService store.KVStoreService, - ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, + cdc codec.BinaryCodec, + storeService store.KVStoreService, + ak types.AccountKeeper, + bk types.BankKeeper, + sk types.StakingKeeper, feeCollectorName, authority string, + opts ...InitOption, ) Keeper { // ensure distribution module account is set if addr := ak.GetModuleAddress(types.ModuleName); addr == nil { @@ -46,15 +67,16 @@ func NewKeeper( sb := collections.NewSchemaBuilder(storeService) k := Keeper{ - storeService: storeService, - cdc: cdc, - authKeeper: ak, - bankKeeper: bk, - stakingKeeper: sk, - feeCollectorName: feeCollectorName, - authority: authority, - Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), - FeePool: collections.NewItem(sb, types.FeePoolKey, "fee_pool", codec.CollValue[types.FeePool](cdc)), + storeService: storeService, + cdc: cdc, + authKeeper: ak, + bankKeeper: bk, + stakingKeeper: sk, + feeCollectorName: feeCollectorName, + authority: authority, + Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), + FeePool: collections.NewItem(sb, types.FeePoolKey, "fee_pool", codec.CollValue[types.FeePool](cdc)), + externalCommunityPool: nil, } schema, err := sb.Build() @@ -62,6 +84,19 @@ func NewKeeper( panic(err) } k.Schema = schema + + for _, opt := range opts { + opt(&k) + } + + if k.HasExternalCommunityPool() { + // ensure external module account is set if we are enabling it + // this will ensure that funds can be transferred to it. + if addr := ak.GetModuleAddress(k.externalCommunityPool.GetCommunityPoolModule()); addr == nil { + panic(fmt.Sprintf("%s module account has not been set", k.externalCommunityPool.GetCommunityPoolModule())) + } + } + return k } @@ -70,6 +105,12 @@ func (k Keeper) GetAuthority() string { return k.authority } +// HasExternalCommunityPool is a helper function to denote whether the x/distribution module +// is using its native community pool, or using an external pool. +func (k Keeper) HasExternalCommunityPool() bool { + return k.externalCommunityPool != nil +} + // Logger returns a module-specific logger. func (k Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) diff --git a/x/distribution/keeper/msg_server.go b/x/distribution/keeper/msg_server.go index 1f4c64e0eb..5204b282fc 100644 --- a/x/distribution/keeper/msg_server.go +++ b/x/distribution/keeper/msg_server.go @@ -103,6 +103,10 @@ func (k msgServer) WithdrawValidatorCommission(ctx context.Context, msg *types.M } func (k msgServer) FundCommunityPool(ctx context.Context, msg *types.MsgFundCommunityPool) (*types.MsgFundCommunityPoolResponse, error) { + if k.HasExternalCommunityPool() { + return nil, errors.Wrapf(sdkerrors.ErrInvalidRequest, "external community pool is enabled - use the FundCommunityPool method exposed by the external community pool") + } + depositor, err := k.authKeeper.AddressCodec().StringToBytes(msg.Depositor) if err != nil { return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid depositor address: %s", err) @@ -141,6 +145,10 @@ func (k msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) } func (k msgServer) CommunityPoolSpend(ctx context.Context, msg *types.MsgCommunityPoolSpend) (*types.MsgCommunityPoolSpendResponse, error) { + if k.HasExternalCommunityPool() { + return nil, errors.Wrapf(sdkerrors.ErrInvalidRequest, "external community pool is enabled - use the DistributFromCommunityPool method exposed by the external community pool") + } + if err := k.validateAuthority(msg.Authority); err != nil { return nil, err } diff --git a/x/distribution/module.go b/x/distribution/module.go index b80d5ce537..81108d4279 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -207,9 +207,10 @@ type ModuleInputs struct { StoreService store.KVStoreService Cdc codec.Codec - AccountKeeper types.AccountKeeper - BankKeeper types.BankKeeper - StakingKeeper types.StakingKeeper + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper + StakingKeeper types.StakingKeeper + ExternalPoolKeeper types.ExternalCommunityPoolKeeper `optional:"true"` // LegacySubspace is used solely for migration of x/params managed parameters LegacySubspace exported.Subspace `optional:"true"` @@ -235,6 +236,11 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } + var opts []keeper.InitOption + if in.ExternalPoolKeeper != nil { + opts = append(opts, keeper.WithExternalCommunityPool(in.ExternalPoolKeeper)) + } + k := keeper.NewKeeper( in.Cdc, in.StoreService, @@ -243,6 +249,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { in.StakingKeeper, feeCollectorName, authority.String(), + opts..., ) m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper, in.StakingKeeper, in.LegacySubspace) diff --git a/x/distribution/simulation/operations.go b/x/distribution/simulation/operations.go index 4fff81489e..7918386f3f 100644 --- a/x/distribution/simulation/operations.go +++ b/x/distribution/simulation/operations.go @@ -34,7 +34,7 @@ const ( // WeightedOperations returns all the operations from the module with their respective weights func WeightedOperations( appParams simtypes.AppParams, - cdc codec.JSONCodec, + _ codec.JSONCodec, txConfig client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, @@ -61,7 +61,7 @@ func WeightedOperations( weightMsgFundCommunityPool = DefaultWeightMsgFundCommunityPool }) - return simulation.WeightedOperations{ + ops := simulation.WeightedOperations{ simulation.NewWeightedOperation( weightMsgSetWithdrawAddress, SimulateMsgSetWithdrawAddress(txConfig, ak, bk, k), @@ -74,11 +74,16 @@ func WeightedOperations( weightMsgWithdrawValidatorCommission, SimulateMsgWithdrawValidatorCommission(txConfig, ak, bk, k, sk), ), - simulation.NewWeightedOperation( + } + + if !k.HasExternalCommunityPool() { + ops = append(ops, simulation.NewWeightedOperation( weightMsgFundCommunityPool, SimulateMsgFundCommunityPool(txConfig, ak, bk, k, sk), - ), + )) } + + return ops } // SimulateMsgSetWithdrawAddress generates a MsgSetWithdrawAddress with random values. diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go index 4237bb6691..911afa6959 100644 --- a/x/distribution/types/expected_keepers.go +++ b/x/distribution/types/expected_keepers.go @@ -1,11 +1,12 @@ package types import ( - context "context" + "context" "cosmossdk.io/core/address" sdk "github.com/cosmos/cosmos-sdk/types" + protocolpooltypes "github.com/cosmos/cosmos-sdk/x/protocolpool/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -60,3 +61,5 @@ type StakingHooks interface { AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error // Must be called when a validator is created AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error } + +type ExternalCommunityPoolKeeper protocolpooltypes.ExternalCommunityPoolKeeper diff --git a/x/distribution/types/query.pb.go b/x/distribution/types/query.pb.go index 8321dd4b27..f8d98d40bd 100644 --- a/x/distribution/types/query.pb.go +++ b/x/distribution/types/query.pb.go @@ -1095,6 +1095,8 @@ type QueryClient interface { // DelegatorWithdrawAddress queries withdraw address of a delegator. DelegatorWithdrawAddress(ctx context.Context, in *QueryDelegatorWithdrawAddressRequest, opts ...grpc.CallOption) (*QueryDelegatorWithdrawAddressResponse, error) // CommunityPool queries the community pool coins. + // + // WARNING: This query will fail if an external community pool is used. CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) } @@ -1218,6 +1220,8 @@ type QueryServer interface { // DelegatorWithdrawAddress queries withdraw address of a delegator. DelegatorWithdrawAddress(context.Context, *QueryDelegatorWithdrawAddressRequest) (*QueryDelegatorWithdrawAddressResponse, error) // CommunityPool queries the community pool coins. + // + // WARNING: This query will fail if an external community pool is used. CommunityPool(context.Context, *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) } diff --git a/x/distribution/types/tx.pb.go b/x/distribution/types/tx.pb.go index dd1ad6fa4b..726f07194a 100644 --- a/x/distribution/types/tx.pb.go +++ b/x/distribution/types/tx.pb.go @@ -975,6 +975,8 @@ type MsgClient interface { WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) // FundCommunityPool defines a method to allow an account to directly // fund the community pool. + // + // WARNING: This method will fail if an external community pool is used. FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) // UpdateParams defines a governance operation for updating the x/distribution // module parameters. The authority is defined in the keeper. @@ -983,6 +985,8 @@ type MsgClient interface { // the community pool in the x/distribution module to another account, which // could be the governance module itself. The authority is defined in the // keeper. + // + // WARNING: This method will fail if an external community pool is used. CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) // DepositValidatorRewardsPool defines a method to provide additional rewards // to delegators to a specific validator. @@ -1073,6 +1077,8 @@ type MsgServer interface { WithdrawValidatorCommission(context.Context, *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) // FundCommunityPool defines a method to allow an account to directly // fund the community pool. + // + // WARNING: This method will fail if an external community pool is used. FundCommunityPool(context.Context, *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) // UpdateParams defines a governance operation for updating the x/distribution // module parameters. The authority is defined in the keeper. @@ -1081,6 +1087,8 @@ type MsgServer interface { // the community pool in the x/distribution module to another account, which // could be the governance module itself. The authority is defined in the // keeper. + // + // WARNING: This method will fail if an external community pool is used. CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) // DepositValidatorRewardsPool defines a method to provide additional rewards // to delegators to a specific validator. diff --git a/x/protocolpool/README.md b/x/protocolpool/README.md new file mode 100644 index 0000000000..4d70566457 --- /dev/null +++ b/x/protocolpool/README.md @@ -0,0 +1,145 @@ +--- +sidebar_position: 1 +--- + +# `x/protocolpool` + +## Concepts + +`x/protocolpool` is a supplemental Cosmos SDK module that handles functionality for community pool funds. The module provides a separate module account for the community pool making it easier to track the pool assets. Starting with v0.53 of the Cosmos SDK, community funds can be tracked using this module instead of the `x/distribution` module. Funds are migrated from the `x/distribution` module's community pool to `x/protocolpool`'s module account automatically. + +This module is `supplemental`; it is not required to run a Cosmos SDK chain. `x/protocolpool` enhances the community pool functionality provided by `x/distribution` and enables custom modules to further extend the community pool. + +## State Transitions + +### FundCommunityPool + +FundCommunityPool can be called by any valid account to send funds to the `x/protocolpool` module account. + +```protobuf + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); +``` + +### CommunityPoolSpend + +CommunityPoolSpend can be called by the module authority (default governance module account) or any account with authorization to spend funds from the `x/protocolpool` module account to a receiver address. + +```protobuf + // 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. + rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); +``` + +### CreateContinuousFund + +CreateContinuousFund is a message used to initiate a continuous fund for a specific recipient. The proposed percentage of funds will be distributed only on withdraw request for the recipient. The fund distribution continues until expiry time is reached or continuous fund request is canceled. +NOTE: This feature is designed to work with the SDK's default bond denom. + +```protobuf + // CreateContinuousFund defines a method to distribute a percentage of funds to an address continuously. + // This ContinuousFund can be indefinite or run until a given expiry time. + // Funds come from validator block rewards from x/distribution, but may also come from + // any user who funds the ProtocolPoolEscrow module account directly through x/bank. + rpc CreateContinuousFund(MsgCreateContinuousFund) returns (MsgCreateContinuousFundResponse); +``` + +### CancelContinuousFund + +CancelContinuousFund is a message used to cancel an existing continuous fund proposal for a specific recipient. Cancelling a continuous fund stops further distribution of funds, and the state object is removed from storage. + +```protobuf + // CancelContinuousFund defines a method for cancelling continuous fund. + rpc CancelContinuousFund(MsgCancelContinuousFund) returns (MsgCancelContinuousFundResponse); +``` + +## Messages + +### MsgFundCommunityPool + +This message sends coins directly from the sender to the community pool. + +:::tip +If you know the `x/protocolpool` module account address, you can directly use bank `send` transaction instead. +::: + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/release/v0.53.x/proto/cosmos/protocolpool/v1/tx.proto#L43-L53 +``` + +* The msg will fail if the amount cannot be transferred from the sender to the `x/protocolpool` module account. + +```go +func (k Keeper) FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error { + return k.bankKeeper.SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, amount) +} +``` + +### MsgCommunityPoolSpend + +This message distributes funds from the `x/protocolpool` module account to the recipient using `DistributeFromCommunityPool` keeper method. + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/release/v0.53.x/proto/cosmos/protocolpool/v1/tx.proto#L58-L69 +``` + +The message will fail under the following conditions: + +* The amount cannot be transferred to the recipient from the `x/protocolpool` module account. +* The `recipient` address is restricted + +```go +func (k Keeper) DistributeFromCommunityPool(ctx context.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error { + return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, receiveAddr, amount) +} +``` + +### MsgCreateContinuousFund + +This message is used to create a continuous fund for a specific recipient. The proposed percentage of funds will be distributed only on withdraw request for the recipient. This fund distribution continues until expiry time is reached or continuous fund request is canceled. + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/release/v0.53.x/proto/cosmos/protocolpool/v1/tx.proto#L114-L130 +``` + +The message will fail under the following conditions: + +- The recipient address is empty or restricted. +- The percentage is zero/negative/greater than one. +- The Expiry time is less than the current block time. + +:::warning +If two continuous fund proposals to the same address are created, the previous ContinuousFund will be updated with the new ContinuousFund. +::: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/release/v0.53.x/x/protocolpool/keeper/msg_server.go#L103-L166 +``` + +### MsgCancelContinuousFund + +This message is used to cancel an existing continuous fund proposal for a specific recipient. Once canceled, the continuous fund will no longer distribute funds at each begin block, and the state object will be removed. + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/release/v0.53.x/x/protocolpool/proto/cosmos/protocolpool/v1/tx.proto#L136-L161 +``` + +The message will fail under the following conditions: + +- The recipient address is empty or restricted. +- The ContinuousFund for the recipient does not exist. + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/release/v0.53.x/x/protocolpool/keeper/msg_server.go#L188-L226 +``` + +## Client + +It takes the advantage of `AutoCLI` + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/release/v0.53.x/x/protocolpool/autocli.go +``` diff --git a/x/protocolpool/autocli.go b/x/protocolpool/autocli.go new file mode 100644 index 0000000000..371a3d5f04 --- /dev/null +++ b/x/protocolpool/autocli.go @@ -0,0 +1,82 @@ +package protocolpool + +import ( + "fmt" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + poolv1 "cosmossdk.io/api/cosmos/protocolpool/v1" + + "github.com/cosmos/cosmos-sdk/version" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: poolv1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "CommunityPool", + Use: "community-pool", + Short: "Query the amount of coins in the community pool", + Example: fmt.Sprintf(`%s query protocolpool community-pool`, version.AppName), + }, + { + RpcMethod: "ContinuousFunds", + Use: "continuous-funds", + Short: "Query all continuous funds", + Example: fmt.Sprintf(`%s query protocolpool continuous-funds`, version.AppName), + }, + { + RpcMethod: "ContinuousFund", + Use: "continuous-fund ", + Short: "Query a continuous fund by its recipient address", + Example: fmt.Sprintf(`%s query protocolpool continuous-fund cosmos1...`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "recipient"}}, + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: poolv1.Msg_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "FundCommunityPool", + Use: "fund-community-pool ", + Short: "Funds the community pool with the specified amount", + Example: fmt.Sprintf(`%s tx protocolpool fund-community-pool 100uatom --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "amount"}}, + }, + { + RpcMethod: "CreateContinuousFund", + Use: "create-continuous-fund ", + Short: "Create continuous fund for a recipient with optional expiry", + Example: fmt.Sprintf(`%s tx protocolpool create-continuous-fund cosmos1... 0.2 2023-11-31T12:34:56.789Z --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "recipient"}, + {ProtoField: "percentage"}, + {ProtoField: "expiry", Optional: true}, + }, + GovProposal: true, + }, + { + RpcMethod: "CancelContinuousFund", + Use: "cancel-continuous-fund ", + Short: "Cancel continuous fund for a specific recipient", + Example: fmt.Sprintf(`%s tx protocolpool cancel-continuous-fund cosmos1... --from mykey`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{ + {ProtoField: "recipient"}, + }, + GovProposal: true, + }, + { + RpcMethod: "UpdateParams", + Use: "update-params-proposal ", + Short: "Submit a proposal to update protocolpool module params. Note: the entire params must be provided.", + Example: fmt.Sprintf(`%s tx protocolpool update-params-proposal '{ "enabled_distribution_denoms": ["stake", "foo"] }'`, version.AppName), + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}}, + GovProposal: true, + }, + }, + }, + } +} diff --git a/x/protocolpool/depinject.go b/x/protocolpool/depinject.go new file mode 100644 index 0000000000..4a549c3e6a --- /dev/null +++ b/x/protocolpool/depinject.go @@ -0,0 +1,66 @@ +package protocolpool + +import ( + modulev1 "cosmossdk.io/api/cosmos/protocolpool/module/v1" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/depinject/appconfig" + + "github.com/cosmos/cosmos-sdk/codec" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool/keeper" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +var _ depinject.OnePerModuleType = AppModule{} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +func init() { + appconfig.RegisterModule( + &modulev1.Module{}, + appconfig.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + Config *modulev1.Module + Codec codec.Codec + StoreService store.KVStoreService + + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper +} + +type ModuleOutputs struct { + depinject.Out + + Keeper keeper.Keeper + Module appmodule.AppModule +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) + } + + authorityAddr, err := in.AccountKeeper.AddressCodec().BytesToString(authority) + if err != nil { + panic(err) + } + + k := keeper.NewKeeper(in.Codec, in.StoreService, in.AccountKeeper, in.BankKeeper, authorityAddr) + m := NewAppModule(in.Codec, k, in.AccountKeeper, in.BankKeeper) + + return ModuleOutputs{ + Keeper: k, + Module: m, + } +} diff --git a/x/protocolpool/keeper/abci.go b/x/protocolpool/keeper/abci.go new file mode 100644 index 0000000000..bc2627984e --- /dev/null +++ b/x/protocolpool/keeper/abci.go @@ -0,0 +1,23 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +func (k Keeper) BeginBlocker(ctx sdk.Context) error { + start := telemetry.Now() + defer telemetry.ModuleMeasureSince(types.ModuleName, start, telemetry.MetricKeyBeginBlocker) + + params, err := k.Params.Get(ctx) + if err != nil { + return err + } + + if uint64(ctx.BlockHeight())%params.DistributionFrequency == 0 { + return k.DistributeFunds(ctx) + } + + return nil +} diff --git a/x/protocolpool/keeper/genesis.go b/x/protocolpool/keeper/genesis.go new file mode 100644 index 0000000000..ca61e19f94 --- /dev/null +++ b/x/protocolpool/keeper/genesis.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) error { + currentTime := ctx.BlockTime() + + err := k.Params.Set(ctx, data.Params) + if err != nil { + return fmt.Errorf("failed to set params: %w", err) + } + + for _, cf := range data.ContinuousFunds { + recipientAddress, err := k.authKeeper.AddressCodec().StringToBytes(cf.Recipient) + if err != nil { + return fmt.Errorf("failed to decode recipient address: %w", err) + } + + if k.bankKeeper.BlockedAddr(recipientAddress) { + return fmt.Errorf("recipient is blocked in the bank keeper: %s", recipientAddress) + } + + // ignore expired ContinuousFunds + if cf.Expiry != nil && cf.Expiry.Before(currentTime) { + continue + } + + if err := k.ContinuousFunds.Set(ctx, recipientAddress, cf); err != nil { + return fmt.Errorf("failed to set continuous fund for recipient %s: %w", recipientAddress, err) + } + } + + return nil +} + +func (k Keeper) ExportGenesis(ctx sdk.Context) (*types.GenesisState, error) { + cf, err := k.GetAllContinuousFunds(ctx) + if err != nil { + return nil, err + } + + genState := types.NewGenesisState(cf) + + params, err := k.Params.Get(ctx) + if err != nil { + return nil, err + } + + genState.Params = params + + return genState, nil +} diff --git a/x/protocolpool/keeper/genesis_test.go b/x/protocolpool/keeper/genesis_test.go new file mode 100644 index 0000000000..6a4677bf9f --- /dev/null +++ b/x/protocolpool/keeper/genesis_test.go @@ -0,0 +1,93 @@ +package keeper_test + +import ( + "time" + + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +func (suite *KeeperTestSuite) TestInitExportGenesis() { + suite.bankKeeper.EXPECT().BlockedAddr(recipientAddr).Return(false).Times(1) + + gs := types.NewGenesisState( + []types.ContinuousFund{ + { + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.1"), + Expiry: nil, + }, + }, + ) + + err := suite.poolKeeper.InitGenesis(suite.ctx, gs) + suite.Require().NoError(err) + + // Export + exportedGenState, err := suite.poolKeeper.ExportGenesis(suite.ctx) + suite.Require().NoError(err) + suite.Require().Equal(gs.ContinuousFunds, exportedGenState.ContinuousFunds) +} + +func (suite *KeeperTestSuite) TestInitExportGenesis_BlockedAddress() { + suite.bankKeeper.EXPECT().BlockedAddr(recipientAddr).Return(true).Times(1) + + gs := types.NewGenesisState( + []types.ContinuousFund{ + { + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.1"), + Expiry: nil, + }, + }, + ) + + err := suite.poolKeeper.InitGenesis(suite.ctx, gs) + suite.Require().Error(err) +} + +func (suite *KeeperTestSuite) TestInitGenesis_InvalidRecipient() { + gs := types.NewGenesisState([]types.ContinuousFund{ + { + Recipient: "invalid_address", // This should fail the address decoding. + Percentage: math.LegacyMustNewDecFromStr("0.1"), + Expiry: nil, + }, + }) + + err := suite.poolKeeper.InitGenesis(suite.ctx, gs) + suite.Require().Error(err) +} + +func (suite *KeeperTestSuite) TestInitGenesis_SkipsExpiredFunds() { + suite.bankKeeper.EXPECT().BlockedAddr(recipientAddr).Return(false).Times(1) + suite.bankKeeper.EXPECT().BlockedAddr(recipientAddr2).Return(false).Times(1) + + // Set up block time for the test + currentTime := suite.ctx.BlockTime() + expiredTime := currentTime.Add(-time.Hour) + futureTime := currentTime.Add(time.Hour) + + gs := types.NewGenesisState([]types.ContinuousFund{ + { + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.1"), + Expiry: &expiredTime, // This fund should be ignored. + }, + { + Recipient: recipientAddr2.String(), + Percentage: math.LegacyMustNewDecFromStr("0.2"), + Expiry: &futureTime, // This fund should be accepted. + }, + }) + + err := suite.poolKeeper.InitGenesis(suite.ctx, gs) + suite.Require().NoError(err) + + // Export and verify only the valid continuous fund is present. + exportedGenState, err := suite.poolKeeper.ExportGenesis(suite.ctx) + suite.Require().NoError(err) + suite.Require().Len(exportedGenState.ContinuousFunds, 1) + suite.Require().Equal(recipientAddr2.String(), exportedGenState.ContinuousFunds[0].Recipient) +} diff --git a/x/protocolpool/keeper/grpc_query.go b/x/protocolpool/keeper/grpc_query.go new file mode 100644 index 0000000000..79dd50a137 --- /dev/null +++ b/x/protocolpool/keeper/grpc_query.go @@ -0,0 +1,98 @@ +package keeper + +import ( + "context" + "errors" + "fmt" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "cosmossdk.io/collections" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +var _ types.QueryServer = Querier{} + +type Querier struct { + Keeper +} + +func NewQuerier(keeper Keeper) Querier { + return Querier{Keeper: keeper} +} + +// CommunityPool queries the community pool coins +func (k Querier) CommunityPool(ctx context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + amount, err := k.GetCommunityPool(sdkCtx) + if err != nil { + return nil, err + } + return &types.QueryCommunityPoolResponse{Pool: amount}, nil +} + +// ContinuousFund queries a continuous fund by its recipient address. +func (k Querier) ContinuousFund(ctx context.Context, req *types.QueryContinuousFundRequest) (*types.QueryContinuousFundResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + acc, err := k.authKeeper.AddressCodec().StringToBytes(req.Recipient) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, fmt.Errorf("invalid address: %w", err).Error()) + } + + fund, err := k.Keeper.ContinuousFunds.Get(sdkCtx, acc) + if err != nil { + return nil, status.Errorf(codes.NotFound, fmt.Sprintf("not found %s", req.Recipient)) + } + + return &types.QueryContinuousFundResponse{ContinuousFund: fund}, nil +} + +// ContinuousFunds queries all continuous funds in the store. +func (k Querier) ContinuousFunds(ctx context.Context, req *types.QueryContinuousFundsRequest) (*types.QueryContinuousFundsResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + funds, err := k.GetAllContinuousFunds(sdkCtx) + if err != nil { + return nil, status.Errorf(codes.Internal, fmt.Errorf("failed to fetch continuous funds: %w", err).Error()) + } + + return &types.QueryContinuousFundsResponse{ContinuousFunds: funds}, nil +} + +// Params queries params of x/protocolpool module. +func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + params, err := k.Keeper.Params.Get(sdkCtx) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return nil, status.Errorf(codes.NotFound, "params not found") + } + return nil, err + } + + return &types.QueryParamsResponse{ + Params: params, + }, nil +} diff --git a/x/protocolpool/keeper/grpc_query_test.go b/x/protocolpool/keeper/grpc_query_test.go new file mode 100644 index 0000000000..01647e4ba2 --- /dev/null +++ b/x/protocolpool/keeper/grpc_query_test.go @@ -0,0 +1,271 @@ +package keeper_test + +import ( + "go.uber.org/mock/gomock" + + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/codec/address" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +func (suite *KeeperTestSuite) TestParams() { + expectedParams := types.DefaultGenesisState().Params + err := suite.poolKeeper.Params.Set(suite.ctx, expectedParams) + suite.Require().NoError(err) + + testCases := []struct { + name string + preRun func() + req *types.QueryParamsRequest + expErr bool + expErrMsg string + resp *types.QueryParamsResponse + }{ + { + name: "nil request - error", + req: nil, + expErr: true, + expErrMsg: "rpc error: code = InvalidArgument desc = empty request", + }, + { + name: "valid", + req: &types.QueryParamsRequest{}, + expErr: false, + expErrMsg: "empty address string is not allowed", + resp: &types.QueryParamsResponse{ + Params: expectedParams, + }, + }, + } + for _, tc := range testCases { + suite.Run(tc.name, func() { + if tc.preRun != nil { + tc.preRun() + } + resp, err := suite.queryServer.Params(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) + } + }) + } +} + +func (suite *KeeperTestSuite) TestCommunityPool() { + testCases := []struct { + name string + preRun func() + req *types.QueryCommunityPoolRequest + expErr bool + expErrMsg string + resp *types.QueryCommunityPoolResponse + }{ + { + name: "nil request - error", + req: nil, + expErr: true, + expErrMsg: "rpc error: code = InvalidArgument desc = empty request", + }, + { + name: "valid", + preRun: func() { + suite.authKeeper.EXPECT().GetModuleAccount(gomock.Any(), types.ModuleName).Return(poolAcc).Times(1) + suite.bankKeeper.EXPECT().GetAllBalances(gomock.Any(), poolAcc.GetAddress()).Return(sdk.NewCoins(fooCoin)).Times(1) + }, + req: &types.QueryCommunityPoolRequest{}, + resp: &types.QueryCommunityPoolResponse{ + Pool: sdk.NewCoins(fooCoin), + }, + expErr: false, + expErrMsg: "", + }, + } + for _, tc := range testCases { + suite.Run(tc.name, func() { + if tc.preRun != nil { + tc.preRun() + } + resp, err := suite.queryServer.CommunityPool(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) + } + }) + } +} + +func (suite *KeeperTestSuite) TestContinuousFund() { + testCases := []struct { + name string + preRun func() + req *types.QueryContinuousFundRequest + expErr bool + expErrMsg string + resp *types.QueryContinuousFundResponse + }{ + { + name: "nil request - error", + req: nil, + expErr: true, + expErrMsg: "empty request", + }, + { + name: "invalid address", + req: &types.QueryContinuousFundRequest{ + Recipient: "invalid", // not a valid Bech32 address + }, + preRun: func() { + // Return a real codec; its StringToBytes will fail for an invalid address. + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + }, + expErr: true, + expErrMsg: "invalid address:", + }, + { + name: "fund not found", + req: &types.QueryContinuousFundRequest{ + Recipient: recipientAddr.String(), // valid format but not set in store + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + }, + expErr: true, + expErrMsg: "not found", + }, + { + name: "valid continuous fund", + req: &types.QueryContinuousFundRequest{ + Recipient: recipientAddr.String(), + }, + preRun: func() { + // Use the real codec to convert the address. + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + // Insert a continuous fund directly into the pool keeper. + fund := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.5"), + Expiry: nil, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund) + suite.Require().NoError(err) + }, + expErr: false, + resp: &types.QueryContinuousFundResponse{ + ContinuousFund: types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.5"), + Expiry: nil, + }, + }, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + if tc.preRun != nil { + tc.preRun() + } + resp, err := suite.queryServer.ContinuousFund(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.ContinuousFund.Recipient, resp.ContinuousFund.Recipient) + suite.Require().Equal(tc.resp.ContinuousFund.Percentage, resp.ContinuousFund.Percentage) + suite.Require().Equal(tc.resp.ContinuousFund.Expiry, resp.ContinuousFund.Expiry) + } + }) + } +} + +func (suite *KeeperTestSuite) TestContinuousFunds() { + testCases := []struct { + name string + preRun func() + req *types.QueryContinuousFundsRequest + expErr bool + expErrMsg string + resp *types.QueryContinuousFundsResponse + }{ + { + name: "nil request - error", + req: nil, + expErr: true, + expErrMsg: "empty request", + }, + { + name: "no continuous funds", + req: &types.QueryContinuousFundsRequest{}, + preRun: nil, + expErr: false, + resp: &types.QueryContinuousFundsResponse{ + ContinuousFunds: []types.ContinuousFund{}, + }, + }, + { + name: "valid continuous funds", + req: &types.QueryContinuousFundsRequest{}, + preRun: func() { + // Insert two continuous funds directly into the keeper. + fund1 := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.3"), + Expiry: nil, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund1) + suite.Require().NoError(err) + + fund2 := types.ContinuousFund{ + Recipient: recipientAddr2.String(), + Percentage: math.LegacyMustNewDecFromStr("0.7"), + Expiry: nil, + } + err = suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr2, fund2) + suite.Require().NoError(err) + }, + expErr: false, + resp: &types.QueryContinuousFundsResponse{ + ContinuousFunds: []types.ContinuousFund{ + { + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.3"), + Expiry: nil, + }, + { + Recipient: recipientAddr2.String(), + Percentage: math.LegacyMustNewDecFromStr("0.7"), + Expiry: nil, + }, + }, + }, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + if tc.preRun != nil { + tc.preRun() + } + resp, err := suite.queryServer.ContinuousFunds(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().ElementsMatch(tc.resp.ContinuousFunds, resp.ContinuousFunds) + } + }) + } +} diff --git a/x/protocolpool/keeper/keeper.go b/x/protocolpool/keeper/keeper.go new file mode 100644 index 0000000000..188e14183c --- /dev/null +++ b/x/protocolpool/keeper/keeper.go @@ -0,0 +1,232 @@ +package keeper + +import ( + "errors" + "fmt" + + "cosmossdk.io/collections" + "cosmossdk.io/core/store" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +// assert that this keeper can be used by x/distribution +var _ types.ExternalCommunityPoolKeeper = &Keeper{} + +type Keeper struct { + storeService store.KVStoreService + + authKeeper types.AccountKeeper + bankKeeper types.BankKeeper + + cdc codec.BinaryCodec + + authority string + + // State + Schema collections.Schema + ContinuousFunds collections.Map[sdk.AccAddress, types.ContinuousFund] + Params collections.Item[types.Params] +} + +const ( + errModuleAccountNotSet = "%s module account has not been set" +) + +func NewKeeper(cdc codec.BinaryCodec, storeService store.KVStoreService, ak types.AccountKeeper, bk types.BankKeeper, authority string, +) Keeper { + // ensure pool module account is set + if addr := ak.GetModuleAddress(types.ModuleName); addr == nil { + panic(fmt.Sprintf(errModuleAccountNotSet, types.ModuleName)) + } + // ensure protocol pool distribution account is set + if addr := ak.GetModuleAddress(types.ProtocolPoolEscrowAccount); addr == nil { + panic(fmt.Sprintf(errModuleAccountNotSet, types.ProtocolPoolEscrowAccount)) + } + + sb := collections.NewSchemaBuilder(storeService) + + keeper := Keeper{ + storeService: storeService, + authKeeper: ak, + bankKeeper: bk, + cdc: cdc, + authority: authority, + ContinuousFunds: collections.NewMap(sb, types.ContinuousFundsKey, "continuous_funds", sdk.AccAddressKey, codec.CollValue[types.ContinuousFund](cdc)), + Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), + } + + schema, err := sb.Build() + if err != nil { + panic(err) + } + keeper.Schema = schema + + return keeper +} + +// GetAuthority returns the x/protocolpool module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + +// GetCommunityPoolModule gets the module name that funds should be sent to for the community pool. +// This is the address that x/distribution will send funds to for external management. +func (k Keeper) GetCommunityPoolModule() string { + return types.ProtocolPoolEscrowAccount +} + +// FundCommunityPool allows an account to directly fund the community fund pool. +func (k Keeper) FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error { + return k.bankKeeper.SendCoinsFromAccountToModule(ctx, sender, types.ModuleName, amount) +} + +// DistributeFromCommunityPool distributes funds from the protocolpool module account to +// a receiver address. +func (k Keeper) DistributeFromCommunityPool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error { + return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, receiveAddr, amount) +} + +// GetCommunityPool gets the community pool balance. +func (k Keeper) GetCommunityPool(ctx sdk.Context) (sdk.Coins, error) { + moduleAccount := k.authKeeper.GetModuleAccount(ctx, types.ModuleName) + if moduleAccount == nil { + return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", types.ModuleName) + } + return k.bankKeeper.GetAllBalances(ctx, moduleAccount.GetAddress()), nil +} + +// DistributeFunds sets the amount to be distributed among recipients. +// Get all valid continuous funds: +// - for each continuous fund, check if expired and remove if so +// - for each continuous fund, distribute funds according to percentage +// - distribute remaining funds to the community pool +// +// This function is run at the BeginBlocker method and therefore must be very safe. +func (k Keeper) DistributeFunds(ctx sdk.Context) error { + // Get current balance of the intermediary module account + moduleAccount := k.authKeeper.GetModuleAccount(ctx, types.ProtocolPoolEscrowAccount) + if moduleAccount == nil { + return errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", types.ProtocolPoolEscrowAccount) + } + params, err := k.Params.Get(ctx) + if err != nil { + return err + } + + // only take into account the balances of denoms whitelisted in EnabledDistributionDenoms + amountToDistribute := sdk.NewCoins() + for _, denom := range params.EnabledDistributionDenoms { + bal := k.bankKeeper.GetBalance(ctx, moduleAccount.GetAddress(), denom) + amountToDistribute = append(amountToDistribute, bal) + } + + // if the balance is zero, return early + if amountToDistribute.IsZero() { + return nil + } + + remainingCoins := sdk.NewCoins(amountToDistribute...) + iter, err := k.ContinuousFunds.Iterate(ctx, nil) + if err != nil { + return fmt.Errorf("failed to create iterator for continuous funds: %w", err) + } + + kValues, err := iter.KeyValues() + if err != nil { + return fmt.Errorf("failed to iterate continuous funds: %w", err) + } + + blockTime := ctx.BlockTime() + anyNegative := false + for _, kv := range kValues { + recipient := kv.Key + fund := kv.Value + + // remove newly expired funds + if fund.Expiry != nil && fund.Expiry.Before(blockTime) { + err := k.ContinuousFunds.Remove(ctx, recipient) + if err != nil { + return fmt.Errorf("failed to remove fund for %s from ContinuousFunds: %w", recipient, err) + } + continue + } + + amountToStream := PercentageCoinMul(fund.Percentage, amountToDistribute) + remainingCoins, anyNegative = remainingCoins.SafeSub(amountToStream...) + if anyNegative { + return fmt.Errorf("negative funds for distribution from ContinuousFunds: %v", remainingCoins) + } + + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ProtocolPoolEscrowAccount, recipient, amountToStream) + if err != nil { + // in the case where the address is unauthorized (blocked) + // - remove the continuous fund + // - add back the coins + if errors.Is(err, sdkerrors.ErrUnauthorized) { + ctx.Logger().Debug("recipient is unauthorized - removing the continuous fund", "error", err) + remainingCoins = remainingCoins.Add(amountToStream...) + err := k.ContinuousFunds.Remove(ctx, recipient) + if err != nil { + return fmt.Errorf("failed to remove fund for %s from ContinuousFunds: %w", recipient, err) + } + continue + } + + return fmt.Errorf("failed to distribute fund for %s from ContinuousFunds: %w", recipient, err) + } + } + + // send all remaining funds to the community pool + if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, remainingCoins); err != nil { + return fmt.Errorf("failed to send coins to community pool: %w", err) + } + + return nil +} + +// GetAllContinuousFunds gets all continuous funds in the store. +func (k Keeper) GetAllContinuousFunds(ctx sdk.Context) ([]types.ContinuousFund, error) { + it, err := k.ContinuousFunds.Iterate(ctx, nil) + if err != nil { + return nil, err + } + cf, err := it.Values() + if err != nil { + return nil, err + } + + return cf, nil +} + +func (k Keeper) validateAuthority(authority string) error { + if _, err := k.authKeeper.AddressCodec().StringToBytes(authority); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address: %s", err) + } + + if k.authority != authority { + return errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, authority) + } + + return nil +} + +// PercentageCoinMul multiplies each coin in an sdk.Coins struct by the given percentage and returns the new +// value. +// +// When performing multiplication, the resulting values are truncated to an sdk.Int. +func PercentageCoinMul(percentage math.LegacyDec, coins sdk.Coins) sdk.Coins { + ret := sdk.NewCoins() + + for _, denom := range coins.Denoms() { + am := sdk.NewCoin(denom, percentage.MulInt(coins.AmountOf(denom)).TruncateInt()) + ret = ret.Add(am) + } + + return ret +} diff --git a/x/protocolpool/keeper/keeper_test.go b/x/protocolpool/keeper/keeper_test.go new file mode 100644 index 0000000000..724fb18b6a --- /dev/null +++ b/x/protocolpool/keeper/keeper_test.go @@ -0,0 +1,529 @@ +package keeper_test + +import ( + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/suite" + "go.uber.org/mock/gomock" + + "cosmossdk.io/core/header" + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/baseapp" + "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" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + poolkeeper "github.com/cosmos/cosmos-sdk/x/protocolpool/keeper" + pooltestutil "github.com/cosmos/cosmos-sdk/x/protocolpool/testutil" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +var ( + poolAcc = authtypes.NewEmptyModuleAccount(types.ModuleName) + poolDistrAcc = authtypes.NewEmptyModuleAccount(types.ProtocolPoolEscrowAccount) + + recipientAddr = sdk.AccAddress("to1__________________") + recipientAddr2 = sdk.AccAddress("to2__________________") + + fooCoin = sdk.NewInt64Coin("foo", 100) +) + +type KeeperTestSuite struct { + suite.Suite + + ctx sdk.Context + poolKeeper poolkeeper.Keeper + authKeeper *pooltestutil.MockAccountKeeper + bankKeeper *pooltestutil.MockBankKeeper + + msgServer types.MsgServer + queryServer types.QueryServer +} + +func (suite *KeeperTestSuite) SetupTest() { + key := storetypes.NewKVStoreKey(types.StoreKey) + storeService := runtime.NewKVStoreService(key) + testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) + ctx := testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now()}) + encCfg := moduletestutil.MakeTestEncodingConfig() + + // gomock initializations + ctrl := gomock.NewController(suite.T()) + accountKeeper := pooltestutil.NewMockAccountKeeper(ctrl) + accountKeeper.EXPECT().GetModuleAddress(types.ModuleName).Return(poolAcc.GetAddress()).AnyTimes() + accountKeeper.EXPECT().GetModuleAddress(types.ProtocolPoolEscrowAccount).Return(poolDistrAcc.GetAddress()).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + suite.authKeeper = accountKeeper + + bankKeeper := pooltestutil.NewMockBankKeeper(ctrl) + suite.bankKeeper = bankKeeper + + authority, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress(govtypes.ModuleName)) + suite.Require().NoError(err) + + poolKeeper := poolkeeper.NewKeeper( + encCfg.Codec, + storeService, + accountKeeper, + bankKeeper, + authority, + ) + suite.ctx = ctx + suite.poolKeeper = poolKeeper + + err = suite.poolKeeper.Params.Set(ctx, types.Params{ + EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}, + }) + suite.Require().NoError(err) + + types.RegisterInterfaces(encCfg.InterfaceRegistry) + queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) + types.RegisterQueryServer(queryHelper, poolkeeper.Querier{Keeper: poolKeeper}) + suite.msgServer = poolkeeper.NewMsgServerImpl(poolKeeper) + suite.queryServer = poolkeeper.NewQuerier(poolKeeper) +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func (suite *KeeperTestSuite) TestGetCommunityPool() { + expectedBalance := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000000))) + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ModuleName).Return(poolAcc).Times(1) + suite.bankKeeper.EXPECT().GetAllBalances(suite.ctx, poolAcc.GetAddress()).Return(expectedBalance).Times(1) + + balance, err := suite.poolKeeper.GetCommunityPool(suite.ctx) + suite.Require().NoError(err) + suite.Require().Equal(expectedBalance, balance) + + // Test error case when module account doesn't exist + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ModuleName).Return(nil).Times(1) + _, err = suite.poolKeeper.GetCommunityPool(suite.ctx) + suite.Require().Error(err) + suite.Require().Contains(err.Error(), "module account protocolpool does not exist") +} + +func (suite *KeeperTestSuite) TestGetAllContinuousFunds() { + suite.Run("empty store", func() { + // Reset the context to start with a clean store. + suite.SetupTest() + + funds, err := suite.poolKeeper.GetAllContinuousFunds(suite.ctx) + suite.Require().NoError(err) + suite.Require().Empty(funds, "expected no continuous funds in store") + }) + + suite.Run("one fund in store", func() { + suite.SetupTest() + + fund := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.5"), + Expiry: nil, + } + + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund) + suite.Require().NoError(err) + + funds, err := suite.poolKeeper.GetAllContinuousFunds(suite.ctx) + suite.Require().NoError(err) + suite.Require().Len(funds, 1, "expected one continuous fund in store") + suite.Require().Equal(fund.Recipient, funds[0].Recipient) + suite.Require().Equal(fund.Percentage, funds[0].Percentage) + suite.Require().Equal(fund.Expiry, funds[0].Expiry) + }) + + suite.Run("many funds in store", func() { + suite.SetupTest() + + totalFunds := 10 + + // Insert a number of funds. + for i := 0; i < totalFunds; i++ { + accAddr := sdk.AccAddress(fmt.Sprintf("ao%d__________________", i)) + + fund := types.ContinuousFund{ + Recipient: accAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.1"), + Expiry: nil, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, accAddr, fund) + suite.Require().NoError(err) + } + + funds, err := suite.poolKeeper.GetAllContinuousFunds(suite.ctx) + suite.Require().NoError(err) + suite.Require().Len(funds, totalFunds, "expected many continuous funds in store") + + // verify each inserted fund's percentage. + for _, f := range funds { + suite.Require().Equal(math.LegacyMustNewDecFromStr("0.1"), f.Percentage) + } + }) +} + +func (suite *KeeperTestSuite) TestDistributeFunds() { + initialBalance := sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000)) + initalBalanceCoins := sdk.NewCoins(initialBalance) + + tests := []struct { + name string + params types.Params + initialPoolBalance sdk.Coin + setup func() + expectedErr string + verify func() + }{ + { + name: "module account missing", + params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + setup: func() { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolEscrowAccount).Return(nil) + }, + expectedErr: "module account", + }, + { + name: "zero funds in module account", + initialPoolBalance: sdk.NewCoin(sdk.DefaultBondDenom, math.ZeroInt()), + params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + setup: func() { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolEscrowAccount). + Return(poolDistrAcc).AnyTimes() + }, + expectedErr: "", + }, + { + name: "one valid continuous fund", + params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + initialPoolBalance: initialBalance, + setup: func() { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolEscrowAccount). + Return(poolDistrAcc).AnyTimes() + + fund := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.3"), + Expiry: nil, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund) + suite.Require().NoError(err) + + amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initalBalanceCoins) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream). + Return(nil).Times(1) + + remainingCoins := initalBalanceCoins.Sub(amountToStream...) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, remainingCoins). + Return(nil).Times(1) + }, + expectedErr: "", + }, + { + name: "one valid continuous fund with a blocked account", + params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + initialPoolBalance: initialBalance, + setup: func() { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolEscrowAccount). + Return(poolDistrAcc).AnyTimes() + + fund := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.3"), + Expiry: nil, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund) + suite.Require().NoError(err) + + amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initalBalanceCoins) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream). + Return(sdkerrors.ErrUnauthorized).Times(1) + + suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, initalBalanceCoins). + Return(nil).Times(1) + }, + expectedErr: "", + verify: func() { + // check that the broken continuous fund is removed + _, err := suite.poolKeeper.ContinuousFunds.Get(suite.ctx, recipientAddr) + suite.Require().Error(err) + }, + }, + { + name: "one expired continuous fund", + params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + initialPoolBalance: initialBalance, + setup: func() { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolEscrowAccount). + Return(poolDistrAcc).AnyTimes() + + expiredTime := suite.ctx.BlockTime().Add(-time.Hour) + fund := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.3"), + Expiry: &expiredTime, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund) + suite.Require().NoError(err) + + // And full amount to be sent to the community pool. + suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, initalBalanceCoins). + Return(nil).Times(1) + }, + expectedErr: "", + verify: func() { + // Verify that the expired fund was removed. + funds, err := suite.poolKeeper.GetAllContinuousFunds(suite.ctx) + suite.Require().NoError(err) + suite.Require().Empty(funds, "expected expired continuous fund to be removed") + }, + }, + { + name: "multiple valid continuous funds - one recipient is blocked", + initialPoolBalance: initialBalance, + params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + setup: func() { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolEscrowAccount). + Return(poolDistrAcc).AnyTimes() + + fund1 := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.3"), + Expiry: nil, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund1) + suite.Require().NoError(err) + + fund2 := types.ContinuousFund{ + Recipient: recipientAddr2.String(), + Percentage: math.LegacyMustNewDecFromStr("0.2"), + Expiry: nil, + } + accAddr, err := sdk.AccAddressFromBech32(fund2.Recipient) + suite.Require().NoError(err) + + err = suite.poolKeeper.ContinuousFunds.Set(suite.ctx, accAddr, fund2) + suite.Require().NoError(err) + + amountToStream1 := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initalBalanceCoins) + amountToStream2 := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.2"), initalBalanceCoins) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream1). + Return(sdkerrors.ErrUnauthorized).Times(1) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr2, amountToStream2). + Return(nil).Times(1) + + remainingCoins := initalBalanceCoins.Sub(amountToStream2...) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, remainingCoins). + Return(nil).Times(1) + }, + expectedErr: "", + verify: func() { + // check that the broken continuous fund is removed + _, err := suite.poolKeeper.ContinuousFunds.Get(suite.ctx, recipientAddr) + suite.Require().Error(err) + // check that the valid continuous fund is in the store + _, err = suite.poolKeeper.ContinuousFunds.Get(suite.ctx, recipientAddr2) + suite.Require().NoError(err) + }, + }, + { + name: "fund percentages sum over 1 (resulting in negative remainder)", + initialPoolBalance: initialBalance, + params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + setup: func() { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolEscrowAccount). + Return(poolDistrAcc).AnyTimes() + + // Two funds whose percentages sum to 1.3 (80% and 50%). + fund1 := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.8"), + Expiry: nil, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund1) + suite.Require().NoError(err) + + fund2 := types.ContinuousFund{ + Recipient: recipientAddr2.String(), + Percentage: math.LegacyMustNewDecFromStr("0.5"), + Expiry: nil, + } + err = suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr2, fund2) + suite.Require().NoError(err) + + amountToStream1 := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.8"), initalBalanceCoins) // 800 stake + suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream1). + Return(nil).Times(1) + }, + // we will fail on the second iteration of the loop + expectedErr: "negative funds for distribution from ContinuousFunds: -300stake", + }, + { + name: "bank send to account error", + params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + setup: func() { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolEscrowAccount). + Return(poolDistrAcc).AnyTimes() + + totalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000))) + suite.bankKeeper.EXPECT().GetBalance(suite.ctx, poolDistrAcc.GetAddress(), sdk.DefaultBondDenom). + Return(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000))).Times(1) + + fund := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.3"), + Expiry: nil, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund) + suite.Require().NoError(err) + + amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), totalCoins) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream). + Return(fmt.Errorf("send account error")).Times(1) + }, + expectedErr: "failed to distribute fund", + }, + { + name: "bank send to module error", + initialPoolBalance: initialBalance, + params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + setup: func() { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolEscrowAccount). + Return(poolDistrAcc).AnyTimes() + + fund := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.3"), + Expiry: nil, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund) + suite.Require().NoError(err) + + amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initalBalanceCoins) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream). + Return(nil).Times(1) + + remainingCoins := initalBalanceCoins.Sub(amountToStream...) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, remainingCoins). + Return(fmt.Errorf("send module error")).Times(1) + }, + expectedErr: "failed to send coins to community pool", + }, + { + name: "fund expiry equals block time (not expired)", + params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + initialPoolBalance: initialBalance, + setup: func() { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolEscrowAccount). + Return(poolDistrAcc).AnyTimes() + + expiryTime := suite.ctx.BlockTime() // exactly equal to block time. + fund := types.ContinuousFund{ + Recipient: recipientAddr.String(), + Percentage: math.LegacyMustNewDecFromStr("0.3"), + Expiry: &expiryTime, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, recipientAddr, fund) + suite.Require().NoError(err) + + amountToStream := poolkeeper.PercentageCoinMul(math.LegacyMustNewDecFromStr("0.3"), initalBalanceCoins) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(suite.ctx, types.ProtocolPoolEscrowAccount, recipientAddr, amountToStream). + Return(nil).Times(1) + + remainingCoins := initalBalanceCoins.Sub(amountToStream...) + suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, types.ProtocolPoolEscrowAccount, types.ModuleName, remainingCoins). + Return(nil).Times(1) + }, + expectedErr: "", + }, + } + + for _, tc := range tests { + suite.Run(tc.name, func() { + suite.SetupTest() + suite.Require().NoError(suite.poolKeeper.Params.Set(suite.ctx, tc.params)) + if !tc.initialPoolBalance.IsNil() { + suite.bankKeeper.EXPECT().GetBalance(suite.ctx, poolDistrAcc.GetAddress(), initialBalance.Denom). + Return(tc.initialPoolBalance).Times(1) + } + + tc.setup() + + err := suite.poolKeeper.DistributeFunds(suite.ctx) + switch { + case tc.expectedErr != "": + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expectedErr) + default: + suite.Require().NoError(err) + } + }) + } +} + +// TestPercentageCoinMul tests the PercentageCoinMul function. +func TestPercentageCoinMul(t *testing.T) { + tests := []struct { + name string + percentage math.LegacyDec + coins sdk.Coins + expected sdk.Coins + }{ + { + name: "zero percentage", + percentage: math.LegacyMustNewDecFromStr("0.0"), + coins: sdk.NewCoins(sdk.NewCoin("atom", math.NewInt(100))), + expected: sdk.NewCoins(sdk.NewCoin("atom", math.NewInt(0))), + }, + { + name: "100 percent", + percentage: math.LegacyMustNewDecFromStr("1.0"), + coins: sdk.NewCoins(sdk.NewCoin("atom", math.NewInt(100))), + expected: sdk.NewCoins(sdk.NewCoin("atom", math.NewInt(100))), + }, + { + name: "50 percent", + percentage: math.LegacyMustNewDecFromStr("0.5"), + coins: sdk.NewCoins(sdk.NewCoin("atom", math.NewInt(100))), + expected: sdk.NewCoins(sdk.NewCoin("atom", math.NewInt(50))), + }, + { + name: "fraction with truncation", + percentage: math.LegacyMustNewDecFromStr("0.333333333333333333"), // Approx. 1/3. + coins: sdk.NewCoins(sdk.NewCoin("atom", math.NewInt(100))), + // 100 * 1/3 = 33.333... which truncates to 33. + expected: sdk.NewCoins(sdk.NewCoin("atom", math.NewInt(33))), + }, + { + name: "multiple denominations", + percentage: math.LegacyMustNewDecFromStr("0.5"), + coins: sdk.NewCoins( + sdk.NewCoin("atom", math.NewInt(100)), + sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(200)), + ), + expected: sdk.NewCoins( + sdk.NewCoin("atom", math.NewInt(50)), + sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100)), + ), + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + // Call the function under test. + result := poolkeeper.PercentageCoinMul(tc.percentage, tc.coins) + + // Compare the resulting coins with the expected coins. + if !result.Equal(tc.expected) { + t.Errorf("unexpected result for %s:\nexpected: %s\ngot: %s", tc.name, tc.expected.String(), result.String()) + } + }) + } +} diff --git a/x/protocolpool/keeper/msg_server.go b/x/protocolpool/keeper/msg_server.go new file mode 100644 index 0000000000..e376f1dae7 --- /dev/null +++ b/x/protocolpool/keeper/msg_server.go @@ -0,0 +1,176 @@ +package keeper + +import ( + "context" + "fmt" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +type MsgServer struct { + Keeper +} + +var _ types.MsgServer = MsgServer{} + +// NewMsgServerImpl returns an implementation of the protocolpool MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &MsgServer{Keeper: keeper} +} + +func (k MsgServer) FundCommunityPool(ctx context.Context, msg *types.MsgFundCommunityPool) (*types.MsgFundCommunityPoolResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + depositor, err := k.authKeeper.AddressCodec().StringToBytes(msg.Depositor) + if err != nil { + return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid depositor address: %s", err) + } + + if err := validateAmount(msg.Amount); err != nil { + return nil, err + } + + // send funds to community pool module account + if err := k.Keeper.FundCommunityPool(sdkCtx, msg.Amount, depositor); err != nil { + return nil, err + } + + return &types.MsgFundCommunityPoolResponse{}, nil +} + +func (k MsgServer) CommunityPoolSpend(ctx context.Context, msg *types.MsgCommunityPoolSpend) (*types.MsgCommunityPoolSpendResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if err := k.validateAuthority(msg.Authority); err != nil { + return nil, err + } + + if err := validateAmount(msg.Amount); err != nil { + return nil, err + } + + recipient, err := k.authKeeper.AddressCodec().StringToBytes(msg.Recipient) + if err != nil { + return nil, err + } + + // distribute funds from community pool module account + if err := k.DistributeFromCommunityPool(sdkCtx, msg.Amount, recipient); err != nil { + return nil, err + } + + sdkCtx.Logger().Debug("transferred from the community pool", "amount", msg.Amount.String(), "recipient", msg.Recipient) + + return &types.MsgCommunityPoolSpendResponse{}, nil +} + +func (k MsgServer) CreateContinuousFund(ctx context.Context, msg *types.MsgCreateContinuousFund) (*types.MsgCreateContinuousFundResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if err := k.validateAuthority(msg.Authority); err != nil { + return nil, err + } + + recipient, err := k.Keeper.authKeeper.AddressCodec().StringToBytes(msg.Recipient) + if err != nil { + return nil, err + } + + // deny creation if we know this address is blocked from receiving funds + if k.bankKeeper.BlockedAddr(recipient) { + return nil, fmt.Errorf("recipient is blocked in the bank keeper: %s", msg.Recipient) + } + + has, err := k.ContinuousFunds.Has(sdkCtx, recipient) + if err != nil { + return nil, err + } + if has { + return nil, fmt.Errorf("continuous fund already exists for recipient %s", msg.Recipient) + } + + // Validate the message fields + err = validateContinuousFund(sdkCtx, *msg) + if err != nil { + return nil, err + } + + // Check if total funds percentage exceeds 100% + // If exceeds, we should not setup continuous fund proposal. + totalStreamFundsPercentage := math.LegacyZeroDec() + err = k.ContinuousFunds.Walk(sdkCtx, nil, func(key sdk.AccAddress, value types.ContinuousFund) (stop bool, err error) { + totalStreamFundsPercentage = totalStreamFundsPercentage.Add(value.Percentage) + return false, nil + }) + if err != nil { + return nil, err + } + totalStreamFundsPercentage = totalStreamFundsPercentage.Add(msg.Percentage) + if totalStreamFundsPercentage.GT(math.LegacyOneDec()) { + return nil, fmt.Errorf("cannot set continuous fund proposal\ntotal funds percentage exceeds 100\ncurrent total percentage: %s", totalStreamFundsPercentage.Sub(msg.Percentage).MulInt64(100).TruncateInt().String()) + } + + // Create continuous fund proposal + cf := types.ContinuousFund{ + Recipient: msg.Recipient, + Percentage: msg.Percentage, + Expiry: msg.Expiry, + } + + // Set continuous fund to the state + err = k.ContinuousFunds.Set(sdkCtx, recipient, cf) + if err != nil { + return nil, err + } + + return &types.MsgCreateContinuousFundResponse{}, nil +} + +func (k MsgServer) CancelContinuousFund(ctx context.Context, msg *types.MsgCancelContinuousFund) (*types.MsgCancelContinuousFundResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if err := k.validateAuthority(msg.Authority); err != nil { + return nil, err + } + + recipient, err := k.Keeper.authKeeper.AddressCodec().StringToBytes(msg.Recipient) + if err != nil { + return nil, err + } + + canceledHeight := sdkCtx.BlockHeight() + canceledTime := sdkCtx.BlockTime() + + if err := k.ContinuousFunds.Remove(sdkCtx, recipient); err != nil { + return nil, fmt.Errorf("failed to remove continuous fund for recipient %s: %w", msg.Recipient, err) + } + + return &types.MsgCancelContinuousFundResponse{ + CanceledTime: canceledTime, + CanceledHeight: uint64(canceledHeight), + Recipient: msg.Recipient, + }, nil +} + +func (k MsgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if err := k.validateAuthority(msg.GetAuthority()); err != nil { + return nil, err + } + + if err := msg.Params.Validate(); err != nil { + return nil, fmt.Errorf("invalid params: %w", err) + } + + if err := k.Params.Set(sdkCtx, msg.Params); err != nil { + return nil, fmt.Errorf("failed to set params: %w", err) + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/protocolpool/keeper/msg_server_test.go b/x/protocolpool/keeper/msg_server_test.go new file mode 100644 index 0000000000..780fbbaa4a --- /dev/null +++ b/x/protocolpool/keeper/msg_server_test.go @@ -0,0 +1,479 @@ +package keeper_test + +import ( + "time" + + "go.uber.org/mock/gomock" + + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/codec/address" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +func (suite *KeeperTestSuite) TestFundCommunityPool() { + validDepositor := recipientAddr + validAmount := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000))) + + testCases := []struct { + name string + preRun func() + msg *types.MsgFundCommunityPool + expErr bool + expErrMsg string + }{ + { + name: "invalid depositor address", + msg: &types.MsgFundCommunityPool{ + Depositor: "invalid", + Amount: validAmount, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + }, + expErr: true, + expErrMsg: "invalid depositor address:", + }, + { + name: "invalid amount", + msg: &types.MsgFundCommunityPool{ + Depositor: validDepositor.String(), + Amount: sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: math.NewInt(-1)}}, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + }, + expErr: true, + expErrMsg: "-1stake: invalid coins", + }, + { + name: "valid fund community pool", + msg: &types.MsgFundCommunityPool{ + Depositor: validDepositor.String(), + Amount: validAmount, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + suite.bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), validDepositor, types.ModuleName, validAmount).Return(nil).Times(1) + }, + expErr: false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + if tc.preRun != nil { + tc.preRun() + } + resp, err := suite.msgServer.FundCommunityPool(suite.ctx, tc.msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().NotNil(resp) + } + }) + } +} + +func (suite *KeeperTestSuite) TestCommunityPoolSpend() { + validAuthority := suite.poolKeeper.GetAuthority() + validRecipient := recipientAddr + validAmount := sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(500))) + + testCases := []struct { + name string + preRun func() + msg *types.MsgCommunityPoolSpend + expErr bool + expErrMsg string + }{ + { + name: "invalid authority", + msg: &types.MsgCommunityPoolSpend{ + Authority: "invalid_auth", + Recipient: validRecipient.String(), + Amount: validAmount, + }, + preRun: nil, + expErr: true, + expErrMsg: "invalid authority address", + }, + { + name: "invalid amount", + msg: &types.MsgCommunityPoolSpend{ + Authority: validAuthority, + Recipient: validRecipient.String(), + Amount: sdk.Coins{sdk.Coin{Denom: "stake", Amount: math.NewInt(-1)}}, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + }, + expErr: true, + expErrMsg: "-1stake: invalid coins", + }, + { + name: "invalid recipient address", + msg: &types.MsgCommunityPoolSpend{ + Authority: validAuthority, + Recipient: "invalid", + Amount: validAmount, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + }, + expErr: true, + expErrMsg: "decoding bech32 failed", + }, + { + name: "valid community pool spend", + msg: &types.MsgCommunityPoolSpend{ + Authority: validAuthority, + Recipient: validRecipient.String(), + Amount: validAmount, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + suite.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(gomock.Any(), types.ModuleName, validRecipient, validAmount).Return(nil).Times(1) + }, + expErr: false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + if tc.preRun != nil { + tc.preRun() + } + resp, err := suite.msgServer.CommunityPoolSpend(suite.ctx, tc.msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().NotNil(resp) + } + }) + } +} + +func (suite *KeeperTestSuite) TestCreateContinuousFund() { + validAuthority := suite.poolKeeper.GetAuthority() + validRecipient := recipientAddr + validPercentage := math.LegacyMustNewDecFromStr("0.2") + validExpiry := suite.ctx.BlockTime().Add(24 * time.Hour) + + testCases := []struct { + name string + preRun func() + msg *types.MsgCreateContinuousFund + expErr bool + expErrMsg string + verify func(msg *types.MsgCreateContinuousFund) + }{ + { + name: "invalid authority", + msg: &types.MsgCreateContinuousFund{ + Authority: "invalid_auth", + Recipient: validRecipient.String(), + Percentage: validPercentage, + Expiry: &validExpiry, + }, + preRun: func() {}, + expErr: true, + expErrMsg: "invalid authority address", + }, + { + name: "invalid recipient address", + msg: &types.MsgCreateContinuousFund{ + Authority: validAuthority, + Recipient: "invalid", + Percentage: validPercentage, + Expiry: &validExpiry, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + }, + expErr: true, + expErrMsg: "decoding bech32 failed", + }, + { + name: "continuous fund already exists", + msg: &types.MsgCreateContinuousFund{ + Authority: validAuthority, + Recipient: validRecipient.String(), + Percentage: validPercentage, + Expiry: &validExpiry, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + suite.bankKeeper.EXPECT().BlockedAddr(validRecipient).Return(false).Times(1) + // Pre-create a continuous fund. + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, validRecipient, types.ContinuousFund{ + Recipient: validRecipient.String(), + Percentage: validPercentage, + Expiry: &validExpiry, + }) + suite.Require().NoError(err) + }, + expErr: true, + expErrMsg: "continuous fund already exists", + }, + { + name: "invalid continuous fund fields", + msg: &types.MsgCreateContinuousFund{ + Authority: validAuthority, + Recipient: validRecipient.String(), + Percentage: math.LegacyZeroDec(), // zero percent is invalid + Expiry: &validExpiry, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + suite.bankKeeper.EXPECT().BlockedAddr(validRecipient).Return(false).Times(1) + }, + expErr: true, + expErrMsg: "invalid continuous fund", + }, + { + name: "total percentage exceeds 100%", + msg: &types.MsgCreateContinuousFund{ + Authority: validAuthority, + Recipient: validRecipient.String(), + // Set a high percentage so that total exceeds 1 when added to an existing fund. + Percentage: math.LegacyMustNewDecFromStr("0.9"), + Expiry: &validExpiry, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + suite.bankKeeper.EXPECT().BlockedAddr(validRecipient).Return(false).Times(1) + + existingRecipient := recipientAddr2 + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, existingRecipient, types.ContinuousFund{ + Recipient: existingRecipient.String(), + Percentage: math.LegacyMustNewDecFromStr("0.2"), // total will become 1.1 + Expiry: nil, + }) + suite.Require().NoError(err) + }, + expErr: true, + expErrMsg: "total funds percentage exceeds 100", + }, + { + name: "address is bocked", + msg: &types.MsgCreateContinuousFund{ + Authority: validAuthority, + Recipient: validRecipient.String(), + Percentage: validPercentage, + Expiry: &validExpiry, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + suite.bankKeeper.EXPECT().BlockedAddr(validRecipient).Return(true).Times(1) + + // Ensure any existing fund for validRecipient is removed. + _ = suite.poolKeeper.ContinuousFunds.Remove(suite.ctx, validRecipient) + }, + expErr: true, + expErrMsg: "recipient is blocked in the bank keeper", + }, + { + name: "valid create continuous fund", + msg: &types.MsgCreateContinuousFund{ + Authority: validAuthority, + Recipient: validRecipient.String(), + Percentage: validPercentage, + Expiry: &validExpiry, + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + suite.bankKeeper.EXPECT().BlockedAddr(validRecipient).Return(false).Times(1) + // Ensure any existing fund for validRecipient is removed. + _ = suite.poolKeeper.ContinuousFunds.Remove(suite.ctx, validRecipient) + }, + expErr: false, + }, + } + + for _, tc := range testCases { + suite.SetupTest() + suite.Run(tc.name, func() { + if tc.preRun != nil { + tc.preRun() + } + resp, err := suite.msgServer.CreateContinuousFund(suite.ctx, tc.msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().NotNil(resp) + // Verify that the fund was stored. + fund, err := suite.poolKeeper.ContinuousFunds.Get(suite.ctx, sdk.MustAccAddressFromBech32(tc.msg.Recipient)) + suite.Require().NoError(err) + suite.Require().Equal(tc.msg.Recipient, fund.Recipient) + } + }) + } +} + +func (suite *KeeperTestSuite) TestCancelContinuousFund() { + validAuthority := suite.poolKeeper.GetAuthority() + validRecipient := recipientAddr + + testCases := []struct { + name string + preRun func() + msg *types.MsgCancelContinuousFund + expErr bool + expErrMsg string + verify func(msg *types.MsgCancelContinuousFund) + }{ + { + name: "invalid authority", + msg: &types.MsgCancelContinuousFund{ + Authority: "invalid_auth", + Recipient: validRecipient.String(), + }, + preRun: func() {}, + expErr: true, + expErrMsg: "invalid authority address", + }, + { + name: "invalid recipient address", + msg: &types.MsgCancelContinuousFund{ + Authority: validAuthority, + Recipient: "invalid", + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + }, + expErr: true, + expErrMsg: "decoding bech32 failed:", + }, + { + name: "remove a continuous fund that already was removed - no error", + msg: &types.MsgCancelContinuousFund{ + Authority: validAuthority, + Recipient: validRecipient.String(), + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + // Ensure the continuous fund is not set so that Remove fails. + _ = suite.poolKeeper.ContinuousFunds.Remove(suite.ctx, validRecipient) + }, + expErr: false, + }, + { + name: "valid cancel continuous fund", + msg: &types.MsgCancelContinuousFund{ + Authority: validAuthority, + Recipient: validRecipient.String(), + }, + preRun: func() { + suite.authKeeper.EXPECT().AddressCodec(). + Return(address.NewBech32Codec("cosmos")).AnyTimes() + fund := types.ContinuousFund{ + Recipient: validRecipient.String(), + Percentage: math.LegacyMustNewDecFromStr("0.3"), + Expiry: nil, + } + err := suite.poolKeeper.ContinuousFunds.Set(suite.ctx, validRecipient, fund) + suite.Require().NoError(err) + }, + expErr: false, + verify: func(msg *types.MsgCancelContinuousFund) { + // Verify that the fund has been removed. + _, err := suite.poolKeeper.ContinuousFunds.Get(suite.ctx, validRecipient) + suite.Require().Error(err, "expected error when retrieving removed fund") + }, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + if tc.preRun != nil { + tc.preRun() + } + resp, err := suite.msgServer.CancelContinuousFund(suite.ctx, tc.msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().NotNil(resp) + suite.Require().Equal(uint64(suite.ctx.BlockHeight()), resp.CanceledHeight) + suite.Require().Equal(tc.msg.Recipient, resp.Recipient) + if tc.verify != nil { + tc.verify(tc.msg) + } + } + }) + } +} + +func (suite *KeeperTestSuite) TestUpdateParams() { + validAuthority := suite.poolKeeper.GetAuthority() + + testCases := []struct { + name string + msg *types.MsgUpdateParams + expErr bool + expErrMsg string + }{ + { + name: "invalid authority", + msg: &types.MsgUpdateParams{ + Authority: "invalid_auth", + Params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}}, + }, + expErr: true, + expErrMsg: "invalid authority address", + }, + { + name: "error setting params (invalid params)", + msg: &types.MsgUpdateParams{ + Authority: validAuthority, + Params: types.Params{EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}, DistributionFrequency: 0}, + }, + expErr: true, + expErrMsg: "invalid params", + }, + { + name: "valid update params", + msg: &types.MsgUpdateParams{ + Authority: validAuthority, + Params: types.DefaultParams(), + }, + expErr: false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + resp, err := suite.msgServer.UpdateParams(suite.ctx, tc.msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().NotNil(resp) + } + }) + } +} diff --git a/x/protocolpool/keeper/validate.go b/x/protocolpool/keeper/validate.go new file mode 100644 index 0000000000..2a122ab555 --- /dev/null +++ b/x/protocolpool/keeper/validate.go @@ -0,0 +1,43 @@ +package keeper + +import ( + "fmt" + + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +// validateContinuousFund validates the fields of the CreateContinuousFund message. +func validateContinuousFund(ctx sdk.Context, msg types.MsgCreateContinuousFund) error { + fund := types.ContinuousFund{ + Recipient: msg.Recipient, + Percentage: msg.Percentage, + Expiry: msg.Expiry, + } + if err := fund.Validate(); err != nil { + return fmt.Errorf("invalid continuous fund: %w", err) + } + + // Validate expiry + currentTime := ctx.BlockTime() + if msg.Expiry != nil && msg.Expiry.Compare(currentTime) == -1 { + return fmt.Errorf("expiry time %s cannot be less than the current block time %s", msg.Expiry, currentTime) + } + + return nil +} + +func validateAmount(amount sdk.Coins) error { + if amount == nil { + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, "amount cannot be nil") + } + + if err := amount.Validate(); err != nil { + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, amount.String()) + } + + return nil +} diff --git a/x/protocolpool/keeper/validate_test.go b/x/protocolpool/keeper/validate_test.go new file mode 100644 index 0000000000..32c140ae6e --- /dev/null +++ b/x/protocolpool/keeper/validate_test.go @@ -0,0 +1,159 @@ +package keeper + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +// TestValidateAmount tests the validateAmount function. +func TestValidateAmount(t *testing.T) { + tests := []struct { + name string + amount sdk.Coins + expErr bool + errMsg string + }{ + { + name: "nil amount", + amount: nil, + expErr: true, + errMsg: "amount cannot be nil", + }, + { + name: "negative coin amount", + amount: sdk.Coins{ + { + Denom: "stake", + Amount: math.NewInt(-100), + }, + }, + expErr: true, + errMsg: "-100", + }, + { + name: "valid single coin", + amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), + expErr: false, + }, + { + name: "multiple valid coins", + amount: sdk.NewCoins( + sdk.NewCoin("stake", math.NewInt(100)), + sdk.NewCoin("token", math.NewInt(200)), + ), + expErr: false, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + err := validateAmount(tc.amount) + if tc.expErr { + require.Error(t, err, "expected an error but got none") + require.Contains(t, err.Error(), tc.errMsg) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateContinuousFund(t *testing.T) { + now := time.Now() + future := now.Add(1 * time.Hour) + past := now.Add(-1 * time.Hour) + + // Create a context with the current block time. + ctx := sdk.Context{}.WithBlockTime(now) + + tests := []struct { + name string + msg types.MsgCreateContinuousFund + expErr bool + errMsg string + }{ + { + name: "zero percentage", + msg: types.MsgCreateContinuousFund{ + Authority: "authority", + Recipient: "recipient", + Percentage: math.LegacyZeroDec(), + Expiry: &future, + }, + expErr: true, + errMsg: "percentage cannot be zero or empty", + }, + { + name: "negative percentage", + msg: types.MsgCreateContinuousFund{ + Authority: "authority", + Recipient: "recipient", + Percentage: math.LegacyNewDecFromInt(math.NewInt(-1)), + Expiry: &future, + }, + expErr: true, + errMsg: "percentage cannot be negative", + }, + { + name: "percentage greater than one", + msg: types.MsgCreateContinuousFund{ + Authority: "authority", + Recipient: "recipient", + Percentage: math.LegacyMustNewDecFromStr("1.1"), + Expiry: &future, + }, + expErr: true, + errMsg: "percentage cannot be greater than one", + }, + { + name: "valid percentage with nil expiry", + msg: types.MsgCreateContinuousFund{ + Authority: "authority", + Recipient: "recipient", + Percentage: math.LegacyNewDecWithPrec(5, 1), // 0.5 + Expiry: nil, + }, + expErr: false, + }, + { + name: "valid percentage with future expiry", + msg: types.MsgCreateContinuousFund{ + Authority: "authority", + Recipient: "recipient", + Percentage: math.LegacyNewDecWithPrec(5, 1), // 0.5 + Expiry: &future, + }, + expErr: false, + }, + { + name: "expiry in past", + msg: types.MsgCreateContinuousFund{ + Authority: "authority", + Recipient: "recipient", + Percentage: math.LegacyNewDecWithPrec(5, 1), // 0.5 + Expiry: &past, + }, + expErr: true, + errMsg: "cannot be less than the current block time", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + err := validateContinuousFund(ctx, tc.msg) + if tc.expErr { + require.Error(t, err, "expected an error but got none") + require.Contains(t, err.Error(), tc.errMsg) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/protocolpool/module.go b/x/protocolpool/module.go new file mode 100644 index 0000000000..ba7641533c --- /dev/null +++ b/x/protocolpool/module.go @@ -0,0 +1,160 @@ +package protocolpool + +import ( + "context" + "encoding/json" + "fmt" + + gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" + + "cosmossdk.io/core/appmodule" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/protocolpool/keeper" + "github.com/cosmos/cosmos-sdk/x/protocolpool/simulation" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +// ConsensusVersion defines the current x/protocolpool module consensus version. +const ConsensusVersion = 1 + +var ( + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + _ module.HasServices = AppModule{} + _ module.AppModule = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} +) + +// AppModule implements an application module for the pool module +type AppModule struct { + cdc codec.Codec + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +// NewAppModule creates a new AppModule object +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, + accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + cdc: cdc, + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// IsAppModule implements the appmodule.AppModule interface. +func (AppModule) IsAppModule() {} + +// Name returns the protocolpool module's name. +// Deprecated: kept for legacy reasons. +func (AppModule) Name() string { return types.ModuleName } + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes +func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// RegisterInterfaces registers interfaces and implementations of the protocolpool module. +func (AppModule) RegisterInterfaces(ir codectypes.InterfaceRegistry) { + types.RegisterInterfaces(ir) +} + +func (am AppModule) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(amino) +} + +// RegisterServices registers module services. +func (am AppModule) RegisterServices(configurator module.Configurator) { + types.RegisterMsgServer(configurator, keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(configurator, keeper.NewQuerier(am.keeper)) +} + +// DefaultGenesis returns default genesis state as raw bytes for the protocolpool module. +func (am AppModule) DefaultGenesis(_ codec.JSONCodec) json.RawMessage { + data, err := am.cdc.MarshalJSON(types.DefaultGenesisState()) + if err != nil { + panic(err) + } + return data +} + +// ValidateGenesis performs genesis state validation for the protocolpool module. +func (am AppModule) ValidateGenesis(_ codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var data types.GenesisState + if err := am.cdc.UnmarshalJSON(bz, &data); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + + return data.Validate() +} + +// InitGenesis performs genesis initialization for the protocolpool module. +func (am AppModule) InitGenesis(ctx sdk.Context, _ codec.JSONCodec, data json.RawMessage) { + var genesisState types.GenesisState + am.cdc.MustUnmarshalJSON(data, &genesisState) + + if err := am.keeper.InitGenesis(ctx, &genesisState); err != nil { + panic(fmt.Errorf("failed to init genesis state: %w", err)) + } +} + +// ExportGenesis returns the exported genesis state as raw bytes for the protocolpool module. +func (am AppModule) ExportGenesis(ctx sdk.Context, _ codec.JSONCodec) json.RawMessage { + gs, err := am.keeper.ExportGenesis(ctx) + if err != nil { + panic(fmt.Errorf("failed to export genesis state: %w", err)) + } + return am.cdc.MustMarshalJSON(gs) +} + +// BeginBlock implements appmodule.HasBeginBlocker. +func (am AppModule) BeginBlock(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + return am.keeper.BeginBlocker(sdkCtx) +} + +// ConsensusVersion implements HasConsensusVersion +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } + +// ____________________________________________________________________________ + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the protocolpool module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + // GenerateGenesisState creates a randomized GenState of the protocolpool module. + simulation.RandomizedGenState(simState) +} + +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedProposalMsg { + return simulation.ProposalMsgs() +} + +// RegisterStoreDecoder registers a decoder for protocolpool module's types +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) { +} + +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + return simulation.WeightedOperations( + simState.AppParams, + simState.TxConfig, + am.accountKeeper, + am.bankKeeper, + am.keeper, + ) +} diff --git a/x/protocolpool/simulation/genesis.go b/x/protocolpool/simulation/genesis.go new file mode 100644 index 0000000000..01e339a390 --- /dev/null +++ b/x/protocolpool/simulation/genesis.go @@ -0,0 +1,33 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +const ( + Params = "params" +) + +func GenParams(r *rand.Rand) types.Params { + params := types.DefaultParams() + + // window length of [1:20] so that we can trigger the BeginBlocker regularly + windowLen := r.Intn(20) + 1 + params.DistributionFrequency = uint64(windowLen) + + return params +} + +// RandomizedGenState generates a random GenesisState for gov +func RandomizedGenState(simState *module.SimulationState) { + params := types.DefaultParams() + simState.AppParams.GetOrGenerate(Params, ¶ms, simState.Rand, func(r *rand.Rand) { params = GenParams(r) }) + + genesis := types.DefaultGenesisState() + genesis.Params = params + + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(genesis) +} diff --git a/x/protocolpool/simulation/operations.go b/x/protocolpool/simulation/operations.go new file mode 100644 index 0000000000..a943b76ec1 --- /dev/null +++ b/x/protocolpool/simulation/operations.go @@ -0,0 +1,91 @@ +package simulation + +import ( + "fmt" + "math/rand" + + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/protocolpool/keeper" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" + "github.com/cosmos/cosmos-sdk/x/simulation" +) + +var TypeFundCommunityPool = sdk.MsgTypeURL(&types.MsgFundCommunityPool{}) + +// Simulation operation weights constants +const ( + OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool" + + DefaultWeightMsgFundCommunityPool = 100 +) + +// WeightedOperations returns all the operations from the module with their respective weights +func WeightedOperations( + appParams simtypes.AppParams, + txGen client.TxConfig, + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simulation.WeightedOperations { + var weightMsgFundCommunityPool int + + appParams.GetOrGenerate(OpWeightMsgFundCommunityPool, &weightMsgFundCommunityPool, nil, + func(_ *rand.Rand) { + weightMsgFundCommunityPool = DefaultWeightMsgFundCommunityPool + }, + ) + + return simulation.WeightedOperations{ + simulation.NewWeightedOperation( + weightMsgFundCommunityPool, + SimulateMsgFundCommunityPool(txGen, ak, bk, k), + ), + } +} + +func SimulateMsgFundCommunityPool( + txGen client.TxConfig, + ak types.AccountKeeper, + bk types.BankKeeper, + _ keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + account := ak.GetAccount(ctx, simAccount.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + // choose 10% - 70% of spendable + // we do not want to use the full balance so that fees can be covered + decimalVal := r.Intn(6) + 1 // [1:7] + spendableSubAmount := keeper.PercentageCoinMul(math.LegacyMustNewDecFromStr(fmt.Sprintf("0.%d", decimalVal)), spendable) + if spendableSubAmount.IsZero() { + return simtypes.NoOpMsg(types.ModuleName, TypeFundCommunityPool, "no balance"), nil, nil + } + + msg := &types.MsgFundCommunityPool{ + Amount: spendableSubAmount, + Depositor: account.GetAddress().String(), + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: txGen, + Cdc: nil, + Msg: msg, + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendableSubAmount, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/protocolpool/simulation/proposals.go b/x/protocolpool/simulation/proposals.go new file mode 100644 index 0000000000..72348d0df7 --- /dev/null +++ b/x/protocolpool/simulation/proposals.go @@ -0,0 +1,65 @@ +package simulation + +import ( + "math/rand" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" + "github.com/cosmos/cosmos-sdk/x/simulation" +) + +// Simulation operation weights constants +const ( + DefaultWeightMsgUpdateParams int = 50 + + OpWeightMsgUpdateParams = "op_weight_msg_update_params" + + DefaultWeightCreateContinuousFund int = 50 + + OpWeightMsgCreateContinuousFund = "op_weight_msg_create_continuous_fund" +) + +// ProposalMsgs defines the module weighted proposals' contents +func ProposalMsgs() []simtypes.WeightedProposalMsg { + return []simtypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( + OpWeightMsgUpdateParams, + DefaultWeightMsgUpdateParams, + SimulateMsgUpdateParams, + ), + simulation.NewWeightedProposalMsg( + OpWeightMsgCreateContinuousFund, + DefaultWeightCreateContinuousFund, + SimulateMsgCreateContinuousFund, + ), + } +} + +// SimulateMsgUpdateParams returns a random MsgUpdateParams +func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) sdk.Msg { + // use the default gov module account address as authority + var authority sdk.AccAddress = address.Module("gov") + + return &types.MsgUpdateParams{ + Authority: authority.String(), + Params: GenParams(r), + } +} + +// SimulateMsgCreateContinuousFund returns a random MsgCreateContinuousFund +func SimulateMsgCreateContinuousFund(r *rand.Rand, _ sdk.Context, accs []simtypes.Account) sdk.Msg { + // use the default gov module account address as authority + var authority sdk.AccAddress = address.Module("gov") + simAccount, _ := simtypes.RandomAcc(r, accs) + percentage := math.LegacyNewDec(int64(r.Intn(10) + 1)).Quo(math.LegacyNewDec(100)) + + return &types.MsgCreateContinuousFund{ + Authority: authority.String(), + Recipient: simAccount.Address.String(), + Percentage: percentage, + } +} diff --git a/x/protocolpool/testutil/app_config.go b/x/protocolpool/testutil/app_config.go new file mode 100644 index 0000000000..e6d3a4ba6c --- /dev/null +++ b/x/protocolpool/testutil/app_config.go @@ -0,0 +1,28 @@ +package testutil + +import ( + "github.com/cosmos/cosmos-sdk/testutil/configurator" + _ "github.com/cosmos/cosmos-sdk/x/auth" // import as blank for app wiring + _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" // import as blank for app wiring + _ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring + _ "github.com/cosmos/cosmos-sdk/x/consensus" // import as blank for app wiring + _ "github.com/cosmos/cosmos-sdk/x/distribution" // import as blank for app wiring + _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring + _ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring + _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring + _ "github.com/cosmos/cosmos-sdk/x/protocolpool" // import as blank for app wiring + _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring +) + +var AppConfig = configurator.NewAppConfig( + configurator.AuthModule(), + configurator.BankModule(), + configurator.StakingModule(), + configurator.TxModule(), + configurator.ConsensusModule(), + configurator.ParamsModule(), + configurator.GenutilModule(), + configurator.DistributionModule(), + configurator.MintModule(), + configurator.ProtocolPoolModule(), +) diff --git a/x/protocolpool/testutil/expected_keepers_mocks.go b/x/protocolpool/testutil/expected_keepers_mocks.go new file mode 100644 index 0000000000..8aaf31dcc2 --- /dev/null +++ b/x/protocolpool/testutil/expected_keepers_mocks.go @@ -0,0 +1,233 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/protocolpool/types/expected_keepers.go +// +// Generated by this command: +// +// mockgen -source=x/protocolpool/types/expected_keepers.go -package testutil -destination x/protocolpool/testutil/expected_keepers_mocks.go +// + +// Package testutil is a generated GoMock package. +package testutil + +import ( + context "context" + reflect "reflect" + + address "cosmossdk.io/core/address" + types "github.com/cosmos/cosmos-sdk/types" + gomock "go.uber.org/mock/gomock" +) + +// MockAccountKeeper is a mock of AccountKeeper interface. +type MockAccountKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountKeeperMockRecorder + isgomock struct{} +} + +// MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. +type MockAccountKeeperMockRecorder struct { + mock *MockAccountKeeper +} + +// NewMockAccountKeeper creates a new mock instance. +func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper { + mock := &MockAccountKeeper{ctrl: ctrl} + mock.recorder = &MockAccountKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { + return m.recorder +} + +// AddressCodec mocks base method. +func (m *MockAccountKeeper) AddressCodec() address.Codec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddressCodec") + ret0, _ := ret[0].(address.Codec) + return ret0 +} + +// AddressCodec indicates an expected call of AddressCodec. +func (mr *MockAccountKeeperMockRecorder) AddressCodec() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddressCodec", reflect.TypeOf((*MockAccountKeeper)(nil).AddressCodec)) +} + +// GetAccount mocks base method. +func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types.AccAddress) types.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", ctx, addr) + ret0, _ := ret[0].(types.AccountI) + return ret0 +} + +// GetAccount indicates an expected call of GetAccount. +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) +} + +// GetModuleAccount mocks base method. +func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, name string) types.ModuleAccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAccount", ctx, name) + ret0, _ := ret[0].(types.ModuleAccountI) + return ret0 +} + +// GetModuleAccount indicates an expected call of GetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, name any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, name) +} + +// GetModuleAddress mocks base method. +func (m *MockAccountKeeper) GetModuleAddress(name string) types.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAddress", name) + ret0, _ := ret[0].(types.AccAddress) + return ret0 +} + +// GetModuleAddress indicates an expected call of GetModuleAddress. +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), name) +} + +// SetModuleAccount mocks base method. +func (m *MockAccountKeeper) SetModuleAccount(ctx context.Context, macc types.ModuleAccountI) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetModuleAccount", ctx, macc) +} + +// SetModuleAccount indicates an expected call of SetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(ctx, macc any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), ctx, macc) +} + +// MockBankKeeper is a mock of BankKeeper interface. +type MockBankKeeper struct { + ctrl *gomock.Controller + recorder *MockBankKeeperMockRecorder + isgomock struct{} +} + +// MockBankKeeperMockRecorder is the mock recorder for MockBankKeeper. +type MockBankKeeperMockRecorder struct { + mock *MockBankKeeper +} + +// NewMockBankKeeper creates a new mock instance. +func NewMockBankKeeper(ctrl *gomock.Controller) *MockBankKeeper { + mock := &MockBankKeeper{ctrl: ctrl} + mock.recorder = &MockBankKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { + return m.recorder +} + +// BlockedAddr mocks base method. +func (m *MockBankKeeper) BlockedAddr(addr types.AccAddress) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockedAddr", addr) + ret0, _ := ret[0].(bool) + return ret0 +} + +// BlockedAddr indicates an expected call of BlockedAddr. +func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockedAddr", reflect.TypeOf((*MockBankKeeper)(nil).BlockedAddr), addr) +} + +// GetAllBalances mocks base method. +func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllBalances", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} + +// GetAllBalances indicates an expected call of GetAllBalances. +func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) +} + +// GetBalance mocks base method. +func (m *MockBankKeeper) GetBalance(ctx context.Context, addr types.AccAddress, denom string) types.Coin { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBalance", ctx, addr, denom) + ret0, _ := ret[0].(types.Coin) + return ret0 +} + +// GetBalance indicates an expected call of GetBalance. +func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*MockBankKeeper)(nil).GetBalance), ctx, addr, denom) +} + +// SendCoinsFromAccountToModule mocks base method. +func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) +} + +// SendCoinsFromModuleToAccount mocks base method. +func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromModuleToAccount", ctx, senderModule, recipientAddr, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) +} + +// SendCoinsFromModuleToModule mocks base method. +func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromModuleToModule", ctx, senderModule, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) +} + +// SpendableCoins mocks base method. +func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types.AccAddress) types.Coins { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SpendableCoins", ctx, addr) + ret0, _ := ret[0].(types.Coins) + return ret0 +} + +// SpendableCoins indicates an expected call of SpendableCoins. +func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) +} diff --git a/x/protocolpool/types/codec.go b/x/protocolpool/types/codec.go new file mode 100644 index 0000000000..5e073f3e56 --- /dev/null +++ b/x/protocolpool/types/codec.go @@ -0,0 +1,37 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterInterfaces(ir codectypes.InterfaceRegistry) { + ir.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgFundCommunityPool{}, + &MsgCommunityPoolSpend{}, + &MsgCreateContinuousFund{}, + &MsgCancelContinuousFund{}, + &MsgUpdateParams{}, + ) + + msgservice.RegisterMsgServiceDesc(ir, &_Msg_serviceDesc) +} + +// RegisterLegacyAminoCodec registers the necessary x/protocolpool interfaces and concrete types +// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. +// +// NOTE amino msg name paths are shorted due to the 40-character limit for amino. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + legacy.RegisterAminoMsg(cdc, &MsgFundCommunityPool{}, "cosmos-sdk/pp/MsgFundCommunityPool") + legacy.RegisterAminoMsg(cdc, &MsgCommunityPoolSpend{}, "cosmos-sdk/pp/MsgCommunityPoolSpend") + legacy.RegisterAminoMsg(cdc, &MsgCreateContinuousFund{}, "cosmos-sdk/pp/MsgCreateContinuousFund") + legacy.RegisterAminoMsg(cdc, &MsgCancelContinuousFund{}, "cosmos-sdk/pp/MsgCancelContinuousFund") + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/pp/MsgUpdateParams") + + cdc.RegisterConcrete(&ContinuousFund{}, "cosmos-sdk/pp/ContinuousFund", nil) + cdc.RegisterConcrete(&Params{}, "cosmos-sdk/pp/Params", nil) +} diff --git a/x/protocolpool/types/errors.go b/x/protocolpool/types/errors.go new file mode 100644 index 0000000000..8b31a933cb --- /dev/null +++ b/x/protocolpool/types/errors.go @@ -0,0 +1,5 @@ +package types + +import "cosmossdk.io/errors" + +var ErrInvalidSigner = errors.Register(ModuleName, 2, "expected authority account as only signer for community pool spend message") diff --git a/x/protocolpool/types/expected_keepers.go b/x/protocolpool/types/expected_keepers.go new file mode 100644 index 0000000000..f9a512592f --- /dev/null +++ b/x/protocolpool/types/expected_keepers.go @@ -0,0 +1,28 @@ +package types + +import ( + "context" + + "cosmossdk.io/core/address" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type AccountKeeper interface { + AddressCodec() address.Codec + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI + GetModuleAddress(name string) sdk.AccAddress + GetModuleAccount(ctx context.Context, name string) sdk.ModuleAccountI + SetModuleAccount(ctx context.Context, macc sdk.ModuleAccountI) +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + BlockedAddr(addr sdk.AccAddress) bool + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error +} diff --git a/x/protocolpool/types/genesis.go b/x/protocolpool/types/genesis.go new file mode 100644 index 0000000000..407b9136d7 --- /dev/null +++ b/x/protocolpool/types/genesis.go @@ -0,0 +1,37 @@ +package types + +import ( + "errors" + + "cosmossdk.io/math" +) + +func NewGenesisState(cf []ContinuousFund) *GenesisState { + return &GenesisState{ + ContinuousFunds: cf, + Params: Params{}, + } +} + +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + ContinuousFunds: []ContinuousFund{}, + Params: DefaultParams(), + } +} + +// Validate validates the genesis state of protocolpool genesis input +func (gs *GenesisState) Validate() error { + totalPercentage := math.LegacyZeroDec() + for _, cf := range gs.ContinuousFunds { + totalPercentage = totalPercentage.Add(cf.Percentage) + if err := cf.Validate(); err != nil { + return err + } + } + if totalPercentage.GT(math.LegacyOneDec()) { + return errors.New("total percentage cannot be greater than 100") + } + + return gs.Params.Validate() +} diff --git a/x/protocolpool/types/genesis.pb.go b/x/protocolpool/types/genesis.pb.go new file mode 100644 index 0000000000..2d286837a2 --- /dev/null +++ b/x/protocolpool/types/genesis.pb.go @@ -0,0 +1,391 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/protocolpool/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// 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 + +// GenesisState defines the protocolpool module's genesis state. +type GenesisState struct { + // ContinuousFunds defines the continuous funds at genesis. + ContinuousFunds []ContinuousFund `protobuf:"bytes,1,rep,name=continuous_funds,json=continuousFunds,proto3" json:"continuous_funds"` + // Params defines the parameters of this module, currently only contains the + // denoms that will be used for continuous fund distributions. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_72560a99455b4146, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetContinuousFunds() []ContinuousFund { + if m != nil { + return m.ContinuousFunds + } + return nil +} + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.protocolpool.v1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/protocolpool/v1/genesis.proto", fileDescriptor_72560a99455b4146) +} + +var fileDescriptor_72560a99455b4146 = []byte{ + // 244 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0x29, 0xc8, 0xcf, 0xcf, 0xd1, + 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x03, 0x8b, 0x0b, 0x89, 0x41, + 0x54, 0xe9, 0x21, 0xab, 0xd2, 0x2b, 0x33, 0x94, 0x52, 0xc2, 0xa1, 0xbb, 0xa4, 0xb2, 0x20, 0x15, + 0xaa, 0x5a, 0x4a, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xcc, 0xd4, 0x07, 0xb1, 0x20, 0xa2, 0x4a, 0x4b, + 0x19, 0xb9, 0x78, 0xdc, 0x21, 0x76, 0x04, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x85, 0x73, 0x09, 0x24, + 0xe7, 0xe7, 0x95, 0x64, 0xe6, 0x95, 0xe6, 0x97, 0x16, 0xc7, 0xa7, 0x95, 0xe6, 0xa5, 0x14, 0x4b, + 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0xa9, 0xe9, 0x61, 0xb7, 0x5d, 0xcf, 0x19, 0xae, 0xde, 0xad, + 0x34, 0x2f, 0xc5, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xfe, 0x64, 0x14, 0xd1, 0x62, 0x21, + 0x1b, 0x2e, 0xb6, 0x82, 0xc4, 0xa2, 0xc4, 0xdc, 0x62, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, + 0x39, 0x5c, 0xc6, 0x05, 0x80, 0x55, 0x41, 0x8d, 0x81, 0xea, 0x71, 0xf2, 0x3e, 0xf1, 0x48, 0x8e, + 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, + 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xc3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, + 0xfc, 0x5c, 0x7d, 0x68, 0x30, 0x40, 0x28, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x0a, 0xd4, 0x30, 0x01, + 0x07, 0x48, 0x12, 0x1b, 0x58, 0xcc, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x0a, 0xb2, 0x9f, 0x6f, + 0x75, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ContinuousFunds) > 0 { + for iNdEx := len(m.ContinuousFunds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ContinuousFunds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ContinuousFunds) > 0 { + for _, e := range m.ContinuousFunds { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContinuousFunds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContinuousFunds = append(m.ContinuousFunds, ContinuousFund{}) + if err := m.ContinuousFunds[len(m.ContinuousFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/protocolpool/types/genesis_test.go b/x/protocolpool/types/genesis_test.go new file mode 100644 index 0000000000..3d9531781e --- /dev/null +++ b/x/protocolpool/types/genesis_test.go @@ -0,0 +1,109 @@ +package types_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +func TestValidateGenesis(t *testing.T) { + tests := []struct { + name string + genesisState *types.GenesisState + expectedErr string + }{ + { + name: "default genesis state valid", + genesisState: types.DefaultGenesisState(), + expectedErr: "", + }, + { + name: "valid genesis state with a continuous fund", + genesisState: &types.GenesisState{ + ContinuousFunds: []types.ContinuousFund{ + { + Recipient: "cosmos1validaddress", + Percentage: math.LegacyMustNewDecFromStr("0.5"), + Expiry: nil, + }, + }, + Params: types.DefaultParams(), + }, + expectedErr: "", + }, + { + name: "invalid genesis state with continuous fund (empty recipient)", + genesisState: &types.GenesisState{ + ContinuousFunds: []types.ContinuousFund{ + { + Recipient: "", + Percentage: math.LegacyMustNewDecFromStr("0.5"), + Expiry: nil, + }, + }, + Params: types.DefaultParams(), + }, + expectedErr: "recipient cannot be empty", + }, + { + name: "invalid genesis state with params (zero distribution frequency)", + genesisState: &types.GenesisState{ + ContinuousFunds: []types.ContinuousFund{}, + Params: types.Params{ + EnabledDistributionDenoms: []string{"stake"}, + DistributionFrequency: 0, + }, + }, + expectedErr: "DistributionFrequency must be greater than 0", + }, + { + name: "invalid genesis state with continuous fund (percentage > 1)", + genesisState: &types.GenesisState{ + ContinuousFunds: []types.ContinuousFund{ + { + Recipient: "cosmos1validaddress", + Percentage: math.LegacyMustNewDecFromStr("1.1"), + Expiry: nil, + }, + }, + Params: types.DefaultParams(), + }, + expectedErr: "percentage cannot be greater than one", + }, + { + name: "invalid genesis state with continuous funds (percentage sum > 1)", + genesisState: &types.GenesisState{ + ContinuousFunds: []types.ContinuousFund{ + { + Recipient: "cosmos1validaddress", + Percentage: math.LegacyMustNewDecFromStr("0.5"), + Expiry: nil, + }, + { + Recipient: "cosmos2validaddress", + Percentage: math.LegacyMustNewDecFromStr("0.6"), + Expiry: nil, + }, + }, + Params: types.DefaultParams(), + }, + expectedErr: "total percentage cannot be greater than 100", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + err := tc.genesisState.Validate() + if tc.expectedErr != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expectedErr) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/protocolpool/types/interface.go b/x/protocolpool/types/interface.go new file mode 100644 index 0000000000..b5e6164a3e --- /dev/null +++ b/x/protocolpool/types/interface.go @@ -0,0 +1,16 @@ +package types + +import sdk "github.com/cosmos/cosmos-sdk/types" + +// ExternalCommunityPoolKeeper is the interface that an external community pool module keeper must fulfill +// for x/distribution to properly accept it as a community pool fund destination. +type ExternalCommunityPoolKeeper interface { + // GetCommunityPoolModule gets the module name that funds should be sent to for the community pool. + // This is the address that x/distribution will send funds to for external management. + GetCommunityPoolModule() string + // FundCommunityPool allows an account to directly fund the community fund pool. + FundCommunityPool(ctx sdk.Context, amount sdk.Coins, senderAddr sdk.AccAddress) error + // DistributeFromCommunityPool distributes funds from the community pool module account to + // a receiver address. + DistributeFromCommunityPool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error +} diff --git a/x/protocolpool/types/keys.go b/x/protocolpool/types/keys.go new file mode 100644 index 0000000000..55137bbc3d --- /dev/null +++ b/x/protocolpool/types/keys.go @@ -0,0 +1,35 @@ +package types + +import ( + "cosmossdk.io/collections" +) + +const ( + // ModuleName is the module name constant used in many places + // + // The module account associated with this name is the x/protocolpool community pool module account. + // Funded by: + // - direct funding from users using MsgFundProtocolPool + // - all leftover funds that are not allocated to continuous funds in the BeginBlocker from ProtocolPoolEscrowAccount + // Distributes to: + // - users on MsgCommunityPoolSpend + ModuleName = "protocolpool" + + // ProtocolPoolEscrowAccount is an intermediary account that holds the funds to be distributed to other accounts. + // + // It can receive funds from `x/distribution` and distribute them to continuous funds and/or the community pool. + // Funded by: + // - `x/distribution` during its BeginBlocker from the FeePool.CommunityPool + // Distributes to: + // - Continuous Funds in the store in the BeginBlocker + // - CommunityPool (all remaining funds not allocated for Continuous Funds) in the BeginBlocker + ProtocolPoolEscrowAccount = "protocolpool_escrow" + + // StoreKey is the store key string for protocolpool + StoreKey = ModuleName +) + +var ( + ContinuousFundsKey = collections.NewPrefix(3) + ParamsKey = collections.NewPrefix(8) +) diff --git a/x/protocolpool/types/msg.go b/x/protocolpool/types/msg.go new file mode 100644 index 0000000000..bbd470455c --- /dev/null +++ b/x/protocolpool/types/msg.go @@ -0,0 +1,32 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + _ sdk.Msg = (*MsgFundCommunityPool)(nil) + _ sdk.Msg = (*MsgCommunityPoolSpend)(nil) + _ sdk.Msg = (*MsgUpdateParams)(nil) + _ sdk.Msg = (*MsgCreateContinuousFund)(nil) + _ sdk.Msg = (*MsgCancelContinuousFund)(nil) +) + +// NewMsgFundCommunityPool returns a new MsgFundCommunityPool with a sender and +// a funding amount. +func NewMsgFundCommunityPool(amount sdk.Coins, depositor string) *MsgFundCommunityPool { + return &MsgFundCommunityPool{ + Amount: amount, + Depositor: depositor, + } +} + +// NewMsgCommunityPoolSpend returns a new CommunityPoolSpend with authority, recipient and +// a spending amount. +func NewMsgCommunityPoolSpend(amount sdk.Coins, authority, recipient string) *MsgCommunityPoolSpend { + return &MsgCommunityPoolSpend{ + Authority: authority, + Recipient: recipient, + Amount: amount, + } +} diff --git a/x/protocolpool/types/params.go b/x/protocolpool/types/params.go new file mode 100644 index 0000000000..119cd09e3e --- /dev/null +++ b/x/protocolpool/types/params.go @@ -0,0 +1,37 @@ +package types + +import ( + "errors" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func DefaultParams() Params { + return Params{ + EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}, + DistributionFrequency: 1, + } +} + +func (p *Params) Validate() error { + seenDenoms := make(map[string]struct{}) + + for _, d := range p.EnabledDistributionDenoms { + err := sdk.ValidateDenom(d) + if err != nil { + return err + } + + if _, seen := seenDenoms[d]; seen { + return fmt.Errorf("duplicate enabled distribution denom %s", d) + } + seenDenoms[d] = struct{}{} + } + + if p.DistributionFrequency == 0 { + return errors.New("DistributionFrequency must be greater than 0") + } + + return nil +} diff --git a/x/protocolpool/types/params_test.go b/x/protocolpool/types/params_test.go new file mode 100644 index 0000000000..4fc352960d --- /dev/null +++ b/x/protocolpool/types/params_test.go @@ -0,0 +1,77 @@ +package types_test + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/protocolpool/types" +) + +func TestParamsValidation(t *testing.T) { + tests := []struct { + name string + params types.Params + expectErr bool + errContains string + }{ + { + name: "default params valid", + params: types.DefaultParams(), + expectErr: false, + errContains: "", + }, + { + name: "custom valid params", + params: types.Params{ + EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}, + DistributionFrequency: 10, + }, + expectErr: false, + errContains: "", + }, + { + name: "invalid denom", + params: types.Params{ + EnabledDistributionDenoms: []string{"invalid!denom"}, + DistributionFrequency: 1, + }, + expectErr: true, + errContains: "invalid denom", + }, + { + name: "duplicate denom", + params: types.Params{ + EnabledDistributionDenoms: []string{sdk.DefaultBondDenom, sdk.DefaultBondDenom}, + DistributionFrequency: 1, + }, + expectErr: true, + errContains: "duplicate enabled distribution denom", + }, + { + name: "zero distribution frequency", + params: types.Params{ + EnabledDistributionDenoms: []string{sdk.DefaultBondDenom}, + DistributionFrequency: 0, + }, + expectErr: true, + errContains: "DistributionFrequency must be greater than 0", + }, + } + + for _, tc := range tests { + // capture range variable + t.Run(tc.name, func(t *testing.T) { + err := tc.params.Validate() + if tc.expectErr { + require.Error(t, err) + require.True(t, strings.Contains(err.Error(), tc.errContains), + "expected error to contain %q, got %q", tc.errContains, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/protocolpool/types/query.pb.go b/x/protocolpool/types/query.pb.go new file mode 100644 index 0000000000..f9db55b3c5 --- /dev/null +++ b/x/protocolpool/types/query.pb.go @@ -0,0 +1,1631 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/protocolpool/v1/query.proto + +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" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// 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 + +// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC +// method. +type QueryCommunityPoolRequest struct { +} + +func (m *QueryCommunityPoolRequest) Reset() { *m = QueryCommunityPoolRequest{} } +func (m *QueryCommunityPoolRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCommunityPoolRequest) ProtoMessage() {} +func (*QueryCommunityPoolRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51500a0a77d57843, []int{0} +} +func (m *QueryCommunityPoolRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCommunityPoolRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCommunityPoolRequest.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 *QueryCommunityPoolRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCommunityPoolRequest.Merge(m, src) +} +func (m *QueryCommunityPoolRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCommunityPoolRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCommunityPoolRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCommunityPoolRequest proto.InternalMessageInfo + +// QueryCommunityPoolResponse is the response type for the Query/CommunityPool +// RPC method. +type QueryCommunityPoolResponse struct { + // pool defines community pool's coins. + Pool github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=pool,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"pool"` +} + +func (m *QueryCommunityPoolResponse) Reset() { *m = QueryCommunityPoolResponse{} } +func (m *QueryCommunityPoolResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCommunityPoolResponse) ProtoMessage() {} +func (*QueryCommunityPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51500a0a77d57843, []int{1} +} +func (m *QueryCommunityPoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCommunityPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCommunityPoolResponse.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 *QueryCommunityPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCommunityPoolResponse.Merge(m, src) +} +func (m *QueryCommunityPoolResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCommunityPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCommunityPoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCommunityPoolResponse proto.InternalMessageInfo + +func (m *QueryCommunityPoolResponse) GetPool() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Pool + } + return nil +} + +// QueryContinuousFundRequest is the request type for the Query/ContinuousFund +// RPC method. +type QueryContinuousFundRequest struct { + // recipient is the recipient address to query unclaimed budget amount for. + Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (m *QueryContinuousFundRequest) Reset() { *m = QueryContinuousFundRequest{} } +func (m *QueryContinuousFundRequest) String() string { return proto.CompactTextString(m) } +func (*QueryContinuousFundRequest) ProtoMessage() {} +func (*QueryContinuousFundRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51500a0a77d57843, []int{2} +} +func (m *QueryContinuousFundRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryContinuousFundRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryContinuousFundRequest.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 *QueryContinuousFundRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryContinuousFundRequest.Merge(m, src) +} +func (m *QueryContinuousFundRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryContinuousFundRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryContinuousFundRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryContinuousFundRequest proto.InternalMessageInfo + +func (m *QueryContinuousFundRequest) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +// QueryUnclaimedBudgetResponse is the response type for the Query/ContinuousFund +// RPC method. +type QueryContinuousFundResponse struct { + // ContinuousFunds is the given continuous fund returned in the query. + ContinuousFund ContinuousFund `protobuf:"bytes,1,opt,name=continuous_fund,json=continuousFund,proto3" json:"continuous_fund"` +} + +func (m *QueryContinuousFundResponse) Reset() { *m = QueryContinuousFundResponse{} } +func (m *QueryContinuousFundResponse) String() string { return proto.CompactTextString(m) } +func (*QueryContinuousFundResponse) ProtoMessage() {} +func (*QueryContinuousFundResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51500a0a77d57843, []int{3} +} +func (m *QueryContinuousFundResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryContinuousFundResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryContinuousFundResponse.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 *QueryContinuousFundResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryContinuousFundResponse.Merge(m, src) +} +func (m *QueryContinuousFundResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryContinuousFundResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryContinuousFundResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryContinuousFundResponse proto.InternalMessageInfo + +func (m *QueryContinuousFundResponse) GetContinuousFund() ContinuousFund { + if m != nil { + return m.ContinuousFund + } + return ContinuousFund{} +} + +// QueryContinuousFundRequest is the request type for the Query/ContinuousFunds +// RPC method. +type QueryContinuousFundsRequest struct { +} + +func (m *QueryContinuousFundsRequest) Reset() { *m = QueryContinuousFundsRequest{} } +func (m *QueryContinuousFundsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryContinuousFundsRequest) ProtoMessage() {} +func (*QueryContinuousFundsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51500a0a77d57843, []int{4} +} +func (m *QueryContinuousFundsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryContinuousFundsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryContinuousFundsRequest.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 *QueryContinuousFundsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryContinuousFundsRequest.Merge(m, src) +} +func (m *QueryContinuousFundsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryContinuousFundsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryContinuousFundsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryContinuousFundsRequest proto.InternalMessageInfo + +// QueryUnclaimedBudgetResponse is the response type for the Query/ContinuousFunds +// RPC method. +type QueryContinuousFundsResponse struct { + // ContinuousFunds defines all continuous funds in state. + ContinuousFunds []ContinuousFund `protobuf:"bytes,1,rep,name=continuous_funds,json=continuousFunds,proto3" json:"continuous_funds"` +} + +func (m *QueryContinuousFundsResponse) Reset() { *m = QueryContinuousFundsResponse{} } +func (m *QueryContinuousFundsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryContinuousFundsResponse) ProtoMessage() {} +func (*QueryContinuousFundsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51500a0a77d57843, []int{5} +} +func (m *QueryContinuousFundsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryContinuousFundsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryContinuousFundsResponse.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 *QueryContinuousFundsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryContinuousFundsResponse.Merge(m, src) +} +func (m *QueryContinuousFundsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryContinuousFundsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryContinuousFundsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryContinuousFundsResponse proto.InternalMessageInfo + +func (m *QueryContinuousFundsResponse) GetContinuousFunds() []ContinuousFund { + if m != nil { + return m.ContinuousFunds + } + return nil +} + +// QueryParamsRequest is the response type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51500a0a77d57843, []int{6} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51500a0a77d57843, []int{7} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryCommunityPoolRequest)(nil), "cosmos.protocolpool.v1.QueryCommunityPoolRequest") + proto.RegisterType((*QueryCommunityPoolResponse)(nil), "cosmos.protocolpool.v1.QueryCommunityPoolResponse") + proto.RegisterType((*QueryContinuousFundRequest)(nil), "cosmos.protocolpool.v1.QueryContinuousFundRequest") + proto.RegisterType((*QueryContinuousFundResponse)(nil), "cosmos.protocolpool.v1.QueryContinuousFundResponse") + proto.RegisterType((*QueryContinuousFundsRequest)(nil), "cosmos.protocolpool.v1.QueryContinuousFundsRequest") + proto.RegisterType((*QueryContinuousFundsResponse)(nil), "cosmos.protocolpool.v1.QueryContinuousFundsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.protocolpool.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.protocolpool.v1.QueryParamsResponse") +} + +func init() { + proto.RegisterFile("cosmos/protocolpool/v1/query.proto", fileDescriptor_51500a0a77d57843) +} + +var fileDescriptor_51500a0a77d57843 = []byte{ + // 588 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x3f, 0x6f, 0xd3, 0x40, + 0x18, 0xc6, 0x63, 0x68, 0x2b, 0xf5, 0x2a, 0x5a, 0x74, 0x54, 0x28, 0x71, 0x8b, 0x1b, 0x79, 0x88, + 0xa2, 0xa2, 0xda, 0x75, 0x5a, 0x75, 0xea, 0x42, 0x2a, 0xb1, 0xb0, 0x94, 0x14, 0x84, 0xc4, 0x12, + 0x39, 0xce, 0x61, 0x2c, 0x92, 0x7b, 0x5d, 0xdf, 0x39, 0x10, 0xa1, 0x2e, 0x6c, 0x6c, 0x48, 0x7c, + 0x07, 0x90, 0x18, 0x98, 0x90, 0xf8, 0x0a, 0x1d, 0x2b, 0x58, 0x98, 0x00, 0x25, 0x7c, 0x10, 0xe4, + 0xf3, 0x9b, 0x50, 0x57, 0x76, 0x69, 0xa6, 0x44, 0xef, 0x9f, 0xe7, 0xf9, 0xdd, 0xe5, 0xc9, 0x11, + 0xd3, 0x03, 0xd1, 0x07, 0x61, 0x87, 0x11, 0x48, 0xf0, 0xa0, 0x17, 0x02, 0xf4, 0xec, 0x81, 0x63, + 0x1f, 0xc7, 0x2c, 0x1a, 0x5a, 0xaa, 0x4a, 0x6f, 0xa7, 0x33, 0xd6, 0xf9, 0x19, 0x6b, 0xe0, 0xe8, + 0xab, 0x3e, 0xf8, 0xa0, 0x8a, 0x76, 0xf2, 0x2d, 0xed, 0xeb, 0xeb, 0x3e, 0x80, 0xdf, 0x63, 0xb6, + 0x1b, 0x06, 0xb6, 0xcb, 0x39, 0x48, 0x57, 0x06, 0xc0, 0x71, 0x5b, 0x37, 0xd0, 0xaf, 0xe3, 0x0a, + 0x66, 0x0f, 0x9c, 0x0e, 0x93, 0xae, 0x63, 0x7b, 0x10, 0x70, 0xec, 0x57, 0xd2, 0x7e, 0x3b, 0x95, + 0x3d, 0x6f, 0xac, 0x17, 0xa1, 0xca, 0x61, 0xc8, 0x70, 0xc6, 0x5c, 0x23, 0x95, 0x87, 0x09, 0xf9, + 0x01, 0xf4, 0xfb, 0x31, 0x0f, 0xe4, 0xf0, 0x10, 0xa0, 0xd7, 0x62, 0xc7, 0x31, 0x13, 0xd2, 0x3c, + 0x21, 0x7a, 0x5e, 0x53, 0x84, 0xc0, 0x05, 0xa3, 0x6d, 0x32, 0x97, 0x28, 0x96, 0xb5, 0xea, 0xf5, + 0xfa, 0x52, 0xa3, 0x62, 0xa1, 0x77, 0x02, 0x6a, 0x21, 0xa8, 0x75, 0x00, 0x01, 0x6f, 0x6e, 0x9f, + 0xfe, 0xdc, 0x28, 0x7d, 0xfa, 0xb5, 0x51, 0xf7, 0x03, 0xf9, 0x3c, 0xee, 0x58, 0x1e, 0xf4, 0x11, + 0x14, 0x3f, 0xb6, 0x44, 0xf7, 0x05, 0x52, 0x25, 0x0b, 0xa2, 0xa5, 0x84, 0xcd, 0x47, 0x53, 0x7b, + 0x2e, 0x03, 0x1e, 0x43, 0x2c, 0xee, 0xc7, 0xbc, 0x8b, 0x70, 0x74, 0x8f, 0x2c, 0x46, 0xcc, 0x0b, + 0xc2, 0x80, 0x71, 0x59, 0xd6, 0xaa, 0x5a, 0x7d, 0xb1, 0x59, 0xfe, 0xf6, 0x65, 0x6b, 0x15, 0x31, + 0xee, 0x75, 0xbb, 0x11, 0x13, 0xe2, 0x48, 0x46, 0x01, 0xf7, 0x5b, 0xff, 0x46, 0x4d, 0x49, 0xd6, + 0x72, 0x55, 0xf1, 0x54, 0x8f, 0xc9, 0x8a, 0x37, 0xed, 0xb4, 0x9f, 0xc5, 0xbc, 0xab, 0xc4, 0x97, + 0x1a, 0x35, 0x2b, 0xff, 0x57, 0xb5, 0xb2, 0x42, 0xcd, 0xb9, 0xe4, 0xb4, 0xad, 0x65, 0x2f, 0x53, + 0x35, 0xef, 0xe4, 0xba, 0x8a, 0xc9, 0x4d, 0xbf, 0x24, 0xeb, 0xf9, 0x6d, 0xa4, 0x7a, 0x42, 0x6e, + 0x5e, 0xa0, 0x12, 0x78, 0xef, 0xb3, 0x61, 0xad, 0x64, 0xb1, 0x84, 0xb9, 0x4a, 0xa8, 0x32, 0x3e, + 0x74, 0x23, 0xb7, 0x3f, 0xc5, 0x39, 0x22, 0xb7, 0x32, 0x55, 0xa4, 0xd8, 0x27, 0x0b, 0xa1, 0xaa, + 0xe0, 0x95, 0x18, 0x45, 0xde, 0xe9, 0x1e, 0x7a, 0xe2, 0x4e, 0xe3, 0xe3, 0x3c, 0x99, 0x57, 0xaa, + 0xf4, 0x83, 0x46, 0x6e, 0x64, 0x32, 0x45, 0x9d, 0x22, 0xa5, 0xc2, 0x70, 0xea, 0x8d, 0x59, 0x56, + 0xd2, 0x03, 0x98, 0xd6, 0x9b, 0xef, 0x7f, 0xde, 0x5f, 0xab, 0xd3, 0x9a, 0x5d, 0xf0, 0xd7, 0xf0, + 0x26, 0x6b, 0xed, 0xa4, 0x42, 0xbf, 0x6a, 0x64, 0x39, 0x7b, 0x8f, 0xf4, 0x7f, 0xb6, 0x39, 0x51, + 0xd5, 0x77, 0x66, 0xda, 0x41, 0xd6, 0x7d, 0xc5, 0xba, 0x47, 0x77, 0x8b, 0x59, 0xb3, 0x81, 0xb0, + 0x5f, 0x4f, 0x43, 0x7e, 0x42, 0x3f, 0x6b, 0x64, 0xe5, 0x42, 0x98, 0xe8, 0x2c, 0x18, 0x93, 0x28, + 0xe8, 0xbb, 0xb3, 0x2d, 0x21, 0xfc, 0xb6, 0x82, 0xdf, 0xa4, 0xf5, 0xab, 0xc2, 0xd3, 0xb7, 0x1a, + 0x59, 0x48, 0x63, 0x43, 0x37, 0x2f, 0xb5, 0xcc, 0x24, 0x55, 0xbf, 0x7b, 0xa5, 0x59, 0xa4, 0xaa, + 0x29, 0xaa, 0x2a, 0x35, 0x8a, 0xa8, 0xd2, 0xa4, 0x36, 0x1f, 0x9c, 0x8e, 0x0c, 0xed, 0x6c, 0x64, + 0x68, 0xbf, 0x47, 0x86, 0xf6, 0x6e, 0x6c, 0x94, 0xce, 0xc6, 0x46, 0xe9, 0xc7, 0xd8, 0x28, 0x3d, + 0x75, 0x2e, 0x7d, 0xc2, 0x5e, 0x65, 0x05, 0xd5, 0x8b, 0xd6, 0x59, 0x50, 0xb5, 0x9d, 0xbf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xdb, 0x06, 0x4d, 0xb9, 0x39, 0x06, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // CommunityPool queries the community pool coins. + CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) + // ContinuousFund queries a continuous fund by the recipient is is associated with. + ContinuousFund(ctx context.Context, in *QueryContinuousFundRequest, opts ...grpc.CallOption) (*QueryContinuousFundResponse, error) + // ContinuousFunds queries all continuous funds in the store. + ContinuousFunds(ctx context.Context, in *QueryContinuousFundsRequest, opts ...grpc.CallOption) (*QueryContinuousFundsResponse, error) + // Params returns the total set of x/protocolpool parameters. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) { + out := new(QueryCommunityPoolResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Query/CommunityPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ContinuousFund(ctx context.Context, in *QueryContinuousFundRequest, opts ...grpc.CallOption) (*QueryContinuousFundResponse, error) { + out := new(QueryContinuousFundResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Query/ContinuousFund", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ContinuousFunds(ctx context.Context, in *QueryContinuousFundsRequest, opts ...grpc.CallOption) (*QueryContinuousFundsResponse, error) { + out := new(QueryContinuousFundsResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Query/ContinuousFunds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Query/Params", 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) + // ContinuousFund queries a continuous fund by the recipient is is associated with. + ContinuousFund(context.Context, *QueryContinuousFundRequest) (*QueryContinuousFundResponse, error) + // ContinuousFunds queries all continuous funds in the store. + ContinuousFunds(context.Context, *QueryContinuousFundsRequest) (*QueryContinuousFundsResponse, error) + // Params returns the total set of x/protocolpool parameters. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +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) ContinuousFund(ctx context.Context, req *QueryContinuousFundRequest) (*QueryContinuousFundResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ContinuousFund not implemented") +} +func (*UnimplementedQueryServer) ContinuousFunds(ctx context.Context, req *QueryContinuousFundsRequest) (*QueryContinuousFundsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ContinuousFunds not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_CommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCommunityPoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CommunityPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Query/CommunityPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CommunityPool(ctx, req.(*QueryCommunityPoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ContinuousFund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryContinuousFundRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ContinuousFund(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Query/ContinuousFund", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ContinuousFund(ctx, req.(*QueryContinuousFundRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ContinuousFunds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryContinuousFundsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ContinuousFunds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Query/ContinuousFunds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ContinuousFunds(ctx, req.(*QueryContinuousFundsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Query_serviceDesc = _Query_serviceDesc +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.protocolpool.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CommunityPool", + Handler: _Query_CommunityPool_Handler, + }, + { + MethodName: "ContinuousFund", + Handler: _Query_ContinuousFund_Handler, + }, + { + MethodName: "ContinuousFunds", + Handler: _Query_ContinuousFunds_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/protocolpool/v1/query.proto", +} + +func (m *QueryCommunityPoolRequest) 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 *QueryCommunityPoolRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCommunityPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryCommunityPoolResponse) 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 *QueryCommunityPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pool) > 0 { + for iNdEx := len(m.Pool) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Pool[iNdEx].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 (m *QueryContinuousFundRequest) 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 *QueryContinuousFundRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryContinuousFundRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryContinuousFundResponse) 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 *QueryContinuousFundResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryContinuousFundResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ContinuousFund.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 (m *QueryContinuousFundsRequest) 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 *QueryContinuousFundsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryContinuousFundsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryContinuousFundsResponse) 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 *QueryContinuousFundsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryContinuousFundsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ContinuousFunds) > 0 { + for iNdEx := len(m.ContinuousFunds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ContinuousFunds[iNdEx].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 (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryCommunityPoolRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryCommunityPoolResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Pool) > 0 { + for _, e := range m.Pool { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryContinuousFundRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryContinuousFundResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ContinuousFund.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryContinuousFundsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryContinuousFundsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ContinuousFunds) > 0 { + for _, e := range m.ContinuousFunds { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryCommunityPoolRequest) 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: QueryCommunityPoolRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCommunityPoolRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryCommunityPoolResponse) 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: QueryCommunityPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCommunityPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pool", 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 + } + m.Pool = append(m.Pool, types.Coin{}) + if err := m.Pool[len(m.Pool)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *QueryContinuousFundRequest) 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: QueryContinuousFundRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryContinuousFundRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", 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.Recipient = 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 *QueryContinuousFundResponse) 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: QueryContinuousFundResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryContinuousFundResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContinuousFund", 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 err := m.ContinuousFund.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *QueryContinuousFundsRequest) 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: QueryContinuousFundsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryContinuousFundsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryContinuousFundsResponse) 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: QueryContinuousFundsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryContinuousFundsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContinuousFunds", 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 + } + m.ContinuousFunds = append(m.ContinuousFunds, ContinuousFund{}) + if err := m.ContinuousFunds[len(m.ContinuousFunds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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 err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 skipQuery(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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/protocolpool/types/query.pb.gw.go b/x/protocolpool/types/query.pb.gw.go new file mode 100644 index 0000000000..65f649a90c --- /dev/null +++ b/x/protocolpool/types/query.pb.gw.go @@ -0,0 +1,384 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/protocolpool/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_CommunityPool_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCommunityPoolRequest + var metadata runtime.ServerMetadata + + msg, err := client.CommunityPool(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CommunityPool_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCommunityPoolRequest + var metadata runtime.ServerMetadata + + msg, err := server.CommunityPool(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ContinuousFund_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryContinuousFundRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["recipient"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "recipient") + } + + protoReq.Recipient, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "recipient", err) + } + + msg, err := client.ContinuousFund(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ContinuousFund_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryContinuousFundRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["recipient"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "recipient") + } + + protoReq.Recipient, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "recipient", err) + } + + msg, err := server.ContinuousFund(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ContinuousFunds_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryContinuousFundsRequest + var metadata runtime.ServerMetadata + + msg, err := client.ContinuousFunds(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ContinuousFunds_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryContinuousFundsRequest + var metadata runtime.ServerMetadata + + msg, err := server.ContinuousFunds(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_CommunityPool_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_CommunityPool_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_CommunityPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ContinuousFund_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_ContinuousFund_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_ContinuousFund_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ContinuousFunds_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_ContinuousFunds_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_ContinuousFunds_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_CommunityPool_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_CommunityPool_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_CommunityPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ContinuousFund_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_ContinuousFund_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_ContinuousFund_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ContinuousFunds_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_ContinuousFunds_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_ContinuousFunds_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_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_ContinuousFund_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", "continuous_funds", "recipient"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ContinuousFunds_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "protocolpool", "v1", "continuous_funds"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "protocolpool", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_CommunityPool_0 = runtime.ForwardResponseMessage + + forward_Query_ContinuousFund_0 = runtime.ForwardResponseMessage + + forward_Query_ContinuousFunds_0 = runtime.ForwardResponseMessage + + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/protocolpool/types/tx.pb.go b/x/protocolpool/types/tx.pb.go new file mode 100644 index 0000000000..cab423ab72 --- /dev/null +++ b/x/protocolpool/types/tx.pb.go @@ -0,0 +1,2484 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/protocolpool/v1/tx.proto + +package types + +import ( + context "context" + cosmossdk_io_math "cosmossdk.io/math" + 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/cosmos-sdk/types/msgservice" + _ "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/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 + +// MsgFundCommunityPool allows an account to directly +// fund the community pool. +type MsgFundCommunityPool struct { + Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty"` + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` +} + +func (m *MsgFundCommunityPool) Reset() { *m = MsgFundCommunityPool{} } +func (m *MsgFundCommunityPool) String() string { return proto.CompactTextString(m) } +func (*MsgFundCommunityPool) ProtoMessage() {} +func (*MsgFundCommunityPool) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{0} +} +func (m *MsgFundCommunityPool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundCommunityPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundCommunityPool.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 *MsgFundCommunityPool) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundCommunityPool.Merge(m, src) +} +func (m *MsgFundCommunityPool) XXX_Size() int { + return m.Size() +} +func (m *MsgFundCommunityPool) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundCommunityPool.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundCommunityPool proto.InternalMessageInfo + +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +type MsgFundCommunityPoolResponse struct { +} + +func (m *MsgFundCommunityPoolResponse) Reset() { *m = MsgFundCommunityPoolResponse{} } +func (m *MsgFundCommunityPoolResponse) String() string { return proto.CompactTextString(m) } +func (*MsgFundCommunityPoolResponse) ProtoMessage() {} +func (*MsgFundCommunityPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{1} +} +func (m *MsgFundCommunityPoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundCommunityPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundCommunityPoolResponse.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 *MsgFundCommunityPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundCommunityPoolResponse.Merge(m, src) +} +func (m *MsgFundCommunityPoolResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgFundCommunityPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundCommunityPoolResponse.DiscardUnknown(m) +} + +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. +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"` + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` +} + +func (m *MsgCommunityPoolSpend) Reset() { *m = MsgCommunityPoolSpend{} } +func (m *MsgCommunityPoolSpend) String() string { return proto.CompactTextString(m) } +func (*MsgCommunityPoolSpend) ProtoMessage() {} +func (*MsgCommunityPoolSpend) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{2} +} +func (m *MsgCommunityPoolSpend) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCommunityPoolSpend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCommunityPoolSpend.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 *MsgCommunityPoolSpend) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCommunityPoolSpend.Merge(m, src) +} +func (m *MsgCommunityPoolSpend) XXX_Size() int { + return m.Size() +} +func (m *MsgCommunityPoolSpend) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCommunityPoolSpend.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCommunityPoolSpend proto.InternalMessageInfo + +func (m *MsgCommunityPoolSpend) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgCommunityPoolSpend) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *MsgCommunityPoolSpend) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Amount + } + return nil +} + +// MsgCommunityPoolSpendResponse defines the response to executing a +// MsgCommunityPoolSpend message. +type MsgCommunityPoolSpendResponse struct { +} + +func (m *MsgCommunityPoolSpendResponse) Reset() { *m = MsgCommunityPoolSpendResponse{} } +func (m *MsgCommunityPoolSpendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCommunityPoolSpendResponse) ProtoMessage() {} +func (*MsgCommunityPoolSpendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{3} +} +func (m *MsgCommunityPoolSpendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCommunityPoolSpendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCommunityPoolSpendResponse.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 *MsgCommunityPoolSpendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCommunityPoolSpendResponse.Merge(m, src) +} +func (m *MsgCommunityPoolSpendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCommunityPoolSpendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCommunityPoolSpendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCommunityPoolSpendResponse proto.InternalMessageInfo + +// MsgCreateContinuousFund defines a message for adding continuous funds. +type MsgCreateContinuousFund 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 of the account receiving funds. + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + // Percentage is the percentage of funds to be allocated from Community pool. + Percentage cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=percentage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"percentage"` + // Optional, if expiry is set, removes the state object when expired. + Expiry *time.Time `protobuf:"bytes,4,opt,name=expiry,proto3,stdtime" json:"expiry,omitempty"` +} + +func (m *MsgCreateContinuousFund) Reset() { *m = MsgCreateContinuousFund{} } +func (m *MsgCreateContinuousFund) String() string { return proto.CompactTextString(m) } +func (*MsgCreateContinuousFund) ProtoMessage() {} +func (*MsgCreateContinuousFund) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{4} +} +func (m *MsgCreateContinuousFund) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateContinuousFund) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateContinuousFund.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 *MsgCreateContinuousFund) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateContinuousFund.Merge(m, src) +} +func (m *MsgCreateContinuousFund) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateContinuousFund) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateContinuousFund.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateContinuousFund proto.InternalMessageInfo + +func (m *MsgCreateContinuousFund) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgCreateContinuousFund) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *MsgCreateContinuousFund) GetExpiry() *time.Time { + if m != nil { + return m.Expiry + } + return nil +} + +// MsgCreateContinuousFundResponse defines the response to executing a +// MsgCreateContinuousFund message. +type MsgCreateContinuousFundResponse struct { +} + +func (m *MsgCreateContinuousFundResponse) Reset() { *m = MsgCreateContinuousFundResponse{} } +func (m *MsgCreateContinuousFundResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateContinuousFundResponse) ProtoMessage() {} +func (*MsgCreateContinuousFundResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{5} +} +func (m *MsgCreateContinuousFundResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateContinuousFundResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateContinuousFundResponse.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 *MsgCreateContinuousFundResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateContinuousFundResponse.Merge(m, src) +} +func (m *MsgCreateContinuousFundResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateContinuousFundResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateContinuousFundResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateContinuousFundResponse proto.InternalMessageInfo + +// MsgCancelContinuousFund defines a message to cancel continuous funds for a specific recipient. +type MsgCancelContinuousFund struct { + // Authority is the account address of authority. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // Recipient is the account address string of the recipient whose funds are to be cancelled. + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (m *MsgCancelContinuousFund) Reset() { *m = MsgCancelContinuousFund{} } +func (m *MsgCancelContinuousFund) String() string { return proto.CompactTextString(m) } +func (*MsgCancelContinuousFund) ProtoMessage() {} +func (*MsgCancelContinuousFund) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{6} +} +func (m *MsgCancelContinuousFund) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelContinuousFund) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelContinuousFund.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 *MsgCancelContinuousFund) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelContinuousFund.Merge(m, src) +} +func (m *MsgCancelContinuousFund) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelContinuousFund) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelContinuousFund.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelContinuousFund proto.InternalMessageInfo + +func (m *MsgCancelContinuousFund) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgCancelContinuousFund) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +// MsgCancelContinuousFundResponse defines the response to executing a +// MsgCancelContinuousFund message. +type MsgCancelContinuousFundResponse struct { + // CanceledTime is the canceled time. + CanceledTime time.Time `protobuf:"bytes,1,opt,name=canceled_time,json=canceledTime,proto3,stdtime" json:"canceled_time"` + // CanceledHeight defines the canceled block height. + CanceledHeight uint64 `protobuf:"varint,2,opt,name=canceled_height,json=canceledHeight,proto3" json:"canceled_height,omitempty"` + // Recipient is the account address string of the recipient whose funds are cancelled. + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (m *MsgCancelContinuousFundResponse) Reset() { *m = MsgCancelContinuousFundResponse{} } +func (m *MsgCancelContinuousFundResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCancelContinuousFundResponse) ProtoMessage() {} +func (*MsgCancelContinuousFundResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{7} +} +func (m *MsgCancelContinuousFundResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelContinuousFundResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelContinuousFundResponse.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 *MsgCancelContinuousFundResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelContinuousFundResponse.Merge(m, src) +} +func (m *MsgCancelContinuousFundResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelContinuousFundResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelContinuousFundResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelContinuousFundResponse proto.InternalMessageInfo + +func (m *MsgCancelContinuousFundResponse) GetCanceledTime() time.Time { + if m != nil { + return m.CanceledTime + } + return time.Time{} +} + +func (m *MsgCancelContinuousFundResponse) GetCanceledHeight() uint64 { + if m != nil { + return m.CanceledHeight + } + return 0 +} + +func (m *MsgCancelContinuousFundResponse) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams 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"` + // params defines the x/protocolpool parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{8} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_09efe14517e7f6dc, []int{9} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +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((*MsgCreateContinuousFund)(nil), "cosmos.protocolpool.v1.MsgCreateContinuousFund") + proto.RegisterType((*MsgCreateContinuousFundResponse)(nil), "cosmos.protocolpool.v1.MsgCreateContinuousFundResponse") + proto.RegisterType((*MsgCancelContinuousFund)(nil), "cosmos.protocolpool.v1.MsgCancelContinuousFund") + proto.RegisterType((*MsgCancelContinuousFundResponse)(nil), "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.protocolpool.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.protocolpool.v1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("cosmos/protocolpool/v1/tx.proto", fileDescriptor_09efe14517e7f6dc) } + +var fileDescriptor_09efe14517e7f6dc = []byte{ + // 785 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcf, 0x6f, 0xd3, 0x48, + 0x14, 0xce, 0x34, 0xd9, 0x68, 0x33, 0xed, 0xb6, 0x5a, 0x2b, 0xdb, 0xa6, 0xde, 0xae, 0xdd, 0xcd, + 0xa5, 0x51, 0xb5, 0xb1, 0x37, 0x01, 0x0a, 0x42, 0x5c, 0x48, 0x2b, 0x04, 0x82, 0x48, 0xc5, 0x85, + 0x0b, 0x97, 0xca, 0xb1, 0x87, 0x89, 0xd5, 0xd8, 0x63, 0x79, 0xc6, 0xa5, 0xe1, 0x54, 0x71, 0xe2, + 0xd8, 0x1b, 0xe2, 0xd6, 0x13, 0x07, 0x4e, 0x3d, 0xf4, 0x8f, 0xa8, 0x84, 0x90, 0xaa, 0x9e, 0x10, + 0x87, 0x16, 0xa5, 0x87, 0x72, 0xe5, 0x3f, 0x40, 0xb6, 0x27, 0xbf, 0x14, 0xd7, 0xb4, 0x95, 0x10, + 0xa7, 0x58, 0xef, 0x7d, 0xdf, 0x7b, 0xdf, 0xfb, 0xec, 0x79, 0x13, 0x28, 0x1b, 0x84, 0xda, 0x84, + 0xaa, 0xae, 0x47, 0x18, 0x31, 0x48, 0xcb, 0x25, 0xa4, 0xa5, 0x6e, 0x56, 0x54, 0xb6, 0xa5, 0x84, + 0x21, 0x61, 0x3a, 0x02, 0x28, 0x83, 0x00, 0x65, 0xb3, 0x22, 0x16, 0xcf, 0x23, 0xb6, 0x5d, 0xc4, + 0xd1, 0x62, 0x1e, 0x13, 0x4c, 0xc2, 0x47, 0x35, 0x78, 0xe2, 0x51, 0x89, 0x33, 0x1b, 0x3a, 0x45, + 0xea, 0x66, 0xa5, 0x81, 0x98, 0x5e, 0x51, 0x0d, 0x62, 0x39, 0x3c, 0x3f, 0x1b, 0xe5, 0xd7, 0x23, + 0xe2, 0x60, 0x7b, 0x71, 0x86, 0x53, 0x6d, 0x8a, 0x83, 0x5e, 0x36, 0xc5, 0x3c, 0x21, 0x63, 0x42, + 0x70, 0x0b, 0x45, 0x6a, 0x1a, 0xfe, 0x73, 0x95, 0x59, 0x36, 0xa2, 0x4c, 0xb7, 0xdd, 0x08, 0x50, + 0xfc, 0x00, 0x60, 0xbe, 0x4e, 0xf1, 0x3d, 0xdf, 0x31, 0x97, 0x89, 0x6d, 0xfb, 0x8e, 0xc5, 0xda, + 0xab, 0x84, 0xb4, 0x84, 0x25, 0x98, 0x33, 0x91, 0x4b, 0xa8, 0xc5, 0x88, 0x57, 0x00, 0xf3, 0xa0, + 0x94, 0xab, 0x15, 0x8e, 0xf6, 0xcb, 0x79, 0xde, 0xf7, 0xae, 0x69, 0x7a, 0x88, 0xd2, 0x35, 0xe6, + 0x59, 0x0e, 0xd6, 0xfa, 0x50, 0xc1, 0x80, 0x59, 0xdd, 0x26, 0xbe, 0xc3, 0x0a, 0x63, 0xf3, 0xe9, + 0xd2, 0x78, 0x75, 0x56, 0xe1, 0x8c, 0x60, 0x2c, 0x85, 0x8f, 0xa5, 0x2c, 0x13, 0xcb, 0xa9, 0xfd, + 0x7f, 0x70, 0x2c, 0xa7, 0xde, 0x9f, 0xc8, 0x25, 0x6c, 0xb1, 0xa6, 0xdf, 0x50, 0x0c, 0x62, 0xf3, + 0xb1, 0xf8, 0x4f, 0x99, 0x9a, 0x1b, 0xdc, 0xb8, 0x80, 0x40, 0x35, 0x5e, 0xfa, 0xf6, 0xf4, 0xeb, + 0x5d, 0x39, 0xf5, 0x75, 0x57, 0x4e, 0xbd, 0x3a, 0xdb, 0x5b, 0xec, 0x37, 0x2f, 0x4a, 0x70, 0x2e, + 0x6e, 0x18, 0x0d, 0x51, 0x97, 0x38, 0x14, 0x15, 0x3b, 0x00, 0xfe, 0x55, 0xa7, 0x78, 0x28, 0xb9, + 0xe6, 0x22, 0xc7, 0x0c, 0xc6, 0xd5, 0x7d, 0xd6, 0x24, 0x9e, 0xc5, 0xda, 0x3f, 0x1e, 0xb7, 0x07, + 0x15, 0xe6, 0x60, 0xce, 0x43, 0x86, 0xe5, 0x5a, 0x28, 0x9c, 0x18, 0x94, 0x72, 0x5a, 0x3f, 0x30, + 0x60, 0x46, 0xfa, 0xe7, 0x99, 0x31, 0x19, 0x9a, 0xd0, 0x93, 0x54, 0x94, 0xe1, 0x3f, 0xb1, 0x33, + 0xf6, 0x5c, 0x78, 0x37, 0x06, 0x67, 0x02, 0x84, 0x87, 0x74, 0x86, 0x96, 0x89, 0xc3, 0x2c, 0xc7, + 0x27, 0x3e, 0x0d, 0x6c, 0xbb, 0xb2, 0x0f, 0x4b, 0x23, 0x3e, 0x24, 0xf1, 0xfa, 0x0e, 0x3d, 0x86, + 0xd0, 0x45, 0x9e, 0x81, 0x1c, 0xa6, 0x63, 0x54, 0x48, 0x87, 0xc4, 0x4a, 0x60, 0xc5, 0xe7, 0x63, + 0xf9, 0xef, 0x88, 0x4c, 0xcd, 0x0d, 0xc5, 0x22, 0xaa, 0xad, 0xb3, 0xa6, 0xf2, 0x08, 0x61, 0xdd, + 0x68, 0xaf, 0x20, 0xe3, 0x68, 0xbf, 0x0c, 0x79, 0xed, 0x15, 0x64, 0x68, 0x03, 0x45, 0x84, 0x5b, + 0x30, 0x8b, 0xb6, 0x5c, 0xcb, 0x6b, 0x17, 0x32, 0xf3, 0xa0, 0x34, 0x5e, 0x15, 0x95, 0xe8, 0x10, + 0x28, 0xdd, 0x43, 0xa0, 0x3c, 0xe9, 0x1e, 0x82, 0x5a, 0x66, 0xe7, 0x44, 0x06, 0x1a, 0xc7, 0x8f, + 0x38, 0xf9, 0x2f, 0x94, 0xcf, 0xf1, 0xa9, 0xe7, 0xe5, 0x5b, 0x10, 0x79, 0xa9, 0x3b, 0x06, 0x6a, + 0xfd, 0x5a, 0x2f, 0x47, 0xe4, 0x7f, 0x04, 0x91, 0xfe, 0x18, 0x6d, 0x5d, 0xfd, 0xc2, 0x03, 0xf8, + 0x87, 0x11, 0xe6, 0x91, 0xb9, 0x1e, 0xec, 0x86, 0x50, 0x67, 0xb2, 0x67, 0xbf, 0x07, 0xaf, 0x27, + 0xf4, 0x6d, 0xa2, 0x4b, 0x0d, 0x92, 0xc2, 0x02, 0x9c, 0xea, 0x95, 0x6a, 0x22, 0x0b, 0x37, 0x23, + 0xf1, 0x19, 0x6d, 0xb2, 0x1b, 0xbe, 0x1f, 0x46, 0x87, 0xe7, 0x4b, 0x5f, 0x78, 0xbe, 0xe2, 0x1b, + 0x00, 0xa7, 0xea, 0x14, 0x3f, 0x75, 0x4d, 0x9d, 0xa1, 0x55, 0xdd, 0xd3, 0x6d, 0x7a, 0x65, 0x8f, + 0xef, 0xc0, 0xac, 0x1b, 0x56, 0x08, 0x35, 0x8e, 0x57, 0x25, 0x25, 0x7e, 0x9f, 0x2b, 0x51, 0x9f, + 0x5a, 0x26, 0x18, 0x5a, 0xe3, 0x9c, 0x11, 0xa7, 0x67, 0xc3, 0x8f, 0x60, 0x50, 0x58, 0xd7, 0xe0, + 0xea, 0xb7, 0x0c, 0x4c, 0xd7, 0x29, 0x16, 0x5e, 0xc0, 0x3f, 0x47, 0x97, 0xec, 0x7f, 0xe7, 0x75, + 0x8d, 0xdb, 0x62, 0xe2, 0xf5, 0xcb, 0xa0, 0x7b, 0x6f, 0xf8, 0x25, 0x14, 0x62, 0xf6, 0x5d, 0x39, + 0xa1, 0xd6, 0x28, 0x5c, 0xbc, 0x71, 0x29, 0x78, 0xaf, 0xf7, 0x36, 0x80, 0xf9, 0xd8, 0x35, 0xa3, + 0x26, 0xd5, 0x8b, 0x21, 0x88, 0x37, 0x2f, 0x49, 0x18, 0x96, 0x10, 0x77, 0x3a, 0x13, 0x25, 0xc4, + 0x10, 0x92, 0x25, 0x24, 0x9d, 0xb1, 0x26, 0x9c, 0x18, 0xfa, 0x66, 0x17, 0x12, 0x0a, 0x0d, 0x02, + 0x45, 0xf5, 0x82, 0xc0, 0x6e, 0x27, 0xf1, 0xb7, 0xed, 0xb3, 0xbd, 0x45, 0x50, 0x7b, 0x78, 0xd0, + 0x91, 0xc0, 0x61, 0x47, 0x02, 0x5f, 0x3a, 0x12, 0xd8, 0x39, 0x95, 0x52, 0x87, 0xa7, 0x52, 0xea, + 0xd3, 0xa9, 0x94, 0x7a, 0x56, 0x49, 0xbc, 0x5d, 0xb6, 0x86, 0xff, 0xb5, 0x84, 0x97, 0x4d, 0x23, + 0x1b, 0xc6, 0xae, 0x7d, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x26, 0x0e, 0xff, 0x8f, 0x12, 0x09, 0x00, + 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + 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. + CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) + // CreateContinuousFund defines a method to distribute a percentage of funds to an address continuously. + // This ContinuousFund can be indefinite or run until a given expiry time. + // Funds come from validator block rewards from x/distribution, but may also come from + // any user who funds the ProtocolPoolEscrow module account directly through x/bank. + CreateContinuousFund(ctx context.Context, in *MsgCreateContinuousFund, opts ...grpc.CallOption) (*MsgCreateContinuousFundResponse, error) + // CancelContinuousFund defines a method for cancelling continuous fund. + CancelContinuousFund(ctx context.Context, in *MsgCancelContinuousFund, opts ...grpc.CallOption) (*MsgCancelContinuousFundResponse, error) + // UpdateParams defines a governance operation for updating the x/protocolpool module parameters. + // The authority is defined in the keeper. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) { + out := new(MsgFundCommunityPoolResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Msg/FundCommunityPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) { + out := new(MsgCommunityPoolSpendResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Msg/CommunityPoolSpend", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateContinuousFund(ctx context.Context, in *MsgCreateContinuousFund, opts ...grpc.CallOption) (*MsgCreateContinuousFundResponse, error) { + out := new(MsgCreateContinuousFundResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Msg/CreateContinuousFund", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CancelContinuousFund(ctx context.Context, in *MsgCancelContinuousFund, opts ...grpc.CallOption) (*MsgCancelContinuousFundResponse, error) { + out := new(MsgCancelContinuousFundResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Msg/CancelContinuousFund", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Msg/UpdateParams", 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. + 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. + CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) + // CreateContinuousFund defines a method to distribute a percentage of funds to an address continuously. + // This ContinuousFund can be indefinite or run until a given expiry time. + // Funds come from validator block rewards from x/distribution, but may also come from + // any user who funds the ProtocolPoolEscrow module account directly through x/bank. + CreateContinuousFund(context.Context, *MsgCreateContinuousFund) (*MsgCreateContinuousFundResponse, error) + // CancelContinuousFund defines a method for cancelling continuous fund. + CancelContinuousFund(context.Context, *MsgCancelContinuousFund) (*MsgCancelContinuousFundResponse, error) + // UpdateParams defines a governance operation for updating the x/protocolpool module parameters. + // The authority is defined in the keeper. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) FundCommunityPool(ctx context.Context, req *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundCommunityPool not implemented") +} +func (*UnimplementedMsgServer) CommunityPoolSpend(ctx context.Context, req *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CommunityPoolSpend not implemented") +} +func (*UnimplementedMsgServer) CreateContinuousFund(ctx context.Context, req *MsgCreateContinuousFund) (*MsgCreateContinuousFundResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateContinuousFund not implemented") +} +func (*UnimplementedMsgServer) CancelContinuousFund(ctx context.Context, req *MsgCancelContinuousFund) (*MsgCancelContinuousFundResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelContinuousFund not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_FundCommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFundCommunityPool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FundCommunityPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Msg/FundCommunityPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FundCommunityPool(ctx, req.(*MsgFundCommunityPool)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CommunityPoolSpend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCommunityPoolSpend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CommunityPoolSpend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Msg/CommunityPoolSpend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CommunityPoolSpend(ctx, req.(*MsgCommunityPoolSpend)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateContinuousFund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateContinuousFund) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateContinuousFund(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Msg/CreateContinuousFund", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateContinuousFund(ctx, req.(*MsgCreateContinuousFund)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CancelContinuousFund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelContinuousFund) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CancelContinuousFund(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Msg/CancelContinuousFund", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CancelContinuousFund(ctx, req.(*MsgCancelContinuousFund)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.protocolpool.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.protocolpool.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "FundCommunityPool", + Handler: _Msg_FundCommunityPool_Handler, + }, + { + MethodName: "CommunityPoolSpend", + Handler: _Msg_CommunityPoolSpend_Handler, + }, + { + MethodName: "CreateContinuousFund", + Handler: _Msg_CreateContinuousFund_Handler, + }, + { + MethodName: "CancelContinuousFund", + Handler: _Msg_CancelContinuousFund_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/protocolpool/v1/tx.proto", +} + +func (m *MsgFundCommunityPool) 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 *MsgFundCommunityPool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundCommunityPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgFundCommunityPoolResponse) 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 *MsgFundCommunityPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCommunityPoolSpend) 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 *MsgCommunityPoolSpend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCommunityPoolSpend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + 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 *MsgCommunityPoolSpendResponse) 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 *MsgCommunityPoolSpendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCommunityPoolSpendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCreateContinuousFund) 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 *MsgCreateContinuousFund) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateContinuousFund) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expiry != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiry, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiry):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintTx(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x22 + } + { + size := m.Percentage.Size() + i -= size + if _, err := m.Percentage.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + 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 *MsgCreateContinuousFundResponse) 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 *MsgCreateContinuousFundResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateContinuousFundResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCancelContinuousFund) 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 *MsgCancelContinuousFund) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelContinuousFund) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + 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 *MsgCancelContinuousFundResponse) 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 *MsgCancelContinuousFundResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelContinuousFundResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x1a + } + if m.CanceledHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CanceledHeight)) + i-- + dAtA[i] = 0x10 + } + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CanceledTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CanceledTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintTx(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + 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 *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + 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 + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + 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)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgCommunityPoolSpendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateContinuousFund) 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.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Percentage.Size() + n += 1 + l + sovTx(uint64(l)) + if m.Expiry != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiry) + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateContinuousFundResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCancelContinuousFund) 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.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCancelContinuousFundResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CanceledTime) + n += 1 + l + sovTx(uint64(l)) + if m.CanceledHeight != 0 { + n += 1 + sovTx(uint64(m.CanceledHeight)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateParams) 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 = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgFundCommunityPool) 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: MsgFundCommunityPool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundCommunityPool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 + } + m.Amount = append(m.Amount, types.Coin{}) + if err := m.Amount[len(m.Amount)-1].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 (m *MsgFundCommunityPoolResponse) 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: MsgFundCommunityPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundCommunityPoolResponse: 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 *MsgCommunityPoolSpend) 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: MsgCommunityPoolSpend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCommunityPoolSpend: 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 Recipient", 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.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 + } + m.Amount = append(m.Amount, types.Coin{}) + if err := m.Amount[len(m.Amount)-1].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 (m *MsgCommunityPoolSpendResponse) 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: MsgCommunityPoolSpendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCommunityPoolSpendResponse: 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 *MsgCreateContinuousFund) 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: MsgCreateContinuousFund: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateContinuousFund: 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 Recipient", 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.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Percentage", 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 + } + if err := m.Percentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiry", 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.Expiry == nil { + m.Expiry = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Expiry, 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 *MsgCreateContinuousFundResponse) 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: MsgCreateContinuousFundResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateContinuousFundResponse: 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 *MsgCancelContinuousFund) 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: MsgCancelContinuousFund: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelContinuousFund: 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 Recipient", 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.Recipient = 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 *MsgCancelContinuousFundResponse) 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: MsgCancelContinuousFundResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelContinuousFundResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CanceledTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.CanceledTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CanceledHeight", wireType) + } + m.CanceledHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CanceledHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", 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.Recipient = 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 *MsgUpdateParams) 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: 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 Params", 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.Params.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 (m *MsgUpdateParamsResponse) 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/protocolpool/types/types.go b/x/protocolpool/types/types.go new file mode 100644 index 0000000000..1462ab7e3a --- /dev/null +++ b/x/protocolpool/types/types.go @@ -0,0 +1,25 @@ +package types + +import ( + "errors" + + "cosmossdk.io/math" +) + +func (cf *ContinuousFund) Validate() error { + if cf.Recipient == "" { + return errors.New("recipient cannot be empty") + } + + // Validate percentage + if cf.Percentage.IsNil() || cf.Percentage.IsZero() { + return errors.New("percentage cannot be zero or empty") + } + if cf.Percentage.IsNegative() { + return errors.New("percentage cannot be negative") + } + if cf.Percentage.GT(math.LegacyOneDec()) { + return errors.New("percentage cannot be greater than one") + } + return nil +} diff --git a/x/protocolpool/types/types.pb.go b/x/protocolpool/types/types.pb.go new file mode 100644 index 0000000000..3875a1394e --- /dev/null +++ b/x/protocolpool/types/types.pb.go @@ -0,0 +1,662 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/protocolpool/v1/types.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "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/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 + +// ContinuousFund defines the fields of continuous fund proposal. +type ContinuousFund struct { + // Recipient is the address string of the account receiving funds. + Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + // Percentage is the percentage of funds to be allocated from Community pool. + Percentage cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=percentage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"percentage"` + // Optional, if expiry is set, removes the state object when expired. + Expiry *time.Time `protobuf:"bytes,3,opt,name=expiry,proto3,stdtime" json:"expiry,omitempty"` +} + +func (m *ContinuousFund) Reset() { *m = ContinuousFund{} } +func (m *ContinuousFund) String() string { return proto.CompactTextString(m) } +func (*ContinuousFund) ProtoMessage() {} +func (*ContinuousFund) Descriptor() ([]byte, []int) { + return fileDescriptor_c1b7d0ea246d7f44, []int{0} +} +func (m *ContinuousFund) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ContinuousFund) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ContinuousFund.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 *ContinuousFund) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContinuousFund.Merge(m, src) +} +func (m *ContinuousFund) XXX_Size() int { + return m.Size() +} +func (m *ContinuousFund) XXX_DiscardUnknown() { + xxx_messageInfo_ContinuousFund.DiscardUnknown(m) +} + +var xxx_messageInfo_ContinuousFund proto.InternalMessageInfo + +func (m *ContinuousFund) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *ContinuousFund) GetExpiry() *time.Time { + if m != nil { + return m.Expiry + } + return nil +} + +// Params defines the parameters for the protocolpool module. +type Params struct { + // EnabledDistributionDenoms lists the denoms that are allowed to be distributed. + // This is to avoid spending time distributing undesired tokens to continuous funds and budgets. + EnabledDistributionDenoms []string `protobuf:"bytes,1,rep,name=enabled_distribution_denoms,json=enabledDistributionDenoms,proto3" json:"enabled_distribution_denoms,omitempty"` + // DistributionFrequency is the frequency (in terms of blocks) that funds are distributed out from the + // x/protocolpool module. + DistributionFrequency uint64 `protobuf:"varint,2,opt,name=distribution_frequency,json=distributionFrequency,proto3" json:"distribution_frequency,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_c1b7d0ea246d7f44, []int{1} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetEnabledDistributionDenoms() []string { + if m != nil { + return m.EnabledDistributionDenoms + } + return nil +} + +func (m *Params) GetDistributionFrequency() uint64 { + if m != nil { + return m.DistributionFrequency + } + return 0 +} + +func init() { + proto.RegisterType((*ContinuousFund)(nil), "cosmos.protocolpool.v1.ContinuousFund") + proto.RegisterType((*Params)(nil), "cosmos.protocolpool.v1.Params") +} + +func init() { + proto.RegisterFile("cosmos/protocolpool/v1/types.proto", fileDescriptor_c1b7d0ea246d7f44) +} + +var fileDescriptor_c1b7d0ea246d7f44 = []byte{ + // 401 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0x41, 0x6b, 0xdb, 0x30, + 0x18, 0x86, 0xa3, 0xb5, 0x04, 0xa2, 0xc1, 0x0e, 0xa6, 0x2b, 0x6e, 0x0a, 0x4e, 0xc8, 0x29, 0x97, + 0xc8, 0x64, 0x63, 0x63, 0xa7, 0xc1, 0x32, 0xd3, 0xcb, 0x76, 0xd8, 0xbc, 0x9d, 0x76, 0x09, 0xb6, + 0xf4, 0x55, 0x15, 0xb5, 0xf5, 0x79, 0x92, 0x5c, 0xea, 0xd3, 0xfe, 0x42, 0x7f, 0x4c, 0x7f, 0x44, + 0x8f, 0xa5, 0x30, 0x18, 0x3b, 0x74, 0x23, 0xf9, 0x23, 0x63, 0x96, 0x43, 0xdd, 0x93, 0xc4, 0xf7, + 0x3e, 0xef, 0x2b, 0x5e, 0xf4, 0xd1, 0x19, 0x47, 0x5b, 0xa2, 0x8d, 0x2b, 0x83, 0x0e, 0x39, 0x16, + 0x15, 0x62, 0x11, 0x5f, 0x2c, 0x63, 0xd7, 0x54, 0x60, 0x59, 0x3b, 0x0d, 0x0e, 0x3d, 0xc3, 0xfa, + 0x0c, 0xbb, 0x58, 0x8e, 0x0f, 0x24, 0x4a, 0x6c, 0x87, 0xf1, 0xff, 0x9b, 0xd7, 0xc7, 0x47, 0x9e, + 0x5e, 0x7b, 0xa1, 0x6f, 0x1d, 0x4f, 0x24, 0xa2, 0x2c, 0xc0, 0x3f, 0x96, 0xd7, 0xa7, 0xb1, 0x53, + 0x25, 0x58, 0x97, 0x95, 0x95, 0x07, 0x66, 0x3f, 0x09, 0x7d, 0xf6, 0x1e, 0xb5, 0x53, 0xba, 0xc6, + 0xda, 0x9e, 0xd4, 0x5a, 0x04, 0xaf, 0xe9, 0xc8, 0x00, 0x57, 0x95, 0x02, 0xed, 0x42, 0x32, 0x25, + 0xf3, 0xd1, 0x2a, 0xbc, 0xbb, 0x5e, 0x1c, 0x74, 0xc1, 0xef, 0x84, 0x30, 0x60, 0xed, 0x17, 0x67, + 0x94, 0x96, 0xe9, 0x03, 0x1a, 0x7c, 0xa6, 0xb4, 0x02, 0xc3, 0x41, 0xbb, 0x4c, 0x42, 0xf8, 0xa4, + 0x35, 0x2e, 0x6f, 0xee, 0x27, 0x83, 0xdf, 0xf7, 0x93, 0x63, 0x6f, 0xb6, 0xe2, 0x9c, 0x29, 0x8c, + 0xcb, 0xcc, 0x9d, 0xb1, 0x8f, 0x20, 0x33, 0xde, 0x24, 0xc0, 0xef, 0xae, 0x17, 0xb4, 0xcb, 0x4e, + 0x80, 0xa7, 0xbd, 0x90, 0xe0, 0x0d, 0x1d, 0xc2, 0x65, 0xa5, 0x4c, 0x13, 0xee, 0x4d, 0xc9, 0xfc, + 0xe9, 0x8b, 0x31, 0xf3, 0x7d, 0xd8, 0xae, 0x0f, 0xfb, 0xba, 0xeb, 0xb3, 0xda, 0xbf, 0xfa, 0x33, + 0x21, 0x69, 0xc7, 0xcf, 0x7e, 0xd0, 0xe1, 0xa7, 0xcc, 0x64, 0xa5, 0x0d, 0xde, 0xd2, 0x63, 0xd0, + 0x59, 0x5e, 0x80, 0x58, 0x0b, 0x65, 0x9d, 0x51, 0x79, 0xed, 0x14, 0xea, 0xb5, 0x00, 0x8d, 0xa5, + 0x0d, 0xc9, 0x74, 0x6f, 0x3e, 0x4a, 0x8f, 0x3a, 0x24, 0xe9, 0x11, 0x49, 0x0b, 0x04, 0xaf, 0xe8, + 0xe1, 0x23, 0xdf, 0xa9, 0x81, 0xef, 0x35, 0x68, 0xde, 0xb4, 0x15, 0xf7, 0xd3, 0xe7, 0x7d, 0xf5, + 0x64, 0x27, 0xae, 0x3e, 0xdc, 0x6c, 0x22, 0x72, 0xbb, 0x89, 0xc8, 0xdf, 0x4d, 0x44, 0xae, 0xb6, + 0xd1, 0xe0, 0x76, 0x1b, 0x0d, 0x7e, 0x6d, 0xa3, 0xc1, 0xb7, 0xa5, 0x54, 0xee, 0xac, 0xce, 0x19, + 0xc7, 0xb2, 0xfb, 0xac, 0xee, 0x58, 0x58, 0x71, 0x1e, 0x5f, 0x3e, 0x5e, 0x8c, 0x76, 0x2b, 0xf2, + 0x61, 0x3b, 0x7b, 0xf9, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xc9, 0x13, 0xcd, 0x50, 0x3c, 0x02, 0x00, + 0x00, +} + +func (m *ContinuousFund) 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 *ContinuousFund) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContinuousFund) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expiry != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiry, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiry):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintTypes(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a + } + { + size := m.Percentage.Size() + i -= size + if _, err := m.Percentage.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DistributionFrequency != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.DistributionFrequency)) + i-- + dAtA[i] = 0x10 + } + if len(m.EnabledDistributionDenoms) > 0 { + for iNdEx := len(m.EnabledDistributionDenoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EnabledDistributionDenoms[iNdEx]) + copy(dAtA[i:], m.EnabledDistributionDenoms[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.EnabledDistributionDenoms[iNdEx]))) + 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 *ContinuousFund) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = m.Percentage.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.Expiry != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiry) + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.EnabledDistributionDenoms) > 0 { + for _, s := range m.EnabledDistributionDenoms { + l = len(s) + n += 1 + l + sovTypes(uint64(l)) + } + } + if m.DistributionFrequency != 0 { + n += 1 + sovTypes(uint64(m.DistributionFrequency)) + } + 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 *ContinuousFund) 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: ContinuousFund: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContinuousFund: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", 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.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Percentage", 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 + } + if err := m.Percentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiry", 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.Expiry == nil { + m.Expiry = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Expiry, 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 (m *Params) 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnabledDistributionDenoms", 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.EnabledDistributionDenoms = append(m.EnabledDistributionDenoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DistributionFrequency", wireType) + } + m.DistributionFrequency = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DistributionFrequency |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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") +) diff --git a/x/protocolpool/types/types_test.go b/x/protocolpool/types/types_test.go new file mode 100644 index 0000000000..403848c265 --- /dev/null +++ b/x/protocolpool/types/types_test.go @@ -0,0 +1,105 @@ +package types + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func TestRegisterInterfaces(t *testing.T) { + interfaceRegistry := codectestutil.CodecOptions{}.NewInterfaceRegistry() + RegisterInterfaces(interfaceRegistry) + require.NoError(t, interfaceRegistry.EnsureRegistered(&MsgFundCommunityPool{})) + require.NoError(t, interfaceRegistry.EnsureRegistered(&MsgCommunityPoolSpend{})) + require.NoError(t, interfaceRegistry.EnsureRegistered(&MsgCreateContinuousFund{})) + require.NoError(t, interfaceRegistry.EnsureRegistered(&MsgCancelContinuousFund{})) +} + +func TestNewMsgFundCommunityPool(t *testing.T) { + amount := sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))) + depositor := "cosmos1qypq2q2l8z4wz2z2l8z4wz2z2l8z4wz2z2l8z4" + msg := NewMsgFundCommunityPool(amount, depositor) + require.Equal(t, amount, msg.Amount) + require.Equal(t, depositor, msg.Depositor) +} + +func TestNewMsgCommunityPoolSpend(t *testing.T) { + amount := sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))) + authority := "cosmos1qypq2q2l8z4wz2z2l8z4wz2z2l8z4wz2z2l8z4" + recipient := "cosmos1qypq2q2l8z4wz2z2l8z4wz2z2l8z4wz2z2l8z5" + msg := NewMsgCommunityPoolSpend(amount, authority, recipient) + require.Equal(t, amount, msg.Amount) + require.Equal(t, authority, msg.Authority) + require.Equal(t, recipient, msg.Recipient) +} + +func TestValidateContinuousFund(t *testing.T) { + testCases := []struct { + name string + cf ContinuousFund + expErrMsg string + }{ + { + "valid continuous fund", + ContinuousFund{ + Recipient: "cosmos1qypq2q2l8z4wz2z2l8z4wz2z2l8z4wz2z2l8z4", + Percentage: math.LegacyMustNewDecFromStr("0.1"), + Expiry: nil, + }, + "", + }, + { + "empty recipient", + ContinuousFund{ + Recipient: "", + }, + "recipient cannot be empty", + }, + { + "zero percentage", + ContinuousFund{ + Recipient: "cosmos1qypq2q2l8z4wz2z2l8z4wz2z2l8z4wz2z2l8z4", + Percentage: math.LegacyZeroDec(), + }, + "percentage cannot be zero or empty", + }, + { + "nil percentage", + ContinuousFund{ + Recipient: "cosmos1qypq2q2l8z4wz2z2l8z4wz2z2l8z4wz2z2l8z4", + Percentage: math.LegacyDec{}, + }, + "percentage cannot be zero or empty", + }, + { + "negative percentage", + ContinuousFund{ + Recipient: "cosmos1qypq2q2l8z4wz2z2l8z4wz2z2l8z4wz2z2l8z4", + Percentage: math.LegacyMustNewDecFromStr("-0.1"), + }, + "percentage cannot be negative", + }, + { + "percentage exceeds 100%", + ContinuousFund{ + Recipient: "cosmos1qypq2q2l8z4wz2z2l8z4wz2z2l8z4wz2z2l8z4", + Percentage: math.LegacyMustNewDecFromStr("1.1"), + }, + "percentage cannot be greater than one", + }, + } + + for _, tc := range testCases { + err := tc.cf.Validate() + if tc.expErrMsg == "" { + require.NoError(t, err) + } else { + require.EqualError(t, err, tc.expErrMsg) + } + } +}