From 0591027f333bd845a38bdd3fcaa23377cbfd0dfa Mon Sep 17 00:00:00 2001 From: mbreithecker Date: Thu, 6 Feb 2025 10:41:49 +0100 Subject: [PATCH] feat: turn into separate module --- Makefile | 2 +- api/kyve/compliance/module/module.pulsar.go | 576 +++++++ app/app.go | 6 +- app/app_config.go | 11 +- app/upgrades/v2_0/upgrade.go | 9 +- docs/static/openapi.yml | 138 -- proto/kyve/compliance/module/module.proto | 12 + proto/kyve/compliance/v1beta1/events.proto | 21 + proto/kyve/compliance/v1beta1/genesis.proto | 26 + proto/kyve/compliance/v1beta1/params.proto | 15 + proto/kyve/compliance/v1beta1/query.proto | 67 + proto/kyve/compliance/v1beta1/tx.proto | 63 + proto/kyve/compliance/v1beta1/types.proto | 57 + proto/kyve/stakers/v1beta1/genesis.proto | 11 - proto/kyve/stakers/v1beta1/params.proto | 7 - proto/kyve/stakers/v1beta1/query.proto | 41 - proto/kyve/stakers/v1beta1/stakers.proto | 37 - proto/kyve/stakers/v1beta1/tx.proto | 33 - testutil/integration/integration.go | 2 + x/compliance/client/cli/query.go | 32 + x/compliance/client/cli/query_params.go | 35 + x/compliance/client/cli/tx.go | 27 + .../cli/tx_set_multi_coin_refund_policy.go | 3 +- .../cli/tx_toggle_multi_coin_rewards.go | 3 +- x/compliance/genesis.go | 43 + .../keeper/getters_compliance.go | 7 +- x/compliance/keeper/getters_params.go | 38 + x/compliance/keeper/getters_queue.go | 29 + x/compliance/keeper/grpc_query.go | 55 + x/compliance/keeper/keeper.go | 83 + x/compliance/keeper/keeper_suite_test.go | 31 + .../keeper/logic_compliance.go | 16 +- x/compliance/keeper/logic_queue.go | 45 + x/compliance/keeper/msg_server.go | 17 + .../keeper/msg_server_compliance.go | 2 +- .../keeper/msg_server_compliance_test.go | 221 +++ .../keeper/msg_server_update_params.go | 35 + x/compliance/module.go | 223 +++ x/compliance/types/codec.go | 28 + x/compliance/types/errors.go | 13 + x/compliance/types/events.pb.go | 434 +++++ x/compliance/types/expected_keepers.go | 13 + x/compliance/types/genesis.go | 40 + x/compliance/types/genesis.pb.go | 570 ++++++ x/compliance/types/keys.go | 45 + .../message_set_multi_coin_refund_policy.go | 0 .../message_toggle_multi_coin_rewards.go | 0 x/compliance/types/msgs.go | 35 + x/compliance/types/params.go | 37 + x/compliance/types/params.pb.go | 361 ++++ x/compliance/types/query.pb.go | 1327 ++++++++++++++ x/compliance/types/query.pb.gw.go | 319 ++++ x/compliance/types/tx.pb.go | 1370 +++++++++++++++ x/compliance/types/types.go | 47 + x/compliance/types/types.pb.go | 1294 ++++++++++++++ x/global/ante_test.go | 2 +- x/query/keeper/keeper.go | 8 +- x/query/module.go | 3 +- x/stakers/client/cli/tx.go | 2 - x/stakers/genesis.go | 21 - x/stakers/keeper/getters_params.go | 5 - x/stakers/keeper/grpc_query.go | 33 - x/stakers/keeper/keeper.go | 24 - x/stakers/module.go | 13 +- x/stakers/types/codec.go | 4 - x/stakers/types/errors.go | 5 - x/stakers/types/genesis.go | 25 +- x/stakers/types/genesis.pb.go | 303 +--- x/stakers/types/keys.go | 26 +- x/stakers/types/params.go | 22 +- x/stakers/types/params.pb.go | 140 +- x/stakers/types/query.pb.go | 832 +-------- x/stakers/types/query.pb.gw.go | 166 -- x/stakers/types/stakers.pb.go | 1531 ++++------------- x/stakers/types/tx.pb.go | 1343 +++------------ x/stakers/types/types.go | 46 - 76 files changed, 8400 insertions(+), 4166 deletions(-) create mode 100644 api/kyve/compliance/module/module.pulsar.go create mode 100644 proto/kyve/compliance/module/module.proto create mode 100644 proto/kyve/compliance/v1beta1/events.proto create mode 100644 proto/kyve/compliance/v1beta1/genesis.proto create mode 100644 proto/kyve/compliance/v1beta1/params.proto create mode 100644 proto/kyve/compliance/v1beta1/query.proto create mode 100644 proto/kyve/compliance/v1beta1/tx.proto create mode 100644 proto/kyve/compliance/v1beta1/types.proto create mode 100644 x/compliance/client/cli/query.go create mode 100644 x/compliance/client/cli/query_params.go create mode 100644 x/compliance/client/cli/tx.go rename x/{stakers => compliance}/client/cli/tx_set_multi_coin_refund_policy.go (95%) rename x/{stakers => compliance}/client/cli/tx_toggle_multi_coin_rewards.go (94%) create mode 100644 x/compliance/genesis.go rename x/{stakers => compliance}/keeper/getters_compliance.go (94%) create mode 100644 x/compliance/keeper/getters_params.go create mode 100644 x/compliance/keeper/getters_queue.go create mode 100644 x/compliance/keeper/grpc_query.go create mode 100644 x/compliance/keeper/keeper.go create mode 100644 x/compliance/keeper/keeper_suite_test.go rename x/{stakers => compliance}/keeper/logic_compliance.go (91%) create mode 100644 x/compliance/keeper/logic_queue.go create mode 100644 x/compliance/keeper/msg_server.go rename x/{stakers => compliance}/keeper/msg_server_compliance.go (97%) create mode 100644 x/compliance/keeper/msg_server_compliance_test.go create mode 100644 x/compliance/keeper/msg_server_update_params.go create mode 100644 x/compliance/module.go create mode 100644 x/compliance/types/codec.go create mode 100644 x/compliance/types/errors.go create mode 100644 x/compliance/types/events.pb.go create mode 100644 x/compliance/types/expected_keepers.go create mode 100644 x/compliance/types/genesis.go create mode 100644 x/compliance/types/genesis.pb.go create mode 100644 x/compliance/types/keys.go rename x/{stakers => compliance}/types/message_set_multi_coin_refund_policy.go (100%) rename x/{stakers => compliance}/types/message_toggle_multi_coin_rewards.go (100%) create mode 100644 x/compliance/types/msgs.go create mode 100644 x/compliance/types/params.go create mode 100644 x/compliance/types/params.pb.go create mode 100644 x/compliance/types/query.pb.go create mode 100644 x/compliance/types/query.pb.gw.go create mode 100644 x/compliance/types/tx.pb.go create mode 100644 x/compliance/types/types.go create mode 100644 x/compliance/types/types.pb.go diff --git a/Makefile b/Makefile index 38bdd0be..450f8c93 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ ifndef ENV endif ensure_version: -ifneq ($(GO_VERSION),1.22) +ifneq ($(GO_VERSION),1.23) $(error ❌ Please run Go v1.22.x..) endif diff --git a/api/kyve/compliance/module/module.pulsar.go b/api/kyve/compliance/module/module.pulsar.go new file mode 100644 index 00000000..f25f19c3 --- /dev/null +++ b/api/kyve/compliance/module/module.pulsar.go @@ -0,0 +1,576 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package module + +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_kyve_compliance_module_module_proto_init() + md_Module = File_kyve_compliance_module_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_kyve_compliance_module_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 "kyve.compliance.module.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: kyve.compliance.module.Module")) + } + panic(fmt.Errorf("message kyve.compliance.module.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 "kyve.compliance.module.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: kyve.compliance.module.Module")) + } + panic(fmt.Errorf("message kyve.compliance.module.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 "kyve.compliance.module.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: kyve.compliance.module.Module")) + } + panic(fmt.Errorf("message kyve.compliance.module.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 "kyve.compliance.module.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: kyve.compliance.module.Module")) + } + panic(fmt.Errorf("message kyve.compliance.module.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 "kyve.compliance.module.Module.authority": + panic(fmt.Errorf("field authority of message kyve.compliance.module.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: kyve.compliance.module.Module")) + } + panic(fmt.Errorf("message kyve.compliance.module.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 "kyve.compliance.module.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: kyve.compliance.module.Module")) + } + panic(fmt.Errorf("message kyve.compliance.module.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 kyve.compliance.module.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: kyve/compliance/module/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 for the 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_kyve_compliance_module_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_kyve_compliance_module_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_kyve_compliance_module_module_proto protoreflect.FileDescriptor + +var file_kyve_compliance_module_module_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x6b, 0x79, 0x76, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, 0x6e, 0x63, + 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x6b, 0x79, 0x76, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x70, + 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 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, + 0x41, 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, 0x19, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x13, 0x0a, + 0x11, 0x6b, 0x79, 0x76, 0x65, 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, 0x6e, + 0x63, 0x65, 0x42, 0xcc, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x6b, 0x79, 0x76, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x27, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x6b, 0x79, 0x76, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, 0x6e, + 0x63, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x4b, 0x43, 0x4d, 0xaa, + 0x02, 0x16, 0x4b, 0x79, 0x76, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, 0x6e, 0x63, + 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xca, 0x02, 0x16, 0x4b, 0x79, 0x76, 0x65, 0x5c, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0xe2, 0x02, 0x22, 0x4b, 0x79, 0x76, 0x65, 0x5c, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, + 0x6e, 0x63, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x4b, 0x79, 0x76, 0x65, 0x3a, 0x3a, 0x43, + 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_kyve_compliance_module_module_proto_rawDescOnce sync.Once + file_kyve_compliance_module_module_proto_rawDescData = file_kyve_compliance_module_module_proto_rawDesc +) + +func file_kyve_compliance_module_module_proto_rawDescGZIP() []byte { + file_kyve_compliance_module_module_proto_rawDescOnce.Do(func() { + file_kyve_compliance_module_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_kyve_compliance_module_module_proto_rawDescData) + }) + return file_kyve_compliance_module_module_proto_rawDescData +} + +var file_kyve_compliance_module_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_kyve_compliance_module_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: kyve.compliance.module.Module +} +var file_kyve_compliance_module_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_kyve_compliance_module_module_proto_init() } +func file_kyve_compliance_module_module_proto_init() { + if File_kyve_compliance_module_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_kyve_compliance_module_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_kyve_compliance_module_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_kyve_compliance_module_module_proto_goTypes, + DependencyIndexes: file_kyve_compliance_module_module_proto_depIdxs, + MessageInfos: file_kyve_compliance_module_module_proto_msgTypes, + }.Build() + File_kyve_compliance_module_module_proto = out.File + file_kyve_compliance_module_module_proto_rawDesc = nil + file_kyve_compliance_module_module_proto_goTypes = nil + file_kyve_compliance_module_module_proto_depIdxs = nil +} diff --git a/app/app.go b/app/app.go index 6f9f40db..ee12f69c 100644 --- a/app/app.go +++ b/app/app.go @@ -75,6 +75,8 @@ import ( // Kyve modules _ "github.com/KYVENetwork/chain/x/bundles" bundleskeeper "github.com/KYVENetwork/chain/x/bundles/keeper" + _ "github.com/KYVENetwork/chain/x/compliance" // import for side-effects + compliancekeeper "github.com/KYVENetwork/chain/x/compliance/keeper" _ "github.com/KYVENetwork/chain/x/delegation" // import for side-effects delegationkeeper "github.com/KYVENetwork/chain/x/delegation/keeper" _ "github.com/KYVENetwork/chain/x/funders" // import for side-effects @@ -119,7 +121,7 @@ type App struct { AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper StakingKeeper *stakingkeeper.Keeper - DistributionKeeper distrkeeper.Keeper + DistributionKeeper *distrkeeper.Keeper ConsensusKeeper consensuskeeper.Keeper SlashingKeeper slashingkeeper.Keeper @@ -151,6 +153,7 @@ type App struct { StakersKeeper *stakerskeeper.Keeper TeamKeeper teamkeeper.Keeper FundersKeeper funderskeeper.Keeper + ComplianceKeeper compliancekeeper.Keeper // simulation manager // sm *module.SimulationManager @@ -296,6 +299,7 @@ func New( &app.StakersKeeper, &app.TeamKeeper, &app.FundersKeeper, + &app.ComplianceKeeper, // this line is used by starport scaffolding # stargate/app/keeperDefinition ); err != nil { panic(err) diff --git a/app/app_config.go b/app/app_config.go index 97351848..1a37397c 100644 --- a/app/app_config.go +++ b/app/app_config.go @@ -28,6 +28,7 @@ import ( "cosmossdk.io/x/feegrant" upgradetypes "cosmossdk.io/x/upgrade/types" bundlesmodulev1 "github.com/KYVENetwork/chain/api/kyve/bundles/module" + compliancemodulev1 "github.com/KYVENetwork/chain/api/kyve/compliance/module" delegationmodulev1 "github.com/KYVENetwork/chain/api/kyve/delegation/module" fundersmodulev1 "github.com/KYVENetwork/chain/api/kyve/funders/module" globalmodulev1 "github.com/KYVENetwork/chain/api/kyve/global/module" @@ -56,6 +57,7 @@ import ( "google.golang.org/protobuf/types/known/durationpb" bundlestypes "github.com/KYVENetwork/chain/x/bundles/types" + compliancetypes "github.com/KYVENetwork/chain/x/compliance/types" delegationtypes "github.com/KYVENetwork/chain/x/delegation/types" funderstypes "github.com/KYVENetwork/chain/x/funders/types" globaltypes "github.com/KYVENetwork/chain/x/global/types" @@ -105,6 +107,7 @@ var ( globaltypes.ModuleName, teamtypes.ModuleName, funderstypes.ModuleName, + compliancetypes.ModuleName, // this line is used by starport scaffolding # stargate/app/initGenesis } @@ -135,6 +138,7 @@ var ( // KYVE modules delegationtypes.ModuleName, stakerstypes.ModuleName, + compliancetypes.ModuleName, // this line is used by starport scaffolding # stargate/app/beginBlockers } @@ -181,7 +185,8 @@ var ( {Account: delegationtypes.ModuleName}, {Account: pooltypes.ModuleName}, {Account: stakerstypes.ModuleName}, - {Account: stakerstypes.MultiCoinRewardsRedistributionAccountName}, + {Account: compliancetypes.ModuleName}, + {Account: compliancetypes.MultiCoinRewardsRedistributionAccountName}, {Account: teamtypes.ModuleName}, {Account: funderstypes.ModuleName}, // this line is used by starport scaffolding # stargate/app/maccPerms @@ -356,6 +361,10 @@ var ( Name: funderstypes.ModuleName, Config: appconfig.WrapAny(&fundersmodulev1.Module{}), }, + { + Name: compliancetypes.ModuleName, + Config: appconfig.WrapAny(&compliancemodulev1.Module{}), + }, // this line is used by starport scaffolding # stargate/app/moduleConfig }, }) diff --git a/app/upgrades/v2_0/upgrade.go b/app/upgrades/v2_0/upgrade.go index 8041335e..85de0fa8 100644 --- a/app/upgrades/v2_0/upgrade.go +++ b/app/upgrades/v2_0/upgrade.go @@ -4,6 +4,8 @@ import ( "context" "fmt" + compliancetypes "github.com/KYVENetwork/chain/x/compliance/types" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -13,7 +15,6 @@ import ( delegationkeeper "github.com/KYVENetwork/chain/x/delegation/keeper" globalTypes "github.com/KYVENetwork/chain/x/global/types" stakerskeeper "github.com/KYVENetwork/chain/x/stakers/keeper" - stakersTypes "github.com/KYVENetwork/chain/x/stakers/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -58,17 +59,17 @@ func CreateUpgradeHandler( } func EnsureComplianceAccount(ctx sdk.Context, ak authkeeper.AccountKeeper) { - address := authTypes.NewModuleAddress(stakersTypes.MultiCoinRewardsRedistributionAccountName) + address := authTypes.NewModuleAddress(compliancetypes.MultiCoinRewardsRedistributionAccountName) account := ak.GetAccount(ctx, address) if account == nil { // account doesn't exist, initialise a new module account. - newAcc := authTypes.NewEmptyModuleAccount(stakersTypes.MultiCoinRewardsRedistributionAccountName) + newAcc := authTypes.NewEmptyModuleAccount(compliancetypes.MultiCoinRewardsRedistributionAccountName) account = ak.NewAccountWithAddress(ctx, newAcc.GetAddress()) } else { // account exists, adjust it to a module account. baseAccount := authTypes.NewBaseAccount(address, nil, account.GetAccountNumber(), 0) - account = authTypes.NewModuleAccount(baseAccount, stakersTypes.MultiCoinRewardsRedistributionAccountName) + account = authTypes.NewModuleAccount(baseAccount, compliancetypes.MultiCoinRewardsRedistributionAccountName) } ak.SetAccount(ctx, account) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 1b37754a..a7a08b8d 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -2683,18 +2683,6 @@ paths: timeout_slash: type: string description: timeout_slash ... - multi_coin_refund_policy_admin_address: - type: string - title: >- - multi_coin_compliance_admin_address specifies an address - which is allowed to adjust the weights for - - the coin redistribution. This address can now drain coins, - but only - multi_coin_refund_pending_time: - type: string - format: uint64 - description: multi_coin_refund_pending_time ... pool_params: description: pool_params ... type: object @@ -8833,120 +8821,6 @@ paths: default: FUNDING_STATUS_UNSPECIFIED tags: - QueryFunders - /kyve/stakers/v1beta1/multi_coin_refund_policy: - get: - summary: >- - policy, multi-coin-enabled, multi-coin-status/address: {enabled true - false, pending rewards} - operationId: MultiCoinRefundPolicyQuery - responses: - '200': - description: A successful response. - schema: - type: object - properties: - policy: - description: params holds all the parameters of this module. - type: object - properties: - entries: - type: array - items: - type: object - properties: - denom: - type: string - pool_weights: - type: array - items: - type: object - properties: - pool_id: - type: string - format: uint64 - weight: - type: string - description: MultiCoinRefundPoolWeightEntry ... - description: MultiCoinRefundDenomEntry ... - description: QueryMultiCoinRefundPolicyResponse ... - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - QueryStakers - /kyve/stakers/v1beta1/multi_coin_status/{address}: - get: - summary: MultiCoinStatus ... - operationId: MultiCoinStatus - responses: - '200': - description: A successful response. - schema: - type: object - properties: - enabled: - type: boolean - description: enabled ... - pending_multi_coin_rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - description: pending_multi_coin_rewards ... - description: QueryMultiCoinRefundPolicyResponse ... - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - parameters: - - name: address - description: address ... - in: path - required: true - type: string - tags: - - QueryStakers /kyve/stakers/v1beta1/params: get: summary: Parameters queries the parameters of the module. @@ -8982,18 +8856,6 @@ paths: timeout_slash: type: string description: timeout_slash ... - multi_coin_refund_policy_admin_address: - type: string - title: >- - multi_coin_compliance_admin_address specifies an address - which is allowed to adjust the weights for - - the coin redistribution. This address can now drain coins, - but only - multi_coin_refund_pending_time: - type: string - format: uint64 - description: multi_coin_refund_pending_time ... description: >- QueryParamsResponse is response type for the Query/Params RPC method. diff --git a/proto/kyve/compliance/module/module.proto b/proto/kyve/compliance/module/module.proto new file mode 100644 index 00000000..337b79a5 --- /dev/null +++ b/proto/kyve/compliance/module/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package kyve.compliance.module; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the module. +message Module { + option (cosmos.app.v1alpha1.module) = {go_import: "kyve/x/compliance"}; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} diff --git a/proto/kyve/compliance/v1beta1/events.proto b/proto/kyve/compliance/v1beta1/events.proto new file mode 100644 index 00000000..383cfbf7 --- /dev/null +++ b/proto/kyve/compliance/v1beta1/events.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package kyve.compliance.v1beta1; + +import "gogoproto/gogo.proto"; +import "kyve/compliance/v1beta1/params.proto"; + +option go_package = "github.com/KYVENetwork/chain/x/compliance/types"; + +// EventUpdateParams is an event emitted when the module parameters are updated. +// emitted_by: MsgUpdateParams +message EventUpdateParams { + // old_params is the module's old parameters. + kyve.compliance.v1beta1.Params old_params = 1 [(gogoproto.nullable) = false]; + // new_params is the module's new parameters. + kyve.compliance.v1beta1.Params new_params = 2 [(gogoproto.nullable) = false]; + // payload is the parameter updates that were performed. + string payload = 3; +} + +// TODO add events diff --git a/proto/kyve/compliance/v1beta1/genesis.proto b/proto/kyve/compliance/v1beta1/genesis.proto new file mode 100644 index 00000000..95e3c3e5 --- /dev/null +++ b/proto/kyve/compliance/v1beta1/genesis.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package kyve.compliance.v1beta1; + +import "gogoproto/gogo.proto"; +import "kyve/compliance/v1beta1/params.proto"; +import "kyve/compliance/v1beta1/types.proto"; + +option go_package = "github.com/KYVENetwork/chain/x/compliance/types"; + +// GenesisState defines the compliance module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; + + // MultiCoinPendingRewardsEntry ... + repeated MultiCoinPendingRewardsEntry multi_coin_pending_rewards_entries = 2 [(gogoproto.nullable) = false]; + // queue_state_state_fraction ... + QueueState queue_state_pending_rewards = 3 [(gogoproto.nullable) = false]; + + // multi_coin_enabled ... + repeated string multi_coin_enabled = 4; + + // multi_coin_refund_policy ... + MultiCoinRefundPolicy multi_coin_refund_policy = 5; +} diff --git a/proto/kyve/compliance/v1beta1/params.proto b/proto/kyve/compliance/v1beta1/params.proto new file mode 100644 index 00000000..fdf4dc05 --- /dev/null +++ b/proto/kyve/compliance/v1beta1/params.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package kyve.compliance.v1beta1; + +option go_package = "github.com/KYVENetwork/chain/x/compliance/types"; + +// Params defines the compliance module parameters. +message Params { + // multi_coin_compliance_admin_address specifies an address which is allowed to adjust the weights for + // the coin redistribution. This address can now drain coins, but only + string multi_coin_refund_policy_admin_address = 7; + + // multi_coin_refund_pending_time ... + uint64 multi_coin_refund_pending_time = 8; +} diff --git a/proto/kyve/compliance/v1beta1/query.proto b/proto/kyve/compliance/v1beta1/query.proto new file mode 100644 index 00000000..75051cd1 --- /dev/null +++ b/proto/kyve/compliance/v1beta1/query.proto @@ -0,0 +1,67 @@ +syntax = "proto3"; + +package kyve.compliance.v1beta1; + +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "kyve/compliance/v1beta1/params.proto"; +import "kyve/compliance/v1beta1/types.proto"; + +option go_package = "github.com/KYVENetwork/chain/x/compliance/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/kyve/compliance/v1/params"; + } + + // policy, multi-coin-enabled, multi-coin-status/address: {enabled true false, pending rewards} + rpc MultiCoinRefundPolicyQuery(QueryMultiCoinRefundPolicyRequest) returns (QueryMultiCoinRefundPolicyResponse) { + option (google.api.http).get = "/kyve/compliance/v1/multi_coin_refund_policy"; + } + + // MultiCoinStatus ... + rpc MultiCoinStatus(QueryMultiCoinStatusRequest) returns (QueryMultiCoinStatusResponse) { + option (google.api.http).get = "/kyve/compliance/v1/multi_coin_status/{address}"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryMultiCoinRefundPolicyRequest ... +message QueryMultiCoinRefundPolicyRequest {} + +// QueryMultiCoinRefundPolicyResponse ... +message QueryMultiCoinRefundPolicyResponse { + // params holds all the parameters of this module. + MultiCoinRefundPolicy policy = 1 [(gogoproto.nullable) = false]; +} + +// QueryMultiCoinRefundPolicyRequest ... +message QueryMultiCoinStatusRequest { + // address ... + string address = 1; +} + +// QueryMultiCoinRefundPolicyResponse ... +message QueryMultiCoinStatusResponse { + // enabled ... + bool enabled = 1; + + // pending_multi_coin_rewards ... + repeated cosmos.base.v1beta1.Coin pending_multi_coin_rewards = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} diff --git a/proto/kyve/compliance/v1beta1/tx.proto b/proto/kyve/compliance/v1beta1/tx.proto new file mode 100644 index 00000000..8eac39f2 --- /dev/null +++ b/proto/kyve/compliance/v1beta1/tx.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; + +package kyve.compliance.v1beta1; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "kyve/compliance/v1beta1/types.proto"; + +option go_package = "github.com/KYVENetwork/chain/x/compliance/types"; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a governance operation for updating the x/compliance module + // parameters. The authority is hard-coded to the x/gov module account. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // ToggleMultiCoinRewards ... + rpc ToggleMultiCoinRewards(MsgToggleMultiCoinRewards) returns (MsgToggleMultiCoinRewardsResponse); + + // SetMultiCoinRewardRefundPolicy ... + rpc SetMultiCoinRewardRefundPolicy(MsgSetMultiCoinRewardsRefundPolicy) returns (MsgSetMultiCoinRewardsRefundPolicyResponse); +} + +// MsgUpdateParams defines a SDK message for updating the module parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // payload defines the x/compliance parameters to update. + string payload = 2; +} + +// MsgUpdateParamsResponse defines the Msg/UpdateParams response type. +message MsgUpdateParamsResponse {} + +// MsgEnableMultiCoinReward enables multi-coin rewards for the sender address +// and claims all current pending rewards. +message MsgToggleMultiCoinRewards { + option (cosmos.msg.v1.signer) = "creator"; + // creator ... + string creator = 1; + // enabled ... + bool enabled = 2; +} + +// MsgEnableMultiCoinRewardResponse ... +message MsgToggleMultiCoinRewardsResponse {} + +// MsgEnableMultiCoinReward enables multi-coin rewards for the sender address +// and claims all current pending rewards. +message MsgSetMultiCoinRewardsRefundPolicy { + option (cosmos.msg.v1.signer) = "creator"; + // creator ... + string creator = 1; + // policy ... + kyve.compliance.v1beta1.MultiCoinRefundPolicy policy = 2; +} + +// MsgEnableMultiCoinRewardResponse ... +message MsgSetMultiCoinRewardsRefundPolicyResponse {} diff --git a/proto/kyve/compliance/v1beta1/types.proto b/proto/kyve/compliance/v1beta1/types.proto new file mode 100644 index 00000000..45d3019b --- /dev/null +++ b/proto/kyve/compliance/v1beta1/types.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; + +package kyve.compliance.v1beta1; + +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/KYVENetwork/chain/x/compliance/types"; + +// UnbondingState stores the state for the unbonding of stakes and delegations. +message QueueState { + // low_index is the tail of the queue. It is the + // oldest entry in the queue. If this entry isn't + // due, non of the other entries is. + uint64 low_index = 1; + // high_index is the head of the queue. New entries + // are added to the top. + uint64 high_index = 2; +} + +// MultiCoinPendingRewardsEntry ... +message MultiCoinPendingRewardsEntry { + // index is needed for the queue-algorithm which + // processes the commission changes + uint64 index = 1; + // address ... + string address = 2; + // rewards ... + repeated cosmos.base.v1beta1.Coin rewards = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + int64 creation_date = 4; +} + +// MultiCoinRefundPolicy ... +message MultiCoinRefundPolicy { + repeated MultiCoinRefundDenomEntry entries = 1; +} + +// MultiCoinRefundDenomEntry ... +message MultiCoinRefundDenomEntry { + string denom = 1; + repeated MultiCoinRefundPoolWeightEntry pool_weights = 2; +} + +// MultiCoinRefundPoolWeightEntry ... +message MultiCoinRefundPoolWeightEntry { + uint64 pool_id = 1; + string weight = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} diff --git a/proto/kyve/stakers/v1beta1/genesis.proto b/proto/kyve/stakers/v1beta1/genesis.proto index f189daba..e967a8eb 100644 --- a/proto/kyve/stakers/v1beta1/genesis.proto +++ b/proto/kyve/stakers/v1beta1/genesis.proto @@ -28,15 +28,4 @@ message GenesisState { repeated StakeFractionChangeEntry stake_fraction_change_entries = 8 [(gogoproto.nullable) = false]; // queue_state_stake_fraction ... QueueState queue_state_stake_fraction = 9 [(gogoproto.nullable) = false]; - - // MultiCoinPendingRewardsEntry ... - repeated MultiCoinPendingRewardsEntry multi_coin_pending_rewards_entries = 10 [(gogoproto.nullable) = false]; - // queue_state_state_fraction ... - QueueState queue_state_pending_rewards = 11 [(gogoproto.nullable) = false]; - - // multi_coin_enabled ... - repeated string multi_coin_enabled = 12; - - // multi_coin_refund_policy ... - MultiCoinRefundPolicy multi_coin_refund_policy = 13; } diff --git a/proto/kyve/stakers/v1beta1/params.proto b/proto/kyve/stakers/v1beta1/params.proto index 5c0d4e46..4a524231 100644 --- a/proto/kyve/stakers/v1beta1/params.proto +++ b/proto/kyve/stakers/v1beta1/params.proto @@ -29,11 +29,4 @@ message Params { (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; - - // multi_coin_compliance_admin_address specifies an address which is allowed to adjust the weights for - // the coin redistribution. This address can now drain coins, but only - string multi_coin_refund_policy_admin_address = 7; - - // multi_coin_refund_pending_time ... - uint64 multi_coin_refund_pending_time = 8; } diff --git a/proto/kyve/stakers/v1beta1/query.proto b/proto/kyve/stakers/v1beta1/query.proto index 48bd7985..ed91f8e7 100644 --- a/proto/kyve/stakers/v1beta1/query.proto +++ b/proto/kyve/stakers/v1beta1/query.proto @@ -2,12 +2,9 @@ syntax = "proto3"; package kyve.stakers.v1beta1; -import "amino/amino.proto"; -import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "kyve/stakers/v1beta1/params.proto"; -import "kyve/stakers/v1beta1/stakers.proto"; option go_package = "github.com/KYVENetwork/chain/x/stakers/types"; @@ -17,16 +14,6 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/kyve/stakers/v1beta1/params"; } - - // policy, multi-coin-enabled, multi-coin-status/address: {enabled true false, pending rewards} - rpc MultiCoinRefundPolicyQuery(QueryMultiCoinRefundPolicyRequest) returns (QueryMultiCoinRefundPolicyResponse) { - option (google.api.http).get = "/kyve/stakers/v1beta1/multi_coin_refund_policy"; - } - - // MultiCoinStatus ... - rpc MultiCoinStatus(QueryMultiCoinStatusRequest) returns (QueryMultiCoinStatusResponse) { - option (google.api.http).get = "/kyve/stakers/v1beta1/multi_coin_status/{address}"; - } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -37,31 +24,3 @@ message QueryParamsResponse { // params holds all the parameters of this module. Params params = 1 [(gogoproto.nullable) = false]; } - -// QueryMultiCoinRefundPolicyRequest ... -message QueryMultiCoinRefundPolicyRequest {} - -// QueryMultiCoinRefundPolicyResponse ... -message QueryMultiCoinRefundPolicyResponse { - // params holds all the parameters of this module. - MultiCoinRefundPolicy policy = 1 [(gogoproto.nullable) = false]; -} - -// QueryMultiCoinRefundPolicyRequest ... -message QueryMultiCoinStatusRequest { - // address ... - string address = 1; -} - -// QueryMultiCoinRefundPolicyResponse ... -message QueryMultiCoinStatusResponse { - // enabled ... - bool enabled = 1; - - // pending_multi_coin_rewards ... - repeated cosmos.base.v1beta1.Coin pending_multi_coin_rewards = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} diff --git a/proto/kyve/stakers/v1beta1/stakers.proto b/proto/kyve/stakers/v1beta1/stakers.proto index d23bda9f..74c09985 100644 --- a/proto/kyve/stakers/v1beta1/stakers.proto +++ b/proto/kyve/stakers/v1beta1/stakers.proto @@ -158,40 +158,3 @@ enum SlashType { // SLASH_TYPE_UPLOAD ... SLASH_TYPE_UPLOAD = 3; } - -// MultiCoinPendingRewardsEntry ... -message MultiCoinPendingRewardsEntry { - // index is needed for the queue-algorithm which - // processes the commission changes - uint64 index = 1; - // staker is the address of the affected staker - string address = 2; - // rewards ... - repeated cosmos.base.v1beta1.Coin rewards = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; - - int64 creation_date = 4; -} - -// MultiCoinRefundPolicy ... -message MultiCoinRefundPolicy { - repeated MultiCoinRefundDenomEntry entries = 1; -} - -// MultiCoinRefundDenomEntry ... -message MultiCoinRefundDenomEntry { - string denom = 1; - repeated MultiCoinRefundPoolWeightEntry pool_weights = 2; -} - -// MultiCoinRefundPoolWeightEntry ... -message MultiCoinRefundPoolWeightEntry { - uint64 pool_id = 1; - string weight = 2 [ - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false - ]; -} diff --git a/proto/kyve/stakers/v1beta1/tx.proto b/proto/kyve/stakers/v1beta1/tx.proto index 018bb6d6..0eff77a0 100644 --- a/proto/kyve/stakers/v1beta1/tx.proto +++ b/proto/kyve/stakers/v1beta1/tx.proto @@ -5,7 +5,6 @@ package kyve.stakers.v1beta1; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -import "kyve/stakers/v1beta1/stakers.proto"; option go_package = "github.com/KYVENetwork/chain/x/stakers/types"; @@ -25,12 +24,6 @@ service Msg { // UpdateParams defines a governance operation for updating the x/stakers module // parameters. The authority is hard-coded to the x/gov module account. rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - - // ToggleMultiCoinRewards ... - rpc ToggleMultiCoinRewards(MsgToggleMultiCoinRewards) returns (MsgToggleMultiCoinRewardsResponse); - - // SetMultiCoinRewardRefundPolicy ... - rpc SetMultiCoinRewardRefundPolicy(MsgSetMultiCoinRewardsRefundPolicy) returns (MsgSetMultiCoinRewardsRefundPolicyResponse); } // MsgUpdateCommission ... // TODO: create v1 types and rename new to MsgUpdatePoolCommission @@ -117,29 +110,3 @@ message MsgUpdateParams { // MsgUpdateParamsResponse defines the Msg/UpdateParams response type. message MsgUpdateParamsResponse {} - -// MsgEnableMultiCoinReward enables multi-coin rewards for the sender address -// and claims all current pending rewards. -message MsgToggleMultiCoinRewards { - option (cosmos.msg.v1.signer) = "creator"; - // creator ... - string creator = 1; - // enabled ... - bool enabled = 2; -} - -// MsgEnableMultiCoinRewardResponse ... -message MsgToggleMultiCoinRewardsResponse {} - -// MsgEnableMultiCoinReward enables multi-coin rewards for the sender address -// and claims all current pending rewards. -message MsgSetMultiCoinRewardsRefundPolicy { - option (cosmos.msg.v1.signer) = "creator"; - // creator ... - string creator = 1; - // policy ... - kyve.stakers.v1beta1.MultiCoinRefundPolicy policy = 2; -} - -// MsgEnableMultiCoinRewardResponse ... -message MsgSetMultiCoinRewardsRefundPolicyResponse {} diff --git a/testutil/integration/integration.go b/testutil/integration/integration.go index 4a35c2cd..80c53a28 100644 --- a/testutil/integration/integration.go +++ b/testutil/integration/integration.go @@ -230,6 +230,7 @@ type TestValidatorAddress struct { PrivateKey *ed25519.PrivKey Address string + ValAddress string AccAddress sdk.AccAddress ConsAccAddress sdk.ConsAddress ConsAddress string @@ -412,6 +413,7 @@ func GenerateTestValidatorAddress(moniker string) TestValidatorAddress { a.AccAddress = sdk.AccAddress(a.PrivateKey.PubKey().Address()) bech32Address, _ := sdk.Bech32ifyAddressBytes("kyve", a.AccAddress) a.Address = bech32Address + a.ValAddress = util.MustValaddressFromOperatorAddress(a.Address) a.ConsAccAddress = sdk.ConsAddress(a.PrivateKey.PubKey().Address()) bech32ConsAddress, _ := sdk.Bech32ifyAddressBytes("kyvevalcons", a.AccAddress) diff --git a/x/compliance/client/cli/query.go b/x/compliance/client/cli/query.go new file mode 100644 index 00000000..7cfe28cf --- /dev/null +++ b/x/compliance/client/cli/query.go @@ -0,0 +1,32 @@ +package cli + +import ( + "fmt" + + "github.com/KYVENetwork/chain/x/compliance/types" + + // "strings" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + // sdk "github.com/cosmos/cosmos-sdk/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group stakers queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdQueryParams()) + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/compliance/client/cli/query_params.go b/x/compliance/client/cli/query_params.go new file mode 100644 index 00000000..4e20f559 --- /dev/null +++ b/x/compliance/client/cli/query_params.go @@ -0,0 +1,35 @@ +package cli + +import ( + "context" + + "github.com/KYVENetwork/chain/x/compliance/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +func CmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "shows the parameters of the module", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/compliance/client/cli/tx.go b/x/compliance/client/cli/tx.go new file mode 100644 index 00000000..77c50f6d --- /dev/null +++ b/x/compliance/client/cli/tx.go @@ -0,0 +1,27 @@ +package cli + +import ( + "fmt" + + "github.com/KYVENetwork/chain/x/compliance/types" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdToggleMultiCoinRewards()) + cmd.AddCommand(CmdSetMultiCoinRefundPolicy()) + + return cmd +} diff --git a/x/stakers/client/cli/tx_set_multi_coin_refund_policy.go b/x/compliance/client/cli/tx_set_multi_coin_refund_policy.go similarity index 95% rename from x/stakers/client/cli/tx_set_multi_coin_refund_policy.go rename to x/compliance/client/cli/tx_set_multi_coin_refund_policy.go index ee1aa883..15757914 100644 --- a/x/stakers/client/cli/tx_set_multi_coin_refund_policy.go +++ b/x/compliance/client/cli/tx_set_multi_coin_refund_policy.go @@ -4,7 +4,8 @@ import ( "encoding/json" "os" - "github.com/KYVENetwork/chain/x/stakers/types" + "github.com/KYVENetwork/chain/x/compliance/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" diff --git a/x/stakers/client/cli/tx_toggle_multi_coin_rewards.go b/x/compliance/client/cli/tx_toggle_multi_coin_rewards.go similarity index 94% rename from x/stakers/client/cli/tx_toggle_multi_coin_rewards.go rename to x/compliance/client/cli/tx_toggle_multi_coin_rewards.go index c14dbe6c..0d8bb12e 100644 --- a/x/stakers/client/cli/tx_toggle_multi_coin_rewards.go +++ b/x/compliance/client/cli/tx_toggle_multi_coin_rewards.go @@ -3,7 +3,8 @@ package cli import ( "fmt" - "github.com/KYVENetwork/chain/x/stakers/types" + "github.com/KYVENetwork/chain/x/compliance/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" diff --git a/x/compliance/genesis.go b/x/compliance/genesis.go new file mode 100644 index 00000000..8e956fe4 --- /dev/null +++ b/x/compliance/genesis.go @@ -0,0 +1,43 @@ +package compliance + +import ( + "github.com/KYVENetwork/chain/x/compliance/keeper" + "github.com/KYVENetwork/chain/x/compliance/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the capability module's state from a provided genesis +// state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + k.SetParams(ctx, genState.Params) + + for _, entry := range genState.MultiCoinPendingRewardsEntries { + k.SetMultiCoinPendingRewardsEntry(ctx, entry) + } + + for _, entry := range genState.MultiCoinEnabled { + err := k.MultiCoinRewardsEnabled.Set(ctx, sdk.MustAccAddressFromBech32(entry)) + if err != nil { + panic(err) + } + } + + k.SetQueueState(ctx, types.QUEUE_IDENTIFIER_MULTI_COIN_REWARDS, genState.QueueStatePendingRewards) +} + +// ExportGenesis returns the capability module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + genesis.MultiCoinPendingRewardsEntries = k.GetAllMultiCoinPendingRewardsEntries(ctx) + + genesis.QueueStatePendingRewards = k.GetQueueState(ctx, types.QUEUE_IDENTIFIER_MULTI_COIN_REWARDS) + + policy, _ := k.MultiCoinRefundPolicy.Get(ctx) + genesis.MultiCoinRefundPolicy = &policy + + genesis.MultiCoinEnabled = k.GetAllEnabledMultiCoinAddresses(ctx) + + return genesis +} diff --git a/x/stakers/keeper/getters_compliance.go b/x/compliance/keeper/getters_compliance.go similarity index 94% rename from x/stakers/keeper/getters_compliance.go rename to x/compliance/keeper/getters_compliance.go index 38474852..c86c21a8 100644 --- a/x/stakers/keeper/getters_compliance.go +++ b/x/compliance/keeper/getters_compliance.go @@ -4,7 +4,7 @@ import ( "cosmossdk.io/store/prefix" storeTypes "cosmossdk.io/store/types" "github.com/KYVENetwork/chain/util" - "github.com/KYVENetwork/chain/x/stakers/types" + "github.com/KYVENetwork/chain/x/compliance/types" "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -33,7 +33,7 @@ func (k Keeper) SetMultiCoinPendingRewardsEntry(ctx sdk.Context, compliancePendi // GetMultiCoinPendingRewardsEntry ... func (k Keeper) GetMultiCoinPendingRewardsEntry(ctx sdk.Context, index uint64) (val types.MultiCoinPendingRewardsEntry, found bool) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - store := prefix.NewStore(storeAdapter, types.CommissionChangeEntryKeyPrefix) + store := prefix.NewStore(storeAdapter, types.MultiCoinPendingRewardsEntryKeyPrefix) b := store.Get(types.MultiCoinPendingRewardsKeyEntry(index)) if b == nil { @@ -54,6 +54,9 @@ func (k Keeper) GetMultiCoinPendingRewardsEntriesByIndex2(ctx sdk.Context, addre for ; iterator.Valid(); iterator.Next() { var val types.MultiCoinPendingRewardsEntry + println("key") + println(string(iterator.Key())) + println(string(iterator.Value())) k.cdc.MustUnmarshal(iterator.Value(), &val) list = append(list, val) } diff --git a/x/compliance/keeper/getters_params.go b/x/compliance/keeper/getters_params.go new file mode 100644 index 00000000..a875bf3f --- /dev/null +++ b/x/compliance/keeper/getters_params.go @@ -0,0 +1,38 @@ +package keeper + +import ( + "github.com/KYVENetwork/chain/x/compliance/types" + "github.com/cosmos/cosmos-sdk/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// GetParams returns the current x/compliance module parameters. +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + + bz := store.Get(types.ParamsKey) + if bz == nil { + return params + } + + k.cdc.MustUnmarshal(bz, ¶ms) + return params +} + +// GetMultiCoinRefundPendingTime returns the MultiCoinRefundPendingTime param +func (k Keeper) GetMultiCoinRefundPendingTime(ctx sdk.Context) (res uint64) { + return k.GetParams(ctx).MultiCoinRefundPendingTime +} + +// GetMultiCoinRefundPolicyAdminAddress returns the admin address which is allowed to update the coin weights +// refund policy +func (k Keeper) GetMultiCoinRefundPolicyAdminAddress(ctx sdk.Context) (res string) { + return k.GetParams(ctx).MultiCoinRefundPolicyAdminAddress +} + +// SetParams sets the x/compliance module parameters. +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + bz := k.cdc.MustMarshal(¶ms) + store.Set(types.ParamsKey, bz) +} diff --git a/x/compliance/keeper/getters_queue.go b/x/compliance/keeper/getters_queue.go new file mode 100644 index 00000000..1fd57855 --- /dev/null +++ b/x/compliance/keeper/getters_queue.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "github.com/KYVENetwork/chain/x/compliance/types" + "github.com/cosmos/cosmos-sdk/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// GetQueueState returns a queue state object based on the identifier as +// there are multiple queues present in the stakers module +func (k Keeper) GetQueueState(ctx sdk.Context, identifier types.QUEUE_IDENTIFIER) (state types.QueueState) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + b := store.Get(identifier) + + if b == nil { + return state + } + + k.cdc.MustUnmarshal(b, &state) + return +} + +// SetQueueState sets a endBlocker queue state based on the identifier. +// The identifier is used to distinguish between different queues. +func (k Keeper) SetQueueState(ctx sdk.Context, identifier types.QUEUE_IDENTIFIER, state types.QueueState) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + b := k.cdc.MustMarshal(&state) + store.Set(identifier, b) +} diff --git a/x/compliance/keeper/grpc_query.go b/x/compliance/keeper/grpc_query.go new file mode 100644 index 00000000..ae02dc84 --- /dev/null +++ b/x/compliance/keeper/grpc_query.go @@ -0,0 +1,55 @@ +package keeper + +import ( + "context" + + "github.com/KYVENetwork/chain/x/compliance/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +var _ types.QueryServer = Keeper{} + +func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} + +func (k Keeper) MultiCoinRefundPolicyQuery(ctx context.Context, request *types.QueryMultiCoinRefundPolicyRequest) (*types.QueryMultiCoinRefundPolicyResponse, error) { + policy, err := k.MultiCoinRefundPolicy.Get(ctx) + if err != nil { + return nil, err + } + return &types.QueryMultiCoinRefundPolicyResponse{Policy: policy}, err +} + +func (k Keeper) MultiCoinStatus(ctx context.Context, request *types.QueryMultiCoinStatusRequest) (*types.QueryMultiCoinStatusResponse, error) { + account, err := sdk.AccAddressFromBech32(request.Address) + if err != nil { + return nil, err + } + + has, err := k.MultiCoinRewardsEnabled.Has(ctx, account) + if err != nil { + return nil, err + } + + entries, _ := k.GetMultiCoinPendingRewardsEntriesByIndex2(sdk.UnwrapSDKContext(ctx), request.Address) + + pendingRewards := sdk.NewCoins() + + for _, entry := range entries { + pendingRewards = pendingRewards.Add(entry.Rewards...) + } + + return &types.QueryMultiCoinStatusResponse{ + Enabled: has, + PendingMultiCoinRewards: pendingRewards, + }, nil +} diff --git a/x/compliance/keeper/keeper.go b/x/compliance/keeper/keeper.go new file mode 100644 index 00000000..7558ea63 --- /dev/null +++ b/x/compliance/keeper/keeper.go @@ -0,0 +1,83 @@ +package keeper + +import ( + "fmt" + + "cosmossdk.io/collections" + + "github.com/KYVENetwork/chain/x/compliance/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "cosmossdk.io/core/store" + + "cosmossdk.io/log" + "github.com/KYVENetwork/chain/util" + "github.com/cosmos/cosmos-sdk/codec" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeService store.KVStoreService + memService store.MemoryStoreService + logger log.Logger + + authority string + + accountKeeper util.AccountKeeper + bankKeeper util.BankKeeper + poolKeeper types.PoolKeeper + + MultiCoinRewardsEnabled collections.KeySet[sdk.AccAddress] + MultiCoinRefundPolicy collections.Item[types.MultiCoinRefundPolicy] + + Schema collections.Schema + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeService store.KVStoreService, + memService store.MemoryStoreService, + logger log.Logger, + + authority string, + + accountKeeper util.AccountKeeper, + bankKeeper util.BankKeeper, + poolKeeper types.PoolKeeper, +) Keeper { + sb := collections.NewSchemaBuilder(storeService) + + k := Keeper{ + cdc: cdc, + storeService: storeService, + memService: memService, + logger: logger, + + authority: authority, + + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + poolKeeper: poolKeeper, + + MultiCoinRewardsEnabled: collections.NewKeySet(sb, types.MultiCoinRewardsEnabledKeyPrefix, + "compliance_multi_coin_enabled", sdk.AccAddressKey), + MultiCoinRefundPolicy: collections.NewItem(sb, types.MultiCoinRefundPolicyKeyPrefix, + "compliance_multi_coin_policy", codec.CollValue[types.MultiCoinRefundPolicy](cdc)), + } + + schema, err := sb.Build() + if err != nil { + panic(err) + } + + k.Schema = schema + + return k +} + +func (k Keeper) Logger() log.Logger { + return k.logger.With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} diff --git a/x/compliance/keeper/keeper_suite_test.go b/x/compliance/keeper/keeper_suite_test.go new file mode 100644 index 00000000..e5aa38db --- /dev/null +++ b/x/compliance/keeper/keeper_suite_test.go @@ -0,0 +1,31 @@ +package keeper_test + +import ( + "fmt" + "testing" + + i "github.com/KYVENetwork/chain/testutil/integration" + sdk "github.com/cosmos/cosmos-sdk/types" + mintTypes "github.com/cosmos/cosmos-sdk/x/mint/types" + + "github.com/KYVENetwork/chain/x/compliance/types" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestStakersKeeper(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, fmt.Sprintf("x/%s Keeper Test Suite", types.ModuleName)) +} + +func payoutRewards(s *i.KeeperTestSuite, staker string, coins sdk.Coins) { + err := s.App().BankKeeper.MintCoins(s.Ctx(), mintTypes.ModuleName, coins) + if err != nil { + panic(err) + } + err = s.App().StakersKeeper.PayoutRewards(s.Ctx(), staker, coins, mintTypes.ModuleName) + if err != nil { + panic(err) + } +} diff --git a/x/stakers/keeper/logic_compliance.go b/x/compliance/keeper/logic_compliance.go similarity index 91% rename from x/stakers/keeper/logic_compliance.go rename to x/compliance/keeper/logic_compliance.go index 8d620e4d..dc892973 100644 --- a/x/stakers/keeper/logic_compliance.go +++ b/x/compliance/keeper/logic_compliance.go @@ -4,20 +4,22 @@ import ( "context" "sort" + "github.com/KYVENetwork/chain/x/compliance/types" + globalTypes "github.com/KYVENetwork/chain/x/global/types" - "github.com/KYVENetwork/chain/x/stakers/types" sdk "github.com/cosmos/cosmos-sdk/types" distributionTypes "github.com/cosmos/cosmos-sdk/x/distribution/types" ) func (k Keeper) addPendingComplianceRewards(ctx sdk.Context, address string, rewards sdk.Coins) { - queueIndex := k.getNextQueueSlot(ctx, types.QUEUE_IDENTIFIER_LEAVE) + queueIndex := k.getNextQueueSlot(ctx, types.QUEUE_IDENTIFIER_MULTI_COIN_REWARDS) compliancePendingEntry := types.MultiCoinPendingRewardsEntry{ - Index: queueIndex, - Address: address, - Rewards: rewards, + Index: queueIndex, + Address: address, + Rewards: rewards, + CreationDate: ctx.BlockTime().Unix(), } k.SetMultiCoinPendingRewardsEntry(ctx, compliancePendingEntry) @@ -134,7 +136,9 @@ func (k Keeper) HandleMultiCoinRewards(goCtx context.Context, withdrawAddress sd panic(err) } // Add Pending-Queue entry - k.addPendingComplianceRewards(ctx, withdrawAddress.String(), nonCompliantRewards) + if !nonCompliantRewards.Empty() { + k.addPendingComplianceRewards(ctx, withdrawAddress.String(), nonCompliantRewards) + } return compliantRewards } diff --git a/x/compliance/keeper/logic_queue.go b/x/compliance/keeper/logic_queue.go new file mode 100644 index 00000000..7549a688 --- /dev/null +++ b/x/compliance/keeper/logic_queue.go @@ -0,0 +1,45 @@ +package keeper + +import ( + "github.com/KYVENetwork/chain/x/compliance/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// getNextQueueSlot inserts an entry into the queue identified by `identifier` +// It automatically updates the queue state and uses the block time. +func (k Keeper) getNextQueueSlot(ctx sdk.Context, identifier types.QUEUE_IDENTIFIER) (index uint64) { + // unbondingState stores the start and the end of the queue with all unbonding entries + // the queue is ordered by time + queueState := k.GetQueueState(ctx, identifier) + + // Increase topIndex as a new entry is about to be appended + queueState.HighIndex += 1 + + k.SetQueueState(ctx, identifier, queueState) + + return queueState.HighIndex +} + +// processQueue passes the tail of the queue to the `processEntry(...)`-function +// The processing continues as long as the function returns true. +func (k Keeper) processQueue(ctx sdk.Context, identifier types.QUEUE_IDENTIFIER, processEntry func(index uint64) bool) { + // Get Queue information + queueState := k.GetQueueState(ctx, identifier) + + // flag for computing every entry at the end of the queue which is due. + // start processing the end of the queue + for commissionChangePerformed := true; commissionChangePerformed; { + commissionChangePerformed = false + + entryRemoved := processEntry(queueState.LowIndex + 1) + + if entryRemoved { + if queueState.LowIndex < queueState.HighIndex { + queueState.LowIndex += 1 + commissionChangePerformed = true + } + } + + } + k.SetQueueState(ctx, identifier, queueState) +} diff --git a/x/compliance/keeper/msg_server.go b/x/compliance/keeper/msg_server.go new file mode 100644 index 00000000..657d3127 --- /dev/null +++ b/x/compliance/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/KYVENetwork/chain/x/compliance/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} diff --git a/x/stakers/keeper/msg_server_compliance.go b/x/compliance/keeper/msg_server_compliance.go similarity index 97% rename from x/stakers/keeper/msg_server_compliance.go rename to x/compliance/keeper/msg_server_compliance.go index 22aee274..1bff31d1 100644 --- a/x/stakers/keeper/msg_server_compliance.go +++ b/x/compliance/keeper/msg_server_compliance.go @@ -4,7 +4,7 @@ import ( "context" "cosmossdk.io/errors" - "github.com/KYVENetwork/chain/x/stakers/types" + "github.com/KYVENetwork/chain/x/compliance/types" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/compliance/keeper/msg_server_compliance_test.go b/x/compliance/keeper/msg_server_compliance_test.go new file mode 100644 index 00000000..d8e56581 --- /dev/null +++ b/x/compliance/keeper/msg_server_compliance_test.go @@ -0,0 +1,221 @@ +package keeper_test + +import ( + "cosmossdk.io/math" + compliancetypes "github.com/KYVENetwork/chain/x/compliance/types" + distributionTypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + i "github.com/KYVENetwork/chain/testutil/integration" + pooltypes "github.com/KYVENetwork/chain/x/pool/types" +) + +/* + +TEST CASES - msg_server_leave_pool.go + +* MultiCoin disabled, Only native rewards +* MultiCoin disabled, Only foreign rewards +* MultiCoin disabled, Mixed rewards +* MultiCoin enabled, Only native rewards +* MultiCoin enabled, Only foreign rewards +* MultiCoin enabled, Mixed rewards +* Claim During period +* Claim after period +* Check redistribution +* Check redistribution by weights + +*/ + +var _ = Describe("msg_server_compliance_test.go", Ordered, func() { + var s *i.KeeperTestSuite + var gov string + var validator1 i.TestValidatorAddress + + BeforeEach(func() { + // init new clean chain + s = i.NewCleanChain() + gov = s.App().GovKeeper.GetGovernanceAccount(s.Ctx()).GetAddress().String() + + // create pool + msg := &pooltypes.MsgCreatePool{ + Authority: gov, + UploadInterval: 60, + MaxBundleSize: 100, + InflationShareWeight: math.LegacyZeroDec(), + Binaries: "{}", + } + s.RunTxPoolSuccess(msg) + + // create staker + validator1 = s.CreateNewValidator("MyValidator-1", 1000*i.KYVE) + }) + + AfterEach(func() { + s.PerformValidityChecks() + }) + + It("MultiCoin disabled, Only native rewards", func() { + // Arrange + payoutRewards(s, validator1.Address, i.KYVECoins(100*i.T_KYVE)) + + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9000000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName)).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address).String()).To(Equal("100000000tkyve")) + + // ACT + s.RunTxSuccess(&distributionTypes.MsgWithdrawDelegatorReward{ + DelegatorAddress: validator1.Address, + ValidatorAddress: validator1.ValAddress, + }) + + // ASSERT + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9100000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName).String()).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address)).To(BeEmpty()) + }) + + It("MultiCoin disabled, Only foreign rewards", func() { + // Arrange + payoutRewards(s, validator1.Address, i.ACoins(100)) + payoutRewards(s, validator1.Address, i.BCoins(50)) + + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9000000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName)).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address).String()).To(Equal("100acoin,50bcoin")) + + // ACT + s.RunTxSuccess(&distributionTypes.MsgWithdrawDelegatorReward{ + DelegatorAddress: validator1.Address, + ValidatorAddress: validator1.ValAddress, + }) + + // ASSERT + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9000000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName).String()).To(Equal("100acoin,50bcoin")) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address)).To(BeEmpty()) + }) + + It("MultiCoin disabled, Mixed rewards", func() { + // Arrange + payoutRewards(s, validator1.Address, i.KYVECoins(200*i.T_KYVE)) + payoutRewards(s, validator1.Address, i.ACoins(100)) + payoutRewards(s, validator1.Address, i.BCoins(50)) + + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9000000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName)).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address).String()).To(Equal("100acoin,50bcoin,200000000tkyve")) + + // ACT + s.RunTxSuccess(&distributionTypes.MsgWithdrawDelegatorReward{ + DelegatorAddress: validator1.Address, + ValidatorAddress: validator1.ValAddress, + }) + + // ASSERT + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9200000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName).String()).To(Equal("100acoin,50bcoin")) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address)).To(BeEmpty()) + }) + + It("MultiCoin enabled, Only native rewards", func() { + // Arrange + _ = s.App().ComplianceKeeper.MultiCoinRewardsEnabled.Set(s.Ctx(), validator1.AccAddress) + payoutRewards(s, validator1.Address, i.KYVECoins(100*i.T_KYVE)) + + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9000000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName)).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address).String()).To(Equal("100000000tkyve")) + + // ACT + s.RunTxSuccess(&distributionTypes.MsgWithdrawDelegatorReward{ + DelegatorAddress: validator1.Address, + ValidatorAddress: validator1.ValAddress, + }) + + // ASSERT + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9100000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName).String()).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address)).To(BeEmpty()) + }) + + It("MultiCoin enabled, Only foreign rewards", func() { + // Arrange + _ = s.App().ComplianceKeeper.MultiCoinRewardsEnabled.Set(s.Ctx(), validator1.AccAddress) + payoutRewards(s, validator1.Address, i.ACoins(100)) + payoutRewards(s, validator1.Address, i.BCoins(50)) + + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9000000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName)).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address).String()).To(Equal("100acoin,50bcoin")) + + // ACT + s.RunTxSuccess(&distributionTypes.MsgWithdrawDelegatorReward{ + DelegatorAddress: validator1.Address, + ValidatorAddress: validator1.ValAddress, + }) + + // ASSERT + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000100acoin,10000000050bcoin,10000000000ccoin,9000000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName).String()).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address)).To(BeEmpty()) + }) + + It("MultiCoin enabled, Mixed rewards", func() { + // Arrange + _ = s.App().ComplianceKeeper.MultiCoinRewardsEnabled.Set(s.Ctx(), validator1.AccAddress) + payoutRewards(s, validator1.Address, i.KYVECoins(200*i.T_KYVE)) + payoutRewards(s, validator1.Address, i.ACoins(100)) + payoutRewards(s, validator1.Address, i.BCoins(50)) + + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9000000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName)).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address).String()).To(Equal("100acoin,50bcoin,200000000tkyve")) + + // ACT + s.RunTxSuccess(&distributionTypes.MsgWithdrawDelegatorReward{ + DelegatorAddress: validator1.Address, + ValidatorAddress: validator1.ValAddress, + }) + + // ASSERT + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000100acoin,10000000050bcoin,10000000000ccoin,9200000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName).String()).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address)).To(BeEmpty()) + }) + + It("MultiCoin claim pending rewards", func() { + // Arrange + payoutRewards(s, validator1.Address, i.KYVECoins(200*i.T_KYVE)) + payoutRewards(s, validator1.Address, i.ACoins(100)) + payoutRewards(s, validator1.Address, i.BCoins(50)) + + s.RunTxSuccess(&distributionTypes.MsgWithdrawDelegatorReward{ + DelegatorAddress: validator1.Address, + ValidatorAddress: validator1.ValAddress, + }) + + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000000acoin,10000000000bcoin,10000000000ccoin,9200000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName).String()).To(Equal("100acoin,50bcoin")) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address)).To(BeEmpty()) + + r := s.App().ComplianceKeeper.GetAllMultiCoinPendingRewardsEntries(s.Ctx()) + _ = r + s.CommitAfterSeconds(10) + p := s.App().ComplianceKeeper.GetParams(s.Ctx()) + _ = p + + // ACT + + s.RunTxSuccess(&compliancetypes.MsgToggleMultiCoinRewards{ + Creator: validator1.Address, + Enabled: true, + }) + + // ASSERT + Expect(s.App().BankKeeper.GetAllBalances(s.Ctx(), validator1.AccAddress).String()).To(Equal("10000000100acoin,10000000050bcoin,10000000000ccoin,9200000000tkyve")) + Expect(s.GetCoinsFromModule(compliancetypes.ModuleName).String()).To(BeEmpty()) + Expect(s.App().StakersKeeper.GetOutstandingRewards(s.Ctx(), validator1.Address, validator1.Address)).To(BeEmpty()) + }) +}) diff --git a/x/compliance/keeper/msg_server_update_params.go b/x/compliance/keeper/msg_server_update_params.go new file mode 100644 index 00000000..5b56e28e --- /dev/null +++ b/x/compliance/keeper/msg_server_update_params.go @@ -0,0 +1,35 @@ +package keeper + +import ( + "context" + "encoding/json" + + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + // Gov + govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" + // Stakers + "github.com/KYVENetwork/chain/x/compliance/types" +) + +func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if k.authority != msg.Authority { + return nil, errors.Wrapf(govTypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.authority, msg.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + oldParams := k.GetParams(ctx) + + newParams := oldParams + _ = json.Unmarshal([]byte(msg.Payload), &newParams) + k.SetParams(ctx, newParams) + + _ = ctx.EventManager().EmitTypedEvent(&types.EventUpdateParams{ + OldParams: oldParams, + NewParams: newParams, + Payload: msg.Payload, + }) + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/compliance/module.go b/x/compliance/module.go new file mode 100644 index 00000000..4de8fd05 --- /dev/null +++ b/x/compliance/module.go @@ -0,0 +1,223 @@ +package compliance + +import ( + "context" + "encoding/json" + "fmt" + + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + + "github.com/KYVENetwork/chain/util" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + // this line is used by starport scaffolding # 1 + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + modulev1 "github.com/KYVENetwork/chain/api/kyve/compliance/module" + "github.com/KYVENetwork/chain/x/compliance/client/cli" + "github.com/KYVENetwork/chain/x/compliance/keeper" + "github.com/KYVENetwork/chain/x/compliance/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" +) + +var ( + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface that defines the independent methods a Cosmos SDK module needs to implement. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the name of the module as a string +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the amino codec for the module, which is used to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(cdc) +} + +// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. The default GenesisState need to be defined by the module developer and is primarily used for testing +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + _ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) +} + +// GetTxCmd returns the root Tx command for the module. The subcommands of this root command are used by end-users to generate new transactions containing messages defined in the module +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the root query command for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + } +} + +// Deprecated: use RegisterServices +func (AppModule) QuerierRoute() string { return types.RouterKey } + +// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the module's genesis initialization. It returns no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) +} + +// ExportGenesis returns the module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1 +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock contains the logic that is automatically triggered at the beginning of each block +func (am AppModule) BeginBlock(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + am.keeper.ProcessComplianceQueue(sdkCtx) + + // Only execute every 50 blocks + if sdkCtx.BlockHeight()%50 != 0 { + _ = am.keeper.DistributeNonClaimedRewards(sdkCtx) + } + + return nil +} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// ---------------------------------------------------------------------------- +// App Wiring Setup +// ---------------------------------------------------------------------------- + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + Cdc codec.Codec + Config *modulev1.Module + StoreService store.KVStoreService + MemService store.MemoryStoreService + Logger log.Logger + + AccountKeeper util.AccountKeeper + BankKeeper util.BankKeeper + PoolKeeper types.PoolKeeper +} + +type ModuleOutputs struct { + depinject.Out + + ComplianceKeeper 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) + } + k := keeper.NewKeeper( + in.Cdc, + in.StoreService, + in.MemService, + in.Logger, + authority.String(), + in.AccountKeeper, + in.BankKeeper, + in.PoolKeeper, + ) + m := NewAppModule( + in.Cdc, + k, + ) + + return ModuleOutputs{ComplianceKeeper: k, Module: m} +} diff --git a/x/compliance/types/codec.go b/x/compliance/types/codec.go new file mode 100644 index 00000000..1471bd5e --- /dev/null +++ b/x/compliance/types/codec.go @@ -0,0 +1,28 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codecTypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptoCodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgUpdateParams{}, "kyve/compliance/MsgUpdateParams", nil) + cdc.RegisterConcrete(&MsgToggleMultiCoinRewards{}, "kyve/compliance/MsgToggleMultiCoinRewards", nil) + cdc.RegisterConcrete(&MsgSetMultiCoinRewardsRefundPolicy{}, "kyve/compliance/MsgSetMultiCoinRewardsRefundPolicy", nil) +} + +func RegisterInterfaces(registry codecTypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}) + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgToggleMultiCoinRewards{}) + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSetMultiCoinRewardsRefundPolicy{}) +} + +var Amino = codec.NewLegacyAmino() + +func init() { + RegisterLegacyAminoCodec(Amino) + cryptoCodec.RegisterCrypto(Amino) + sdk.RegisterLegacyAminoCodec(Amino) +} diff --git a/x/compliance/types/errors.go b/x/compliance/types/errors.go new file mode 100644 index 00000000..57fc9c42 --- /dev/null +++ b/x/compliance/types/errors.go @@ -0,0 +1,13 @@ +package types + +import ( + "cosmossdk.io/errors" +) + +// staking errors +var ( + ErrMultiCoinRefundPolicyInvalidAdminAddress = errors.Register(ModuleName, 1122, "multi coin refund policy admin address invalid") + ErrMultiCoinRefundPolicyInvalid = errors.Register(ModuleName, 1123, "multi coin refund policy invalid") + ErrMultiCoinRewardsAlreadyEnabled = errors.Register(ModuleName, 1124, "multi coin rewards already enabled") + ErrMultiCoinRewardsAlreadyDisabled = errors.Register(ModuleName, 1125, "multi coin rewards already disabled") +) diff --git a/x/compliance/types/events.pb.go b/x/compliance/types/events.pb.go new file mode 100644 index 00000000..48affa6a --- /dev/null +++ b/x/compliance/types/events.pb.go @@ -0,0 +1,434 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kyve/compliance/v1beta1/events.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 + +// EventUpdateParams is an event emitted when the module parameters are updated. +// emitted_by: MsgUpdateParams +type EventUpdateParams struct { + // old_params is the module's old parameters. + OldParams Params `protobuf:"bytes,1,opt,name=old_params,json=oldParams,proto3" json:"old_params"` + // new_params is the module's new parameters. + NewParams Params `protobuf:"bytes,2,opt,name=new_params,json=newParams,proto3" json:"new_params"` + // payload is the parameter updates that were performed. + Payload string `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (m *EventUpdateParams) Reset() { *m = EventUpdateParams{} } +func (m *EventUpdateParams) String() string { return proto.CompactTextString(m) } +func (*EventUpdateParams) ProtoMessage() {} +func (*EventUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_88878326664404ad, []int{0} +} +func (m *EventUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateParams.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 *EventUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateParams.Merge(m, src) +} +func (m *EventUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateParams proto.InternalMessageInfo + +func (m *EventUpdateParams) GetOldParams() Params { + if m != nil { + return m.OldParams + } + return Params{} +} + +func (m *EventUpdateParams) GetNewParams() Params { + if m != nil { + return m.NewParams + } + return Params{} +} + +func (m *EventUpdateParams) GetPayload() string { + if m != nil { + return m.Payload + } + return "" +} + +func init() { + proto.RegisterType((*EventUpdateParams)(nil), "kyve.compliance.v1beta1.EventUpdateParams") +} + +func init() { + proto.RegisterFile("kyve/compliance/v1beta1/events.proto", fileDescriptor_88878326664404ad) +} + +var fileDescriptor_88878326664404ad = []byte{ + // 253 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xc9, 0xae, 0x2c, 0x4b, + 0xd5, 0x4f, 0xce, 0xcf, 0x2d, 0xc8, 0xc9, 0x4c, 0xcc, 0x4b, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, + 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x12, 0x07, 0xa9, 0xd2, 0x43, 0xa8, 0xd2, 0x83, 0xaa, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, + 0x07, 0xab, 0xd1, 0x07, 0xb1, 0x20, 0xca, 0xa5, 0x70, 0x1a, 0x5a, 0x90, 0x58, 0x94, 0x98, 0x0b, + 0x35, 0x54, 0x69, 0x27, 0x23, 0x97, 0xa0, 0x2b, 0xc8, 0x96, 0xd0, 0x82, 0x94, 0xc4, 0x92, 0xd4, + 0x00, 0xb0, 0x9c, 0x90, 0x0b, 0x17, 0x57, 0x7e, 0x4e, 0x4a, 0x3c, 0x44, 0xa5, 0x04, 0xa3, 0x02, + 0xa3, 0x06, 0xb7, 0x91, 0xbc, 0x1e, 0x0e, 0xfb, 0xf5, 0x20, 0x9a, 0x9c, 0x58, 0x4e, 0xdc, 0x93, + 0x67, 0x08, 0xe2, 0xcc, 0xcf, 0x49, 0x41, 0x98, 0x92, 0x97, 0x5a, 0x0e, 0x33, 0x85, 0x89, 0x24, + 0x53, 0xf2, 0x52, 0xcb, 0xa1, 0xa6, 0x48, 0x70, 0xb1, 0x17, 0x24, 0x56, 0xe6, 0xe4, 0x27, 0xa6, + 0x48, 0x30, 0x2b, 0x30, 0x6a, 0x70, 0x06, 0xc1, 0xb8, 0x4e, 0x9e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, + 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, + 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9f, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0x04, 0xb2, 0x46, 0xdf, + 0x3b, 0x32, 0xcc, 0xd5, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x3f, 0x39, 0x23, 0x31, 0x33, + 0x4f, 0xbf, 0x02, 0x39, 0x54, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xa1, 0x61, 0x0c, + 0x08, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xd7, 0x0f, 0xa1, 0x8a, 0x01, 0x00, 0x00, +} + +func (m *EventUpdateParams) 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 *EventUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.NewParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.OldParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.OldParams.Size() + n += 1 + l + sovEvents(uint64(l)) + l = m.NewParams.Size() + n += 1 + l + sovEvents(uint64(l)) + l = len(m.Payload) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventUpdateParams) 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 ErrIntOverflowEvents + } + 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: EventUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OldParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NewParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/compliance/types/expected_keepers.go b/x/compliance/types/expected_keepers.go new file mode 100644 index 00000000..ab86eabb --- /dev/null +++ b/x/compliance/types/expected_keepers.go @@ -0,0 +1,13 @@ +package types + +import ( + "cosmossdk.io/math" + poolTypes "github.com/KYVENetwork/chain/x/pool/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type PoolKeeper interface { + GetMaxVotingPowerPerPool(ctx sdk.Context) (res math.LegacyDec) + AssertPoolExists(ctx sdk.Context, poolId uint64) error + GetPoolWithError(ctx sdk.Context, poolId uint64) (poolTypes.Pool, error) +} diff --git a/x/compliance/types/genesis.go b/x/compliance/types/genesis.go new file mode 100644 index 00000000..9f901fff --- /dev/null +++ b/x/compliance/types/genesis.go @@ -0,0 +1,40 @@ +package types + +import ( + "fmt" +) + +// DefaultGenesis returns the default Capability genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + MultiCoinRefundPolicy: &MultiCoinRefundPolicy{}, + } +} + +// Validate performs basic genesis state validation returning an error upon any failure. +func (gs GenesisState) Validate() error { + // Multi Coin Pending Rewards + multiCoinPendingRewardsMap := make(map[string]struct{}) + + for _, elem := range gs.MultiCoinPendingRewardsEntries { + index := string(MultiCoinPendingRewardsKeyEntry(elem.Index)) + if _, ok := multiCoinPendingRewardsMap[index]; ok { + return fmt.Errorf("duplicated index for multi coin pending rewards entry %v", elem) + } + if elem.Index > gs.QueueStatePendingRewards.HighIndex { + return fmt.Errorf(" multi coin pending rewards entry index too high: %v", elem) + } + if elem.Index < gs.QueueStatePendingRewards.LowIndex { + return fmt.Errorf(" multi coin pending rewards entry index too low: %v", elem) + } + + multiCoinPendingRewardsMap[index] = struct{}{} + } + + if _, err := ParseMultiCoinComplianceMap(*gs.MultiCoinRefundPolicy); err != nil { + return err + } + + return gs.Params.Validate() +} diff --git a/x/compliance/types/genesis.pb.go b/x/compliance/types/genesis.pb.go new file mode 100644 index 00000000..d4be6070 --- /dev/null +++ b/x/compliance/types/genesis.pb.go @@ -0,0 +1,570 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kyve/compliance/v1beta1/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 compliance module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // MultiCoinPendingRewardsEntry ... + MultiCoinPendingRewardsEntries []MultiCoinPendingRewardsEntry `protobuf:"bytes,2,rep,name=multi_coin_pending_rewards_entries,json=multiCoinPendingRewardsEntries,proto3" json:"multi_coin_pending_rewards_entries"` + // queue_state_state_fraction ... + QueueStatePendingRewards QueueState `protobuf:"bytes,3,opt,name=queue_state_pending_rewards,json=queueStatePendingRewards,proto3" json:"queue_state_pending_rewards"` + // multi_coin_enabled ... + MultiCoinEnabled []string `protobuf:"bytes,4,rep,name=multi_coin_enabled,json=multiCoinEnabled,proto3" json:"multi_coin_enabled,omitempty"` + // multi_coin_refund_policy ... + MultiCoinRefundPolicy *MultiCoinRefundPolicy `protobuf:"bytes,5,opt,name=multi_coin_refund_policy,json=multiCoinRefundPolicy,proto3" json:"multi_coin_refund_policy,omitempty"` +} + +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_975566beb6fc9322, []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) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetMultiCoinPendingRewardsEntries() []MultiCoinPendingRewardsEntry { + if m != nil { + return m.MultiCoinPendingRewardsEntries + } + return nil +} + +func (m *GenesisState) GetQueueStatePendingRewards() QueueState { + if m != nil { + return m.QueueStatePendingRewards + } + return QueueState{} +} + +func (m *GenesisState) GetMultiCoinEnabled() []string { + if m != nil { + return m.MultiCoinEnabled + } + return nil +} + +func (m *GenesisState) GetMultiCoinRefundPolicy() *MultiCoinRefundPolicy { + if m != nil { + return m.MultiCoinRefundPolicy + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "kyve.compliance.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("kyve/compliance/v1beta1/genesis.proto", fileDescriptor_975566beb6fc9322) +} + +var fileDescriptor_975566beb6fc9322 = []byte{ + // 390 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcd, 0x6a, 0xdb, 0x40, + 0x10, 0xc7, 0xa5, 0xca, 0x35, 0x54, 0xee, 0xa1, 0x88, 0x96, 0x0a, 0x17, 0x64, 0x63, 0xb7, 0xe0, + 0x43, 0xd1, 0x62, 0x97, 0x1e, 0x7b, 0x71, 0x31, 0xa5, 0x94, 0x06, 0x47, 0x81, 0x40, 0x72, 0x11, + 0x2b, 0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12, 0xad, 0xb8, 0x9e, 0x21, 0x90, 0x1a, 0x33, + 0xfd, 0xcb, 0x22, 0x83, 0x0c, 0xdc, 0xb4, 0xd8, 0xeb, 0x79, 0x13, 0x53, 0x93, 0xdb, 0xf5, 0x6b, + 0x1b, 0x9c, 0x16, 0x5a, 0xf9, 0x25, 0x55, 0x9e, 0xb9, 0x38, 0x4c, 0x9e, 0x06, 0x1a, 0xdf, 0x75, + 0xe3, 0x68, 0x65, 0xa0, 0xd8, 0x8b, 0x20, 0x30, 0x1b, 0x5d, 0x6d, 0xf0, 0xce, 0xf9, 0x70, 0x68, + 0x39, 0x29, 0xe7, 0x46, 0xa8, 0x9b, 0x47, 0x34, 0x87, 0xab, 0x8c, 0x06, 0x6e, 0xc2, 0x22, 0xe2, + 0xe7, 0xe6, 0x5b, 0x59, 0xca, 0x7e, 0xfd, 0x5b, 0x1c, 0x29, 0x9b, 0x4a, 0x95, 0xf3, 0x29, 0x7e, + 0x69, 0x3c, 0xfe, 0xbb, 0xde, 0x59, 0xea, 0x66, 0x67, 0xa9, 0xf7, 0x3b, 0x4b, 0xbd, 0xdd, 0x5b, + 0xca, 0x66, 0x6f, 0x29, 0xdb, 0xbd, 0xa5, 0x5c, 0xa2, 0x90, 0x88, 0x59, 0xe6, 0x15, 0x09, 0xe8, + 0xdf, 0xc5, 0xf9, 0xe4, 0x04, 0xc4, 0x8a, 0xf1, 0x39, 0xf2, 0x67, 0x98, 0x50, 0x74, 0x7d, 0x7c, + 0x33, 0xf2, 0x56, 0xbc, 0xa6, 0x3c, 0x96, 0x1f, 0x0f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x39, + 0x53, 0xd8, 0xcf, 0x02, 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 + if m.MultiCoinRefundPolicy != nil { + { + size, err := m.MultiCoinRefundPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.MultiCoinEnabled) > 0 { + for iNdEx := len(m.MultiCoinEnabled) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.MultiCoinEnabled[iNdEx]) + copy(dAtA[i:], m.MultiCoinEnabled[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.MultiCoinEnabled[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + { + size, err := m.QueueStatePendingRewards.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.MultiCoinPendingRewardsEntries) > 0 { + for iNdEx := len(m.MultiCoinPendingRewardsEntries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MultiCoinPendingRewardsEntries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.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 + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.MultiCoinPendingRewardsEntries) > 0 { + for _, e := range m.MultiCoinPendingRewardsEntries { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = m.QueueStatePendingRewards.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.MultiCoinEnabled) > 0 { + for _, s := range m.MultiCoinEnabled { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.MultiCoinRefundPolicy != nil { + l = m.MultiCoinRefundPolicy.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 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 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MultiCoinPendingRewardsEntries", 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.MultiCoinPendingRewardsEntries = append(m.MultiCoinPendingRewardsEntries, MultiCoinPendingRewardsEntry{}) + if err := m.MultiCoinPendingRewardsEntries[len(m.MultiCoinPendingRewardsEntries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueueStatePendingRewards", 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.QueueStatePendingRewards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MultiCoinEnabled", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MultiCoinEnabled = append(m.MultiCoinEnabled, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MultiCoinRefundPolicy", 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 m.MultiCoinRefundPolicy == nil { + m.MultiCoinRefundPolicy = &MultiCoinRefundPolicy{} + } + if err := m.MultiCoinRefundPolicy.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/compliance/types/keys.go b/x/compliance/types/keys.go new file mode 100644 index 00000000..278fd245 --- /dev/null +++ b/x/compliance/types/keys.go @@ -0,0 +1,45 @@ +package types + +import ( + "github.com/KYVENetwork/chain/util" +) + +const ( + // ModuleName defines the module name + ModuleName = "compliance" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey defines the module's message routing key + RouterKey = ModuleName + + MultiCoinRewardsRedistributionAccountName = "multi_coin_rewards_redistribution" +) + +var ( + // ParamsKey is the prefix for all module params defined in params.proto + ParamsKey = []byte{0x00} + + // MultiCoinPendingRewardsEntryKeyPrefix | + MultiCoinPendingRewardsEntryKeyPrefix = []byte{8, 0} + // MultiCoinPendingRewardsEntryKeyPrefixIndex2 | | + MultiCoinPendingRewardsEntryKeyPrefixIndex2 = []byte{8, 1} + + MultiCoinRewardsEnabledKeyPrefix = []byte{9, 2} + + MultiCoinRefundPolicyKeyPrefix = []byte{9, 3} +) + +// ENUM queue types identifiers +type QUEUE_IDENTIFIER []byte + +var QUEUE_IDENTIFIER_MULTI_COIN_REWARDS QUEUE_IDENTIFIER = []byte{30, 5} + +func MultiCoinPendingRewardsKeyEntry(index uint64) []byte { + return util.GetByteKey(index) +} + +func MultiCoinPendingRewardsKeyEntryIndex2(address string, index uint64) []byte { + return util.GetByteKey(address, index) +} diff --git a/x/stakers/types/message_set_multi_coin_refund_policy.go b/x/compliance/types/message_set_multi_coin_refund_policy.go similarity index 100% rename from x/stakers/types/message_set_multi_coin_refund_policy.go rename to x/compliance/types/message_set_multi_coin_refund_policy.go diff --git a/x/stakers/types/message_toggle_multi_coin_rewards.go b/x/compliance/types/message_toggle_multi_coin_rewards.go similarity index 100% rename from x/stakers/types/message_toggle_multi_coin_rewards.go rename to x/compliance/types/message_toggle_multi_coin_rewards.go diff --git a/x/compliance/types/msgs.go b/x/compliance/types/msgs.go new file mode 100644 index 00000000..e568d11e --- /dev/null +++ b/x/compliance/types/msgs.go @@ -0,0 +1,35 @@ +package types + +import ( + "encoding/json" + + "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (msg *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errors.Wrap(err, "invalid authority address") + } + + params := DefaultParams() + if err := json.Unmarshal([]byte(msg.Payload), ¶ms); err != nil { + return err + } + + if err := params.Validate(); err != nil { + return err + } + + return nil +} diff --git a/x/compliance/types/params.go b/x/compliance/types/params.go new file mode 100644 index 00000000..51ceba20 --- /dev/null +++ b/x/compliance/types/params.go @@ -0,0 +1,37 @@ +package types + +import sdk "github.com/cosmos/cosmos-sdk/types" + +// DefaultMultiCoinRefundPendingTime ... +var DefaultMultiCoinRefundPendingTime = uint64(60 * 60 * 24 * 14) + +// NewParams creates a new Params instance +func NewParams( + multiCoinRefundPendingTime uint64, + multiCoinRefundPolicyAdminAddress string, +) Params { + return Params{ + MultiCoinRefundPendingTime: multiCoinRefundPendingTime, + MultiCoinRefundPolicyAdminAddress: multiCoinRefundPolicyAdminAddress, + } +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams( + DefaultMultiCoinRefundPendingTime, + "", + ) +} + +// Validate validates the set of params +func (p Params) Validate() error { + if p.MultiCoinRefundPolicyAdminAddress != "" { + _, err := sdk.AccAddressFromBech32(p.MultiCoinRefundPolicyAdminAddress) + if err != nil { + return err + } + } + + return nil +} diff --git a/x/compliance/types/params.pb.go b/x/compliance/types/params.pb.go new file mode 100644 index 00000000..e7cfb8f1 --- /dev/null +++ b/x/compliance/types/params.pb.go @@ -0,0 +1,361 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kyve/compliance/v1beta1/params.proto + +package types + +import ( + fmt "fmt" + 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 + +// Params defines the compliance module parameters. +type Params struct { + // multi_coin_compliance_admin_address specifies an address which is allowed to adjust the weights for + // the coin redistribution. This address can now drain coins, but only + MultiCoinRefundPolicyAdminAddress string `protobuf:"bytes,7,opt,name=multi_coin_refund_policy_admin_address,json=multiCoinRefundPolicyAdminAddress,proto3" json:"multi_coin_refund_policy_admin_address,omitempty"` + // multi_coin_refund_pending_time ... + MultiCoinRefundPendingTime uint64 `protobuf:"varint,8,opt,name=multi_coin_refund_pending_time,json=multiCoinRefundPendingTime,proto3" json:"multi_coin_refund_pending_time,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_ccd81e2f97dd7039, []int{0} +} +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) GetMultiCoinRefundPolicyAdminAddress() string { + if m != nil { + return m.MultiCoinRefundPolicyAdminAddress + } + return "" +} + +func (m *Params) GetMultiCoinRefundPendingTime() uint64 { + if m != nil { + return m.MultiCoinRefundPendingTime + } + return 0 +} + +func init() { + proto.RegisterType((*Params)(nil), "kyve.compliance.v1beta1.Params") +} + +func init() { + proto.RegisterFile("kyve/compliance/v1beta1/params.proto", fileDescriptor_ccd81e2f97dd7039) +} + +var fileDescriptor_ccd81e2f97dd7039 = []byte{ + // 252 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xd0, 0x4d, 0x4a, 0xc3, 0x40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0x36, 0x1d, 0x8d, 0x3e, 0x3b, 0x1a, 0x3d, 0xb1, 0x05, + 0xfa, 0x65, 0x9d, 0xf7, 0xb7, 0xd8, 0xcd, 0xe3, 0xc3, 0xd5, 0x2d, 0xf8, 0x17, 0xe3, 0x56, 0xac, + 0x58, 0x0a, 0xd4, 0xec, 0xf5, 0x6f, 0x14, 0xdf, 0x58, 0xa8, 0xf2, 0x41, 0x88, 0x71, 0xf1, 0x1d, + 0x00, 0x00, 0xff, 0xff, 0xe5, 0x62, 0x21, 0x94, 0x34, 0x01, 0x00, 0x00, +} + +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.MultiCoinRefundPendingTime != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MultiCoinRefundPendingTime)) + i-- + dAtA[i] = 0x40 + } + if len(m.MultiCoinRefundPolicyAdminAddress) > 0 { + i -= len(m.MultiCoinRefundPolicyAdminAddress) + copy(dAtA[i:], m.MultiCoinRefundPolicyAdminAddress) + i = encodeVarintParams(dAtA, i, uint64(len(m.MultiCoinRefundPolicyAdminAddress))) + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MultiCoinRefundPolicyAdminAddress) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + if m.MultiCoinRefundPendingTime != 0 { + n += 1 + sovParams(uint64(m.MultiCoinRefundPendingTime)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +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 ErrIntOverflowParams + } + 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 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MultiCoinRefundPolicyAdminAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MultiCoinRefundPolicyAdminAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MultiCoinRefundPendingTime", wireType) + } + m.MultiCoinRefundPendingTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MultiCoinRefundPendingTime |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/compliance/types/query.pb.go b/x/compliance/types/query.pb.go new file mode 100644 index 00000000..bf660f35 --- /dev/null +++ b/x/compliance/types/query.pb.go @@ -0,0 +1,1327 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kyve/compliance/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + 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/tx/amino" + _ "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 + +// QueryParamsRequest is request 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_4bd43aafd00fe18b, []int{0} +} +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 response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + 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_4bd43aafd00fe18b, []int{1} +} +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{} +} + +// QueryMultiCoinRefundPolicyRequest ... +type QueryMultiCoinRefundPolicyRequest struct { +} + +func (m *QueryMultiCoinRefundPolicyRequest) Reset() { *m = QueryMultiCoinRefundPolicyRequest{} } +func (m *QueryMultiCoinRefundPolicyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryMultiCoinRefundPolicyRequest) ProtoMessage() {} +func (*QueryMultiCoinRefundPolicyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4bd43aafd00fe18b, []int{2} +} +func (m *QueryMultiCoinRefundPolicyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMultiCoinRefundPolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMultiCoinRefundPolicyRequest.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 *QueryMultiCoinRefundPolicyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMultiCoinRefundPolicyRequest.Merge(m, src) +} +func (m *QueryMultiCoinRefundPolicyRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryMultiCoinRefundPolicyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMultiCoinRefundPolicyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMultiCoinRefundPolicyRequest proto.InternalMessageInfo + +// QueryMultiCoinRefundPolicyResponse ... +type QueryMultiCoinRefundPolicyResponse struct { + // params holds all the parameters of this module. + Policy MultiCoinRefundPolicy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy"` +} + +func (m *QueryMultiCoinRefundPolicyResponse) Reset() { *m = QueryMultiCoinRefundPolicyResponse{} } +func (m *QueryMultiCoinRefundPolicyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMultiCoinRefundPolicyResponse) ProtoMessage() {} +func (*QueryMultiCoinRefundPolicyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4bd43aafd00fe18b, []int{3} +} +func (m *QueryMultiCoinRefundPolicyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMultiCoinRefundPolicyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMultiCoinRefundPolicyResponse.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 *QueryMultiCoinRefundPolicyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMultiCoinRefundPolicyResponse.Merge(m, src) +} +func (m *QueryMultiCoinRefundPolicyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryMultiCoinRefundPolicyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMultiCoinRefundPolicyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMultiCoinRefundPolicyResponse proto.InternalMessageInfo + +func (m *QueryMultiCoinRefundPolicyResponse) GetPolicy() MultiCoinRefundPolicy { + if m != nil { + return m.Policy + } + return MultiCoinRefundPolicy{} +} + +// QueryMultiCoinRefundPolicyRequest ... +type QueryMultiCoinStatusRequest struct { + // address ... + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryMultiCoinStatusRequest) Reset() { *m = QueryMultiCoinStatusRequest{} } +func (m *QueryMultiCoinStatusRequest) String() string { return proto.CompactTextString(m) } +func (*QueryMultiCoinStatusRequest) ProtoMessage() {} +func (*QueryMultiCoinStatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4bd43aafd00fe18b, []int{4} +} +func (m *QueryMultiCoinStatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMultiCoinStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMultiCoinStatusRequest.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 *QueryMultiCoinStatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMultiCoinStatusRequest.Merge(m, src) +} +func (m *QueryMultiCoinStatusRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryMultiCoinStatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMultiCoinStatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMultiCoinStatusRequest proto.InternalMessageInfo + +func (m *QueryMultiCoinStatusRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// QueryMultiCoinRefundPolicyResponse ... +type QueryMultiCoinStatusResponse struct { + // enabled ... + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + // pending_multi_coin_rewards ... + PendingMultiCoinRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=pending_multi_coin_rewards,json=pendingMultiCoinRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"pending_multi_coin_rewards"` +} + +func (m *QueryMultiCoinStatusResponse) Reset() { *m = QueryMultiCoinStatusResponse{} } +func (m *QueryMultiCoinStatusResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMultiCoinStatusResponse) ProtoMessage() {} +func (*QueryMultiCoinStatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4bd43aafd00fe18b, []int{5} +} +func (m *QueryMultiCoinStatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMultiCoinStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMultiCoinStatusResponse.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 *QueryMultiCoinStatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMultiCoinStatusResponse.Merge(m, src) +} +func (m *QueryMultiCoinStatusResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryMultiCoinStatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMultiCoinStatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMultiCoinStatusResponse proto.InternalMessageInfo + +func (m *QueryMultiCoinStatusResponse) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *QueryMultiCoinStatusResponse) GetPendingMultiCoinRewards() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.PendingMultiCoinRewards + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "kyve.compliance.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "kyve.compliance.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryMultiCoinRefundPolicyRequest)(nil), "kyve.compliance.v1beta1.QueryMultiCoinRefundPolicyRequest") + proto.RegisterType((*QueryMultiCoinRefundPolicyResponse)(nil), "kyve.compliance.v1beta1.QueryMultiCoinRefundPolicyResponse") + proto.RegisterType((*QueryMultiCoinStatusRequest)(nil), "kyve.compliance.v1beta1.QueryMultiCoinStatusRequest") + proto.RegisterType((*QueryMultiCoinStatusResponse)(nil), "kyve.compliance.v1beta1.QueryMultiCoinStatusResponse") +} + +func init() { + proto.RegisterFile("kyve/compliance/v1beta1/query.proto", fileDescriptor_4bd43aafd00fe18b) +} + +var fileDescriptor_4bd43aafd00fe18b = []byte{ + // 588 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4f, 0x6b, 0x13, 0x41, + 0x1c, 0xcd, 0xd4, 0x9a, 0xea, 0xf4, 0x20, 0x8e, 0x85, 0xc6, 0xb5, 0x6c, 0xeb, 0xd6, 0x43, 0xd1, + 0xba, 0x43, 0x62, 0x4b, 0x41, 0xf1, 0x12, 0xf1, 0x20, 0xfe, 0xa1, 0xae, 0x22, 0xe8, 0x25, 0x4c, + 0x76, 0xc7, 0xed, 0x90, 0x64, 0x66, 0xbb, 0x33, 0xdb, 0x1a, 0xc4, 0x8b, 0x17, 0x4f, 0x82, 0xe0, + 0xc9, 0x6f, 0x20, 0x9e, 0xbc, 0xf9, 0x15, 0x02, 0x5e, 0x0a, 0x5e, 0x3c, 0xa9, 0x24, 0x82, 0x5f, + 0x43, 0x66, 0x76, 0xd2, 0x26, 0x36, 0x89, 0xd5, 0x4b, 0x32, 0x7f, 0xde, 0x9b, 0xf7, 0x7e, 0xbf, + 0xdf, 0x63, 0xe1, 0x72, 0xa3, 0xbd, 0x43, 0x71, 0x28, 0x5a, 0x49, 0x93, 0x11, 0x1e, 0x52, 0xbc, + 0x53, 0xae, 0x53, 0x45, 0xca, 0x78, 0x3b, 0xa3, 0x69, 0xdb, 0x4f, 0x52, 0xa1, 0x04, 0x9a, 0xd7, + 0x20, 0xff, 0x00, 0xe4, 0x5b, 0x90, 0x73, 0x9a, 0xb4, 0x18, 0x17, 0xd8, 0xfc, 0xe6, 0x58, 0xc7, + 0x0d, 0x85, 0x6c, 0x09, 0x89, 0xeb, 0x44, 0x1e, 0x3c, 0x16, 0x0a, 0xc6, 0xed, 0xfd, 0x5c, 0x2c, + 0x62, 0x61, 0x96, 0x58, 0xaf, 0xec, 0xe9, 0x42, 0x2c, 0x44, 0xdc, 0xa4, 0x98, 0x24, 0x0c, 0x13, + 0xce, 0x85, 0x22, 0x8a, 0x09, 0x2e, 0xed, 0xed, 0x85, 0x71, 0x26, 0x13, 0x92, 0x92, 0x56, 0x1f, + 0x35, 0xb6, 0x14, 0xd5, 0x4e, 0xa8, 0x05, 0x79, 0x73, 0x10, 0xdd, 0xd7, 0x95, 0x6d, 0x1a, 0x66, + 0x40, 0xb7, 0x33, 0x2a, 0x95, 0xf7, 0x10, 0x9e, 0x19, 0x3a, 0x95, 0x89, 0xe0, 0x92, 0xa2, 0xeb, + 0xb0, 0x98, 0x2b, 0x94, 0xc0, 0x12, 0x58, 0x99, 0xad, 0x2c, 0xfa, 0x63, 0x1a, 0xe1, 0xe7, 0xc4, +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0x41, 0xaf, 0x00, 0x2c, 0xe6, 0xf3, 0x43, 0x97, 0xc6, 0xb6, 0xf5, + 0x70, 0x68, 0x9c, 0xd5, 0xa3, 0x81, 0xf3, 0xce, 0x78, 0xde, 0xcb, 0x2f, 0x3f, 0xdf, 0x4e, 0x2d, + 0x20, 0x07, 0x1f, 0x8e, 0xa9, 0xcd, 0x31, 0xfa, 0x0c, 0xa0, 0x33, 0x72, 0x7e, 0xb9, 0xd1, 0xab, + 0x93, 0x05, 0x27, 0xc5, 0xcc, 0xb9, 0xf6, 0x5f, 0x5c, 0xeb, 0x7d, 0xcd, 0x78, 0xf7, 0xd1, 0xea, + 0x28, 0xef, 0x43, 0xc3, 0xd4, 0xe4, 0x5a, 0x9e, 0x32, 0xf4, 0x09, 0xc0, 0x53, 0x7f, 0xe4, 0x04, + 0xad, 0x1d, 0xd1, 0xc6, 0x50, 0x20, 0x9d, 0xf5, 0x7f, 0x64, 0x59, 0xdb, 0x1b, 0xc6, 0x76, 0x19, + 0xe1, 0xbf, 0xd8, 0x96, 0x86, 0x86, 0x9f, 0xdb, 0x94, 0xbf, 0xa8, 0xde, 0xea, 0x74, 0x5d, 0xb0, + 0xd7, 0x75, 0xc1, 0x8f, 0xae, 0x0b, 0xde, 0xf4, 0xdc, 0xc2, 0x5e, 0xcf, 0x2d, 0x7c, 0xed, 0xb9, + 0x85, 0x27, 0x78, 0x20, 0x7d, 0xb7, 0x1f, 0x3f, 0xba, 0x79, 0x8f, 0xaa, 0x5d, 0x91, 0x36, 0x70, + 0xb8, 0x45, 0x18, 0xc7, 0xcf, 0x06, 0x35, 0x4c, 0x14, 0xeb, 0x45, 0xf3, 0xd9, 0xb9, 0xf2, 0x3b, + 0x00, 0x00, 0xff, 0xff, 0xd9, 0xc7, 0x6d, 0x62, 0x68, 0x05, 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 { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // policy, multi-coin-enabled, multi-coin-status/address: {enabled true false, pending rewards} + MultiCoinRefundPolicyQuery(ctx context.Context, in *QueryMultiCoinRefundPolicyRequest, opts ...grpc.CallOption) (*QueryMultiCoinRefundPolicyResponse, error) + // MultiCoinStatus ... + MultiCoinStatus(ctx context.Context, in *QueryMultiCoinStatusRequest, opts ...grpc.CallOption) (*QueryMultiCoinStatusResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/kyve.compliance.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) MultiCoinRefundPolicyQuery(ctx context.Context, in *QueryMultiCoinRefundPolicyRequest, opts ...grpc.CallOption) (*QueryMultiCoinRefundPolicyResponse, error) { + out := new(QueryMultiCoinRefundPolicyResponse) + err := c.cc.Invoke(ctx, "/kyve.compliance.v1beta1.Query/MultiCoinRefundPolicyQuery", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) MultiCoinStatus(ctx context.Context, in *QueryMultiCoinStatusRequest, opts ...grpc.CallOption) (*QueryMultiCoinStatusResponse, error) { + out := new(QueryMultiCoinStatusResponse) + err := c.cc.Invoke(ctx, "/kyve.compliance.v1beta1.Query/MultiCoinStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // policy, multi-coin-enabled, multi-coin-status/address: {enabled true false, pending rewards} + MultiCoinRefundPolicyQuery(context.Context, *QueryMultiCoinRefundPolicyRequest) (*QueryMultiCoinRefundPolicyResponse, error) + // MultiCoinStatus ... + MultiCoinStatus(context.Context, *QueryMultiCoinStatusRequest) (*QueryMultiCoinStatusResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) MultiCoinRefundPolicyQuery(ctx context.Context, req *QueryMultiCoinRefundPolicyRequest) (*QueryMultiCoinRefundPolicyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MultiCoinRefundPolicyQuery not implemented") +} +func (*UnimplementedQueryServer) MultiCoinStatus(ctx context.Context, req *QueryMultiCoinStatusRequest) (*QueryMultiCoinStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MultiCoinStatus not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/kyve.compliance.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MultiCoinRefundPolicyQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryMultiCoinRefundPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MultiCoinRefundPolicyQuery(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.compliance.v1beta1.Query/MultiCoinRefundPolicyQuery", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MultiCoinRefundPolicyQuery(ctx, req.(*QueryMultiCoinRefundPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_MultiCoinStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryMultiCoinStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MultiCoinStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.compliance.v1beta1.Query/MultiCoinStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MultiCoinStatus(ctx, req.(*QueryMultiCoinStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Query_serviceDesc = _Query_serviceDesc +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "kyve.compliance.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "MultiCoinRefundPolicyQuery", + Handler: _Query_MultiCoinRefundPolicyQuery_Handler, + }, + { + MethodName: "MultiCoinStatus", + Handler: _Query_MultiCoinStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "kyve/compliance/v1beta1/query.proto", +} + +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 (m *QueryMultiCoinRefundPolicyRequest) 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 *QueryMultiCoinRefundPolicyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMultiCoinRefundPolicyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryMultiCoinRefundPolicyResponse) 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 *QueryMultiCoinRefundPolicyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMultiCoinRefundPolicyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Policy.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 *QueryMultiCoinStatusRequest) 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 *QueryMultiCoinStatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMultiCoinStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryMultiCoinStatusResponse) 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 *QueryMultiCoinStatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMultiCoinStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PendingMultiCoinRewards) > 0 { + for iNdEx := len(m.PendingMultiCoinRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PendingMultiCoinRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + 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 *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 (m *QueryMultiCoinRefundPolicyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryMultiCoinRefundPolicyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Policy.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryMultiCoinStatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryMultiCoinStatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Enabled { + n += 2 + } + if len(m.PendingMultiCoinRewards) > 0 { + for _, e := range m.PendingMultiCoinRewards { + l = e.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 *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 (m *QueryMultiCoinRefundPolicyRequest) 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: QueryMultiCoinRefundPolicyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMultiCoinRefundPolicyRequest: 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 *QueryMultiCoinRefundPolicyResponse) 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: QueryMultiCoinRefundPolicyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMultiCoinRefundPolicyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Policy", 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.Policy.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 *QueryMultiCoinStatusRequest) 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: QueryMultiCoinStatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMultiCoinStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryMultiCoinStatusResponse) 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: QueryMultiCoinStatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMultiCoinStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PendingMultiCoinRewards", 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.PendingMultiCoinRewards = append(m.PendingMultiCoinRewards, types.Coin{}) + if err := m.PendingMultiCoinRewards[len(m.PendingMultiCoinRewards)-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 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/compliance/types/query.pb.gw.go b/x/compliance/types/query.pb.gw.go new file mode 100644 index 00000000..b691b774 --- /dev/null +++ b/x/compliance/types/query.pb.gw.go @@ -0,0 +1,319 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: kyve/compliance/v1beta1/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_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 + +} + +func request_Query_MultiCoinRefundPolicyQuery_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMultiCoinRefundPolicyRequest + var metadata runtime.ServerMetadata + + msg, err := client.MultiCoinRefundPolicyQuery(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MultiCoinRefundPolicyQuery_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMultiCoinRefundPolicyRequest + var metadata runtime.ServerMetadata + + msg, err := server.MultiCoinRefundPolicyQuery(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_MultiCoinStatus_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMultiCoinStatusRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := client.MultiCoinStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MultiCoinStatus_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMultiCoinStatusRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := server.MultiCoinStatus(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_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()...) + + }) + + mux.Handle("GET", pattern_Query_MultiCoinRefundPolicyQuery_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_MultiCoinRefundPolicyQuery_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_MultiCoinRefundPolicyQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MultiCoinStatus_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_MultiCoinStatus_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_MultiCoinStatus_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_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()...) + + }) + + mux.Handle("GET", pattern_Query_MultiCoinRefundPolicyQuery_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_MultiCoinRefundPolicyQuery_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_MultiCoinRefundPolicyQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_MultiCoinStatus_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_MultiCoinStatus_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_MultiCoinStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kyve", "compliance", "v1", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MultiCoinRefundPolicyQuery_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kyve", "compliance", "v1", "multi_coin_refund_policy"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_MultiCoinStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"kyve", "compliance", "v1", "multi_coin_status", "address"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_MultiCoinRefundPolicyQuery_0 = runtime.ForwardResponseMessage + + forward_Query_MultiCoinStatus_0 = runtime.ForwardResponseMessage +) diff --git a/x/compliance/types/tx.pb.go b/x/compliance/types/tx.pb.go new file mode 100644 index 00000000..07995961 --- /dev/null +++ b/x/compliance/types/tx.pb.go @@ -0,0 +1,1370 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kyve/compliance/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +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 + +// MsgUpdateParams defines a SDK message for updating the module parameters. +type MsgUpdateParams struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // payload defines the x/compliance parameters to update. + Payload string `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +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_0e334ee27ef03cb7, []int{0} +} +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) GetPayload() string { + if m != nil { + return m.Payload + } + return "" +} + +// MsgUpdateParamsResponse defines the Msg/UpdateParams response type. +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_0e334ee27ef03cb7, []int{1} +} +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 + +// MsgEnableMultiCoinReward enables multi-coin rewards for the sender address +// and claims all current pending rewards. +type MsgToggleMultiCoinRewards struct { + // creator ... + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // enabled ... + Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (m *MsgToggleMultiCoinRewards) Reset() { *m = MsgToggleMultiCoinRewards{} } +func (m *MsgToggleMultiCoinRewards) String() string { return proto.CompactTextString(m) } +func (*MsgToggleMultiCoinRewards) ProtoMessage() {} +func (*MsgToggleMultiCoinRewards) Descriptor() ([]byte, []int) { + return fileDescriptor_0e334ee27ef03cb7, []int{2} +} +func (m *MsgToggleMultiCoinRewards) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgToggleMultiCoinRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgToggleMultiCoinRewards.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 *MsgToggleMultiCoinRewards) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgToggleMultiCoinRewards.Merge(m, src) +} +func (m *MsgToggleMultiCoinRewards) XXX_Size() int { + return m.Size() +} +func (m *MsgToggleMultiCoinRewards) XXX_DiscardUnknown() { + xxx_messageInfo_MsgToggleMultiCoinRewards.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgToggleMultiCoinRewards proto.InternalMessageInfo + +func (m *MsgToggleMultiCoinRewards) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgToggleMultiCoinRewards) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +// MsgEnableMultiCoinRewardResponse ... +type MsgToggleMultiCoinRewardsResponse struct { +} + +func (m *MsgToggleMultiCoinRewardsResponse) Reset() { *m = MsgToggleMultiCoinRewardsResponse{} } +func (m *MsgToggleMultiCoinRewardsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgToggleMultiCoinRewardsResponse) ProtoMessage() {} +func (*MsgToggleMultiCoinRewardsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0e334ee27ef03cb7, []int{3} +} +func (m *MsgToggleMultiCoinRewardsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgToggleMultiCoinRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgToggleMultiCoinRewardsResponse.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 *MsgToggleMultiCoinRewardsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgToggleMultiCoinRewardsResponse.Merge(m, src) +} +func (m *MsgToggleMultiCoinRewardsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgToggleMultiCoinRewardsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgToggleMultiCoinRewardsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgToggleMultiCoinRewardsResponse proto.InternalMessageInfo + +// MsgEnableMultiCoinReward enables multi-coin rewards for the sender address +// and claims all current pending rewards. +type MsgSetMultiCoinRewardsRefundPolicy struct { + // creator ... + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // policy ... + Policy *MultiCoinRefundPolicy `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"` +} + +func (m *MsgSetMultiCoinRewardsRefundPolicy) Reset() { *m = MsgSetMultiCoinRewardsRefundPolicy{} } +func (m *MsgSetMultiCoinRewardsRefundPolicy) String() string { return proto.CompactTextString(m) } +func (*MsgSetMultiCoinRewardsRefundPolicy) ProtoMessage() {} +func (*MsgSetMultiCoinRewardsRefundPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_0e334ee27ef03cb7, []int{4} +} +func (m *MsgSetMultiCoinRewardsRefundPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetMultiCoinRewardsRefundPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicy.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 *MsgSetMultiCoinRewardsRefundPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicy.Merge(m, src) +} +func (m *MsgSetMultiCoinRewardsRefundPolicy) XXX_Size() int { + return m.Size() +} +func (m *MsgSetMultiCoinRewardsRefundPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicy proto.InternalMessageInfo + +func (m *MsgSetMultiCoinRewardsRefundPolicy) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgSetMultiCoinRewardsRefundPolicy) GetPolicy() *MultiCoinRefundPolicy { + if m != nil { + return m.Policy + } + return nil +} + +// MsgEnableMultiCoinRewardResponse ... +type MsgSetMultiCoinRewardsRefundPolicyResponse struct { +} + +func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) Reset() { + *m = MsgSetMultiCoinRewardsRefundPolicyResponse{} +} +func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) String() string { + return proto.CompactTextString(m) +} +func (*MsgSetMultiCoinRewardsRefundPolicyResponse) ProtoMessage() {} +func (*MsgSetMultiCoinRewardsRefundPolicyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0e334ee27ef03cb7, []int{5} +} +func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicyResponse.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 *MsgSetMultiCoinRewardsRefundPolicyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicyResponse.Merge(m, src) +} +func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicyResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "kyve.compliance.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "kyve.compliance.v1beta1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgToggleMultiCoinRewards)(nil), "kyve.compliance.v1beta1.MsgToggleMultiCoinRewards") + proto.RegisterType((*MsgToggleMultiCoinRewardsResponse)(nil), "kyve.compliance.v1beta1.MsgToggleMultiCoinRewardsResponse") + proto.RegisterType((*MsgSetMultiCoinRewardsRefundPolicy)(nil), "kyve.compliance.v1beta1.MsgSetMultiCoinRewardsRefundPolicy") + proto.RegisterType((*MsgSetMultiCoinRewardsRefundPolicyResponse)(nil), "kyve.compliance.v1beta1.MsgSetMultiCoinRewardsRefundPolicyResponse") +} + +func init() { proto.RegisterFile("kyve/compliance/v1beta1/tx.proto", fileDescriptor_0e334ee27ef03cb7) } + +var fileDescriptor_0e334ee27ef03cb7 = []byte{ + // 481 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x77, 0x2c, 0x56, 0x3b, 0x16, 0x85, 0x20, 0x6e, 0x36, 0x87, 0x50, 0xd3, 0x4b, 0x59, + 0x34, 0xe3, 0xae, 0xe0, 0x61, 0x3d, 0xd9, 0xa2, 0x20, 0x12, 0x29, 0xa9, 0x0a, 0x0a, 0x22, 0x93, + 0x64, 0x9c, 0x1d, 0x9b, 0x64, 0xc2, 0xcc, 0x64, 0xdb, 0xdc, 0xc4, 0x93, 0x47, 0x0f, 0x7e, 0x02, + 0x4f, 0x1e, 0x7b, 0xf0, 0x43, 0x78, 0x2c, 0x9e, 0x3c, 0xca, 0xee, 0xa1, 0x5f, 0x43, 0xf2, 0xaf, + 0xe9, 0xb6, 0x66, 0xab, 0x78, 0x0a, 0x2f, 0xef, 0xef, 0x79, 0x9f, 0x27, 0xf3, 0xf2, 0xc2, 0xb5, + 0xdd, 0x6c, 0x42, 0x90, 0xcf, 0xa3, 0x24, 0x64, 0x38, 0xf6, 0x09, 0x9a, 0x0c, 0x3c, 0xa2, 0xf0, + 0x00, 0xa9, 0x7d, 0x3b, 0x11, 0x5c, 0x71, 0xad, 0x9b, 0x13, 0x76, 0x43, 0xd8, 0x15, 0x61, 0x74, + 0x7d, 0x2e, 0x23, 0x2e, 0x51, 0x24, 0x29, 0x9a, 0x0c, 0xf2, 0x4f, 0xa9, 0x30, 0x7a, 0x65, 0xe3, + 0x4d, 0x51, 0xa1, 0xb2, 0xa8, 0x5a, 0xeb, 0xad, 0x76, 0x59, 0x42, 0x2a, 0xc8, 0x92, 0xf0, 0x9a, + 0x23, 0xe9, 0xf3, 0x24, 0xc0, 0x8a, 0x6c, 0x63, 0x81, 0x23, 0xa9, 0xdd, 0x83, 0x2b, 0x38, 0x55, + 0x63, 0x2e, 0x98, 0xca, 0x74, 0xb0, 0x06, 0x36, 0x56, 0x36, 0xf5, 0x1f, 0xdf, 0x6e, 0x5f, 0xaf, + 0x86, 0x3f, 0x08, 0x02, 0x41, 0xa4, 0xdc, 0x51, 0x82, 0xc5, 0xd4, 0x6d, 0x50, 0x4d, 0x87, 0x97, + 0x12, 0x9c, 0x85, 0x1c, 0x07, 0xfa, 0x85, 0x5c, 0xe5, 0xd6, 0xe5, 0xe8, 0xea, 0x87, 0xa3, 0x83, + 0x7e, 0x43, 0x5a, 0x3d, 0xd8, 0x3d, 0x65, 0xea, 0x12, 0x99, 0xf0, 0x58, 0x12, 0xeb, 0x35, 0xec, + 0x39, 0x92, 0x3e, 0xe3, 0x94, 0x86, 0xc4, 0x49, 0x43, 0xc5, 0xb6, 0x38, 0x8b, 0x5d, 0xb2, 0x87, + 0x45, 0x20, 0x73, 0x07, 0x5f, 0x10, 0xac, 0xb8, 0x28, 0x73, 0xb9, 0x75, 0x99, 0x77, 0x48, 0x8c, + 0xbd, 0x90, 0x94, 0xde, 0x97, 0xdd, 0xba, 0x1c, 0xad, 0xe6, 0xde, 0x35, 0x67, 0xad, 0xc3, 0x9b, + 0xad, 0xe3, 0x8f, 0x33, 0x7c, 0x06, 0xd0, 0x72, 0x24, 0xdd, 0x21, 0xea, 0x2c, 0xf2, 0x36, 0x8d, + 0x83, 0x6d, 0x1e, 0x32, 0x3f, 0x5b, 0x90, 0xe6, 0x11, 0x5c, 0x4e, 0x0a, 0xa6, 0x08, 0x73, 0x65, + 0x68, 0xdb, 0x2d, 0x7b, 0xb5, 0x4f, 0x18, 0x34, 0x93, 0xdd, 0x4a, 0x7d, 0x2a, 0xfb, 0x2d, 0xd8, + 0x3f, 0x3f, 0x55, 0xfd, 0x13, 0xc3, 0xaf, 0x4b, 0x70, 0xc9, 0x91, 0x54, 0x7b, 0x07, 0x57, 0xe7, + 0xb6, 0xbb, 0xd1, 0x9e, 0x65, 0x7e, 0x25, 0xc6, 0x9d, 0xbf, 0x25, 0x6b, 0x4f, 0xed, 0x23, 0x80, + 0x37, 0x5a, 0x56, 0x37, 0x5c, 0x34, 0xec, 0xcf, 0x1a, 0x63, 0xf4, 0xef, 0x9a, 0xe3, 0x28, 0x5f, + 0x00, 0x34, 0xcf, 0x3e, 0xd5, 0xdc, 0xfe, 0xee, 0x2f, 0x1a, 0x7f, 0xce, 0x33, 0x1b, 0x5b, 0xff, + 0x21, 0xae, 0x43, 0x1a, 0x17, 0xdf, 0x1f, 0x1d, 0xf4, 0xc1, 0xe6, 0xe3, 0xef, 0x53, 0x13, 0x1c, + 0x4e, 0x4d, 0xf0, 0x6b, 0x6a, 0x82, 0x4f, 0x33, 0xb3, 0x73, 0x38, 0x33, 0x3b, 0x3f, 0x67, 0x66, + 0xe7, 0x15, 0xa2, 0x4c, 0x8d, 0x53, 0x2f, 0xb7, 0x41, 0x4f, 0x5e, 0xbe, 0x78, 0xf8, 0x94, 0xa8, + 0x3d, 0x2e, 0x76, 0x91, 0x3f, 0xc6, 0x2c, 0x46, 0xfb, 0x27, 0x8f, 0xbb, 0x38, 0x6a, 0x6f, 0xb9, + 0xb8, 0xea, 0xbb, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x46, 0x49, 0x30, 0x29, 0x6b, 0x04, 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 { + // UpdateParams defines a governance operation for updating the x/compliance module + // parameters. The authority is hard-coded to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // ToggleMultiCoinRewards ... + ToggleMultiCoinRewards(ctx context.Context, in *MsgToggleMultiCoinRewards, opts ...grpc.CallOption) (*MsgToggleMultiCoinRewardsResponse, error) + // SetMultiCoinRewardRefundPolicy ... + SetMultiCoinRewardRefundPolicy(ctx context.Context, in *MsgSetMultiCoinRewardsRefundPolicy, opts ...grpc.CallOption) (*MsgSetMultiCoinRewardsRefundPolicyResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/kyve.compliance.v1beta1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ToggleMultiCoinRewards(ctx context.Context, in *MsgToggleMultiCoinRewards, opts ...grpc.CallOption) (*MsgToggleMultiCoinRewardsResponse, error) { + out := new(MsgToggleMultiCoinRewardsResponse) + err := c.cc.Invoke(ctx, "/kyve.compliance.v1beta1.Msg/ToggleMultiCoinRewards", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetMultiCoinRewardRefundPolicy(ctx context.Context, in *MsgSetMultiCoinRewardsRefundPolicy, opts ...grpc.CallOption) (*MsgSetMultiCoinRewardsRefundPolicyResponse, error) { + out := new(MsgSetMultiCoinRewardsRefundPolicyResponse) + err := c.cc.Invoke(ctx, "/kyve.compliance.v1beta1.Msg/SetMultiCoinRewardRefundPolicy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a governance operation for updating the x/compliance module + // parameters. The authority is hard-coded to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // ToggleMultiCoinRewards ... + ToggleMultiCoinRewards(context.Context, *MsgToggleMultiCoinRewards) (*MsgToggleMultiCoinRewardsResponse, error) + // SetMultiCoinRewardRefundPolicy ... + SetMultiCoinRewardRefundPolicy(context.Context, *MsgSetMultiCoinRewardsRefundPolicy) (*MsgSetMultiCoinRewardsRefundPolicyResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) ToggleMultiCoinRewards(ctx context.Context, req *MsgToggleMultiCoinRewards) (*MsgToggleMultiCoinRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ToggleMultiCoinRewards not implemented") +} +func (*UnimplementedMsgServer) SetMultiCoinRewardRefundPolicy(ctx context.Context, req *MsgSetMultiCoinRewardsRefundPolicy) (*MsgSetMultiCoinRewardsRefundPolicyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetMultiCoinRewardRefundPolicy not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +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: "/kyve.compliance.v1beta1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ToggleMultiCoinRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgToggleMultiCoinRewards) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ToggleMultiCoinRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.compliance.v1beta1.Msg/ToggleMultiCoinRewards", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ToggleMultiCoinRewards(ctx, req.(*MsgToggleMultiCoinRewards)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetMultiCoinRewardRefundPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetMultiCoinRewardsRefundPolicy) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetMultiCoinRewardRefundPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.compliance.v1beta1.Msg/SetMultiCoinRewardRefundPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetMultiCoinRewardRefundPolicy(ctx, req.(*MsgSetMultiCoinRewardsRefundPolicy)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "kyve.compliance.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "ToggleMultiCoinRewards", + Handler: _Msg_ToggleMultiCoinRewards_Handler, + }, + { + MethodName: "SetMultiCoinRewardRefundPolicy", + Handler: _Msg_SetMultiCoinRewardRefundPolicy_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "kyve/compliance/v1beta1/tx.proto", +} + +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 + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintTx(dAtA, i, uint64(len(m.Payload))) + 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 (m *MsgToggleMultiCoinRewards) 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 *MsgToggleMultiCoinRewards) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgToggleMultiCoinRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgToggleMultiCoinRewardsResponse) 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 *MsgToggleMultiCoinRewardsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgToggleMultiCoinRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSetMultiCoinRewardsRefundPolicy) 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 *MsgSetMultiCoinRewardsRefundPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetMultiCoinRewardsRefundPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Policy != nil { + { + size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) 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 *MsgSetMultiCoinRewardsRefundPolicyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) 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 *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 = len(m.Payload) + if l > 0 { + 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 (m *MsgToggleMultiCoinRewards) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Enabled { + n += 2 + } + return n +} + +func (m *MsgToggleMultiCoinRewardsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSetMultiCoinRewardsRefundPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Policy != nil { + l = m.Policy.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) 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 *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 Payload", 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.Payload = 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 *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 (m *MsgToggleMultiCoinRewards) 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: MsgToggleMultiCoinRewards: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgToggleMultiCoinRewards: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + 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 *MsgToggleMultiCoinRewardsResponse) 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: MsgToggleMultiCoinRewardsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgToggleMultiCoinRewardsResponse: 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 *MsgSetMultiCoinRewardsRefundPolicy) 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: MsgSetMultiCoinRewardsRefundPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetMultiCoinRewardsRefundPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Policy", 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.Policy == nil { + m.Policy = &MultiCoinRefundPolicy{} + } + if err := m.Policy.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 *MsgSetMultiCoinRewardsRefundPolicyResponse) 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: MsgSetMultiCoinRewardsRefundPolicyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetMultiCoinRewardsRefundPolicyResponse: 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/compliance/types/types.go b/x/compliance/types/types.go new file mode 100644 index 00000000..3bf873db --- /dev/null +++ b/x/compliance/types/types.go @@ -0,0 +1,47 @@ +package types + +import ( + "fmt" + + "cosmossdk.io/math" +) + +type ( + ComplianceMultiCoinMap map[string][]ComplainceMultiCoinPoolNormalizedEntry + ComplainceMultiCoinPoolNormalizedEntry struct { + PoolId uint64 + NormalizedWeight math.LegacyDec + } +) + +func ParseMultiCoinComplianceMap(policy MultiCoinRefundPolicy) (ComplianceMultiCoinMap, error) { + var compliance ComplianceMultiCoinMap = make(map[string][]ComplainceMultiCoinPoolNormalizedEntry) + + for _, denomEntry := range policy.Entries { + complianceWeightsDuplicateCheck := make(map[uint64]struct{}) + + totalWeight := math.LegacyNewDec(0) + for _, weights := range denomEntry.PoolWeights { + totalWeight = totalWeight.Add(weights.Weight) + if _, ok := complianceWeightsDuplicateCheck[weights.PoolId]; ok { + return nil, fmt.Errorf("duplicate compliance weight for pool id %d", weights.PoolId) + } + } + + normalizedWeights := make([]ComplainceMultiCoinPoolNormalizedEntry, 0) + for _, weight := range denomEntry.PoolWeights { + normalizedWeights = append(normalizedWeights, ComplainceMultiCoinPoolNormalizedEntry{ + PoolId: weight.PoolId, + NormalizedWeight: weight.Weight.Quo(totalWeight), + }) + } + + if _, ok := compliance[denomEntry.Denom]; !ok { + compliance[denomEntry.Denom] = normalizedWeights + } else { + return nil, fmt.Errorf("duplicate entry for denom %s", denomEntry.Denom) + } + } + + return compliance, nil +} diff --git a/x/compliance/types/types.pb.go b/x/compliance/types/types.pb.go new file mode 100644 index 00000000..b988f879 --- /dev/null +++ b/x/compliance/types/types.pb.go @@ -0,0 +1,1294 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kyve/compliance/v1beta1/types.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + 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/tx/amino" + _ "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 + +// UnbondingState stores the state for the unbonding of stakes and delegations. +type QueueState struct { + // low_index is the tail of the queue. It is the + // oldest entry in the queue. If this entry isn't + // due, non of the other entries is. + LowIndex uint64 `protobuf:"varint,1,opt,name=low_index,json=lowIndex,proto3" json:"low_index,omitempty"` + // high_index is the head of the queue. New entries + // are added to the top. + HighIndex uint64 `protobuf:"varint,2,opt,name=high_index,json=highIndex,proto3" json:"high_index,omitempty"` +} + +func (m *QueueState) Reset() { *m = QueueState{} } +func (m *QueueState) String() string { return proto.CompactTextString(m) } +func (*QueueState) ProtoMessage() {} +func (*QueueState) Descriptor() ([]byte, []int) { + return fileDescriptor_0cce4fd19494211c, []int{0} +} +func (m *QueueState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueueState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueueState.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 *QueueState) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueueState.Merge(m, src) +} +func (m *QueueState) XXX_Size() int { + return m.Size() +} +func (m *QueueState) XXX_DiscardUnknown() { + xxx_messageInfo_QueueState.DiscardUnknown(m) +} + +var xxx_messageInfo_QueueState proto.InternalMessageInfo + +func (m *QueueState) GetLowIndex() uint64 { + if m != nil { + return m.LowIndex + } + return 0 +} + +func (m *QueueState) GetHighIndex() uint64 { + if m != nil { + return m.HighIndex + } + return 0 +} + +// MultiCoinPendingRewardsEntry ... +type MultiCoinPendingRewardsEntry struct { + // index is needed for the queue-algorithm which + // processes the commission changes + Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + // address ... + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // rewards ... + Rewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"rewards"` + CreationDate int64 `protobuf:"varint,4,opt,name=creation_date,json=creationDate,proto3" json:"creation_date,omitempty"` +} + +func (m *MultiCoinPendingRewardsEntry) Reset() { *m = MultiCoinPendingRewardsEntry{} } +func (m *MultiCoinPendingRewardsEntry) String() string { return proto.CompactTextString(m) } +func (*MultiCoinPendingRewardsEntry) ProtoMessage() {} +func (*MultiCoinPendingRewardsEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_0cce4fd19494211c, []int{1} +} +func (m *MultiCoinPendingRewardsEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MultiCoinPendingRewardsEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MultiCoinPendingRewardsEntry.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 *MultiCoinPendingRewardsEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiCoinPendingRewardsEntry.Merge(m, src) +} +func (m *MultiCoinPendingRewardsEntry) XXX_Size() int { + return m.Size() +} +func (m *MultiCoinPendingRewardsEntry) XXX_DiscardUnknown() { + xxx_messageInfo_MultiCoinPendingRewardsEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiCoinPendingRewardsEntry proto.InternalMessageInfo + +func (m *MultiCoinPendingRewardsEntry) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *MultiCoinPendingRewardsEntry) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *MultiCoinPendingRewardsEntry) GetRewards() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Rewards + } + return nil +} + +func (m *MultiCoinPendingRewardsEntry) GetCreationDate() int64 { + if m != nil { + return m.CreationDate + } + return 0 +} + +// MultiCoinRefundPolicy ... +type MultiCoinRefundPolicy struct { + Entries []*MultiCoinRefundDenomEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` +} + +func (m *MultiCoinRefundPolicy) Reset() { *m = MultiCoinRefundPolicy{} } +func (m *MultiCoinRefundPolicy) String() string { return proto.CompactTextString(m) } +func (*MultiCoinRefundPolicy) ProtoMessage() {} +func (*MultiCoinRefundPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_0cce4fd19494211c, []int{2} +} +func (m *MultiCoinRefundPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MultiCoinRefundPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MultiCoinRefundPolicy.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 *MultiCoinRefundPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiCoinRefundPolicy.Merge(m, src) +} +func (m *MultiCoinRefundPolicy) XXX_Size() int { + return m.Size() +} +func (m *MultiCoinRefundPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_MultiCoinRefundPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiCoinRefundPolicy proto.InternalMessageInfo + +func (m *MultiCoinRefundPolicy) GetEntries() []*MultiCoinRefundDenomEntry { + if m != nil { + return m.Entries + } + return nil +} + +// MultiCoinRefundDenomEntry ... +type MultiCoinRefundDenomEntry struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + PoolWeights []*MultiCoinRefundPoolWeightEntry `protobuf:"bytes,2,rep,name=pool_weights,json=poolWeights,proto3" json:"pool_weights,omitempty"` +} + +func (m *MultiCoinRefundDenomEntry) Reset() { *m = MultiCoinRefundDenomEntry{} } +func (m *MultiCoinRefundDenomEntry) String() string { return proto.CompactTextString(m) } +func (*MultiCoinRefundDenomEntry) ProtoMessage() {} +func (*MultiCoinRefundDenomEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_0cce4fd19494211c, []int{3} +} +func (m *MultiCoinRefundDenomEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MultiCoinRefundDenomEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MultiCoinRefundDenomEntry.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 *MultiCoinRefundDenomEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiCoinRefundDenomEntry.Merge(m, src) +} +func (m *MultiCoinRefundDenomEntry) XXX_Size() int { + return m.Size() +} +func (m *MultiCoinRefundDenomEntry) XXX_DiscardUnknown() { + xxx_messageInfo_MultiCoinRefundDenomEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiCoinRefundDenomEntry proto.InternalMessageInfo + +func (m *MultiCoinRefundDenomEntry) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *MultiCoinRefundDenomEntry) GetPoolWeights() []*MultiCoinRefundPoolWeightEntry { + if m != nil { + return m.PoolWeights + } + return nil +} + +// MultiCoinRefundPoolWeightEntry ... +type MultiCoinRefundPoolWeightEntry struct { + PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` + Weight cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight"` +} + +func (m *MultiCoinRefundPoolWeightEntry) Reset() { *m = MultiCoinRefundPoolWeightEntry{} } +func (m *MultiCoinRefundPoolWeightEntry) String() string { return proto.CompactTextString(m) } +func (*MultiCoinRefundPoolWeightEntry) ProtoMessage() {} +func (*MultiCoinRefundPoolWeightEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_0cce4fd19494211c, []int{4} +} +func (m *MultiCoinRefundPoolWeightEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MultiCoinRefundPoolWeightEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MultiCoinRefundPoolWeightEntry.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 *MultiCoinRefundPoolWeightEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiCoinRefundPoolWeightEntry.Merge(m, src) +} +func (m *MultiCoinRefundPoolWeightEntry) XXX_Size() int { + return m.Size() +} +func (m *MultiCoinRefundPoolWeightEntry) XXX_DiscardUnknown() { + xxx_messageInfo_MultiCoinRefundPoolWeightEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiCoinRefundPoolWeightEntry proto.InternalMessageInfo + +func (m *MultiCoinRefundPoolWeightEntry) GetPoolId() uint64 { + if m != nil { + return m.PoolId + } + return 0 +} + +func init() { + proto.RegisterType((*QueueState)(nil), "kyve.compliance.v1beta1.QueueState") + proto.RegisterType((*MultiCoinPendingRewardsEntry)(nil), "kyve.compliance.v1beta1.MultiCoinPendingRewardsEntry") + proto.RegisterType((*MultiCoinRefundPolicy)(nil), "kyve.compliance.v1beta1.MultiCoinRefundPolicy") + proto.RegisterType((*MultiCoinRefundDenomEntry)(nil), "kyve.compliance.v1beta1.MultiCoinRefundDenomEntry") + proto.RegisterType((*MultiCoinRefundPoolWeightEntry)(nil), "kyve.compliance.v1beta1.MultiCoinRefundPoolWeightEntry") +} + +func init() { + proto.RegisterFile("kyve/compliance/v1beta1/types.proto", fileDescriptor_0cce4fd19494211c) +} + +var fileDescriptor_0cce4fd19494211c = []byte{ + // 534 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xc1, 0x6e, 0x13, 0x3d, + 0x10, 0xce, 0xfe, 0xe9, 0x9f, 0x10, 0xb7, 0x1c, 0xb0, 0x8a, 0x9a, 0xb6, 0xb0, 0x89, 0x92, 0x4b, + 0x84, 0xc4, 0x5a, 0x2d, 0x42, 0x1c, 0xb8, 0x85, 0x54, 0x22, 0xa2, 0xa0, 0xb0, 0x48, 0x20, 0x7a, + 0x89, 0x9c, 0xf5, 0xb0, 0x6b, 0xb2, 0xb1, 0xa3, 0xb5, 0x93, 0x34, 0x0f, 0x81, 0xc4, 0x63, 0x20, + 0x4e, 0x3c, 0x46, 0x8f, 0x3d, 0x22, 0x0e, 0x2d, 0x4a, 0x0e, 0xbc, 0x06, 0xb2, 0xbd, 0x69, 0x23, + 0xa4, 0x22, 0x2e, 0xbb, 0xfe, 0x66, 0xbe, 0x19, 0xcf, 0x7c, 0xdf, 0x2e, 0x6a, 0x0e, 0xe7, 0x53, + 0x20, 0x91, 0x1c, 0x8d, 0x53, 0x4e, 0x45, 0x04, 0x64, 0x7a, 0x30, 0x00, 0x4d, 0x0f, 0x88, 0x9e, + 0x8f, 0x41, 0x05, 0xe3, 0x4c, 0x6a, 0x89, 0x77, 0x0c, 0x29, 0xb8, 0x26, 0x05, 0x39, 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0x2f, 0x9c, 0x90, 0x35, 0x97, 0x5f, + 0xbc, 0x7f, 0x7b, 0xf4, 0x0a, 0xf4, 0x4c, 0x66, 0x43, 0x12, 0x25, 0x94, 0x0b, 0x72, 0xba, 0xfe, + 0x57, 0x59, 0xcb, 0x07, 0x25, 0xfb, 0xb1, 0x3f, 0xfa, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x5b, 0xaa, + 0xa9, 0x2a, 0x75, 0x03, 0x00, 0x00, +} + +func (m *QueueState) 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 *QueueState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueueState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.HighIndex != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.HighIndex)) + i-- + dAtA[i] = 0x10 + } + if m.LowIndex != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.LowIndex)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MultiCoinPendingRewardsEntry) 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 *MultiCoinPendingRewardsEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MultiCoinPendingRewardsEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CreationDate != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.CreationDate)) + i-- + dAtA[i] = 0x20 + } + if len(m.Rewards) > 0 { + for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if m.Index != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MultiCoinRefundPolicy) 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 *MultiCoinRefundPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MultiCoinRefundPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MultiCoinRefundDenomEntry) 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 *MultiCoinRefundDenomEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MultiCoinRefundDenomEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PoolWeights) > 0 { + for iNdEx := len(m.PoolWeights) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MultiCoinRefundPoolWeightEntry) 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 *MultiCoinRefundPoolWeightEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MultiCoinRefundPoolWeightEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Weight.Size() + i -= size + if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.PoolId != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x8 + } + 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 *QueueState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LowIndex != 0 { + n += 1 + sovTypes(uint64(m.LowIndex)) + } + if m.HighIndex != 0 { + n += 1 + sovTypes(uint64(m.HighIndex)) + } + return n +} + +func (m *MultiCoinPendingRewardsEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sovTypes(uint64(m.Index)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.Rewards) > 0 { + for _, e := range m.Rewards { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + if m.CreationDate != 0 { + n += 1 + sovTypes(uint64(m.CreationDate)) + } + return n +} + +func (m *MultiCoinRefundPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *MultiCoinRefundDenomEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.PoolWeights) > 0 { + for _, e := range m.PoolWeights { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *MultiCoinRefundPoolWeightEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PoolId != 0 { + n += 1 + sovTypes(uint64(m.PoolId)) + } + l = m.Weight.Size() + n += 1 + l + sovTypes(uint64(l)) + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueueState) 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: QueueState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueueState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LowIndex", wireType) + } + m.LowIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LowIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HighIndex", wireType) + } + m.HighIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HighIndex |= 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 (m *MultiCoinPendingRewardsEntry) 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: MultiCoinPendingRewardsEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MultiCoinPendingRewardsEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", 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 + } + m.Rewards = append(m.Rewards, types.Coin{}) + if err := m.Rewards[len(m.Rewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) + } + m.CreationDate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationDate |= int64(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 (m *MultiCoinRefundPolicy) 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: MultiCoinRefundPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MultiCoinRefundPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entries", 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 + } + m.Entries = append(m.Entries, &MultiCoinRefundDenomEntry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(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 *MultiCoinRefundDenomEntry) 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: MultiCoinRefundDenomEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MultiCoinRefundDenomEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolWeights", 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 + } + m.PoolWeights = append(m.PoolWeights, &MultiCoinRefundPoolWeightEntry{}) + if err := m.PoolWeights[len(m.PoolWeights)-1].Unmarshal(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 *MultiCoinRefundPoolWeightEntry) 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: MultiCoinRefundPoolWeightEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MultiCoinRefundPoolWeightEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Weight", 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.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/global/ante_test.go b/x/global/ante_test.go index 9a7e1a39..cb0010b7 100644 --- a/x/global/ante_test.go +++ b/x/global/ante_test.go @@ -292,7 +292,7 @@ var _ = Describe("GasAdjustmentDecorator", Ordered, func() { // NOTE: This will change as implementation changes. // TODO: Why does this change as the implementation changes? - BaseCost := 63370 + BaseCost := 62974 BeforeEach(func() { s = i.NewCleanChain() diff --git a/x/query/keeper/keeper.go b/x/query/keeper/keeper.go index 11205b06..39313a20 100644 --- a/x/query/keeper/keeper.go +++ b/x/query/keeper/keeper.go @@ -9,15 +9,13 @@ import ( fundersKeeper "github.com/KYVENetwork/chain/x/funders/keeper" + "cosmossdk.io/log" globalKeeper "github.com/KYVENetwork/chain/x/global/keeper" poolkeeper "github.com/KYVENetwork/chain/x/pool/keeper" stakerskeeper "github.com/KYVENetwork/chain/x/stakers/keeper" teamKeeper "github.com/KYVENetwork/chain/x/team/keeper" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - - "cosmossdk.io/log" "github.com/KYVENetwork/chain/x/query/types" "github.com/cosmos/cosmos-sdk/codec" @@ -30,7 +28,7 @@ type ( accountKeeper authkeeper.AccountKeeper bankKeeper bankkeeper.Keeper - distrkeeper distrkeeper.Keeper + distrkeeper util.DistributionKeeper poolKeeper *poolkeeper.Keeper // TODO: rename to stakersKeeper stakerKeeper *stakerskeeper.Keeper @@ -50,7 +48,7 @@ func NewKeeper( accountKeeper authkeeper.AccountKeeper, bankKeeper bankkeeper.Keeper, - distrkeeper distrkeeper.Keeper, + distrkeeper util.DistributionKeeper, poolKeeper *poolkeeper.Keeper, stakerKeeper *stakerskeeper.Keeper, bundleKeeper types.BundlesKeeper, diff --git a/x/query/module.go b/x/query/module.go index 6b3b813b..3a29c0de 100644 --- a/x/query/module.go +++ b/x/query/module.go @@ -17,7 +17,6 @@ import ( teamKeeper "github.com/KYVENetwork/chain/x/team/keeper" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - distributionKeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" // this line is used by starport scaffolding # 1 @@ -180,7 +179,7 @@ type ModuleInputs struct { AccountKeeper authkeeper.AccountKeeper BankKeeper bankKeeper.Keeper - DistributionKeeper distributionKeeper.Keeper + DistributionKeeper util.DistributionKeeper UpgradeKeeper util.UpgradeKeeper PoolKeeper *poolKeeper.Keeper TeamKeeper teamKeeper.Keeper diff --git a/x/stakers/client/cli/tx.go b/x/stakers/client/cli/tx.go index 215efe0d..e1768072 100644 --- a/x/stakers/client/cli/tx.go +++ b/x/stakers/client/cli/tx.go @@ -23,8 +23,6 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdLeavePool()) cmd.AddCommand(CmdUpdateCommission()) cmd.AddCommand(CmdUpdateStakeFraction()) - cmd.AddCommand(CmdToggleMultiCoinRewards()) - cmd.AddCommand(CmdSetMultiCoinRefundPolicy()) return cmd } diff --git a/x/stakers/genesis.go b/x/stakers/genesis.go index 185fac9c..e703234c 100644 --- a/x/stakers/genesis.go +++ b/x/stakers/genesis.go @@ -28,21 +28,9 @@ func InitGenesis(ctx sdk.Context, k *keeper.Keeper, genState types.GenesisState) k.SetStakeFractionChangeEntry(ctx, entry) } - for _, entry := range genState.MultiCoinPendingRewardsEntries { - k.SetMultiCoinPendingRewardsEntry(ctx, entry) - } - - for _, entry := range genState.MultiCoinEnabled { - err := k.MultiCoinRewardsEnabled.Set(ctx, sdk.MustAccAddressFromBech32(entry)) - if err != nil { - panic(err) - } - } - k.SetQueueState(ctx, types.QUEUE_IDENTIFIER_COMMISSION, genState.QueueStateCommission) k.SetQueueState(ctx, types.QUEUE_IDENTIFIER_LEAVE, genState.QueueStateLeave) k.SetQueueState(ctx, types.QUEUE_IDENTIFIER_STAKE_FRACTION, genState.QueueStateStakeFraction) - k.SetQueueState(ctx, types.QUEUE_IDENTIFIER_MULTI_COIN_REWARDS, genState.QueueStatePendingRewards) } // ExportGenesis returns the capability module's exported genesis. @@ -58,20 +46,11 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *types.GenesisState { genesis.StakeFractionChangeEntries = k.GetAllStakeFractionChangeEntries(ctx) - genesis.MultiCoinPendingRewardsEntries = k.GetAllMultiCoinPendingRewardsEntries(ctx) - genesis.QueueStateCommission = k.GetQueueState(ctx, types.QUEUE_IDENTIFIER_COMMISSION) genesis.QueueStateLeave = k.GetQueueState(ctx, types.QUEUE_IDENTIFIER_LEAVE) genesis.QueueStateStakeFraction = k.GetQueueState(ctx, types.QUEUE_IDENTIFIER_STAKE_FRACTION) - genesis.QueueStatePendingRewards = k.GetQueueState(ctx, types.QUEUE_IDENTIFIER_MULTI_COIN_REWARDS) - - policy, _ := k.MultiCoinRefundPolicy.Get(ctx) - genesis.MultiCoinRefundPolicy = &policy - - genesis.MultiCoinEnabled = k.GetAllEnabledMultiCoinAddresses(ctx) - return genesis } diff --git a/x/stakers/keeper/getters_params.go b/x/stakers/keeper/getters_params.go index 91c4f46c..aade9b04 100644 --- a/x/stakers/keeper/getters_params.go +++ b/x/stakers/keeper/getters_params.go @@ -35,11 +35,6 @@ func (k Keeper) GetStakeFractionChangeTime(ctx sdk.Context) (res uint64) { return k.GetParams(ctx).StakeFractionChangeTime } -// GetMultiCoinRefundPendingTime returns the MultiCoinRefundPendingTime param -func (k Keeper) GetMultiCoinRefundPendingTime(ctx sdk.Context) (res uint64) { - return k.GetParams(ctx).MultiCoinRefundPendingTime -} - // GetVoteSlash returns the VoteSlash param func (k Keeper) GetVoteSlash(ctx sdk.Context) (res math.LegacyDec) { return k.GetParams(ctx).VoteSlash diff --git a/x/stakers/keeper/grpc_query.go b/x/stakers/keeper/grpc_query.go index de6a1a8b..763c25ec 100644 --- a/x/stakers/keeper/grpc_query.go +++ b/x/stakers/keeper/grpc_query.go @@ -19,36 +19,3 @@ func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil } - -func (k Keeper) MultiCoinRefundPolicyQuery(ctx context.Context, request *types.QueryMultiCoinRefundPolicyRequest) (*types.QueryMultiCoinRefundPolicyResponse, error) { - policy, err := k.MultiCoinRefundPolicy.Get(ctx) - if err != nil { - return nil, err - } - return &types.QueryMultiCoinRefundPolicyResponse{Policy: policy}, err -} - -func (k Keeper) MultiCoinStatus(ctx context.Context, request *types.QueryMultiCoinStatusRequest) (*types.QueryMultiCoinStatusResponse, error) { - account, err := sdk.AccAddressFromBech32(request.Address) - if err != nil { - return nil, err - } - - has, err := k.MultiCoinRewardsEnabled.Has(ctx, account) - if err != nil { - return nil, err - } - - entries, _ := k.GetMultiCoinPendingRewardsEntriesByIndex2(sdk.UnwrapSDKContext(ctx), request.Address) - - pendingRewards := sdk.NewCoins() - - for _, entry := range entries { - pendingRewards = pendingRewards.Add(entry.Rewards...) - } - - return &types.QueryMultiCoinStatusResponse{ - Enabled: has, - PendingMultiCoinRewards: pendingRewards, - }, nil -} diff --git a/x/stakers/keeper/keeper.go b/x/stakers/keeper/keeper.go index 407d0711..1ec68567 100644 --- a/x/stakers/keeper/keeper.go +++ b/x/stakers/keeper/keeper.go @@ -4,8 +4,6 @@ import ( "context" "fmt" - "cosmossdk.io/collections" - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -27,16 +25,10 @@ type ( authority string - accountKeeper util.AccountKeeper bankKeeper util.BankKeeper poolKeeper types.PoolKeeper stakingKeeper util.StakingKeeper distKeeper util.DistributionKeeper - - MultiCoinRewardsEnabled collections.KeySet[sdk.AccAddress] - MultiCoinRefundPolicy collections.Item[types.MultiCoinRefundPolicy] - - Schema collections.Schema } ) @@ -48,14 +40,11 @@ func NewKeeper( authority string, - accountKeeper util.AccountKeeper, bankKeeper util.BankKeeper, poolKeeper types.PoolKeeper, stakingKeeper util.StakingKeeper, distributionKeeper util.DistributionKeeper, ) *Keeper { - sb := collections.NewSchemaBuilder(storeService) - k := &Keeper{ cdc: cdc, storeService: storeService, @@ -64,25 +53,12 @@ func NewKeeper( authority: authority, - accountKeeper: accountKeeper, bankKeeper: bankKeeper, poolKeeper: poolKeeper, stakingKeeper: stakingKeeper, distKeeper: distributionKeeper, - - MultiCoinRewardsEnabled: collections.NewKeySet(sb, types.MultiCoinRewardsEnabledKeyPrefix, - "compliance_multi_coin_enabled", sdk.AccAddressKey), - MultiCoinRefundPolicy: collections.NewItem(sb, types.MultiCoinRefundPolicyKeyPrefix, - "compliance_multi_coin_policy", codec.CollValue[types.MultiCoinRefundPolicy](cdc)), - } - - schema, err := sb.Build() - if err != nil { - panic(err) } - k.Schema = schema - return k } diff --git a/x/stakers/module.go b/x/stakers/module.go index 033aa9ca..721c4df4 100644 --- a/x/stakers/module.go +++ b/x/stakers/module.go @@ -15,7 +15,6 @@ import ( "github.com/KYVENetwork/chain/util" poolKeeper "github.com/KYVENetwork/chain/x/pool/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - distributionKeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" // this line is used by starport scaffolding # 1 @@ -157,14 +156,6 @@ func (am AppModule) BeginBlock(ctx context.Context) error { am.keeper.ProcessCommissionChangeQueue(sdkCtx) am.keeper.ProcessLeavePoolQueue(sdkCtx) am.keeper.ProcessStakeFractionChangeQueue(sdkCtx) - - am.keeper.ProcessComplianceQueue(sdkCtx) - - // Only execute every 50 blocks - if sdkCtx.BlockHeight()%50 != 0 { - _ = am.keeper.DistributeNonClaimedRewards(sdkCtx) - } - return nil } @@ -194,9 +185,8 @@ type ModuleInputs struct { MemService store.MemoryStoreService Logger log.Logger - AccountKeeper util.AccountKeeper BankKeeper util.BankKeeper - DistributionKeeper distributionKeeper.Keeper + DistributionKeeper util.DistributionKeeper PoolKeeper *poolKeeper.Keeper StakingKeeper util.StakingKeeper } @@ -221,7 +211,6 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { in.MemService, in.Logger, authority.String(), - in.AccountKeeper, in.BankKeeper, in.PoolKeeper, in.StakingKeeper, diff --git a/x/stakers/types/codec.go b/x/stakers/types/codec.go index ac51ee1c..686e887f 100644 --- a/x/stakers/types/codec.go +++ b/x/stakers/types/codec.go @@ -13,8 +13,6 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgJoinPool{}, "kyve/stakers/MsgJoinPool", nil) cdc.RegisterConcrete(&MsgLeavePool{}, "kyve/stakers/MsgLeavePool", nil) cdc.RegisterConcrete(&MsgUpdateParams{}, "kyve/stakers/MsgUpdateParams", nil) - cdc.RegisterConcrete(&MsgToggleMultiCoinRewards{}, "kyve/stakers/MsgToggleMultiCoinRewards", nil) - cdc.RegisterConcrete(&MsgSetMultiCoinRewardsRefundPolicy{}, "kyve/stakers/MsgSetMultiCoinRewardsRefundPolicy", nil) } func RegisterInterfaces(registry codecTypes.InterfaceRegistry) { @@ -23,8 +21,6 @@ func RegisterInterfaces(registry codecTypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgJoinPool{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgLeavePool{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgToggleMultiCoinRewards{}) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSetMultiCoinRewardsRefundPolicy{}) } var Amino = codec.NewLegacyAmino() diff --git a/x/stakers/types/errors.go b/x/stakers/types/errors.go index 98a31217..8269dccd 100644 --- a/x/stakers/types/errors.go +++ b/x/stakers/types/errors.go @@ -23,9 +23,4 @@ var ( ErrPoolAccountUnauthorized = errors.Register(ModuleName, 1118, "pool account unauthorized") ErrValidatorNotInActiveSet = errors.Register(ModuleName, 1119, "validator not in active set") ErrNoPoolAccount = errors.Register(ModuleName, 1120, "sender has no pool account") - - ErrMultiCoinRefundPolicyInvalidAdminAddress = errors.Register(ModuleName, 1122, "multi coin refund policy admin address invalid") - ErrMultiCoinRefundPolicyInvalid = errors.Register(ModuleName, 1123, "multi coin refund policy invalid") - ErrMultiCoinRewardsAlreadyEnabled = errors.Register(ModuleName, 1124, "multi coin rewards already enabled") - ErrMultiCoinRewardsAlreadyDisabled = errors.Register(ModuleName, 1125, "multi coin rewards already disabled") ) diff --git a/x/stakers/types/genesis.go b/x/stakers/types/genesis.go index 4a330856..fad05b6f 100644 --- a/x/stakers/types/genesis.go +++ b/x/stakers/types/genesis.go @@ -7,8 +7,7 @@ import ( // DefaultGenesis returns the default Capability genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - Params: DefaultParams(), - MultiCoinRefundPolicy: &MultiCoinRefundPolicy{}, + Params: DefaultParams(), } } @@ -84,27 +83,5 @@ func (gs GenesisState) Validate() error { stakeFractionChangeMap[index] = struct{}{} } - // Multi Coin Pending Rewards - multiCoinPendingRewardsMap := make(map[string]struct{}) - - for _, elem := range gs.MultiCoinPendingRewardsEntries { - index := string(MultiCoinPendingRewardsKeyEntry(elem.Index)) - if _, ok := multiCoinPendingRewardsMap[index]; ok { - return fmt.Errorf("duplicated index for multi coin pending rewards entry %v", elem) - } - if elem.Index > gs.QueueStatePendingRewards.HighIndex { - return fmt.Errorf(" multi coin pending rewards entry index too high: %v", elem) - } - if elem.Index < gs.QueueStatePendingRewards.LowIndex { - return fmt.Errorf(" multi coin pending rewards entry index too low: %v", elem) - } - - multiCoinPendingRewardsMap[index] = struct{}{} - } - - if _, err := ParseMultiCoinComplianceMap(*gs.MultiCoinRefundPolicy); err != nil { - return err - } - return gs.Params.Validate() } diff --git a/x/stakers/types/genesis.pb.go b/x/stakers/types/genesis.pb.go index 4f5a8f14..35e179ae 100644 --- a/x/stakers/types/genesis.pb.go +++ b/x/stakers/types/genesis.pb.go @@ -43,14 +43,6 @@ type GenesisState struct { StakeFractionChangeEntries []StakeFractionChangeEntry `protobuf:"bytes,8,rep,name=stake_fraction_change_entries,json=stakeFractionChangeEntries,proto3" json:"stake_fraction_change_entries"` // queue_state_stake_fraction ... QueueStateStakeFraction QueueState `protobuf:"bytes,9,opt,name=queue_state_stake_fraction,json=queueStateStakeFraction,proto3" json:"queue_state_stake_fraction"` - // MultiCoinPendingRewardsEntry ... - MultiCoinPendingRewardsEntries []MultiCoinPendingRewardsEntry `protobuf:"bytes,10,rep,name=multi_coin_pending_rewards_entries,json=multiCoinPendingRewardsEntries,proto3" json:"multi_coin_pending_rewards_entries"` - // queue_state_state_fraction ... - QueueStatePendingRewards QueueState `protobuf:"bytes,11,opt,name=queue_state_pending_rewards,json=queueStatePendingRewards,proto3" json:"queue_state_pending_rewards"` - // multi_coin_enabled ... - MultiCoinEnabled []string `protobuf:"bytes,12,rep,name=multi_coin_enabled,json=multiCoinEnabled,proto3" json:"multi_coin_enabled,omitempty"` - // multi_coin_refund_policy ... - MultiCoinRefundPolicy *MultiCoinRefundPolicy `protobuf:"bytes,13,opt,name=multi_coin_refund_policy,json=multiCoinRefundPolicy,proto3" json:"multi_coin_refund_policy,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -149,34 +141,6 @@ func (m *GenesisState) GetQueueStateStakeFraction() QueueState { return QueueState{} } -func (m *GenesisState) GetMultiCoinPendingRewardsEntries() []MultiCoinPendingRewardsEntry { - if m != nil { - return m.MultiCoinPendingRewardsEntries - } - return nil -} - -func (m *GenesisState) GetQueueStatePendingRewards() QueueState { - if m != nil { - return m.QueueStatePendingRewards - } - return QueueState{} -} - -func (m *GenesisState) GetMultiCoinEnabled() []string { - if m != nil { - return m.MultiCoinEnabled - } - return nil -} - -func (m *GenesisState) GetMultiCoinRefundPolicy() *MultiCoinRefundPolicy { - if m != nil { - return m.MultiCoinRefundPolicy - } - return nil -} - func init() { proto.RegisterType((*GenesisState)(nil), "kyve.stakers.v1beta1.GenesisState") } @@ -186,44 +150,37 @@ func init() { } var fileDescriptor_0deb2ee89d595051 = []byte{ - // 584 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcf, 0x6e, 0xd3, 0x30, - 0x18, 0x6f, 0xd8, 0x18, 0xcc, 0x1d, 0xda, 0x66, 0x15, 0x16, 0x0a, 0x84, 0xae, 0xe2, 0x30, 0x69, - 0x53, 0xa2, 0x8d, 0x1b, 0x37, 0x56, 0x75, 0x1c, 0x18, 0xa8, 0xa4, 0x12, 0x02, 0x84, 0x64, 0xb9, - 0xa9, 0x97, 0x5a, 0x4d, 0xec, 0x2c, 0x76, 0x5a, 0x7a, 0xe7, 0x01, 0x78, 0x23, 0xae, 0x3b, 0xee, - 0xc8, 0x09, 0xa1, 0xf6, 0x45, 0x50, 0x9c, 0xac, 0x49, 0xc1, 0x05, 0xf5, 0xd6, 0x7e, 0xdf, 0xef, - 0xef, 0x97, 0x28, 0xa0, 0x39, 0x9c, 0x8c, 0x88, 0x23, 0x24, 0x1e, 0x92, 0x58, 0x38, 0xa3, 0xe3, - 0x1e, 0x91, 0xf8, 0xd8, 0xf1, 0x09, 0x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8a, 0x0a, 0x98, - 0x79, 0x5b, 0x1d, 0xb5, 0xa1, 0xf7, 0x7a, 0x97, 0x72, 0xd4, 0x63, 0xc8, 0x0d, 0x6a, 0x97, 0xf3, - 0x49, 0x91, 0x03, 0x7e, 0x00, 0x30, 0x20, 0x78, 0x44, 0x90, 0xba, 0xd3, 0x4d, 0x8b, 0x0d, 0xd5, - 0xe2, 0x99, 0x5e, 0xf9, 0x3c, 0xc5, 0xa7, 0x77, 0x2a, 0xc7, 0xdf, 0x09, 0xca, 0xd3, 0x34, 0xb7, - 0x0b, 0x76, 0xcb, 0xb9, 0xd5, 0xde, 0xbc, 0xb3, 0x52, 0xe4, 0xed, 0x22, 0xb2, 0x32, 0x85, 0x63, - 0xf0, 0x44, 0x91, 0xd0, 0x45, 0x8c, 0x3d, 0xa9, 0x39, 0xff, 0x5d, 0x15, 0xdc, 0xfe, 0xc7, 0x6b, - 0x72, 0x96, 0x33, 0xff, 0x7e, 0x02, 0x75, 0xa1, 0xdf, 0xa7, 0x65, 0x3c, 0x50, 0x2f, 0x97, 0x59, - 0x0c, 0x61, 0x6e, 0xae, 0xd4, 0x6a, 0xaf, 0x68, 0xb5, 0x90, 0x08, 0x7e, 0x35, 0x40, 0x33, 0x4c, - 0x02, 0x49, 0x91, 0xc7, 0x29, 0x43, 0x11, 0x61, 0x7d, 0xca, 0x7c, 0x14, 0x93, 0x31, 0x8e, 0xfb, - 0x62, 0xde, 0x11, 0xa8, 0x8e, 0x27, 0x7a, 0xb7, 0x37, 0x29, 0xbf, 0xc5, 0x29, 0xeb, 0x64, 0x6c, - 0x37, 0x23, 0x97, 0x7b, 0x5a, 0xe1, 0x72, 0x4c, 0xda, 0x95, 0x80, 0x47, 0xe5, 0xae, 0x7f, 0xc4, - 0x30, 0xab, 0x2b, 0x95, 0x35, 0x8b, 0xb2, 0x8b, 0x6e, 0xf0, 0x08, 0xc0, 0x52, 0x59, 0xc2, 0x70, - 0x2f, 0x20, 0x7d, 0x73, 0xab, 0xb1, 0x76, 0xb0, 0xe9, 0xee, 0xcc, 0x23, 0xb6, 0xb3, 0x39, 0xec, - 0x03, 0xb3, 0x84, 0x8e, 0xc9, 0x45, 0xc2, 0xfa, 0x28, 0xe2, 0x01, 0xf5, 0x26, 0xe6, 0x3d, 0x95, - 0xe8, 0xf0, 0x3f, 0x07, 0x71, 0x15, 0xa7, 0xa3, 0x28, 0xee, 0xfd, 0x50, 0x37, 0x3e, 0x3d, 0xbb, - 0x9a, 0x5a, 0xc6, 0xf5, 0xd4, 0x32, 0x7e, 0x4d, 0x2d, 0xe3, 0xdb, 0xcc, 0xaa, 0x5c, 0xcf, 0xac, - 0xca, 0x8f, 0x99, 0x55, 0xf9, 0x74, 0xe4, 0x53, 0x39, 0x48, 0x7a, 0xb6, 0xc7, 0x43, 0xe7, 0xf5, - 0xc7, 0xf7, 0xed, 0xb7, 0x44, 0x8e, 0x79, 0x3c, 0x74, 0xbc, 0x01, 0xa6, 0xcc, 0xf9, 0x32, 0xff, - 0x32, 0xca, 0x49, 0x44, 0x44, 0x6f, 0x43, 0x7d, 0x10, 0x9f, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, - 0x7c, 0x9e, 0xde, 0xca, 0xa9, 0x05, 0x00, 0x00, + // 468 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0x1b, 0x36, 0x0a, 0x78, 0x48, 0x63, 0x51, 0xc5, 0x42, 0x04, 0xa1, 0x9b, 0x38, 0x20, + 0x81, 0x12, 0x0d, 0x6e, 0xdc, 0x58, 0xb5, 0x71, 0x60, 0x42, 0xb0, 0x4a, 0x08, 0x10, 0x92, 0xe5, + 0x5a, 0x8f, 0xd4, 0x6a, 0x12, 0x67, 0xb1, 0xdb, 0xd1, 0x6f, 0xc1, 0x17, 0xe2, 0xbe, 0xe3, 0x8e, + 0x9c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0xbc, 0xfd, 0xfc, 0xf1, 0xe0, + 0x1d, 0xe8, 0x53, 0x59, 0x4d, 0x12, 0x3e, 0x66, 0xa2, 0x48, 0xbe, 0xaf, 0xde, 0xa5, 0x9e, 0x97, + 0xa0, 0x46, 0x5d, 0x7c, 0x8e, 0x2f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x7d, 0xb2, 0x45, 0x3f, + 0x27, 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -246,51 +203,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.MultiCoinRefundPolicy != nil { - { - size, err := m.MultiCoinRefundPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - if len(m.MultiCoinEnabled) > 0 { - for iNdEx := len(m.MultiCoinEnabled) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.MultiCoinEnabled[iNdEx]) - copy(dAtA[i:], m.MultiCoinEnabled[iNdEx]) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.MultiCoinEnabled[iNdEx]))) - i-- - dAtA[i] = 0x62 - } - } - { - size, err := m.QueueStatePendingRewards.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - if len(m.MultiCoinPendingRewardsEntries) > 0 { - for iNdEx := len(m.MultiCoinPendingRewardsEntries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.MultiCoinPendingRewardsEntries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - } { size, err := m.QueueStateStakeFraction.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -459,24 +371,6 @@ func (m *GenesisState) Size() (n int) { } l = m.QueueStateStakeFraction.Size() n += 1 + l + sovGenesis(uint64(l)) - if len(m.MultiCoinPendingRewardsEntries) > 0 { - for _, e := range m.MultiCoinPendingRewardsEntries { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - l = m.QueueStatePendingRewards.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.MultiCoinEnabled) > 0 { - for _, s := range m.MultiCoinEnabled { - l = len(s) - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.MultiCoinRefundPolicy != nil { - l = m.MultiCoinRefundPolicy.Size() - n += 1 + l + sovGenesis(uint64(l)) - } return n } @@ -817,141 +711,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MultiCoinPendingRewardsEntries", 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.MultiCoinPendingRewardsEntries = append(m.MultiCoinPendingRewardsEntries, MultiCoinPendingRewardsEntry{}) - if err := m.MultiCoinPendingRewardsEntries[len(m.MultiCoinPendingRewardsEntries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueueStatePendingRewards", 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.QueueStatePendingRewards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MultiCoinEnabled", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MultiCoinEnabled = append(m.MultiCoinEnabled, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MultiCoinRefundPolicy", 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 m.MultiCoinRefundPolicy == nil { - m.MultiCoinRefundPolicy = &MultiCoinRefundPolicy{} - } - if err := m.MultiCoinRefundPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/stakers/types/keys.go b/x/stakers/types/keys.go index 524e717f..d7e86bb2 100644 --- a/x/stakers/types/keys.go +++ b/x/stakers/types/keys.go @@ -13,8 +13,6 @@ const ( // RouterKey defines the module's message routing key RouterKey = ModuleName - - MultiCoinRewardsRedistributionAccountName = "multi_coin_rewards_redistribution" ) var ( @@ -48,15 +46,6 @@ var ( StakeFractionChangeEntryKeyPrefix = []byte{7, 0} // StakeFractionChangeKeyPrefixIndex2 | | StakeFractionChangeKeyPrefixIndex2 = []byte{7, 1} - - // MultiCoinPendingRewardsEntryKeyPrefix | - MultiCoinPendingRewardsEntryKeyPrefix = []byte{8, 0} - // MultiCoinPendingRewardsEntryKeyPrefixIndex2 | | - MultiCoinPendingRewardsEntryKeyPrefixIndex2 = []byte{8, 1} - - MultiCoinRewardsEnabledKeyPrefix = []byte{9, 2} - - MultiCoinRefundPolicyKeyPrefix = []byte{9, 3} ) // ENUM aggregated data types @@ -68,10 +57,9 @@ var STAKER_STATS_COUNT STAKER_STATS = "total_stakers" type QUEUE_IDENTIFIER []byte var ( - QUEUE_IDENTIFIER_COMMISSION QUEUE_IDENTIFIER = []byte{30, 2} - QUEUE_IDENTIFIER_LEAVE QUEUE_IDENTIFIER = []byte{30, 3} - QUEUE_IDENTIFIER_STAKE_FRACTION QUEUE_IDENTIFIER = []byte{30, 4} - QUEUE_IDENTIFIER_MULTI_COIN_REWARDS QUEUE_IDENTIFIER = []byte{30, 5} + QUEUE_IDENTIFIER_COMMISSION QUEUE_IDENTIFIER = []byte{30, 2} + QUEUE_IDENTIFIER_LEAVE QUEUE_IDENTIFIER = []byte{30, 3} + QUEUE_IDENTIFIER_STAKE_FRACTION QUEUE_IDENTIFIER = []byte{30, 4} ) const MaxStakers = 50 @@ -108,11 +96,3 @@ func StakeFractionChangeEntryKey(index uint64) []byte { func StakeFractionChangeEntryKeyIndex2(staker string, poolId uint64) []byte { return util.GetByteKey(staker, poolId) } - -func MultiCoinPendingRewardsKeyEntry(index uint64) []byte { - return util.GetByteKey(index) -} - -func MultiCoinPendingRewardsKeyEntryIndex2(address string, index uint64) []byte { - return util.GetByteKey(address, index) -} diff --git a/x/stakers/types/params.go b/x/stakers/types/params.go index a006504a..e2fdd5ab 100644 --- a/x/stakers/types/params.go +++ b/x/stakers/types/params.go @@ -14,9 +14,6 @@ var DefaultLeavePoolTime = uint64(60 * 60 * 24 * 5) // DefaultStakeFractionChangeTime ... var DefaultStakeFractionChangeTime = uint64(60 * 60 * 24 * 5) -// DefaultMultiCoinRefundPendingTime ... -var DefaultMultiCoinRefundPendingTime = uint64(60 * 60 * 24 * 14) - // DefaultVoteSlash ... var DefaultVoteSlash = math.LegacyMustNewDecFromStr("0.01") @@ -31,19 +28,17 @@ func NewParams( commissionChangeTime uint64, leavePoolTime uint64, stakeFractionChangeTime uint64, - multiCoinRefundPendingTime uint64, voteSlash math.LegacyDec, uploadSlash math.LegacyDec, timeoutSlash math.LegacyDec, ) Params { return Params{ - CommissionChangeTime: commissionChangeTime, - LeavePoolTime: leavePoolTime, - StakeFractionChangeTime: stakeFractionChangeTime, - MultiCoinRefundPendingTime: multiCoinRefundPendingTime, - VoteSlash: voteSlash, - UploadSlash: uploadSlash, - TimeoutSlash: timeoutSlash, + CommissionChangeTime: commissionChangeTime, + LeavePoolTime: leavePoolTime, + StakeFractionChangeTime: stakeFractionChangeTime, + VoteSlash: voteSlash, + UploadSlash: uploadSlash, + TimeoutSlash: timeoutSlash, } } @@ -53,7 +48,6 @@ func DefaultParams() Params { DefaultCommissionChangeTime, DefaultLeavePoolTime, DefaultStakeFractionChangeTime, - DefaultMultiCoinRefundPendingTime, DefaultVoteSlash, DefaultUploadSlash, DefaultTimeoutSlash, @@ -74,10 +68,6 @@ func (p Params) Validate() error { return err } - if err := util.ValidateNumber(p.MultiCoinRefundPendingTime); err != nil { - return err - } - if err := util.ValidatePercentage(p.VoteSlash); err != nil { return err } diff --git a/x/stakers/types/params.pb.go b/x/stakers/types/params.pb.go index 5cc1b279..b2cd010d 100644 --- a/x/stakers/types/params.pb.go +++ b/x/stakers/types/params.pb.go @@ -38,11 +38,6 @@ type Params struct { UploadSlash cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=upload_slash,json=uploadSlash,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"upload_slash"` // timeout_slash ... TimeoutSlash cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=timeout_slash,json=timeoutSlash,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"timeout_slash"` - // multi_coin_compliance_admin_address specifies an address which is allowed to adjust the weights for - // the coin redistribution. This address can now drain coins, but only - MultiCoinRefundPolicyAdminAddress string `protobuf:"bytes,7,opt,name=multi_coin_refund_policy_admin_address,json=multiCoinRefundPolicyAdminAddress,proto3" json:"multi_coin_refund_policy_admin_address,omitempty"` - // multi_coin_refund_pending_time ... - MultiCoinRefundPendingTime uint64 `protobuf:"varint,8,opt,name=multi_coin_refund_pending_time,json=multiCoinRefundPendingTime,proto3" json:"multi_coin_refund_pending_time,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -99,20 +94,6 @@ func (m *Params) GetStakeFractionChangeTime() uint64 { return 0 } -func (m *Params) GetMultiCoinRefundPolicyAdminAddress() string { - if m != nil { - return m.MultiCoinRefundPolicyAdminAddress - } - return "" -} - -func (m *Params) GetMultiCoinRefundPendingTime() uint64 { - if m != nil { - return m.MultiCoinRefundPendingTime - } - return 0 -} - func init() { proto.RegisterType((*Params)(nil), "kyve.stakers.v1beta1.Params") } @@ -120,34 +101,29 @@ func init() { func init() { proto.RegisterFile("kyve/stakers/v1beta1/params.proto", fileDescriptor_405cabd7005fc18b) } var fileDescriptor_405cabd7005fc18b = []byte{ - // 424 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0xd2, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0x07, 0xf0, 0xac, 0xc6, 0x68, 0xc7, 0x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0xf2, 0xf9, 0xf5, 0x7b, 0xb0, 0xdf, 0xb0, 0x5e, 0x52, 0x51, 0x70, 0xa9, 0xe9, 0xf7, 0x3f, - 0xaf, 0xd2, 0xb6, 0x15, 0x98, 0xc5, 0xc0, 0xbf, 0xb0, 0xe7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, - 0xef, 0x77, 0x32, 0x97, 0xb2, 0x02, 0x00, 0x00, + // 347 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0xc3, 0x30, + 0x14, 0x80, 0xdb, 0x39, 0x07, 0x8b, 0x1b, 0x42, 0x19, 0x3a, 0x26, 0x74, 0x53, 0x41, 0x76, 0x90, + 0x86, 0xa1, 0x37, 0x6f, 0x53, 0x87, 0xa0, 0xc8, 0x98, 0x22, 0xe8, 0xa5, 0x64, 0x59, 0x6c, 0x43, + 0x9b, 0xbd, 0xd2, 0x64, 0xd5, 0xfd, 0x0b, 0x7f, 0xd6, 0x8e, 0x3b, 0x8a, 0x87, 0x21, 0xdb, 0xaf, + 0xf0, 0x26, 0x4d, 0x8b, 0x8a, 0xa7, 0xdd, 0x4a, 0xf3, 0x7d, 0xdf, 0x7b, 0xf0, 0xd0, 0x7e, 0x30, + 0x4d, 0x18, 0x96, 0x8a, 0x04, 0x2c, 0x96, 0x38, 0xe9, 0x0c, 0x99, 0x22, 0x1d, 0x1c, 0x91, 0x98, + 0x08, 0xe9, 0x44, 0x31, 0x28, 0xb0, 0x6a, 0x29, 0xe2, 0xe4, 0x88, 0x93, 0x23, 0x8d, 0x9a, 0x07, + 0x1e, 0x68, 0x00, 0xa7, 0x5f, 0x19, 0x7b, 0xf0, 0x55, 0x40, 0xa5, 0xbe, 0x96, 0xad, 0x53, 0xb4, + 0x43, 0x41, 0x08, 0x2e, 0x25, 0x87, 0xb1, 0x4b, 0x7d, 0x32, 0xf6, 0x98, 0xab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 0xe7, 0xfc, 0x6a, 0x1a, 0x31, 0x39, 0x2c, 0xe9, 0x53, 0x9e, 0x7c, 0x07, 0x00, + 0x00, 0xff, 0xff, 0xc8, 0xcb, 0x77, 0x48, 0x1b, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -170,18 +146,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.MultiCoinRefundPendingTime != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MultiCoinRefundPendingTime)) - i-- - dAtA[i] = 0x40 - } - if len(m.MultiCoinRefundPolicyAdminAddress) > 0 { - i -= len(m.MultiCoinRefundPolicyAdminAddress) - copy(dAtA[i:], m.MultiCoinRefundPolicyAdminAddress) - i = encodeVarintParams(dAtA, i, uint64(len(m.MultiCoinRefundPolicyAdminAddress))) - i-- - dAtA[i] = 0x3a - } { size := m.TimeoutSlash.Size() i -= size @@ -262,13 +226,6 @@ func (m *Params) Size() (n int) { n += 1 + l + sovParams(uint64(l)) l = m.TimeoutSlash.Size() n += 1 + l + sovParams(uint64(l)) - l = len(m.MultiCoinRefundPolicyAdminAddress) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - if m.MultiCoinRefundPendingTime != 0 { - n += 1 + sovParams(uint64(m.MultiCoinRefundPendingTime)) - } return n } @@ -466,57 +423,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MultiCoinRefundPolicyAdminAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MultiCoinRefundPolicyAdminAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MultiCoinRefundPendingTime", wireType) - } - m.MultiCoinRefundPendingTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MultiCoinRefundPendingTime |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/stakers/types/query.pb.go b/x/stakers/types/query.pb.go index d5b9d697..87483235 100644 --- a/x/stakers/types/query.pb.go +++ b/x/stakers/types/query.pb.go @@ -6,9 +6,6 @@ package types import ( context "context" fmt "fmt" - 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/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -115,240 +112,34 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -// QueryMultiCoinRefundPolicyRequest ... -type QueryMultiCoinRefundPolicyRequest struct { -} - -func (m *QueryMultiCoinRefundPolicyRequest) Reset() { *m = QueryMultiCoinRefundPolicyRequest{} } -func (m *QueryMultiCoinRefundPolicyRequest) String() string { return proto.CompactTextString(m) } -func (*QueryMultiCoinRefundPolicyRequest) ProtoMessage() {} -func (*QueryMultiCoinRefundPolicyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_6c1bf6f190db35c0, []int{2} -} -func (m *QueryMultiCoinRefundPolicyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMultiCoinRefundPolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMultiCoinRefundPolicyRequest.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 *QueryMultiCoinRefundPolicyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMultiCoinRefundPolicyRequest.Merge(m, src) -} -func (m *QueryMultiCoinRefundPolicyRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryMultiCoinRefundPolicyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMultiCoinRefundPolicyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMultiCoinRefundPolicyRequest proto.InternalMessageInfo - -// QueryMultiCoinRefundPolicyResponse ... -type QueryMultiCoinRefundPolicyResponse struct { - // params holds all the parameters of this module. - Policy MultiCoinRefundPolicy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy"` -} - -func (m *QueryMultiCoinRefundPolicyResponse) Reset() { *m = QueryMultiCoinRefundPolicyResponse{} } -func (m *QueryMultiCoinRefundPolicyResponse) String() string { return proto.CompactTextString(m) } -func (*QueryMultiCoinRefundPolicyResponse) ProtoMessage() {} -func (*QueryMultiCoinRefundPolicyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6c1bf6f190db35c0, []int{3} -} -func (m *QueryMultiCoinRefundPolicyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMultiCoinRefundPolicyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMultiCoinRefundPolicyResponse.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 *QueryMultiCoinRefundPolicyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMultiCoinRefundPolicyResponse.Merge(m, src) -} -func (m *QueryMultiCoinRefundPolicyResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryMultiCoinRefundPolicyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMultiCoinRefundPolicyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMultiCoinRefundPolicyResponse proto.InternalMessageInfo - -func (m *QueryMultiCoinRefundPolicyResponse) GetPolicy() MultiCoinRefundPolicy { - if m != nil { - return m.Policy - } - return MultiCoinRefundPolicy{} -} - -// QueryMultiCoinRefundPolicyRequest ... -type QueryMultiCoinStatusRequest struct { - // address ... - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *QueryMultiCoinStatusRequest) Reset() { *m = QueryMultiCoinStatusRequest{} } -func (m *QueryMultiCoinStatusRequest) String() string { return proto.CompactTextString(m) } -func (*QueryMultiCoinStatusRequest) ProtoMessage() {} -func (*QueryMultiCoinStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_6c1bf6f190db35c0, []int{4} -} -func (m *QueryMultiCoinStatusRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMultiCoinStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMultiCoinStatusRequest.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 *QueryMultiCoinStatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMultiCoinStatusRequest.Merge(m, src) -} -func (m *QueryMultiCoinStatusRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryMultiCoinStatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMultiCoinStatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMultiCoinStatusRequest proto.InternalMessageInfo - -func (m *QueryMultiCoinStatusRequest) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -// QueryMultiCoinRefundPolicyResponse ... -type QueryMultiCoinStatusResponse struct { - // enabled ... - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - // pending_multi_coin_rewards ... - PendingMultiCoinRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=pending_multi_coin_rewards,json=pendingMultiCoinRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"pending_multi_coin_rewards"` -} - -func (m *QueryMultiCoinStatusResponse) Reset() { *m = QueryMultiCoinStatusResponse{} } -func (m *QueryMultiCoinStatusResponse) String() string { return proto.CompactTextString(m) } -func (*QueryMultiCoinStatusResponse) ProtoMessage() {} -func (*QueryMultiCoinStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6c1bf6f190db35c0, []int{5} -} -func (m *QueryMultiCoinStatusResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMultiCoinStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMultiCoinStatusResponse.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 *QueryMultiCoinStatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMultiCoinStatusResponse.Merge(m, src) -} -func (m *QueryMultiCoinStatusResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryMultiCoinStatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMultiCoinStatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMultiCoinStatusResponse proto.InternalMessageInfo - -func (m *QueryMultiCoinStatusResponse) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *QueryMultiCoinStatusResponse) GetPendingMultiCoinRewards() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.PendingMultiCoinRewards - } - return nil -} - func init() { proto.RegisterType((*QueryParamsRequest)(nil), "kyve.stakers.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "kyve.stakers.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryMultiCoinRefundPolicyRequest)(nil), "kyve.stakers.v1beta1.QueryMultiCoinRefundPolicyRequest") - proto.RegisterType((*QueryMultiCoinRefundPolicyResponse)(nil), "kyve.stakers.v1beta1.QueryMultiCoinRefundPolicyResponse") - proto.RegisterType((*QueryMultiCoinStatusRequest)(nil), "kyve.stakers.v1beta1.QueryMultiCoinStatusRequest") - proto.RegisterType((*QueryMultiCoinStatusResponse)(nil), "kyve.stakers.v1beta1.QueryMultiCoinStatusResponse") } func init() { proto.RegisterFile("kyve/stakers/v1beta1/query.proto", fileDescriptor_6c1bf6f190db35c0) } var fileDescriptor_6c1bf6f190db35c0 = []byte{ - // 582 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x6b, 0x13, 0x41, - 0x18, 0xc6, 0x33, 0xb5, 0xa6, 0x3a, 0x3d, 0x88, 0x63, 0xc0, 0xb8, 0x86, 0x6d, 0xba, 0x7a, 0x88, - 0xff, 0x76, 0x4c, 0x8a, 0x56, 0x3d, 0x46, 0x14, 0x44, 0x94, 0x76, 0x05, 0x41, 0x2f, 0x61, 0x92, - 0x1d, 0xb7, 0x4b, 0xb2, 0x33, 0xdb, 0x9d, 0xd9, 0xd6, 0x20, 0x5e, 0xf4, 0x5c, 0x10, 0xfc, 0x12, - 0xe2, 0x49, 0xf0, 0x43, 0x98, 0x63, 0xc1, 0x8b, 0x27, 0x95, 0x44, 0xf0, 0x6b, 0xc8, 0xce, 0xcc, - 0x86, 0x46, 0x97, 0xd8, 0x5e, 0x92, 0x9d, 0xd9, 0xe7, 0x99, 0xf7, 0xf7, 0xbe, 0xf3, 0xb0, 0xb0, - 0xde, 0x1f, 0xee, 0x50, 0x2c, 0x24, 0xe9, 0xd3, 0x44, 0xe0, 0x9d, 0x66, 0x97, 0x4a, 0xd2, 0xc4, - 0xdb, 0x29, 0x4d, 0x86, 0x6e, 0x9c, 0x70, 0xc9, 0x51, 0x25, 0x53, 0xb8, 0x46, 0xe1, 0x1a, 0x85, - 0x75, 0x9a, 0x44, 0x21, 0xe3, 0x58, 0xfd, 0x6a, 0xa1, 0x65, 0xf7, 0xb8, 0x88, 0xb8, 0xc0, 0x5d, - 0x22, 0xe8, 0xf4, 0xa4, 0x1e, 0x0f, 0x99, 0x79, 0x5f, 0x09, 0x78, 0xc0, 0xd5, 0x23, 0xce, 0x9e, - 0xcc, 0x6e, 0x2d, 0xe0, 0x3c, 0x18, 0x50, 0x4c, 0xe2, 0x10, 0x13, 0xc6, 0xb8, 0x24, 0x32, 0xe4, - 0x4c, 0x98, 0xb7, 0xab, 0x85, 0x78, 0x31, 0x49, 0x48, 0x94, 0x4b, 0x9c, 0x42, 0x49, 0xce, 0xab, - 0x34, 0x4e, 0x05, 0xa2, 0xcd, 0xac, 0xa5, 0x0d, 0x65, 0xf4, 0xe8, 0x76, 0x4a, 0x85, 0x74, 0x36, - 0xe1, 0x99, 0x99, 0x5d, 0x11, 0x73, 0x26, 0x28, 0xba, 0x03, 0xcb, 0xba, 0x40, 0x15, 0xd4, 0x41, - 0x63, 0xb9, 0x55, 0x73, 0x8b, 0x26, 0xe0, 0x6a, 0x57, 0x7b, 0x71, 0xf4, 0x7d, 0xa5, 0xe4, 0x19, - 0x87, 0x73, 0x01, 0xae, 0xaa, 0x23, 0x1f, 0xa5, 0x03, 0x19, 0xde, 0xe5, 0x21, 0xf3, 0xe8, 0x8b, - 0x94, 0xf9, 0x1b, 0x7c, 0x10, 0xf6, 0x86, 0x79, 0x5d, 0x0e, 0x9d, 0x79, 0x22, 0x83, 0xf1, 0x00, - 0x96, 0x63, 0xb5, 0x63, 0x30, 0xae, 0x14, 0x63, 0x14, 0x1e, 0x32, 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 0x37, 0x1a, 0xee, 0x9b, 0x8a, 0xfb, 0x3a, 0x72, 0x8b, 0xb9, 0x67, 0x2e, 0x31, 0xb3, 0x77, - 0x74, 0xba, 0xd0, 0x67, 0x00, 0x4f, 0xfd, 0x95, 0x0f, 0xd4, 0x3c, 0x0c, 0xc5, 0x4c, 0x0a, 0xad, - 0xd6, 0x51, 0x2c, 0x06, 0xf9, 0xb6, 0x42, 0x5e, 0x43, 0xcd, 0xff, 0x22, 0x0b, 0x65, 0xc4, 0xaf, - 0x4c, 0xb2, 0x5f, 0xb7, 0xef, 0x8f, 0xc6, 0x36, 0xd8, 0x1f, 0xdb, 0xe0, 0xe7, 0xd8, 0x06, 0xef, - 0x26, 0x76, 0x69, 0x7f, 0x62, 0x97, 0xbe, 0x4d, 0xec, 0xd2, 0xf3, 0xab, 0x07, 0x12, 0xf7, 0xf0, - 0xd9, 0xd3, 0x7b, 0x8f, 0xa9, 0xdc, 0xe5, 0x49, 0x1f, 0xf7, 0xb6, 0x48, 0xc8, 0xf0, 0xcb, 0x69, - 0x15, 0x95, 0xbd, 0x6e, 0x59, 0x7d, 0x61, 0xd6, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x15, 0x0e, - 0xd4, 0x56, 0x49, 0x05, 0x00, 0x00, + // 289 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xc8, 0xae, 0x2c, 0x4b, + 0xd5, 0x2f, 0x2e, 0x49, 0xcc, 0x4e, 0x2d, 0x2a, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, + 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x01, 0xa9, + 0xd0, 0x83, 0xaa, 0xd0, 0x83, 0xaa, 0x90, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0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b9, 0xfa, 0xde, 0x91, 0x61, 0xae, 0x7e, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, + 0xc9, 0x19, 0x89, 0x99, 0x79, 0xfa, 0x15, 0x70, 0x03, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, + 0xc0, 0xe1, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x95, 0x3e, 0x8d, 0x82, 0xd8, 0x01, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -365,10 +156,6 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // policy, multi-coin-enabled, multi-coin-status/address: {enabled true false, pending rewards} - MultiCoinRefundPolicyQuery(ctx context.Context, in *QueryMultiCoinRefundPolicyRequest, opts ...grpc.CallOption) (*QueryMultiCoinRefundPolicyResponse, error) - // MultiCoinStatus ... - MultiCoinStatus(ctx context.Context, in *QueryMultiCoinStatusRequest, opts ...grpc.CallOption) (*QueryMultiCoinStatusResponse, error) } type queryClient struct { @@ -388,32 +175,10 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) MultiCoinRefundPolicyQuery(ctx context.Context, in *QueryMultiCoinRefundPolicyRequest, opts ...grpc.CallOption) (*QueryMultiCoinRefundPolicyResponse, error) { - out := new(QueryMultiCoinRefundPolicyResponse) - err := c.cc.Invoke(ctx, "/kyve.stakers.v1beta1.Query/MultiCoinRefundPolicyQuery", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) MultiCoinStatus(ctx context.Context, in *QueryMultiCoinStatusRequest, opts ...grpc.CallOption) (*QueryMultiCoinStatusResponse, error) { - out := new(QueryMultiCoinStatusResponse) - err := c.cc.Invoke(ctx, "/kyve.stakers.v1beta1.Query/MultiCoinStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // policy, multi-coin-enabled, multi-coin-status/address: {enabled true false, pending rewards} - MultiCoinRefundPolicyQuery(context.Context, *QueryMultiCoinRefundPolicyRequest) (*QueryMultiCoinRefundPolicyResponse, error) - // MultiCoinStatus ... - MultiCoinStatus(context.Context, *QueryMultiCoinStatusRequest) (*QueryMultiCoinStatusResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -423,12 +188,6 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) MultiCoinRefundPolicyQuery(ctx context.Context, req *QueryMultiCoinRefundPolicyRequest) (*QueryMultiCoinRefundPolicyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MultiCoinRefundPolicyQuery not implemented") -} -func (*UnimplementedQueryServer) MultiCoinStatus(ctx context.Context, req *QueryMultiCoinStatusRequest) (*QueryMultiCoinStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MultiCoinStatus not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -452,42 +211,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_MultiCoinRefundPolicyQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryMultiCoinRefundPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).MultiCoinRefundPolicyQuery(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kyve.stakers.v1beta1.Query/MultiCoinRefundPolicyQuery", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MultiCoinRefundPolicyQuery(ctx, req.(*QueryMultiCoinRefundPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_MultiCoinStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryMultiCoinStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).MultiCoinStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kyve.stakers.v1beta1.Query/MultiCoinStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MultiCoinStatus(ctx, req.(*QueryMultiCoinStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "kyve.stakers.v1beta1.Query", @@ -497,14 +220,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, - { - MethodName: "MultiCoinRefundPolicyQuery", - Handler: _Query_MultiCoinRefundPolicyQuery_Handler, - }, - { - MethodName: "MultiCoinStatus", - Handler: _Query_MultiCoinStatus_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "kyve/stakers/v1beta1/query.proto", @@ -566,139 +281,6 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryMultiCoinRefundPolicyRequest) 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 *QueryMultiCoinRefundPolicyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMultiCoinRefundPolicyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryMultiCoinRefundPolicyResponse) 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 *QueryMultiCoinRefundPolicyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMultiCoinRefundPolicyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Policy.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 *QueryMultiCoinStatusRequest) 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 *QueryMultiCoinStatusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMultiCoinStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryMultiCoinStatusResponse) 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 *QueryMultiCoinStatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMultiCoinStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PendingMultiCoinRewards) > 0 { - for iNdEx := len(m.PendingMultiCoinRewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PendingMultiCoinRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -730,59 +312,8 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryMultiCoinRefundPolicyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryMultiCoinRefundPolicyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Policy.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryMultiCoinStatusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryMultiCoinStatusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Enabled { - n += 2 - } - if len(m.PendingMultiCoinRewards) > 0 { - for _, e := range m.PendingMultiCoinRewards { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +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)))) @@ -920,325 +451,6 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMultiCoinRefundPolicyRequest) 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: QueryMultiCoinRefundPolicyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMultiCoinRefundPolicyRequest: 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 *QueryMultiCoinRefundPolicyResponse) 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: QueryMultiCoinRefundPolicyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMultiCoinRefundPolicyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Policy", 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.Policy.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 *QueryMultiCoinStatusRequest) 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: QueryMultiCoinStatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMultiCoinStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryMultiCoinStatusResponse) 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: QueryMultiCoinStatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMultiCoinStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PendingMultiCoinRewards", 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.PendingMultiCoinRewards = append(m.PendingMultiCoinRewards, types.Coin{}) - if err := m.PendingMultiCoinRewards[len(m.PendingMultiCoinRewards)-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 skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/stakers/types/query.pb.gw.go b/x/stakers/types/query.pb.gw.go index e0d3d339..d727b58a 100644 --- a/x/stakers/types/query.pb.gw.go +++ b/x/stakers/types/query.pb.gw.go @@ -51,78 +51,6 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -func request_Query_MultiCoinRefundPolicyQuery_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMultiCoinRefundPolicyRequest - var metadata runtime.ServerMetadata - - msg, err := client.MultiCoinRefundPolicyQuery(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_MultiCoinRefundPolicyQuery_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMultiCoinRefundPolicyRequest - var metadata runtime.ServerMetadata - - msg, err := server.MultiCoinRefundPolicyQuery(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_MultiCoinStatus_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMultiCoinStatusRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := client.MultiCoinStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_MultiCoinStatus_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryMultiCoinStatusRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := server.MultiCoinStatus(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. @@ -152,52 +80,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_MultiCoinRefundPolicyQuery_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_MultiCoinRefundPolicyQuery_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_MultiCoinRefundPolicyQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_MultiCoinStatus_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_MultiCoinStatus_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_MultiCoinStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -259,61 +141,13 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_MultiCoinRefundPolicyQuery_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_MultiCoinRefundPolicyQuery_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_MultiCoinRefundPolicyQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_MultiCoinStatus_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_MultiCoinStatus_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_MultiCoinStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kyve", "stakers", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_MultiCoinRefundPolicyQuery_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kyve", "stakers", "v1beta1", "multi_coin_refund_policy"}, "", runtime.AssumeColonVerbOpt(true))) - - pattern_Query_MultiCoinStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"kyve", "stakers", "v1beta1", "multi_coin_status", "address"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_MultiCoinRefundPolicyQuery_0 = runtime.ForwardResponseMessage - - forward_Query_MultiCoinStatus_0 = runtime.ForwardResponseMessage ) diff --git a/x/stakers/types/stakers.pb.go b/x/stakers/types/stakers.pb.go index 53d457c8..8b19dfb0 100644 --- a/x/stakers/types/stakers.pb.go +++ b/x/stakers/types/stakers.pb.go @@ -561,223 +561,6 @@ func (m *QueueState) GetHighIndex() uint64 { return 0 } -// MultiCoinPendingRewardsEntry ... -type MultiCoinPendingRewardsEntry struct { - // index is needed for the queue-algorithm which - // processes the commission changes - Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - // staker is the address of the affected staker - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - // rewards ... - Rewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"rewards"` - CreationDate int64 `protobuf:"varint,4,opt,name=creation_date,json=creationDate,proto3" json:"creation_date,omitempty"` -} - -func (m *MultiCoinPendingRewardsEntry) Reset() { *m = MultiCoinPendingRewardsEntry{} } -func (m *MultiCoinPendingRewardsEntry) String() string { return proto.CompactTextString(m) } -func (*MultiCoinPendingRewardsEntry) ProtoMessage() {} -func (*MultiCoinPendingRewardsEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_d209d1a2a74d375d, []int{6} -} -func (m *MultiCoinPendingRewardsEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MultiCoinPendingRewardsEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MultiCoinPendingRewardsEntry.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 *MultiCoinPendingRewardsEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_MultiCoinPendingRewardsEntry.Merge(m, src) -} -func (m *MultiCoinPendingRewardsEntry) XXX_Size() int { - return m.Size() -} -func (m *MultiCoinPendingRewardsEntry) XXX_DiscardUnknown() { - xxx_messageInfo_MultiCoinPendingRewardsEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_MultiCoinPendingRewardsEntry proto.InternalMessageInfo - -func (m *MultiCoinPendingRewardsEntry) GetIndex() uint64 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *MultiCoinPendingRewardsEntry) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *MultiCoinPendingRewardsEntry) GetRewards() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Rewards - } - return nil -} - -func (m *MultiCoinPendingRewardsEntry) GetCreationDate() int64 { - if m != nil { - return m.CreationDate - } - return 0 -} - -// MultiCoinRefundPolicy ... -type MultiCoinRefundPolicy struct { - Entries []*MultiCoinRefundDenomEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` -} - -func (m *MultiCoinRefundPolicy) Reset() { *m = MultiCoinRefundPolicy{} } -func (m *MultiCoinRefundPolicy) String() string { return proto.CompactTextString(m) } -func (*MultiCoinRefundPolicy) ProtoMessage() {} -func (*MultiCoinRefundPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_d209d1a2a74d375d, []int{7} -} -func (m *MultiCoinRefundPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MultiCoinRefundPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MultiCoinRefundPolicy.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 *MultiCoinRefundPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_MultiCoinRefundPolicy.Merge(m, src) -} -func (m *MultiCoinRefundPolicy) XXX_Size() int { - return m.Size() -} -func (m *MultiCoinRefundPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_MultiCoinRefundPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_MultiCoinRefundPolicy proto.InternalMessageInfo - -func (m *MultiCoinRefundPolicy) GetEntries() []*MultiCoinRefundDenomEntry { - if m != nil { - return m.Entries - } - return nil -} - -// MultiCoinRefundDenomEntry ... -type MultiCoinRefundDenomEntry struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - PoolWeights []*MultiCoinRefundPoolWeightEntry `protobuf:"bytes,2,rep,name=pool_weights,json=poolWeights,proto3" json:"pool_weights,omitempty"` -} - -func (m *MultiCoinRefundDenomEntry) Reset() { *m = MultiCoinRefundDenomEntry{} } -func (m *MultiCoinRefundDenomEntry) String() string { return proto.CompactTextString(m) } -func (*MultiCoinRefundDenomEntry) ProtoMessage() {} -func (*MultiCoinRefundDenomEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_d209d1a2a74d375d, []int{8} -} -func (m *MultiCoinRefundDenomEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MultiCoinRefundDenomEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MultiCoinRefundDenomEntry.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 *MultiCoinRefundDenomEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_MultiCoinRefundDenomEntry.Merge(m, src) -} -func (m *MultiCoinRefundDenomEntry) XXX_Size() int { - return m.Size() -} -func (m *MultiCoinRefundDenomEntry) XXX_DiscardUnknown() { - xxx_messageInfo_MultiCoinRefundDenomEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_MultiCoinRefundDenomEntry proto.InternalMessageInfo - -func (m *MultiCoinRefundDenomEntry) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *MultiCoinRefundDenomEntry) GetPoolWeights() []*MultiCoinRefundPoolWeightEntry { - if m != nil { - return m.PoolWeights - } - return nil -} - -// MultiCoinRefundPoolWeightEntry ... -type MultiCoinRefundPoolWeightEntry struct { - PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` - Weight cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"weight"` -} - -func (m *MultiCoinRefundPoolWeightEntry) Reset() { *m = MultiCoinRefundPoolWeightEntry{} } -func (m *MultiCoinRefundPoolWeightEntry) String() string { return proto.CompactTextString(m) } -func (*MultiCoinRefundPoolWeightEntry) ProtoMessage() {} -func (*MultiCoinRefundPoolWeightEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_d209d1a2a74d375d, []int{9} -} -func (m *MultiCoinRefundPoolWeightEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MultiCoinRefundPoolWeightEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MultiCoinRefundPoolWeightEntry.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 *MultiCoinRefundPoolWeightEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_MultiCoinRefundPoolWeightEntry.Merge(m, src) -} -func (m *MultiCoinRefundPoolWeightEntry) XXX_Size() int { - return m.Size() -} -func (m *MultiCoinRefundPoolWeightEntry) XXX_DiscardUnknown() { - xxx_messageInfo_MultiCoinRefundPoolWeightEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_MultiCoinRefundPoolWeightEntry proto.InternalMessageInfo - -func (m *MultiCoinRefundPoolWeightEntry) GetPoolId() uint64 { - if m != nil { - return m.PoolId - } - return 0 -} - func init() { proto.RegisterEnum("kyve.stakers.v1beta1.SlashType", SlashType_name, SlashType_value) proto.RegisterType((*Staker)(nil), "kyve.stakers.v1beta1.Staker") @@ -786,10 +569,6 @@ func init() { proto.RegisterType((*StakeFractionChangeEntry)(nil), "kyve.stakers.v1beta1.StakeFractionChangeEntry") proto.RegisterType((*LeavePoolEntry)(nil), "kyve.stakers.v1beta1.LeavePoolEntry") proto.RegisterType((*QueueState)(nil), "kyve.stakers.v1beta1.QueueState") - proto.RegisterType((*MultiCoinPendingRewardsEntry)(nil), "kyve.stakers.v1beta1.MultiCoinPendingRewardsEntry") - proto.RegisterType((*MultiCoinRefundPolicy)(nil), "kyve.stakers.v1beta1.MultiCoinRefundPolicy") - proto.RegisterType((*MultiCoinRefundDenomEntry)(nil), "kyve.stakers.v1beta1.MultiCoinRefundDenomEntry") - proto.RegisterType((*MultiCoinRefundPoolWeightEntry)(nil), "kyve.stakers.v1beta1.MultiCoinRefundPoolWeightEntry") } func init() { @@ -797,64 +576,55 @@ func init() { } var fileDescriptor_d209d1a2a74d375d = []byte{ - // 903 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6f, 0x1b, 0xc5, - 0x1b, 0xf7, 0xda, 0xae, 0x1d, 0x3f, 0xe9, 0x8b, 0x33, 0xff, 0x24, 0xff, 0x6d, 0x4a, 0x9d, 0xe2, - 0x5e, 0x42, 0x05, 0xbb, 0x2a, 0x2f, 0x27, 0x4e, 0x89, 0xed, 0xa8, 0x86, 0xb4, 0x31, 0x6b, 0xb7, - 0x55, 0xb9, 0x58, 0xe3, 0xdd, 0xe9, 0x7a, 0xf0, 0x7a, 0xc6, 0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x46, 0x7b, 0xb7, 0xdd, 0x6a, 0x56, 0x73, 0x68, 0x1d, 0x50, 0x46, 0xd7, 0x6b, 0xdf, 0x6d, 0xed, - 0xdf, 0xef, 0x55, 0x2d, 0xf4, 0x3f, 0xb8, 0x92, 0x91, 0x3f, 0xd8, 0xef, 0xb5, 0xaa, 0x79, 0xb4, - 0x06, 0x2b, 0xd9, 0x40, 0x9d, 0xbd, 0xfd, 0xed, 0x66, 0xb5, 0xb0, 0x51, 0xfc, 0xee, 0xc7, 0x5a, - 0x6e, 0x67, 0xf7, 0xf0, 0xa8, 0x66, 0x3d, 0x3d, 0xaa, 0x59, 0x7f, 0x1e, 0xd5, 0xac, 0x1f, 0x8e, - 0x6b, 0xb9, 0xa7, 0xc7, 0xb5, 0xdc, 0xef, 0xc7, 0xb5, 0xdc, 0x97, 0xef, 0x67, 0x46, 0xea, 0xf3, - 0x47, 0x0f, 0x5a, 0xf7, 0x88, 0x9c, 0xf1, 0x78, 0xe4, 0xfa, 0x43, 0x4c, 0x99, 0xfb, 0x64, 0xf1, - 0x21, 0xa2, 0x87, 0x6b, 0x50, 0xd2, 0x1f, 0x08, 0x1f, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0x2a, - 0xee, 0xd7, 0x4f, 0xa5, 0x08, 0x00, 0x00, + // 756 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4d, 0x4f, 0xdb, 0x48, + 0x18, 0x8e, 0x93, 0x90, 0x8f, 0xe1, 0x2b, 0xcc, 0x42, 0xd6, 0x1b, 0x84, 0x61, 0xc3, 0x85, 0x45, + 0xbb, 0xb6, 0xd8, 0xd5, 0xfe, 0x80, 0x90, 0x04, 0x91, 0x36, 0x85, 0xd4, 0x09, 0x48, 0xf4, 0x62, + 0x4d, 0xec, 0x69, 0x32, 0x4a, 0xe2, 0x49, 0x3d, 0x13, 0x42, 0xa4, 0x4a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, 0x80, 0x36, 0x69, 0xb5, 0x03, 0x36, 0x2a, + 0xd9, 0xb4, 0x88, 0x48, 0x7a, 0xf3, 0x09, 0x48, 0xd7, 0xbb, 0x88, 0xb5, 0x1b, 0xa3, 0xbe, 0x78, + 0x82, 0xb2, 0xf5, 0x6a, 0xa1, 0xbe, 0x6b, 0x35, 0x8e, 0x6a, 0x65, 0xeb, 0x60, 0xaf, 0x5e, 0x2b, + 0x17, 0x2b, 0x3b, 0x95, 0x72, 0x29, 0x13, 0x81, 0x59, 0x00, 0x43, 0x5c, 0xa3, 0xf2, 0xa0, 0xbc, + 0x7f, 0xd0, 0xc8, 0x28, 0xf0, 0x37, 0x30, 0x1f, 0x8a, 0x1f, 0xee, 0x37, 0xca, 0x99, 0x28, 0x5c, + 0x02, 0x0b, 0x61, 0xa1, 0x5a, 0x75, 0xbf, 0x50, 0xca, 0xc4, 0x72, 0xf1, 0xe7, 0x2f, 0xb5, 0xc8, + 0xf6, 0xce, 0xe9, 0x85, 0xa6, 0x9c, 0x5d, 0x68, 0xca, 0xa7, 0x0b, 0x4d, 0x79, 0x71, 0xa9, 0x45, + 0xce, 0x2e, 0xb5, 0xc8, 0xfb, 0x4b, 0x2d, 0xf2, 0xe8, 0xef, 0xd0, 0x13, 0x73, 0xff, 0xe8, 0xb0, + 0xbc, 0x87, 0xf9, 0x90, 0x7a, 0x1d, 0xc3, 0x6e, 0x23, 0xe2, 0x1a, 0x27, 0x93, 0xaf, 0x87, 0x7c, + 0x6c, 0x9a, 0x09, 0xf9, 0xaa, 0xff, 0xf7, 0x35, 0x00, 0x00, 0xff, 0xff, 0x31, 0xd2, 0xb6, 0x78, + 0x5a, 0x06, 0x00, 0x00, } func (m *Staker) Marshal() (dAtA []byte, err error) { @@ -1211,234 +981,61 @@ func (m *QueueState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MultiCoinPendingRewardsEntry) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintStakers(dAtA []byte, offset int, v uint64) int { + offset -= sovStakers(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil -} - -func (m *MultiCoinPendingRewardsEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } - -func (m *MultiCoinPendingRewardsEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Staker) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.CreationDate != 0 { - i = encodeVarintStakers(dAtA, i, uint64(m.CreationDate)) - i-- - dAtA[i] = 0x20 + l = len(m.Address) + if l > 0 { + n += 1 + l + sovStakers(uint64(l)) } - if len(m.Rewards) > 0 { - for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakers(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } + l = m.Commission.Size() + n += 1 + l + sovStakers(uint64(l)) + l = len(m.Moniker) + if l > 0 { + n += 1 + l + sovStakers(uint64(l)) } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintStakers(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x12 + l = len(m.Website) + if l > 0 { + n += 1 + l + sovStakers(uint64(l)) } - if m.Index != 0 { - i = encodeVarintStakers(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 + l = len(m.Identity) + if l > 0 { + n += 1 + l + sovStakers(uint64(l)) } - return len(dAtA) - i, nil -} - -func (m *MultiCoinRefundPolicy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + l = len(m.SecurityContact) + if l > 0 { + n += 1 + l + sovStakers(uint64(l)) } - return dAtA[:n], nil -} - -func (m *MultiCoinRefundPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MultiCoinRefundPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Entries) > 0 { - for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakers(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + l = len(m.Details) + if l > 0 { + n += 1 + l + sovStakers(uint64(l)) + } + if len(m.CommissionRewards) > 0 { + for _, e := range m.CommissionRewards { + l = e.Size() + n += 1 + l + sovStakers(uint64(l)) } } - return len(dAtA) - i, nil + return n } -func (m *MultiCoinRefundDenomEntry) 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 *MultiCoinRefundDenomEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MultiCoinRefundDenomEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PoolWeights) > 0 { - for iNdEx := len(m.PoolWeights) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PoolWeights[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakers(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintStakers(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MultiCoinRefundPoolWeightEntry) 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 *MultiCoinRefundPoolWeightEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MultiCoinRefundPoolWeightEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Weight.Size() - i -= size - if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintStakers(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.PoolId != 0 { - i = encodeVarintStakers(dAtA, i, uint64(m.PoolId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintStakers(dAtA []byte, offset int, v uint64) int { - offset -= sovStakers(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Staker) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovStakers(uint64(l)) - } - l = m.Commission.Size() - n += 1 + l + sovStakers(uint64(l)) - l = len(m.Moniker) - if l > 0 { - n += 1 + l + sovStakers(uint64(l)) - } - l = len(m.Website) - if l > 0 { - n += 1 + l + sovStakers(uint64(l)) - } - l = len(m.Identity) - if l > 0 { - n += 1 + l + sovStakers(uint64(l)) - } - l = len(m.SecurityContact) - if l > 0 { - n += 1 + l + sovStakers(uint64(l)) - } - l = len(m.Details) - if l > 0 { - n += 1 + l + sovStakers(uint64(l)) - } - if len(m.CommissionRewards) > 0 { - for _, e := range m.CommissionRewards { - l = e.Size() - n += 1 + l + sovStakers(uint64(l)) - } - } - return n -} - -func (m *PoolAccount) Size() (n int) { - if m == nil { - return 0 +func (m *PoolAccount) Size() (n int) { + if m == nil { + return 0 } var l int _ = l @@ -1551,79 +1148,6 @@ func (m *QueueState) Size() (n int) { return n } -func (m *MultiCoinPendingRewardsEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovStakers(uint64(m.Index)) - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovStakers(uint64(l)) - } - if len(m.Rewards) > 0 { - for _, e := range m.Rewards { - l = e.Size() - n += 1 + l + sovStakers(uint64(l)) - } - } - if m.CreationDate != 0 { - n += 1 + sovStakers(uint64(m.CreationDate)) - } - return n -} - -func (m *MultiCoinRefundPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Entries) > 0 { - for _, e := range m.Entries { - l = e.Size() - n += 1 + l + sovStakers(uint64(l)) - } - } - return n -} - -func (m *MultiCoinRefundDenomEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovStakers(uint64(l)) - } - if len(m.PoolWeights) > 0 { - for _, e := range m.PoolWeights { - l = e.Size() - n += 1 + l + sovStakers(uint64(l)) - } - } - return n -} - -func (m *MultiCoinRefundPoolWeightEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PoolId != 0 { - n += 1 + sovStakers(uint64(m.PoolId)) - } - l = m.Weight.Size() - n += 1 + l + sovStakers(uint64(l)) - return n -} - func sovStakers(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2124,600 +1648,12 @@ func (m *PoolAccount) Unmarshal(dAtA []byte) error { if err := m.Commission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeFraction", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - 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 ErrInvalidLengthStakers - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StakeFraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStakers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CommissionChangeEntry) 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 ErrIntOverflowStakers - } - 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: CommissionChangeEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CommissionChangeEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - 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 ErrInvalidLengthStakers - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Staker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commission", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - 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 ErrInvalidLengthStakers - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Commission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) - } - m.CreationDate = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreationDate |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStakers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StakeFractionChangeEntry) 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 ErrIntOverflowStakers - } - 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: StakeFractionChangeEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StakeFractionChangeEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - 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 ErrInvalidLengthStakers - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Staker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeFraction", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - 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 ErrInvalidLengthStakers - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StakeFraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) - } - m.CreationDate = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreationDate |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStakers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeavePoolEntry) 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 ErrIntOverflowStakers - } - 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: LeavePoolEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeavePoolEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - 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 ErrInvalidLengthStakers - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Staker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) - } - m.CreationDate = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreationDate |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStakers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueueState) 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 ErrIntOverflowStakers - } - 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: QueueState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueueState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LowIndex", wireType) - } - m.LowIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LowIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HighIndex", wireType) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeFraction", wireType) } - m.HighIndex = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStakers @@ -2727,11 +1663,26 @@ func (m *QueueState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.HighIndex |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStakers + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakers + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StakeFraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipStakers(dAtA[iNdEx:]) @@ -2753,7 +1704,7 @@ func (m *QueueState) Unmarshal(dAtA []byte) error { } return nil } -func (m *MultiCoinPendingRewardsEntry) Unmarshal(dAtA []byte) error { +func (m *CommissionChangeEntry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2776,10 +1727,10 @@ func (m *MultiCoinPendingRewardsEntry) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MultiCoinPendingRewardsEntry: wiretype end group for non-group") + return fmt.Errorf("proto: CommissionChangeEntry: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MultiCoinPendingRewardsEntry: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CommissionChangeEntry: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2803,7 +1754,7 @@ func (m *MultiCoinPendingRewardsEntry) Unmarshal(dAtA []byte) error { } case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2831,13 +1782,32 @@ func (m *MultiCoinPendingRewardsEntry) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.Staker = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakers + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Commission", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStakers @@ -2847,27 +1817,27 @@ func (m *MultiCoinPendingRewardsEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthStakers } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthStakers } if postIndex > l { return io.ErrUnexpectedEOF } - m.Rewards = append(m.Rewards, types.Coin{}) - if err := m.Rewards[len(m.Rewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Commission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) } @@ -2907,7 +1877,7 @@ func (m *MultiCoinPendingRewardsEntry) Unmarshal(dAtA []byte) error { } return nil } -func (m *MultiCoinRefundPolicy) Unmarshal(dAtA []byte) error { +func (m *StakeFractionChangeEntry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2930,17 +1900,36 @@ func (m *MultiCoinRefundPolicy) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MultiCoinRefundPolicy: wiretype end group for non-group") + return fmt.Errorf("proto: StakeFractionChangeEntry: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MultiCoinRefundPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: StakeFractionChangeEntry: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakers + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStakers @@ -2950,26 +1939,96 @@ func (m *MultiCoinRefundPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthStakers } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakers + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Staker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakers + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeFraction", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakers + } + 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 ErrInvalidLengthStakers + } + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthStakers } if postIndex > l { return io.ErrUnexpectedEOF } - m.Entries = append(m.Entries, &MultiCoinRefundDenomEntry{}) - if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.StakeFraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) + } + m.CreationDate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakers + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationDate |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipStakers(dAtA[iNdEx:]) @@ -2991,7 +2050,7 @@ func (m *MultiCoinRefundPolicy) Unmarshal(dAtA []byte) error { } return nil } -func (m *MultiCoinRefundDenomEntry) Unmarshal(dAtA []byte) error { +func (m *LeavePoolEntry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3014,15 +2073,34 @@ func (m *MultiCoinRefundDenomEntry) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MultiCoinRefundDenomEntry: wiretype end group for non-group") + return fmt.Errorf("proto: LeavePoolEntry: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MultiCoinRefundDenomEntry: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LeavePoolEntry: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakers + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3050,13 +2128,13 @@ func (m *MultiCoinRefundDenomEntry) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + m.Staker = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolWeights", wireType) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) } - var msglen int + m.PoolId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStakers @@ -3066,26 +2144,30 @@ func (m *MultiCoinRefundDenomEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.PoolId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthStakers - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakers - } - if postIndex > l { - return io.ErrUnexpectedEOF + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationDate", wireType) } - m.PoolWeights = append(m.PoolWeights, &MultiCoinRefundPoolWeightEntry{}) - if err := m.PoolWeights[len(m.PoolWeights)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.CreationDate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakers + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationDate |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipStakers(dAtA[iNdEx:]) @@ -3107,7 +2189,7 @@ func (m *MultiCoinRefundDenomEntry) Unmarshal(dAtA []byte) error { } return nil } -func (m *MultiCoinRefundPoolWeightEntry) Unmarshal(dAtA []byte) error { +func (m *QueueState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3130,17 +2212,17 @@ func (m *MultiCoinRefundPoolWeightEntry) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MultiCoinRefundPoolWeightEntry: wiretype end group for non-group") + return fmt.Errorf("proto: QueueState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MultiCoinRefundPoolWeightEntry: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueueState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LowIndex", wireType) } - m.PoolId = 0 + m.LowIndex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStakers @@ -3150,16 +2232,16 @@ func (m *MultiCoinRefundPoolWeightEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift + m.LowIndex |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HighIndex", wireType) } - var stringLen uint64 + m.HighIndex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStakers @@ -3169,26 +2251,11 @@ func (m *MultiCoinRefundPoolWeightEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.HighIndex |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStakers - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipStakers(dAtA[iNdEx:]) diff --git a/x/stakers/types/tx.pb.go b/x/stakers/types/tx.pb.go index a86626da..69993a86 100644 --- a/x/stakers/types/tx.pb.go +++ b/x/stakers/types/tx.pb.go @@ -517,196 +517,6 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo -// MsgEnableMultiCoinReward enables multi-coin rewards for the sender address -// and claims all current pending rewards. -type MsgToggleMultiCoinRewards struct { - // creator ... - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - // enabled ... - Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` -} - -func (m *MsgToggleMultiCoinRewards) Reset() { *m = MsgToggleMultiCoinRewards{} } -func (m *MsgToggleMultiCoinRewards) String() string { return proto.CompactTextString(m) } -func (*MsgToggleMultiCoinRewards) ProtoMessage() {} -func (*MsgToggleMultiCoinRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_f52b730e69b9fb06, []int{10} -} -func (m *MsgToggleMultiCoinRewards) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgToggleMultiCoinRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgToggleMultiCoinRewards.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 *MsgToggleMultiCoinRewards) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgToggleMultiCoinRewards.Merge(m, src) -} -func (m *MsgToggleMultiCoinRewards) XXX_Size() int { - return m.Size() -} -func (m *MsgToggleMultiCoinRewards) XXX_DiscardUnknown() { - xxx_messageInfo_MsgToggleMultiCoinRewards.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgToggleMultiCoinRewards proto.InternalMessageInfo - -func (m *MsgToggleMultiCoinRewards) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgToggleMultiCoinRewards) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -// MsgEnableMultiCoinRewardResponse ... -type MsgToggleMultiCoinRewardsResponse struct { -} - -func (m *MsgToggleMultiCoinRewardsResponse) Reset() { *m = MsgToggleMultiCoinRewardsResponse{} } -func (m *MsgToggleMultiCoinRewardsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgToggleMultiCoinRewardsResponse) ProtoMessage() {} -func (*MsgToggleMultiCoinRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f52b730e69b9fb06, []int{11} -} -func (m *MsgToggleMultiCoinRewardsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgToggleMultiCoinRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgToggleMultiCoinRewardsResponse.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 *MsgToggleMultiCoinRewardsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgToggleMultiCoinRewardsResponse.Merge(m, src) -} -func (m *MsgToggleMultiCoinRewardsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgToggleMultiCoinRewardsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgToggleMultiCoinRewardsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgToggleMultiCoinRewardsResponse proto.InternalMessageInfo - -// MsgEnableMultiCoinReward enables multi-coin rewards for the sender address -// and claims all current pending rewards. -type MsgSetMultiCoinRewardsRefundPolicy struct { - // creator ... - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - // policy ... - Policy *MultiCoinRefundPolicy `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"` -} - -func (m *MsgSetMultiCoinRewardsRefundPolicy) Reset() { *m = MsgSetMultiCoinRewardsRefundPolicy{} } -func (m *MsgSetMultiCoinRewardsRefundPolicy) String() string { return proto.CompactTextString(m) } -func (*MsgSetMultiCoinRewardsRefundPolicy) ProtoMessage() {} -func (*MsgSetMultiCoinRewardsRefundPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_f52b730e69b9fb06, []int{12} -} -func (m *MsgSetMultiCoinRewardsRefundPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSetMultiCoinRewardsRefundPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicy.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 *MsgSetMultiCoinRewardsRefundPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicy.Merge(m, src) -} -func (m *MsgSetMultiCoinRewardsRefundPolicy) XXX_Size() int { - return m.Size() -} -func (m *MsgSetMultiCoinRewardsRefundPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicy proto.InternalMessageInfo - -func (m *MsgSetMultiCoinRewardsRefundPolicy) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgSetMultiCoinRewardsRefundPolicy) GetPolicy() *MultiCoinRefundPolicy { - if m != nil { - return m.Policy - } - return nil -} - -// MsgEnableMultiCoinRewardResponse ... -type MsgSetMultiCoinRewardsRefundPolicyResponse struct { -} - -func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) Reset() { - *m = MsgSetMultiCoinRewardsRefundPolicyResponse{} -} -func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) String() string { - return proto.CompactTextString(m) -} -func (*MsgSetMultiCoinRewardsRefundPolicyResponse) ProtoMessage() {} -func (*MsgSetMultiCoinRewardsRefundPolicyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f52b730e69b9fb06, []int{13} -} -func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicyResponse.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 *MsgSetMultiCoinRewardsRefundPolicyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicyResponse.Merge(m, src) -} -func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSetMultiCoinRewardsRefundPolicyResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*MsgUpdateCommission)(nil), "kyve.stakers.v1beta1.MsgUpdateCommission") proto.RegisterType((*MsgUpdateCommissionResponse)(nil), "kyve.stakers.v1beta1.MsgUpdateCommissionResponse") @@ -718,65 +528,51 @@ func init() { proto.RegisterType((*MsgLeavePoolResponse)(nil), "kyve.stakers.v1beta1.MsgLeavePoolResponse") proto.RegisterType((*MsgUpdateParams)(nil), "kyve.stakers.v1beta1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "kyve.stakers.v1beta1.MsgUpdateParamsResponse") - proto.RegisterType((*MsgToggleMultiCoinRewards)(nil), "kyve.stakers.v1beta1.MsgToggleMultiCoinRewards") - proto.RegisterType((*MsgToggleMultiCoinRewardsResponse)(nil), "kyve.stakers.v1beta1.MsgToggleMultiCoinRewardsResponse") - proto.RegisterType((*MsgSetMultiCoinRewardsRefundPolicy)(nil), "kyve.stakers.v1beta1.MsgSetMultiCoinRewardsRefundPolicy") - proto.RegisterType((*MsgSetMultiCoinRewardsRefundPolicyResponse)(nil), "kyve.stakers.v1beta1.MsgSetMultiCoinRewardsRefundPolicyResponse") } func init() { proto.RegisterFile("kyve/stakers/v1beta1/tx.proto", fileDescriptor_f52b730e69b9fb06) } var fileDescriptor_f52b730e69b9fb06 = []byte{ - // 770 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x4f, 0x1b, 0x47, - 0x14, 0xf6, 0xf2, 0xc3, 0xe0, 0x87, 0x4b, 0xab, 0xc5, 0x35, 0x66, 0x11, 0x0b, 0x18, 0x55, 0xa2, - 0x2e, 0xec, 0xca, 0xb4, 0x6a, 0x2b, 0x4e, 0x2d, 0x6e, 0x91, 0x4a, 0x71, 0x8b, 0x96, 0xb6, 0x6a, - 0x1b, 0x45, 0x68, 0xbc, 0x3b, 0xac, 0x57, 0xf6, 0xee, 0xac, 0x76, 0xc6, 0x06, 0xdf, 0x22, 0xfe, - 0x82, 0xe4, 0x9a, 0xe4, 0x9a, 0x3b, 0x87, 0x9c, 0xf2, 0x17, 0x70, 0x44, 0x39, 0x45, 0x39, 0xa0, - 0x08, 0x0e, 0xfc, 0x1b, 0xd1, 0xfe, 0x1a, 0x1b, 0x63, 0x63, 0xb0, 0x72, 0xb2, 0xdf, 0xbc, 0xef, - 0x7d, 0xdf, 0x37, 0x6f, 0xe6, 0x8d, 0x16, 0x16, 0x6a, 0xad, 0x26, 0x56, 0x29, 0x43, 0x35, 0xec, - 0x51, 0xb5, 0x59, 0xac, 0x60, 0x86, 0x8a, 0x2a, 0x3b, 0x56, 0x5c, 0x8f, 0x30, 0x22, 0x66, 0xfc, - 0xb4, 0x12, 0xa5, 0x95, 0x28, 0x2d, 0xcd, 0xea, 0x84, 0xda, 0x84, 0xaa, 0x36, 0x35, 0xd5, 0x66, - 0xd1, 0xff, 0x09, 0xe1, 0xd2, 0x5c, 0x98, 0x38, 0x08, 0x22, 0x35, 0x0c, 0xa2, 0x54, 0xc6, 0x24, - 0x26, 0x09, 0xd7, 0xfd, 0x7f, 0xd1, 0x6a, 0xbe, 0xa7, 0x7c, 0xac, 0x17, 0x60, 0xf2, 0x2f, 0x04, - 0x98, 0x29, 0x53, 0xf3, 0x6f, 0xd7, 0x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, 0xfb, 0x7f, 0xff, 0xfc, 0xfa, 0x07, 0x66, 0x47, - 0xc4, 0xab, 0xa9, 0x7a, 0x15, 0x59, 0x8e, 0x7a, 0xcc, 0x3f, 0x47, 0x58, 0xcb, 0xc5, 0xb4, 0x92, - 0x0c, 0xbe, 0x42, 0xbe, 0xfd, 0x18, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xa6, 0xd0, 0x53, 0x2a, 0x09, - 0x00, 0x00, + // 624 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0xee, 0xf2, 0xa3, 0xd8, 0x47, 0x45, 0xb3, 0x54, 0x58, 0x96, 0xb0, 0x40, 0x8d, 0x09, 0x12, + 0xd8, 0x4d, 0xd5, 0x78, 0xe0, 0x26, 0x28, 0x89, 0x48, 0x95, 0x2c, 0xd1, 0xf8, 0xe3, 0x40, 0x86, + 0xdd, 0x71, 0xbb, 0x29, 0xbb, 0xb3, 0xd9, 0x99, 0x56, 0xf6, 0x66, 0xfc, 0x0b, 0x3c, 0x79, 0xd0, + 0xb3, 0x77, 0x0e, 0xfe, 0x11, 0x1c, 0x89, 0x27, 0xe3, 0x81, 0x98, 0xf6, 0xc0, 0xbf, 0x61, 0xb6, + 0xb3, 0x3b, 0x2d, 0xb5, 0xa4, 0xd0, 0x78, 0x6a, 0xdf, 0x7b, 0xdf, 0x7b, 0xdf, 0x37, 0xdf, 0xcc, + 0xce, 0xc0, 0x5c, 0x35, 0xaa, 0x63, 0x83, 0x32, 0x54, 0xc5, 0x21, 0x35, 0xea, 0xa5, 0x7d, 0xcc, + 0x50, 0xc9, 0x60, 0x87, 0x7a, 0x10, 0x12, 0x46, 0xe4, 0x42, 0x5c, 0xd6, 0x93, 0xb2, 0x9e, 0x94, + 0xd5, 0x69, 0x8b, 0x50, 0x8f, 0x50, 0xc3, 0xa3, 0x8e,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, 0x8b, 0xb5, 0x75, 0x43, 0xd5, 0xd2, 0xa5, 0xa1, 0x82, 0x31, 0x82, + 0xc9, 0x5e, 0x77, 0xc4, 0x4a, 0x9f, 0x49, 0xe7, 0xd0, 0xea, 0x83, 0xab, 0xa0, 0x05, 0xb5, 0x0d, + 0xf9, 0x73, 0x07, 0xe7, 0x4e, 0x9f, 0x29, 0x1c, 0xa6, 0xae, 0x5e, 0x0a, 0x96, 0xb2, 0xa8, 0xa3, + 0x1f, 0xcf, 0x8e, 0x96, 0xa5, 0xf5, 0xcd, 0xe3, 0x86, 0x26, 0x9d, 0x34, 0x34, 0xe9, 0x4f, 0x43, + 0x93, 0x3e, 0x37, 0xb5, 0xcc, 0x49, 0x53, 0xcb, 0xfc, 0x6a, 0x6a, 0x99, 0xb7, 0x2b, 0x8e, 0xcb, + 0x2a, 0xb5, 0x7d, 0xdd, 0x22, 0x9e, 0xf1, 0xec, 0xcd, 0xab, 0x27, 0xcf, 0x31, 0xfb, 0x40, 0xc2, + 0xaa, 0x61, 0x55, 0x90, 0xeb, 0x1b, 0x87, 0xe2, 0xfd, 0x61, 0x51, 0x80, 0xe9, 0x7e, 0xb6, 0xf5, + 0x36, 0xdc, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x48, 0xf2, 0xac, 0x26, 0x9c, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -802,10 +598,6 @@ type MsgClient interface { // UpdateParams defines a governance operation for updating the x/stakers module // parameters. The authority is hard-coded to the x/gov module account. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - // ToggleMultiCoinRewards ... - ToggleMultiCoinRewards(ctx context.Context, in *MsgToggleMultiCoinRewards, opts ...grpc.CallOption) (*MsgToggleMultiCoinRewardsResponse, error) - // SetMultiCoinRewardRefundPolicy ... - SetMultiCoinRewardRefundPolicy(ctx context.Context, in *MsgSetMultiCoinRewardsRefundPolicy, opts ...grpc.CallOption) (*MsgSetMultiCoinRewardsRefundPolicyResponse, error) } type msgClient struct { @@ -861,24 +653,6 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } -func (c *msgClient) ToggleMultiCoinRewards(ctx context.Context, in *MsgToggleMultiCoinRewards, opts ...grpc.CallOption) (*MsgToggleMultiCoinRewardsResponse, error) { - out := new(MsgToggleMultiCoinRewardsResponse) - err := c.cc.Invoke(ctx, "/kyve.stakers.v1beta1.Msg/ToggleMultiCoinRewards", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SetMultiCoinRewardRefundPolicy(ctx context.Context, in *MsgSetMultiCoinRewardsRefundPolicy, opts ...grpc.CallOption) (*MsgSetMultiCoinRewardsRefundPolicyResponse, error) { - out := new(MsgSetMultiCoinRewardsRefundPolicyResponse) - err := c.cc.Invoke(ctx, "/kyve.stakers.v1beta1.Msg/SetMultiCoinRewardRefundPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. type MsgServer interface { // JoinPool ... @@ -892,10 +666,6 @@ type MsgServer interface { // UpdateParams defines a governance operation for updating the x/stakers module // parameters. The authority is hard-coded to the x/gov module account. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - // ToggleMultiCoinRewards ... - ToggleMultiCoinRewards(context.Context, *MsgToggleMultiCoinRewards) (*MsgToggleMultiCoinRewardsResponse, error) - // SetMultiCoinRewardRefundPolicy ... - SetMultiCoinRewardRefundPolicy(context.Context, *MsgSetMultiCoinRewardsRefundPolicy) (*MsgSetMultiCoinRewardsRefundPolicyResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -917,12 +687,6 @@ func (*UnimplementedMsgServer) UpdateStakeFraction(ctx context.Context, req *Msg func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } -func (*UnimplementedMsgServer) ToggleMultiCoinRewards(ctx context.Context, req *MsgToggleMultiCoinRewards) (*MsgToggleMultiCoinRewardsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ToggleMultiCoinRewards not implemented") -} -func (*UnimplementedMsgServer) SetMultiCoinRewardRefundPolicy(ctx context.Context, req *MsgSetMultiCoinRewardsRefundPolicy) (*MsgSetMultiCoinRewardsRefundPolicyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetMultiCoinRewardRefundPolicy not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1018,42 +782,6 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Msg_ToggleMultiCoinRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgToggleMultiCoinRewards) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ToggleMultiCoinRewards(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kyve.stakers.v1beta1.Msg/ToggleMultiCoinRewards", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ToggleMultiCoinRewards(ctx, req.(*MsgToggleMultiCoinRewards)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SetMultiCoinRewardRefundPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSetMultiCoinRewardsRefundPolicy) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SetMultiCoinRewardRefundPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/kyve.stakers.v1beta1.Msg/SetMultiCoinRewardRefundPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetMultiCoinRewardRefundPolicy(ctx, req.(*MsgSetMultiCoinRewardsRefundPolicy)) - } - return interceptor(ctx, in, info, handler) -} - var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "kyve.stakers.v1beta1.Msg", @@ -1079,14 +807,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, - { - MethodName: "ToggleMultiCoinRewards", - Handler: _Msg_ToggleMultiCoinRewards_Handler, - }, - { - MethodName: "SetMultiCoinRewardRefundPolicy", - Handler: _Msg_SetMultiCoinRewardRefundPolicy_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "kyve/stakers/v1beta1/tx.proto", @@ -1436,203 +1156,75 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *MsgToggleMultiCoinRewards) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +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++ } - return dAtA[:n], nil -} - -func (m *MsgToggleMultiCoinRewards) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } - -func (m *MsgToggleMultiCoinRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *MsgUpdateCommission) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa + if m.PoolId != 0 { + n += 1 + sovTx(uint64(m.PoolId)) } - return len(dAtA) - i, nil + l = m.Commission.Size() + n += 1 + l + sovTx(uint64(l)) + return n } -func (m *MsgToggleMultiCoinRewardsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *MsgUpdateCommissionResponse) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *MsgToggleMultiCoinRewardsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgToggleMultiCoinRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i var l int _ = l - return len(dAtA) - i, nil + return n } -func (m *MsgSetMultiCoinRewardsRefundPolicy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *MsgUpdateStakeFraction) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.PoolId != 0 { + n += 1 + sovTx(uint64(m.PoolId)) + } + l = m.StakeFraction.Size() + n += 1 + l + sovTx(uint64(l)) + return n } -func (m *MsgSetMultiCoinRewardsRefundPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *MsgUpdateStakeFractionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n } -func (m *MsgSetMultiCoinRewardsRefundPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Policy != nil { - { - size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) 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 *MsgSetMultiCoinRewardsRefundPolicyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) 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 *MsgUpdateCommission) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) - } - l = m.Commission.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateCommissionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateStakeFraction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) - } - l = m.StakeFraction.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateStakeFractionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgJoinPool) Size() (n int) { - if m == nil { - return 0 - } +func (m *MsgJoinPool) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Creator) @@ -1716,57 +1308,6 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } -func (m *MsgToggleMultiCoinRewards) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Enabled { - n += 2 - } - return n -} - -func (m *MsgToggleMultiCoinRewardsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgSetMultiCoinRewardsRefundPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Policy != nil { - l = m.Policy.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) 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 } @@ -1802,430 +1343,9 @@ func (m *MsgUpdateCommission) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgUpdateCommission: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commission", 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.Commission.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 *MsgUpdateCommissionResponse) 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: MsgUpdateCommissionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateCommissionResponse: 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 *MsgUpdateStakeFraction) 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: MsgUpdateStakeFraction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateStakeFraction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeFraction", 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.StakeFraction.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 *MsgUpdateStakeFractionResponse) 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: MsgUpdateStakeFractionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateStakeFractionResponse: 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 *MsgJoinPool) 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: MsgJoinPool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgJoinPool: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2253,13 +1373,13 @@ func (m *MsgJoinPool) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PoolAddress = string(dAtA[iNdEx:postIndex]) + m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) } - m.Amount = 0 + m.PoolId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2269,12 +1389,12 @@ func (m *MsgJoinPool) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Amount |= uint64(b&0x7F) << shift + m.PoolId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 5: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Commission", wireType) } @@ -2308,40 +1428,6 @@ func (m *MsgJoinPool) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeFraction", 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.StakeFraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2363,7 +1449,7 @@ func (m *MsgJoinPool) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgJoinPoolResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateCommissionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2386,10 +1472,10 @@ func (m *MsgJoinPoolResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgJoinPoolResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateCommissionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgJoinPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateCommissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2413,7 +1499,7 @@ func (m *MsgJoinPoolResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgLeavePool) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateStakeFraction) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2436,10 +1522,10 @@ func (m *MsgLeavePool) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgLeavePool: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateStakeFraction: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgLeavePool: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateStakeFraction: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2493,6 +1579,40 @@ func (m *MsgLeavePool) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeFraction", 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.StakeFraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2514,7 +1634,7 @@ func (m *MsgLeavePool) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgLeavePoolResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateStakeFractionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2537,10 +1657,10 @@ func (m *MsgLeavePoolResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgLeavePoolResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateStakeFractionResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgLeavePoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateStakeFractionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2564,7 +1684,7 @@ func (m *MsgLeavePoolResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { +func (m *MsgJoinPool) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2587,15 +1707,15 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + return fmt.Errorf("proto: MsgJoinPool: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgJoinPool: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2623,11 +1743,30 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2655,7 +1794,94 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Payload = string(dAtA[iNdEx:postIndex]) + m.PoolAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + m.Amount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Amount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commission", 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.Commission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakeFraction", 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.StakeFraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -2678,7 +1904,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgJoinPoolResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2701,10 +1927,10 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgJoinPoolResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgJoinPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2728,7 +1954,7 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgToggleMultiCoinRewards) Unmarshal(dAtA []byte) error { +func (m *MsgLeavePool) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2751,10 +1977,10 @@ func (m *MsgToggleMultiCoinRewards) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgToggleMultiCoinRewards: wiretype end group for non-group") + return fmt.Errorf("proto: MsgLeavePool: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgToggleMultiCoinRewards: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgLeavePool: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2791,9 +2017,9 @@ func (m *MsgToggleMultiCoinRewards) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) } - var v int + m.PoolId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2803,12 +2029,11 @@ func (m *MsgToggleMultiCoinRewards) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.PoolId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.Enabled = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2830,7 +2055,7 @@ func (m *MsgToggleMultiCoinRewards) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgToggleMultiCoinRewardsResponse) Unmarshal(dAtA []byte) error { +func (m *MsgLeavePoolResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2853,10 +2078,10 @@ func (m *MsgToggleMultiCoinRewardsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgToggleMultiCoinRewardsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgLeavePoolResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgToggleMultiCoinRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgLeavePoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2880,7 +2105,7 @@ func (m *MsgToggleMultiCoinRewardsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSetMultiCoinRewardsRefundPolicy) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2903,15 +2128,15 @@ func (m *MsgSetMultiCoinRewardsRefundPolicy) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSetMultiCoinRewardsRefundPolicy: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetMultiCoinRewardsRefundPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + 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 Creator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2939,13 +2164,13 @@ func (m *MsgSetMultiCoinRewardsRefundPolicy) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Creator = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2955,27 +2180,23 @@ func (m *MsgSetMultiCoinRewardsRefundPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Policy == nil { - m.Policy = &MultiCoinRefundPolicy{} - } - if err := m.Policy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Payload = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2998,7 +2219,7 @@ func (m *MsgSetMultiCoinRewardsRefundPolicy) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3021,10 +2242,10 @@ func (m *MsgSetMultiCoinRewardsRefundPolicyResponse) Unmarshal(dAtA []byte) erro fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSetMultiCoinRewardsRefundPolicyResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetMultiCoinRewardsRefundPolicyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/stakers/types/types.go b/x/stakers/types/types.go index 3bf873db..ab1254f4 100644 --- a/x/stakers/types/types.go +++ b/x/stakers/types/types.go @@ -1,47 +1 @@ package types - -import ( - "fmt" - - "cosmossdk.io/math" -) - -type ( - ComplianceMultiCoinMap map[string][]ComplainceMultiCoinPoolNormalizedEntry - ComplainceMultiCoinPoolNormalizedEntry struct { - PoolId uint64 - NormalizedWeight math.LegacyDec - } -) - -func ParseMultiCoinComplianceMap(policy MultiCoinRefundPolicy) (ComplianceMultiCoinMap, error) { - var compliance ComplianceMultiCoinMap = make(map[string][]ComplainceMultiCoinPoolNormalizedEntry) - - for _, denomEntry := range policy.Entries { - complianceWeightsDuplicateCheck := make(map[uint64]struct{}) - - totalWeight := math.LegacyNewDec(0) - for _, weights := range denomEntry.PoolWeights { - totalWeight = totalWeight.Add(weights.Weight) - if _, ok := complianceWeightsDuplicateCheck[weights.PoolId]; ok { - return nil, fmt.Errorf("duplicate compliance weight for pool id %d", weights.PoolId) - } - } - - normalizedWeights := make([]ComplainceMultiCoinPoolNormalizedEntry, 0) - for _, weight := range denomEntry.PoolWeights { - normalizedWeights = append(normalizedWeights, ComplainceMultiCoinPoolNormalizedEntry{ - PoolId: weight.PoolId, - NormalizedWeight: weight.Weight.Quo(totalWeight), - }) - } - - if _, ok := compliance[denomEntry.Denom]; !ok { - compliance[denomEntry.Denom] = normalizedWeights - } else { - return nil, fmt.Errorf("duplicate entry for denom %s", denomEntry.Denom) - } - } - - return compliance, nil -}