diff --git a/api/cosmos/svip/v1/genesis.pulsar.go b/api/cosmos/svip/v1/genesis.pulsar.go new file mode 100644 index 00000000..2daf82c8 --- /dev/null +++ b/api/cosmos/svip/v1/genesis.pulsar.go @@ -0,0 +1,1132 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package svipv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_total_distributed protoreflect.FieldDescriptor + fd_GenesisState_activation_time protoreflect.FieldDescriptor + fd_GenesisState_pool_balance_at_activation protoreflect.FieldDescriptor + fd_GenesisState_last_block_time protoreflect.FieldDescriptor + fd_GenesisState_total_paused_seconds protoreflect.FieldDescriptor + fd_GenesisState_activated protoreflect.FieldDescriptor + fd_GenesisState_paused protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_genesis_proto_init() + md_GenesisState = File_cosmos_svip_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_total_distributed = md_GenesisState.Fields().ByName("total_distributed") + fd_GenesisState_activation_time = md_GenesisState.Fields().ByName("activation_time") + fd_GenesisState_pool_balance_at_activation = md_GenesisState.Fields().ByName("pool_balance_at_activation") + fd_GenesisState_last_block_time = md_GenesisState.Fields().ByName("last_block_time") + fd_GenesisState_total_paused_seconds = md_GenesisState.Fields().ByName("total_paused_seconds") + fd_GenesisState_activated = md_GenesisState.Fields().ByName("activated") + fd_GenesisState_paused = md_GenesisState.Fields().ByName("paused") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } + if x.TotalDistributed != "" { + value := protoreflect.ValueOfString(x.TotalDistributed) + if !f(fd_GenesisState_total_distributed, value) { + return + } + } + if x.ActivationTime != nil { + value := protoreflect.ValueOfMessage(x.ActivationTime.ProtoReflect()) + if !f(fd_GenesisState_activation_time, value) { + return + } + } + if x.PoolBalanceAtActivation != "" { + value := protoreflect.ValueOfString(x.PoolBalanceAtActivation) + if !f(fd_GenesisState_pool_balance_at_activation, value) { + return + } + } + if x.LastBlockTime != nil { + value := protoreflect.ValueOfMessage(x.LastBlockTime.ProtoReflect()) + if !f(fd_GenesisState_last_block_time, value) { + return + } + } + if x.TotalPausedSeconds != int64(0) { + value := protoreflect.ValueOfInt64(x.TotalPausedSeconds) + if !f(fd_GenesisState_total_paused_seconds, value) { + return + } + } + if x.Activated != false { + value := protoreflect.ValueOfBool(x.Activated) + if !f(fd_GenesisState_activated, value) { + return + } + } + if x.Paused != false { + value := protoreflect.ValueOfBool(x.Paused) + if !f(fd_GenesisState_paused, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.GenesisState.params": + return x.Params != nil + case "cosmos.svip.v1.GenesisState.total_distributed": + return x.TotalDistributed != "" + case "cosmos.svip.v1.GenesisState.activation_time": + return x.ActivationTime != nil + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + return x.PoolBalanceAtActivation != "" + case "cosmos.svip.v1.GenesisState.last_block_time": + return x.LastBlockTime != nil + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + return x.TotalPausedSeconds != int64(0) + case "cosmos.svip.v1.GenesisState.activated": + return x.Activated != false + case "cosmos.svip.v1.GenesisState.paused": + return x.Paused != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.GenesisState.params": + x.Params = nil + case "cosmos.svip.v1.GenesisState.total_distributed": + x.TotalDistributed = "" + case "cosmos.svip.v1.GenesisState.activation_time": + x.ActivationTime = nil + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + x.PoolBalanceAtActivation = "" + case "cosmos.svip.v1.GenesisState.last_block_time": + x.LastBlockTime = nil + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + x.TotalPausedSeconds = int64(0) + case "cosmos.svip.v1.GenesisState.activated": + x.Activated = false + case "cosmos.svip.v1.GenesisState.paused": + x.Paused = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.total_distributed": + value := x.TotalDistributed + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.GenesisState.activation_time": + value := x.ActivationTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + value := x.PoolBalanceAtActivation + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.GenesisState.last_block_time": + value := x.LastBlockTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + value := x.TotalPausedSeconds + return protoreflect.ValueOfInt64(value) + case "cosmos.svip.v1.GenesisState.activated": + value := x.Activated + return protoreflect.ValueOfBool(value) + case "cosmos.svip.v1.GenesisState.paused": + value := x.Paused + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + case "cosmos.svip.v1.GenesisState.total_distributed": + x.TotalDistributed = value.Interface().(string) + case "cosmos.svip.v1.GenesisState.activation_time": + x.ActivationTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + x.PoolBalanceAtActivation = value.Interface().(string) + case "cosmos.svip.v1.GenesisState.last_block_time": + x.LastBlockTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + x.TotalPausedSeconds = value.Int() + case "cosmos.svip.v1.GenesisState.activated": + x.Activated = value.Bool() + case "cosmos.svip.v1.GenesisState.paused": + x.Paused = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.activation_time": + if x.ActivationTime == nil { + x.ActivationTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.ActivationTime.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.last_block_time": + if x.LastBlockTime == nil { + x.LastBlockTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.LastBlockTime.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.total_distributed": + panic(fmt.Errorf("field total_distributed of message cosmos.svip.v1.GenesisState is not mutable")) + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + panic(fmt.Errorf("field pool_balance_at_activation of message cosmos.svip.v1.GenesisState is not mutable")) + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + panic(fmt.Errorf("field total_paused_seconds of message cosmos.svip.v1.GenesisState is not mutable")) + case "cosmos.svip.v1.GenesisState.activated": + panic(fmt.Errorf("field activated of message cosmos.svip.v1.GenesisState is not mutable")) + case "cosmos.svip.v1.GenesisState.paused": + panic(fmt.Errorf("field paused of message cosmos.svip.v1.GenesisState is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.total_distributed": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.GenesisState.activation_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.pool_balance_at_activation": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.GenesisState.last_block_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.svip.v1.GenesisState.total_paused_seconds": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.svip.v1.GenesisState.activated": + return protoreflect.ValueOfBool(false) + case "cosmos.svip.v1.GenesisState.paused": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.svip.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.TotalDistributed) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ActivationTime != nil { + l = options.Size(x.ActivationTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PoolBalanceAtActivation) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.LastBlockTime != nil { + l = options.Size(x.LastBlockTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TotalPausedSeconds != 0 { + n += 1 + runtime.Sov(uint64(x.TotalPausedSeconds)) + } + if x.Activated { + n += 2 + } + if x.Paused { + n += 2 + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Paused { + i-- + if x.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if x.Activated { + i-- + if x.Activated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if x.TotalPausedSeconds != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TotalPausedSeconds)) + i-- + dAtA[i] = 0x30 + } + if x.LastBlockTime != nil { + encoded, err := options.Marshal(x.LastBlockTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if len(x.PoolBalanceAtActivation) > 0 { + i -= len(x.PoolBalanceAtActivation) + copy(dAtA[i:], x.PoolBalanceAtActivation) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PoolBalanceAtActivation))) + i-- + dAtA[i] = 0x22 + } + if x.ActivationTime != nil { + encoded, err := options.Marshal(x.ActivationTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if len(x.TotalDistributed) > 0 { + i -= len(x.TotalDistributed) + copy(dAtA[i:], x.TotalDistributed) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TotalDistributed))) + i-- + dAtA[i] = 0x12 + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalDistributed", 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.TotalDistributed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ActivationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ActivationTime == nil { + x.ActivationTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ActivationTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PoolBalanceAtActivation", 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.PoolBalanceAtActivation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastBlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.LastBlockTime == nil { + x.LastBlockTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LastBlockTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalPausedSeconds", wireType) + } + x.TotalPausedSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.TotalPausedSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Activated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Activated = bool(v != 0) + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Paused = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/svip/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the svip module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines all the parameters of the svip module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // total_distributed is tokens sent to FeeCollector since the last (re)activation. + TotalDistributed string `protobuf:"bytes,2,opt,name=total_distributed,json=totalDistributed,proto3" json:"total_distributed,omitempty"` + // activation_time is when SVIP was activated. Zero if not yet activated. + ActivationTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=activation_time,json=activationTime,proto3" json:"activation_time,omitempty"` + // pool_balance_at_activation is the pool snapshot used to derive R₀. + PoolBalanceAtActivation string `protobuf:"bytes,4,opt,name=pool_balance_at_activation,json=poolBalanceAtActivation,proto3" json:"pool_balance_at_activation,omitempty"` + // last_block_time is the timestamp of the last processed block. + LastBlockTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3" json:"last_block_time,omitempty"` + // total_paused_seconds is the cumulative seconds spent in paused state. + TotalPausedSeconds int64 `protobuf:"varint,6,opt,name=total_paused_seconds,json=totalPausedSeconds,proto3" json:"total_paused_seconds,omitempty"` + // activated indicates whether SVIP reward distribution is active. + Activated bool `protobuf:"varint,7,opt,name=activated,proto3" json:"activated,omitempty"` + // paused is an emergency pause flag. + Paused bool `protobuf:"varint,8,opt,name=paused,proto3" json:"paused,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +func (x *GenesisState) GetTotalDistributed() string { + if x != nil { + return x.TotalDistributed + } + return "" +} + +func (x *GenesisState) GetActivationTime() *timestamppb.Timestamp { + if x != nil { + return x.ActivationTime + } + return nil +} + +func (x *GenesisState) GetPoolBalanceAtActivation() string { + if x != nil { + return x.PoolBalanceAtActivation + } + return "" +} + +func (x *GenesisState) GetLastBlockTime() *timestamppb.Timestamp { + if x != nil { + return x.LastBlockTime + } + return nil +} + +func (x *GenesisState) GetTotalPausedSeconds() int64 { + if x != nil { + return x.TotalPausedSeconds + } + return 0 +} + +func (x *GenesisState) GetActivated() bool { + if x != nil { + return x.Activated + } + return false +} + +func (x *GenesisState) GetPaused() bool { + if x != nil { + return x.Paused + } + return false +} + +var File_cosmos_svip_v1_genesis_proto protoreflect.FileDescriptor + +var file_cosmos_svip_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, + 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x11, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x03, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, + 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x4a, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x12, 0x4d, 0x0a, 0x0f, 0x61, + 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x5a, 0x0a, 0x1a, 0x70, 0x6f, + 0x6f, 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x74, 0x5f, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, + 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x17, 0x70, + 0x6f, 0x6f, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x74, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, + 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x61, + 0x75, 0x73, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x61, 0x75, 0x73, 0x65, 0x64, 0x53, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x42, 0xa4, 0x01, 0x0a, + 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, + 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, + 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, + 0x58, 0xaa, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, 0x70, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, + 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, 0x70, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_svip_v1_genesis_proto_rawDescOnce sync.Once + file_cosmos_svip_v1_genesis_proto_rawDescData = file_cosmos_svip_v1_genesis_proto_rawDesc +) + +func file_cosmos_svip_v1_genesis_proto_rawDescGZIP() []byte { + file_cosmos_svip_v1_genesis_proto_rawDescOnce.Do(func() { + file_cosmos_svip_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_svip_v1_genesis_proto_rawDescData) + }) + return file_cosmos_svip_v1_genesis_proto_rawDescData +} + +var file_cosmos_svip_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_svip_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: cosmos.svip.v1.GenesisState + (*Params)(nil), // 1: cosmos.svip.v1.Params + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp +} +var file_cosmos_svip_v1_genesis_proto_depIdxs = []int32{ + 1, // 0: cosmos.svip.v1.GenesisState.params:type_name -> cosmos.svip.v1.Params + 2, // 1: cosmos.svip.v1.GenesisState.activation_time:type_name -> google.protobuf.Timestamp + 2, // 2: cosmos.svip.v1.GenesisState.last_block_time:type_name -> google.protobuf.Timestamp + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_cosmos_svip_v1_genesis_proto_init() } +func file_cosmos_svip_v1_genesis_proto_init() { + if File_cosmos_svip_v1_genesis_proto != nil { + return + } + file_cosmos_svip_v1_svip_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_svip_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_svip_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_svip_v1_genesis_proto_goTypes, + DependencyIndexes: file_cosmos_svip_v1_genesis_proto_depIdxs, + MessageInfos: file_cosmos_svip_v1_genesis_proto_msgTypes, + }.Build() + File_cosmos_svip_v1_genesis_proto = out.File + file_cosmos_svip_v1_genesis_proto_rawDesc = nil + file_cosmos_svip_v1_genesis_proto_goTypes = nil + file_cosmos_svip_v1_genesis_proto_depIdxs = nil +} diff --git a/api/cosmos/svip/v1/query.pulsar.go b/api/cosmos/svip/v1/query.pulsar.go new file mode 100644 index 00000000..46cfab4e --- /dev/null +++ b/api/cosmos/svip/v1/query.pulsar.go @@ -0,0 +1,2292 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package svipv1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_query_proto_init() + md_QueryParamsRequest = File_cosmos_svip_v1_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.QueryParamsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_query_proto_init() + md_QueryParamsResponse = File_cosmos_svip_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.QueryParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryPoolStateRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_query_proto_init() + md_QueryPoolStateRequest = File_cosmos_svip_v1_query_proto.Messages().ByName("QueryPoolStateRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryPoolStateRequest)(nil) + +type fastReflection_QueryPoolStateRequest QueryPoolStateRequest + +func (x *QueryPoolStateRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryPoolStateRequest)(x) +} + +func (x *QueryPoolStateRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryPoolStateRequest_messageType fastReflection_QueryPoolStateRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryPoolStateRequest_messageType{} + +type fastReflection_QueryPoolStateRequest_messageType struct{} + +func (x fastReflection_QueryPoolStateRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryPoolStateRequest)(nil) +} +func (x fastReflection_QueryPoolStateRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryPoolStateRequest) +} +func (x fastReflection_QueryPoolStateRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPoolStateRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryPoolStateRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPoolStateRequest +} + +// 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_QueryPoolStateRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryPoolStateRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryPoolStateRequest) New() protoreflect.Message { + return new(fastReflection_QueryPoolStateRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryPoolStateRequest) Interface() protoreflect.ProtoMessage { + return (*QueryPoolStateRequest)(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_QueryPoolStateRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryPoolStateRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateRequest")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateRequest 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_QueryPoolStateRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.QueryPoolStateRequest", 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_QueryPoolStateRequest) 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_QueryPoolStateRequest) 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_QueryPoolStateRequest) 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_QueryPoolStateRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryPoolStateRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryPoolStateRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryPoolStateRequest) + 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: QueryPoolStateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryPoolStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryPoolStateResponse protoreflect.MessageDescriptor + fd_QueryPoolStateResponse_pool_balance protoreflect.FieldDescriptor + fd_QueryPoolStateResponse_total_distributed protoreflect.FieldDescriptor + fd_QueryPoolStateResponse_current_rate_per_second protoreflect.FieldDescriptor + fd_QueryPoolStateResponse_activated protoreflect.FieldDescriptor + fd_QueryPoolStateResponse_paused protoreflect.FieldDescriptor + fd_QueryPoolStateResponse_activation_time protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_query_proto_init() + md_QueryPoolStateResponse = File_cosmos_svip_v1_query_proto.Messages().ByName("QueryPoolStateResponse") + fd_QueryPoolStateResponse_pool_balance = md_QueryPoolStateResponse.Fields().ByName("pool_balance") + fd_QueryPoolStateResponse_total_distributed = md_QueryPoolStateResponse.Fields().ByName("total_distributed") + fd_QueryPoolStateResponse_current_rate_per_second = md_QueryPoolStateResponse.Fields().ByName("current_rate_per_second") + fd_QueryPoolStateResponse_activated = md_QueryPoolStateResponse.Fields().ByName("activated") + fd_QueryPoolStateResponse_paused = md_QueryPoolStateResponse.Fields().ByName("paused") + fd_QueryPoolStateResponse_activation_time = md_QueryPoolStateResponse.Fields().ByName("activation_time") +} + +var _ protoreflect.Message = (*fastReflection_QueryPoolStateResponse)(nil) + +type fastReflection_QueryPoolStateResponse QueryPoolStateResponse + +func (x *QueryPoolStateResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryPoolStateResponse)(x) +} + +func (x *QueryPoolStateResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryPoolStateResponse_messageType fastReflection_QueryPoolStateResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryPoolStateResponse_messageType{} + +type fastReflection_QueryPoolStateResponse_messageType struct{} + +func (x fastReflection_QueryPoolStateResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryPoolStateResponse)(nil) +} +func (x fastReflection_QueryPoolStateResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryPoolStateResponse) +} +func (x fastReflection_QueryPoolStateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPoolStateResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryPoolStateResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryPoolStateResponse +} + +// 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_QueryPoolStateResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryPoolStateResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryPoolStateResponse) New() protoreflect.Message { + return new(fastReflection_QueryPoolStateResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryPoolStateResponse) Interface() protoreflect.ProtoMessage { + return (*QueryPoolStateResponse)(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_QueryPoolStateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.PoolBalance != nil { + value := protoreflect.ValueOfMessage(x.PoolBalance.ProtoReflect()) + if !f(fd_QueryPoolStateResponse_pool_balance, value) { + return + } + } + if x.TotalDistributed != "" { + value := protoreflect.ValueOfString(x.TotalDistributed) + if !f(fd_QueryPoolStateResponse_total_distributed, value) { + return + } + } + if x.CurrentRatePerSecond != "" { + value := protoreflect.ValueOfString(x.CurrentRatePerSecond) + if !f(fd_QueryPoolStateResponse_current_rate_per_second, value) { + return + } + } + if x.Activated != false { + value := protoreflect.ValueOfBool(x.Activated) + if !f(fd_QueryPoolStateResponse_activated, value) { + return + } + } + if x.Paused != false { + value := protoreflect.ValueOfBool(x.Paused) + if !f(fd_QueryPoolStateResponse_paused, value) { + return + } + } + if x.ActivationTime != nil { + value := protoreflect.ValueOfMessage(x.ActivationTime.ProtoReflect()) + if !f(fd_QueryPoolStateResponse_activation_time, 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_QueryPoolStateResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + return x.PoolBalance != nil + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + return x.TotalDistributed != "" + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + return x.CurrentRatePerSecond != "" + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + return x.Activated != false + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + return x.Paused != false + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + return x.ActivationTime != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + x.PoolBalance = nil + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + x.TotalDistributed = "" + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + x.CurrentRatePerSecond = "" + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + x.Activated = false + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + x.Paused = false + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + x.ActivationTime = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + value := x.PoolBalance + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + value := x.TotalDistributed + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + value := x.CurrentRatePerSecond + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + value := x.Activated + return protoreflect.ValueOfBool(value) + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + value := x.Paused + return protoreflect.ValueOfBool(value) + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + value := x.ActivationTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + x.PoolBalance = value.Message().Interface().(*v1beta1.Coin) + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + x.TotalDistributed = value.Interface().(string) + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + x.CurrentRatePerSecond = value.Interface().(string) + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + x.Activated = value.Bool() + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + x.Paused = value.Bool() + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + x.ActivationTime = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + if x.PoolBalance == nil { + x.PoolBalance = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.PoolBalance.ProtoReflect()) + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + if x.ActivationTime == nil { + x.ActivationTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.ActivationTime.ProtoReflect()) + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + panic(fmt.Errorf("field total_distributed of message cosmos.svip.v1.QueryPoolStateResponse is not mutable")) + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + panic(fmt.Errorf("field current_rate_per_second of message cosmos.svip.v1.QueryPoolStateResponse is not mutable")) + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + panic(fmt.Errorf("field activated of message cosmos.svip.v1.QueryPoolStateResponse is not mutable")) + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + panic(fmt.Errorf("field paused of message cosmos.svip.v1.QueryPoolStateResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.QueryPoolStateResponse.pool_balance": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.svip.v1.QueryPoolStateResponse.total_distributed": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.QueryPoolStateResponse.current_rate_per_second": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.QueryPoolStateResponse.activated": + return protoreflect.ValueOfBool(false) + case "cosmos.svip.v1.QueryPoolStateResponse.paused": + return protoreflect.ValueOfBool(false) + case "cosmos.svip.v1.QueryPoolStateResponse.activation_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.QueryPoolStateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.QueryPoolStateResponse 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_QueryPoolStateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.QueryPoolStateResponse", 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_QueryPoolStateResponse) 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_QueryPoolStateResponse) 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_QueryPoolStateResponse) 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_QueryPoolStateResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryPoolStateResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.PoolBalance != nil { + l = options.Size(x.PoolBalance) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.TotalDistributed) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CurrentRatePerSecond) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Activated { + n += 2 + } + if x.Paused { + n += 2 + } + if x.ActivationTime != nil { + l = options.Size(x.ActivationTime) + 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().(*QueryPoolStateResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.ActivationTime != nil { + encoded, err := options.Marshal(x.ActivationTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x32 + } + if x.Paused { + i-- + if x.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if x.Activated { + i-- + if x.Activated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(x.CurrentRatePerSecond) > 0 { + i -= len(x.CurrentRatePerSecond) + copy(dAtA[i:], x.CurrentRatePerSecond) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CurrentRatePerSecond))) + i-- + dAtA[i] = 0x1a + } + if len(x.TotalDistributed) > 0 { + i -= len(x.TotalDistributed) + copy(dAtA[i:], x.TotalDistributed) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TotalDistributed))) + i-- + dAtA[i] = 0x12 + } + if x.PoolBalance != nil { + encoded, err := options.Marshal(x.PoolBalance) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryPoolStateResponse) + 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: QueryPoolStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryPoolStateResponse: 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 PoolBalance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.PoolBalance == nil { + x.PoolBalance = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PoolBalance); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalDistributed", 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.TotalDistributed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentRatePerSecond", 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.CurrentRatePerSecond = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Activated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Activated = bool(v != 0) + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Paused = bool(v != 0) + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ActivationTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ActivationTime == nil { + x.ActivationTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ActivationTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/svip/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryParamsRequest defines the request type for querying x/svip parameters. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse defines the response type for querying x/svip parameters. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params define the svip module parameters. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// QueryPoolStateRequest defines the request type for querying pool state. +type QueryPoolStateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryPoolStateRequest) Reset() { + *x = QueryPoolStateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryPoolStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryPoolStateRequest) ProtoMessage() {} + +// Deprecated: Use QueryPoolStateRequest.ProtoReflect.Descriptor instead. +func (*QueryPoolStateRequest) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_query_proto_rawDescGZIP(), []int{2} +} + +// QueryPoolStateResponse returns the current SVIP pool state. +type QueryPoolStateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pool_balance is the current balance in the SVIP module account. + PoolBalance *v1beta1.Coin `protobuf:"bytes,1,opt,name=pool_balance,json=poolBalance,proto3" json:"pool_balance,omitempty"` + // total_distributed is tokens sent to FeeCollector since the last (re)activation. + TotalDistributed string `protobuf:"bytes,2,opt,name=total_distributed,json=totalDistributed,proto3" json:"total_distributed,omitempty"` + // current_rate_per_second is the current reward rate after decay. + CurrentRatePerSecond string `protobuf:"bytes,3,opt,name=current_rate_per_second,json=currentRatePerSecond,proto3" json:"current_rate_per_second,omitempty"` + // activated indicates whether SVIP is active. + Activated bool `protobuf:"varint,4,opt,name=activated,proto3" json:"activated,omitempty"` + // paused indicates whether SVIP is paused. + Paused bool `protobuf:"varint,5,opt,name=paused,proto3" json:"paused,omitempty"` + // activation_time is when SVIP was activated. + ActivationTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=activation_time,json=activationTime,proto3" json:"activation_time,omitempty"` +} + +func (x *QueryPoolStateResponse) Reset() { + *x = QueryPoolStateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryPoolStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryPoolStateResponse) ProtoMessage() {} + +// Deprecated: Use QueryPoolStateResponse.ProtoReflect.Descriptor instead. +func (*QueryPoolStateResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryPoolStateResponse) GetPoolBalance() *v1beta1.Coin { + if x != nil { + return x.PoolBalance + } + return nil +} + +func (x *QueryPoolStateResponse) GetTotalDistributed() string { + if x != nil { + return x.TotalDistributed + } + return "" +} + +func (x *QueryPoolStateResponse) GetCurrentRatePerSecond() string { + if x != nil { + return x.CurrentRatePerSecond + } + return "" +} + +func (x *QueryPoolStateResponse) GetActivated() bool { + if x != nil { + return x.Activated + } + return false +} + +func (x *QueryPoolStateResponse) GetPaused() bool { + if x != nil { + return x.Paused + } + return false +} + +func (x *QueryPoolStateResponse) GetActivationTime() *timestamppb.Timestamp { + if x != nil { + return x.ActivationTime + } + return nil +} + +var File_cosmos_svip_v1_query_proto protoreflect.FileDescriptor + +var file_cosmos_svip_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, + 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, + 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x76, 0x69, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x89, 0x03, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x70, + 0x6f, 0x6f, 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x0b, 0x70, 0x6f, 0x6f, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x4a, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, + 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x12, 0x5a, 0x0a, 0x17, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, + 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xc8, 0xde, + 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, + 0x63, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x74, 0x65, 0x50, 0x65, + 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, 0x64, 0x12, 0x4d, 0x0a, + 0x0f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x32, 0xfa, 0x01, 0x0a, + 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x71, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, + 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x18, 0x12, 0x16, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x7e, 0x0a, 0x09, 0x50, 0x6f, 0x6f, + 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, + 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x70, + 0x6f, 0x6f, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x42, 0xa2, 0x01, 0x0a, 0x12, 0x63, 0x6f, + 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, + 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x3b, + 0x73, 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x0e, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_svip_v1_query_proto_rawDescOnce sync.Once + file_cosmos_svip_v1_query_proto_rawDescData = file_cosmos_svip_v1_query_proto_rawDesc +) + +func file_cosmos_svip_v1_query_proto_rawDescGZIP() []byte { + file_cosmos_svip_v1_query_proto_rawDescOnce.Do(func() { + file_cosmos_svip_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_svip_v1_query_proto_rawDescData) + }) + return file_cosmos_svip_v1_query_proto_rawDescData +} + +var file_cosmos_svip_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_svip_v1_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: cosmos.svip.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: cosmos.svip.v1.QueryParamsResponse + (*QueryPoolStateRequest)(nil), // 2: cosmos.svip.v1.QueryPoolStateRequest + (*QueryPoolStateResponse)(nil), // 3: cosmos.svip.v1.QueryPoolStateResponse + (*Params)(nil), // 4: cosmos.svip.v1.Params + (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} +var file_cosmos_svip_v1_query_proto_depIdxs = []int32{ + 4, // 0: cosmos.svip.v1.QueryParamsResponse.params:type_name -> cosmos.svip.v1.Params + 5, // 1: cosmos.svip.v1.QueryPoolStateResponse.pool_balance:type_name -> cosmos.base.v1beta1.Coin + 6, // 2: cosmos.svip.v1.QueryPoolStateResponse.activation_time:type_name -> google.protobuf.Timestamp + 0, // 3: cosmos.svip.v1.Query.Params:input_type -> cosmos.svip.v1.QueryParamsRequest + 2, // 4: cosmos.svip.v1.Query.PoolState:input_type -> cosmos.svip.v1.QueryPoolStateRequest + 1, // 5: cosmos.svip.v1.Query.Params:output_type -> cosmos.svip.v1.QueryParamsResponse + 3, // 6: cosmos.svip.v1.Query.PoolState:output_type -> cosmos.svip.v1.QueryPoolStateResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_cosmos_svip_v1_query_proto_init() } +func file_cosmos_svip_v1_query_proto_init() { + if File_cosmos_svip_v1_query_proto != nil { + return + } + file_cosmos_svip_v1_svip_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_svip_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryPoolStateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryPoolStateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_svip_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_svip_v1_query_proto_goTypes, + DependencyIndexes: file_cosmos_svip_v1_query_proto_depIdxs, + MessageInfos: file_cosmos_svip_v1_query_proto_msgTypes, + }.Build() + File_cosmos_svip_v1_query_proto = out.File + file_cosmos_svip_v1_query_proto_rawDesc = nil + file_cosmos_svip_v1_query_proto_goTypes = nil + file_cosmos_svip_v1_query_proto_depIdxs = nil +} diff --git a/api/cosmos/svip/v1/query_grpc.pb.go b/api/cosmos/svip/v1/query_grpc.pb.go new file mode 100644 index 00000000..053061b4 --- /dev/null +++ b/api/cosmos/svip/v1/query_grpc.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: cosmos/svip/v1/query.proto + +package svipv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_Params_FullMethodName = "/cosmos.svip.v1.Query/Params" + Query_PoolState_FullMethodName = "/cosmos.svip.v1.Query/PoolState" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // Params queries the parameters of x/svip module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // PoolState queries the current SVIP pool balance, distribution stats, and + // reward rate. + PoolState(ctx context.Context, in *QueryPoolStateRequest, opts ...grpc.CallOption) (*QueryPoolStateResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) 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, Query_Params_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) PoolState(ctx context.Context, in *QueryPoolStateRequest, opts ...grpc.CallOption) (*QueryPoolStateResponse, error) { + out := new(QueryPoolStateResponse) + err := c.cc.Invoke(ctx, Query_PoolState_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // Params queries the parameters of x/svip module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // PoolState queries the current SVIP pool balance, distribution stats, and + // reward rate. + PoolState(context.Context, *QueryPoolStateRequest) (*QueryPoolStateResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) PoolState(context.Context, *QueryPoolStateRequest) (*QueryPoolStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PoolState not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + 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: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_PoolState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPoolStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PoolState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_PoolState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PoolState(ctx, req.(*QueryPoolStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.svip.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "PoolState", + Handler: _Query_PoolState_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/svip/v1/query.proto", +} diff --git a/api/cosmos/svip/v1/svip.pulsar.go b/api/cosmos/svip/v1/svip.pulsar.go new file mode 100644 index 00000000..af27baf9 --- /dev/null +++ b/api/cosmos/svip/v1/svip.pulsar.go @@ -0,0 +1,560 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package svipv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_half_life_seconds protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_svip_proto_init() + md_Params = File_cosmos_svip_v1_svip_proto.Messages().ByName("Params") + fd_Params_half_life_seconds = md_Params.Fields().ByName("half_life_seconds") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_svip_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_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.HalfLifeSeconds != int64(0) { + value := protoreflect.ValueOfInt64(x.HalfLifeSeconds) + if !f(fd_Params_half_life_seconds, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.Params.half_life_seconds": + return x.HalfLifeSeconds != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.Params.half_life_seconds": + x.HalfLifeSeconds = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.Params.half_life_seconds": + value := x.HalfLifeSeconds + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.Params.half_life_seconds": + x.HalfLifeSeconds = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.Params.half_life_seconds": + panic(fmt.Errorf("field half_life_seconds of message cosmos.svip.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.Params.half_life_seconds": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.Params")) + } + panic(fmt.Errorf("message cosmos.svip.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.HalfLifeSeconds != 0 { + n += 1 + runtime.Sov(uint64(x.HalfLifeSeconds)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.HalfLifeSeconds != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.HalfLifeSeconds)) + i-- + dAtA[i] = 0x18 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HalfLifeSeconds", wireType) + } + x.HalfLifeSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.HalfLifeSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/svip/v1/svip.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) +) + +// Params defines the x/svip module parameters. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // half_life_seconds is the half-life for exponential decay, in seconds. + HalfLifeSeconds int64 `protobuf:"varint,3,opt,name=half_life_seconds,json=halfLifeSeconds,proto3" json:"half_life_seconds,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_svip_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_svip_proto_rawDescGZIP(), []int{0} +} + +func (x *Params) GetHalfLifeSeconds() int64 { + if x != nil { + return x.HalfLifeSeconds + } + return 0 +} + +var File_cosmos_svip_v1_svip_proto protoreflect.FileDescriptor + +var file_cosmos_svip_v1_svip_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, + 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, + 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, + 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x46, + 0x0a, 0x11, 0x68, 0x61, 0x6c, 0x66, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x1a, 0xea, 0xde, 0x1f, 0x11, 0x68, + 0x61, 0x6c, 0x66, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x68, 0x61, 0x6c, 0x66, 0x4c, 0x69, 0x66, 0x65, 0x53, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x19, 0x8a, 0xe7, 0xb0, 0x2a, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x78, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0xa1, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x53, 0x76, 0x69, 0x70, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, + 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x53, 0x58, 0xaa, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, + 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, + 0x69, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, + 0x76, 0x69, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, + 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_svip_v1_svip_proto_rawDescOnce sync.Once + file_cosmos_svip_v1_svip_proto_rawDescData = file_cosmos_svip_v1_svip_proto_rawDesc +) + +func file_cosmos_svip_v1_svip_proto_rawDescGZIP() []byte { + file_cosmos_svip_v1_svip_proto_rawDescOnce.Do(func() { + file_cosmos_svip_v1_svip_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_svip_v1_svip_proto_rawDescData) + }) + return file_cosmos_svip_v1_svip_proto_rawDescData +} + +var file_cosmos_svip_v1_svip_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_svip_v1_svip_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: cosmos.svip.v1.Params +} +var file_cosmos_svip_v1_svip_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_svip_v1_svip_proto_init() } +func file_cosmos_svip_v1_svip_proto_init() { + if File_cosmos_svip_v1_svip_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_svip_v1_svip_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_svip_v1_svip_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_svip_v1_svip_proto_goTypes, + DependencyIndexes: file_cosmos_svip_v1_svip_proto_depIdxs, + MessageInfos: file_cosmos_svip_v1_svip_proto_msgTypes, + }.Build() + File_cosmos_svip_v1_svip_proto = out.File + file_cosmos_svip_v1_svip_proto_rawDesc = nil + file_cosmos_svip_v1_svip_proto_goTypes = nil + file_cosmos_svip_v1_svip_proto_depIdxs = nil +} diff --git a/api/cosmos/svip/v1/tx.pulsar.go b/api/cosmos/svip/v1/tx.pulsar.go new file mode 100644 index 00000000..7c66588e --- /dev/null +++ b/api/cosmos/svip/v1/tx.pulsar.go @@ -0,0 +1,4826 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package svipv1 + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgUpdateParams = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.authority": + return x.Authority != "" + case "cosmos.svip.v1.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.authority": + x.Authority = "" + case "cosmos.svip.v1.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "cosmos.svip.v1.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "cosmos.svip.v1.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message cosmos.svip.v1.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParams")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgUpdateParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgUpdateParamsResponse = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgUpdateParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgUpdateParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgUpdateParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgUpdateParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgUpdateParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgActivate protoreflect.MessageDescriptor + fd_MsgActivate_authority protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgActivate = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgActivate") + fd_MsgActivate_authority = md_MsgActivate.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_MsgActivate)(nil) + +type fastReflection_MsgActivate MsgActivate + +func (x *MsgActivate) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgActivate)(x) +} + +func (x *MsgActivate) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgActivate_messageType fastReflection_MsgActivate_messageType +var _ protoreflect.MessageType = fastReflection_MsgActivate_messageType{} + +type fastReflection_MsgActivate_messageType struct{} + +func (x fastReflection_MsgActivate_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgActivate)(nil) +} +func (x fastReflection_MsgActivate_messageType) New() protoreflect.Message { + return new(fastReflection_MsgActivate) +} +func (x fastReflection_MsgActivate_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivate +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgActivate) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivate +} + +// 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_MsgActivate) Type() protoreflect.MessageType { + return _fastReflection_MsgActivate_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgActivate) New() protoreflect.Message { + return new(fastReflection_MsgActivate) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgActivate) Interface() protoreflect.ProtoMessage { + return (*MsgActivate)(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_MsgActivate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgActivate_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_MsgActivate) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + panic(fmt.Errorf("field authority of message cosmos.svip.v1.MsgActivate is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgActivate.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivate 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_MsgActivate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgActivate", 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_MsgActivate) 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_MsgActivate) 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_MsgActivate) 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_MsgActivate) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgActivate) + 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().(*MsgActivate) + 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().(*MsgActivate) + 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: MsgActivate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgActivate: 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, + } +} + +var ( + md_MsgActivateResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgActivateResponse = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgActivateResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgActivateResponse)(nil) + +type fastReflection_MsgActivateResponse MsgActivateResponse + +func (x *MsgActivateResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgActivateResponse)(x) +} + +func (x *MsgActivateResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgActivateResponse_messageType fastReflection_MsgActivateResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgActivateResponse_messageType{} + +type fastReflection_MsgActivateResponse_messageType struct{} + +func (x fastReflection_MsgActivateResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgActivateResponse)(nil) +} +func (x fastReflection_MsgActivateResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgActivateResponse) +} +func (x fastReflection_MsgActivateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivateResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgActivateResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgActivateResponse +} + +// 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_MsgActivateResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgActivateResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgActivateResponse) New() protoreflect.Message { + return new(fastReflection_MsgActivateResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgActivateResponse) Interface() protoreflect.ProtoMessage { + return (*MsgActivateResponse)(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_MsgActivateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgActivateResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgActivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgActivateResponse 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_MsgActivateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgActivateResponse", 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_MsgActivateResponse) 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_MsgActivateResponse) 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_MsgActivateResponse) 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_MsgActivateResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgActivateResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgActivateResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgActivateResponse) + 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: MsgActivateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgActivateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgReactivate protoreflect.MessageDescriptor + fd_MsgReactivate_authority protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgReactivate = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgReactivate") + fd_MsgReactivate_authority = md_MsgReactivate.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_MsgReactivate)(nil) + +type fastReflection_MsgReactivate MsgReactivate + +func (x *MsgReactivate) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgReactivate)(x) +} + +func (x *MsgReactivate) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgReactivate_messageType fastReflection_MsgReactivate_messageType +var _ protoreflect.MessageType = fastReflection_MsgReactivate_messageType{} + +type fastReflection_MsgReactivate_messageType struct{} + +func (x fastReflection_MsgReactivate_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgReactivate)(nil) +} +func (x fastReflection_MsgReactivate_messageType) New() protoreflect.Message { + return new(fastReflection_MsgReactivate) +} +func (x fastReflection_MsgReactivate_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReactivate +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgReactivate) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReactivate +} + +// 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_MsgReactivate) Type() protoreflect.MessageType { + return _fastReflection_MsgReactivate_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgReactivate) New() protoreflect.Message { + return new(fastReflection_MsgReactivate) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgReactivate) Interface() protoreflect.ProtoMessage { + return (*MsgReactivate)(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_MsgReactivate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgReactivate_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_MsgReactivate) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + panic(fmt.Errorf("field authority of message cosmos.svip.v1.MsgReactivate is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgReactivate.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivate")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivate 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_MsgReactivate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgReactivate", 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_MsgReactivate) 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_MsgReactivate) 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_MsgReactivate) 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_MsgReactivate) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgReactivate) + 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().(*MsgReactivate) + 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().(*MsgReactivate) + 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: MsgReactivate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgReactivate: 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, + } +} + +var ( + md_MsgReactivateResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgReactivateResponse = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgReactivateResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgReactivateResponse)(nil) + +type fastReflection_MsgReactivateResponse MsgReactivateResponse + +func (x *MsgReactivateResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgReactivateResponse)(x) +} + +func (x *MsgReactivateResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgReactivateResponse_messageType fastReflection_MsgReactivateResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgReactivateResponse_messageType{} + +type fastReflection_MsgReactivateResponse_messageType struct{} + +func (x fastReflection_MsgReactivateResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgReactivateResponse)(nil) +} +func (x fastReflection_MsgReactivateResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgReactivateResponse) +} +func (x fastReflection_MsgReactivateResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReactivateResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgReactivateResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReactivateResponse +} + +// 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_MsgReactivateResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgReactivateResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgReactivateResponse) New() protoreflect.Message { + return new(fastReflection_MsgReactivateResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgReactivateResponse) Interface() protoreflect.ProtoMessage { + return (*MsgReactivateResponse)(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_MsgReactivateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgReactivateResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgReactivateResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgReactivateResponse 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_MsgReactivateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgReactivateResponse", 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_MsgReactivateResponse) 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_MsgReactivateResponse) 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_MsgReactivateResponse) 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_MsgReactivateResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgReactivateResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgReactivateResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgReactivateResponse) + 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: MsgReactivateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgReactivateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgPause protoreflect.MessageDescriptor + fd_MsgPause_authority protoreflect.FieldDescriptor + fd_MsgPause_paused protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgPause = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgPause") + fd_MsgPause_authority = md_MsgPause.Fields().ByName("authority") + fd_MsgPause_paused = md_MsgPause.Fields().ByName("paused") +} + +var _ protoreflect.Message = (*fastReflection_MsgPause)(nil) + +type fastReflection_MsgPause MsgPause + +func (x *MsgPause) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgPause)(x) +} + +func (x *MsgPause) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgPause_messageType fastReflection_MsgPause_messageType +var _ protoreflect.MessageType = fastReflection_MsgPause_messageType{} + +type fastReflection_MsgPause_messageType struct{} + +func (x fastReflection_MsgPause_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgPause)(nil) +} +func (x fastReflection_MsgPause_messageType) New() protoreflect.Message { + return new(fastReflection_MsgPause) +} +func (x fastReflection_MsgPause_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPause +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgPause) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPause +} + +// 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_MsgPause) Type() protoreflect.MessageType { + return _fastReflection_MsgPause_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgPause) New() protoreflect.Message { + return new(fastReflection_MsgPause) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgPause) Interface() protoreflect.ProtoMessage { + return (*MsgPause)(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_MsgPause) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgPause_authority, value) { + return + } + } + if x.Paused != false { + value := protoreflect.ValueOfBool(x.Paused) + if !f(fd_MsgPause_paused, 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_MsgPause) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + return x.Authority != "" + case "cosmos.svip.v1.MsgPause.paused": + return x.Paused != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + x.Authority = "" + case "cosmos.svip.v1.MsgPause.paused": + x.Paused = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.MsgPause.paused": + value := x.Paused + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + x.Authority = value.Interface().(string) + case "cosmos.svip.v1.MsgPause.paused": + x.Paused = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + panic(fmt.Errorf("field authority of message cosmos.svip.v1.MsgPause is not mutable")) + case "cosmos.svip.v1.MsgPause.paused": + panic(fmt.Errorf("field paused of message cosmos.svip.v1.MsgPause is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgPause.authority": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.MsgPause.paused": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPause")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPause 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_MsgPause) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgPause", 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_MsgPause) 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_MsgPause) 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_MsgPause) 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_MsgPause) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgPause) + 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.Paused { + n += 2 + } + 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().(*MsgPause) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Paused { + i-- + if x.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + 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().(*MsgPause) + 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: MsgPause: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgPause: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Paused = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgPauseResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgPauseResponse = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgPauseResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgPauseResponse)(nil) + +type fastReflection_MsgPauseResponse MsgPauseResponse + +func (x *MsgPauseResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgPauseResponse)(x) +} + +func (x *MsgPauseResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgPauseResponse_messageType fastReflection_MsgPauseResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgPauseResponse_messageType{} + +type fastReflection_MsgPauseResponse_messageType struct{} + +func (x fastReflection_MsgPauseResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgPauseResponse)(nil) +} +func (x fastReflection_MsgPauseResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgPauseResponse) +} +func (x fastReflection_MsgPauseResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPauseResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgPauseResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPauseResponse +} + +// 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_MsgPauseResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgPauseResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgPauseResponse) New() protoreflect.Message { + return new(fastReflection_MsgPauseResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgPauseResponse) Interface() protoreflect.ProtoMessage { + return (*MsgPauseResponse)(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_MsgPauseResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgPauseResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgPauseResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgPauseResponse 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_MsgPauseResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgPauseResponse", 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_MsgPauseResponse) 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_MsgPauseResponse) 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_MsgPauseResponse) 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_MsgPauseResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgPauseResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgPauseResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgPauseResponse) + 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: MsgPauseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgPauseResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_MsgFundPool_2_list)(nil) + +type _MsgFundPool_2_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgFundPool_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgFundPool_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgFundPool_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgFundPool_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgFundPool_2_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgFundPool_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgFundPool_2_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgFundPool_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgFundPool protoreflect.MessageDescriptor + fd_MsgFundPool_depositor protoreflect.FieldDescriptor + fd_MsgFundPool_amount protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgFundPool = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgFundPool") + fd_MsgFundPool_depositor = md_MsgFundPool.Fields().ByName("depositor") + fd_MsgFundPool_amount = md_MsgFundPool.Fields().ByName("amount") +} + +var _ protoreflect.Message = (*fastReflection_MsgFundPool)(nil) + +type fastReflection_MsgFundPool MsgFundPool + +func (x *MsgFundPool) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgFundPool)(x) +} + +func (x *MsgFundPool) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgFundPool_messageType fastReflection_MsgFundPool_messageType +var _ protoreflect.MessageType = fastReflection_MsgFundPool_messageType{} + +type fastReflection_MsgFundPool_messageType struct{} + +func (x fastReflection_MsgFundPool_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgFundPool)(nil) +} +func (x fastReflection_MsgFundPool_messageType) New() protoreflect.Message { + return new(fastReflection_MsgFundPool) +} +func (x fastReflection_MsgFundPool_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundPool +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgFundPool) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundPool +} + +// 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_MsgFundPool) Type() protoreflect.MessageType { + return _fastReflection_MsgFundPool_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgFundPool) New() protoreflect.Message { + return new(fastReflection_MsgFundPool) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgFundPool) Interface() protoreflect.ProtoMessage { + return (*MsgFundPool)(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_MsgFundPool) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Depositor != "" { + value := protoreflect.ValueOfString(x.Depositor) + if !f(fd_MsgFundPool_depositor, value) { + return + } + } + if len(x.Amount) != 0 { + value := protoreflect.ValueOfList(&_MsgFundPool_2_list{list: &x.Amount}) + if !f(fd_MsgFundPool_amount, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgFundPool) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.svip.v1.MsgFundPool.depositor": + return x.Depositor != "" + case "cosmos.svip.v1.MsgFundPool.amount": + return len(x.Amount) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgFundPool.depositor": + x.Depositor = "" + case "cosmos.svip.v1.MsgFundPool.amount": + x.Amount = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.svip.v1.MsgFundPool.depositor": + value := x.Depositor + return protoreflect.ValueOfString(value) + case "cosmos.svip.v1.MsgFundPool.amount": + if len(x.Amount) == 0 { + return protoreflect.ValueOfList(&_MsgFundPool_2_list{}) + } + listValue := &_MsgFundPool_2_list{list: &x.Amount} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.svip.v1.MsgFundPool.depositor": + x.Depositor = value.Interface().(string) + case "cosmos.svip.v1.MsgFundPool.amount": + lv := value.List() + clv := lv.(*_MsgFundPool_2_list) + x.Amount = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgFundPool.amount": + if x.Amount == nil { + x.Amount = []*v1beta1.Coin{} + } + value := &_MsgFundPool_2_list{list: &x.Amount} + return protoreflect.ValueOfList(value) + case "cosmos.svip.v1.MsgFundPool.depositor": + panic(fmt.Errorf("field depositor of message cosmos.svip.v1.MsgFundPool is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.svip.v1.MsgFundPool.depositor": + return protoreflect.ValueOfString("") + case "cosmos.svip.v1.MsgFundPool.amount": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgFundPool_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPool")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPool 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_MsgFundPool) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgFundPool", 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_MsgFundPool) 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_MsgFundPool) 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_MsgFundPool) 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_MsgFundPool) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgFundPool) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Depositor) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Amount) > 0 { + for _, e := range x.Amount { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgFundPool) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Amount) > 0 { + for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Amount[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Depositor) > 0 { + i -= len(x.Depositor) + copy(dAtA[i:], x.Depositor) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Depositor))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgFundPool) + 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: MsgFundPool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgFundPool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Depositor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Amount = append(x.Amount, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgFundPoolResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_svip_v1_tx_proto_init() + md_MsgFundPoolResponse = File_cosmos_svip_v1_tx_proto.Messages().ByName("MsgFundPoolResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgFundPoolResponse)(nil) + +type fastReflection_MsgFundPoolResponse MsgFundPoolResponse + +func (x *MsgFundPoolResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgFundPoolResponse)(x) +} + +func (x *MsgFundPoolResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgFundPoolResponse_messageType fastReflection_MsgFundPoolResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgFundPoolResponse_messageType{} + +type fastReflection_MsgFundPoolResponse_messageType struct{} + +func (x fastReflection_MsgFundPoolResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgFundPoolResponse)(nil) +} +func (x fastReflection_MsgFundPoolResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgFundPoolResponse) +} +func (x fastReflection_MsgFundPoolResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundPoolResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgFundPoolResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgFundPoolResponse +} + +// 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_MsgFundPoolResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgFundPoolResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgFundPoolResponse) New() protoreflect.Message { + return new(fastReflection_MsgFundPoolResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgFundPoolResponse) Interface() protoreflect.ProtoMessage { + return (*MsgFundPoolResponse)(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_MsgFundPoolResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgFundPoolResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.svip.v1.MsgFundPoolResponse")) + } + panic(fmt.Errorf("message cosmos.svip.v1.MsgFundPoolResponse 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_MsgFundPoolResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.svip.v1.MsgFundPoolResponse", 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_MsgFundPoolResponse) 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_MsgFundPoolResponse) 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_MsgFundPoolResponse) 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_MsgFundPoolResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgFundPoolResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgFundPoolResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgFundPoolResponse) + 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: MsgFundPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgFundPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/svip/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams defines a Msg for updating the x/svip module parameters. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/svip parameters to update. + // NOTE: Only half_life_seconds is configurable via this message. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response for MsgUpdateParams. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{1} +} + +// MsgActivate activates SVIP reward distribution. Governance-only. +type MsgActivate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *MsgActivate) Reset() { + *x = MsgActivate{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgActivate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgActivate) ProtoMessage() {} + +// Deprecated: Use MsgActivate.ProtoReflect.Descriptor instead. +func (*MsgActivate) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgActivate) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +// MsgActivateResponse defines the response for MsgActivate. +type MsgActivateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgActivateResponse) Reset() { + *x = MsgActivateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgActivateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgActivateResponse) ProtoMessage() {} + +// Deprecated: Use MsgActivateResponse.ProtoReflect.Descriptor instead. +func (*MsgActivateResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{3} +} + +// MsgReactivate restarts the decay curve with a fresh pool snapshot. +// Governance-only. Used after pool exhaustion and refund. +type MsgReactivate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *MsgReactivate) Reset() { + *x = MsgReactivate{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgReactivate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgReactivate) ProtoMessage() {} + +// Deprecated: Use MsgReactivate.ProtoReflect.Descriptor instead. +func (*MsgReactivate) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgReactivate) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +// MsgReactivateResponse defines the response for MsgReactivate. +type MsgReactivateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgReactivateResponse) Reset() { + *x = MsgReactivateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgReactivateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgReactivateResponse) ProtoMessage() {} + +// Deprecated: Use MsgReactivateResponse.ProtoReflect.Descriptor instead. +func (*MsgReactivateResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{5} +} + +// MsgPause toggles the SVIP emergency pause flag. Governance-only. +type MsgPause struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // paused is the desired pause state. + Paused bool `protobuf:"varint,2,opt,name=paused,proto3" json:"paused,omitempty"` +} + +func (x *MsgPause) Reset() { + *x = MsgPause{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgPause) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgPause) ProtoMessage() {} + +// Deprecated: Use MsgPause.ProtoReflect.Descriptor instead. +func (*MsgPause) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgPause) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgPause) GetPaused() bool { + if x != nil { + return x.Paused + } + return false +} + +// MsgPauseResponse defines the response for MsgPause. +type MsgPauseResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgPauseResponse) Reset() { + *x = MsgPauseResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgPauseResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgPauseResponse) ProtoMessage() {} + +// Deprecated: Use MsgPauseResponse.ProtoReflect.Descriptor instead. +func (*MsgPauseResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{7} +} + +// MsgFundPool sends native tokens to the SVIP reward pool. Permissionless. +type MsgFundPool struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // depositor is the address funding the pool. + Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty"` + // amount is the coins to transfer. Only the native denom is accepted. + Amount []*v1beta1.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *MsgFundPool) Reset() { + *x = MsgFundPool{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgFundPool) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgFundPool) ProtoMessage() {} + +// Deprecated: Use MsgFundPool.ProtoReflect.Descriptor instead. +func (*MsgFundPool) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgFundPool) GetDepositor() string { + if x != nil { + return x.Depositor + } + return "" +} + +func (x *MsgFundPool) GetAmount() []*v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + +// MsgFundPoolResponse defines the response for MsgFundPool. +type MsgFundPoolResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgFundPoolResponse) Reset() { + *x = MsgFundPoolResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_svip_v1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgFundPoolResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgFundPoolResponse) ProtoMessage() {} + +// Deprecated: Use MsgFundPoolResponse.ProtoReflect.Descriptor instead. +func (*MsgFundPoolResponse) Descriptor() ([]byte, []int) { + return file_cosmos_svip_v1_tx_proto_rawDescGZIP(), []int{9} +} + +var File_cosmos_svip_v1_tx_proto protoreflect.FileDescriptor + +var file_cosmos_svip_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, + 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, + 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x76, 0x69, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, + 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xb6, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x39, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x30, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1d, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x78, 0x2f, 0x73, 0x76, 0x69, 0x70, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x0e, 0x82, 0xe7, + 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x15, 0x0a, 0x13, + 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x57, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x0e, 0x82, 0xe7, + 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x17, 0x0a, 0x15, + 0x4d, 0x73, 0x67, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6a, 0x0a, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x75, 0x73, + 0x65, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x75, + 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x75, 0x73, 0x65, + 0x64, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x22, 0x12, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x75, 0x73, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, + 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x3c, 0x0a, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, + 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x22, 0x15, 0x0a, 0x13, 0x4d, + 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0x9b, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x58, 0x0a, 0x0c, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x27, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x08, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x1a, 0x23, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x12, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x1a, + 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x05, 0x50, 0x61, 0x75, 0x73, 0x65, 0x12, + 0x18, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x75, 0x73, 0x65, 0x1a, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, + 0x75, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x08, 0x46, + 0x75, 0x6e, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, + 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x76, + 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x50, 0x6f, 0x6f, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, + 0x42, 0x9f, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x73, 0x76, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x76, 0x69, 0x70, + 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x76, 0x69, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, + 0xaa, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x76, 0x69, 0x70, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x76, 0x69, 0x70, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x76, 0x69, 0x70, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_svip_v1_tx_proto_rawDescOnce sync.Once + file_cosmos_svip_v1_tx_proto_rawDescData = file_cosmos_svip_v1_tx_proto_rawDesc +) + +func file_cosmos_svip_v1_tx_proto_rawDescGZIP() []byte { + file_cosmos_svip_v1_tx_proto_rawDescOnce.Do(func() { + file_cosmos_svip_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_svip_v1_tx_proto_rawDescData) + }) + return file_cosmos_svip_v1_tx_proto_rawDescData +} + +var file_cosmos_svip_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_cosmos_svip_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: cosmos.svip.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: cosmos.svip.v1.MsgUpdateParamsResponse + (*MsgActivate)(nil), // 2: cosmos.svip.v1.MsgActivate + (*MsgActivateResponse)(nil), // 3: cosmos.svip.v1.MsgActivateResponse + (*MsgReactivate)(nil), // 4: cosmos.svip.v1.MsgReactivate + (*MsgReactivateResponse)(nil), // 5: cosmos.svip.v1.MsgReactivateResponse + (*MsgPause)(nil), // 6: cosmos.svip.v1.MsgPause + (*MsgPauseResponse)(nil), // 7: cosmos.svip.v1.MsgPauseResponse + (*MsgFundPool)(nil), // 8: cosmos.svip.v1.MsgFundPool + (*MsgFundPoolResponse)(nil), // 9: cosmos.svip.v1.MsgFundPoolResponse + (*Params)(nil), // 10: cosmos.svip.v1.Params + (*v1beta1.Coin)(nil), // 11: cosmos.base.v1beta1.Coin +} +var file_cosmos_svip_v1_tx_proto_depIdxs = []int32{ + 10, // 0: cosmos.svip.v1.MsgUpdateParams.params:type_name -> cosmos.svip.v1.Params + 11, // 1: cosmos.svip.v1.MsgFundPool.amount:type_name -> cosmos.base.v1beta1.Coin + 0, // 2: cosmos.svip.v1.Msg.UpdateParams:input_type -> cosmos.svip.v1.MsgUpdateParams + 2, // 3: cosmos.svip.v1.Msg.Activate:input_type -> cosmos.svip.v1.MsgActivate + 4, // 4: cosmos.svip.v1.Msg.Reactivate:input_type -> cosmos.svip.v1.MsgReactivate + 6, // 5: cosmos.svip.v1.Msg.Pause:input_type -> cosmos.svip.v1.MsgPause + 8, // 6: cosmos.svip.v1.Msg.FundPool:input_type -> cosmos.svip.v1.MsgFundPool + 1, // 7: cosmos.svip.v1.Msg.UpdateParams:output_type -> cosmos.svip.v1.MsgUpdateParamsResponse + 3, // 8: cosmos.svip.v1.Msg.Activate:output_type -> cosmos.svip.v1.MsgActivateResponse + 5, // 9: cosmos.svip.v1.Msg.Reactivate:output_type -> cosmos.svip.v1.MsgReactivateResponse + 7, // 10: cosmos.svip.v1.Msg.Pause:output_type -> cosmos.svip.v1.MsgPauseResponse + 9, // 11: cosmos.svip.v1.Msg.FundPool:output_type -> cosmos.svip.v1.MsgFundPoolResponse + 7, // [7:12] is the sub-list for method output_type + 2, // [2:7] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_cosmos_svip_v1_tx_proto_init() } +func file_cosmos_svip_v1_tx_proto_init() { + if File_cosmos_svip_v1_tx_proto != nil { + return + } + file_cosmos_svip_v1_svip_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_svip_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgActivate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgActivateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgReactivate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgReactivateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgPause); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgPauseResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgFundPool); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_svip_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgFundPoolResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_svip_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_svip_v1_tx_proto_goTypes, + DependencyIndexes: file_cosmos_svip_v1_tx_proto_depIdxs, + MessageInfos: file_cosmos_svip_v1_tx_proto_msgTypes, + }.Build() + File_cosmos_svip_v1_tx_proto = out.File + file_cosmos_svip_v1_tx_proto_rawDesc = nil + file_cosmos_svip_v1_tx_proto_goTypes = nil + file_cosmos_svip_v1_tx_proto_depIdxs = nil +} diff --git a/api/cosmos/svip/v1/tx_grpc.pb.go b/api/cosmos/svip/v1/tx_grpc.pb.go new file mode 100644 index 00000000..908b18fd --- /dev/null +++ b/api/cosmos/svip/v1/tx_grpc.pb.go @@ -0,0 +1,267 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: cosmos/svip/v1/tx.proto + +package svipv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_UpdateParams_FullMethodName = "/cosmos.svip.v1.Msg/UpdateParams" + Msg_Activate_FullMethodName = "/cosmos.svip.v1.Msg/Activate" + Msg_Reactivate_FullMethodName = "/cosmos.svip.v1.Msg/Reactivate" + Msg_Pause_FullMethodName = "/cosmos.svip.v1.Msg/Pause" + Msg_FundPool_FullMethodName = "/cosmos.svip.v1.Msg/FundPool" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams updates the x/svip module parameters. Governance-only. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // Activate turns on reward distribution. Snapshots pool balance. + Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) + // Reactivate restarts the decay curve with a fresh pool snapshot. + Reactivate(ctx context.Context, in *MsgReactivate, opts ...grpc.CallOption) (*MsgReactivateResponse, error) + // Pause toggles the emergency pause flag. Governance-only. + Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) + // FundPool transfers native tokens into the SVIP pool. Permissionless. + FundPool(ctx context.Context, in *MsgFundPool, opts ...grpc.CallOption) (*MsgFundPoolResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) 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, Msg_UpdateParams_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) { + out := new(MsgActivateResponse) + err := c.cc.Invoke(ctx, Msg_Activate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Reactivate(ctx context.Context, in *MsgReactivate, opts ...grpc.CallOption) (*MsgReactivateResponse, error) { + out := new(MsgReactivateResponse) + err := c.cc.Invoke(ctx, Msg_Reactivate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) { + out := new(MsgPauseResponse) + err := c.cc.Invoke(ctx, Msg_Pause_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FundPool(ctx context.Context, in *MsgFundPool, opts ...grpc.CallOption) (*MsgFundPoolResponse, error) { + out := new(MsgFundPoolResponse) + err := c.cc.Invoke(ctx, Msg_FundPool_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // UpdateParams updates the x/svip module parameters. Governance-only. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // Activate turns on reward distribution. Snapshots pool balance. + Activate(context.Context, *MsgActivate) (*MsgActivateResponse, error) + // Reactivate restarts the decay curve with a fresh pool snapshot. + Reactivate(context.Context, *MsgReactivate) (*MsgReactivateResponse, error) + // Pause toggles the emergency pause flag. Governance-only. + Pause(context.Context, *MsgPause) (*MsgPauseResponse, error) + // FundPool transfers native tokens into the SVIP pool. Permissionless. + FundPool(context.Context, *MsgFundPool) (*MsgFundPoolResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) Activate(context.Context, *MsgActivate) (*MsgActivateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Activate not implemented") +} +func (UnimplementedMsgServer) Reactivate(context.Context, *MsgReactivate) (*MsgReactivateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Reactivate not implemented") +} +func (UnimplementedMsgServer) Pause(context.Context, *MsgPause) (*MsgPauseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Pause not implemented") +} +func (UnimplementedMsgServer) FundPool(context.Context, *MsgFundPool) (*MsgFundPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundPool not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + 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: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Activate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgActivate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Activate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Activate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Activate(ctx, req.(*MsgActivate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Reactivate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReactivate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Reactivate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Reactivate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Reactivate(ctx, req.(*MsgReactivate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Pause_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPause) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Pause(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Pause_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Pause(ctx, req.(*MsgPause)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FundPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFundPool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FundPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_FundPool_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FundPool(ctx, req.(*MsgFundPool)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.svip.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "Activate", + Handler: _Msg_Activate_Handler, + }, + { + MethodName: "Reactivate", + Handler: _Msg_Reactivate_Handler, + }, + { + MethodName: "Pause", + Handler: _Msg_Pause_Handler, + }, + { + MethodName: "FundPool", + Handler: _Msg_FundPool_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/svip/v1/tx.proto", +} diff --git a/evmd/app.go b/evmd/app.go index b92e46e5..0924bfbc 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -127,6 +127,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/evm/x/svip" + svipkeeper "github.com/cosmos/evm/x/svip/keeper" + sviptypes "github.com/cosmos/evm/x/svip/types" ) func init() { @@ -175,6 +178,7 @@ type EVMD struct { EvidenceKeeper evidencekeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper + SvipKeeper svipkeeper.Keeper // IBC keepers IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly @@ -238,6 +242,7 @@ func NewExampleApp( ibcexported.StoreKey, ibctransfertypes.StoreKey, // Cosmos EVM store keys evmtypes.StoreKey, feemarkettypes.StoreKey, erc20types.StoreKey, precisebanktypes.StoreKey, + sviptypes.StoreKey, ) oKeys := storetypes.NewObjectStoreKeys(banktypes.ObjectStoreKey, evmtypes.ObjectKey) @@ -550,6 +555,14 @@ func NewExampleApp( tmLightClientModule := ibctm.NewLightClientModule(appCodec, storeProvider) clientKeeper.AddRoute(ibctm.ModuleName, &tmLightClientModule) + app.SvipKeeper = svipkeeper.NewKeeper( + appCodec, + keys[sviptypes.StoreKey], + authtypes.NewModuleAddress(govtypes.ModuleName), + app.PreciseBankKeeper, + app.AccountKeeper, + ) + // Override the ICS20 app module transferModule := transfer.NewAppModule(app.TransferKeeper) @@ -570,6 +583,7 @@ func NewExampleApp( slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil, app.interfaceRegistry), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, nil), + svip.NewAppModule(app.SvipKeeper), upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()), evidence.NewAppModule(app.EvidenceKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), @@ -617,6 +631,7 @@ func NewExampleApp( // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC) app.ModuleManager.SetOrderBeginBlockers( minttypes.ModuleName, + sviptypes.ModuleName, // IBC modules ibcexported.ModuleName, ibctransfertypes.ModuleName, @@ -654,6 +669,7 @@ func NewExampleApp( feegrant.ModuleName, upgradetypes.ModuleName, consensusparamtypes.ModuleName, precisebanktypes.ModuleName, vestingtypes.ModuleName, + sviptypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -661,6 +677,7 @@ func NewExampleApp( // NOTE: The genutils module must also occur after auth so that it can access the params from auth. genesisModuleOrder := []string{ authtypes.ModuleName, banktypes.ModuleName, + sviptypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, ibcexported.ModuleName, @@ -1099,11 +1116,22 @@ func (app *EVMD) AutoCliOpts() autocli.AppOptions { } } - return autocli.AppOptions{ + opts := autocli.AppOptions{ Modules: modules, ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.ModuleManager.Modules), AddressCodec: evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32AccountAddrPrefix()), ValidatorAddressCodec: evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), ConsensusAddressCodec: evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), } + + // Skip autocli for FundPool — it panics with repeated Coin fields. + // The manual CLI in x/svip/client/cli/tx.go handles it instead. + if svipOpts, ok := opts.ModuleOptions[sviptypes.ModuleName]; ok && svipOpts != nil && svipOpts.Tx != nil { + svipOpts.Tx.EnhanceCustomCommand = true + svipOpts.Tx.RpcCommandOptions = append(svipOpts.Tx.RpcCommandOptions, + &autocliv1.RpcCommandOptions{RpcMethod: "FundPool", Skip: true}, + ) + } + + return opts } diff --git a/evmd/config/permissions.go b/evmd/config/permissions.go index 2aa0d5fa..0adfcf73 100644 --- a/evmd/config/permissions.go +++ b/evmd/config/permissions.go @@ -13,6 +13,7 @@ import ( erc20types "github.com/cosmos/evm/x/erc20/types" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" precisebanktypes "github.com/cosmos/evm/x/precisebank/types" + sviptypes "github.com/cosmos/evm/x/svip/types" vmtypes "github.com/cosmos/evm/x/vm/types" transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" corevm "github.com/ethereum/go-ethereum/core/vm" @@ -65,6 +66,7 @@ var maccPerms = map[string][]string{ feemarkettypes.ModuleName: nil, erc20types.ModuleName: {authtypes.Minter, authtypes.Burner}, precisebanktypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + sviptypes.ModuleName: nil, } // GetMaccPerms returns a copy of the module account permissions diff --git a/evmd/docs/SVIP.md b/evmd/docs/SVIP.md new file mode 100644 index 00000000..4e3ae40f --- /dev/null +++ b/evmd/docs/SVIP.md @@ -0,0 +1,404 @@ +# Sustained Validator Incentive Pool (SVIP) + +SVIP pays validators from a pre-funded token pool. The rewards start high and slowly decrease over time (exponential decay). Every block, the module sends a small amount to the FeeCollector, and the existing `x/distribution` module splits it across validators based on their voting power. + +There's no inflation. The pool is funded by bridging tokens from Base. + +Proposal templates: `evmd/docs/svip_update_params_proposal.json`, `evmd/docs/svip_activate_proposal.json` + +--- + +## How it works + +Every block, SVIP does this: + +1. Checks how much time has passed since activation. +2. Calculates the reward for this block using exponential decay: `reward = R₀ × e^(-λt) × Δt`. +3. Sends that amount from the SVIP module account to the FeeCollector. +4. `x/distribution` takes it from there and pays validators. + +The starting rate `R₀` comes from the pool size and half-life: `R₀ = (ln2 / half_life) × pool_balance`. This math guarantees the pool can never pay out more than it holds. The total converges to exactly the pool size over infinite time. + +### Funding the pool + +You can't send tokens directly to the SVIP module address with `bank send`. That will fail with `unauthorized` (standard Cosmos SDK behavior for module accounts). Use the dedicated command instead: + +```bash +evmd tx svip fund-pool +``` + +This command uses a manual CLI handler (not the SDK's auto-generated one) to work around a known SDK compatibility issue. + +--- + +## Lifecycle + +``` +1. Genesis → Module registered, pool empty, not activated +2. Fund pool → Bridge tokens from Base, call MsgFundPool +3. Set params → Governance sets half_life_seconds via MsgUpdateParams +4. Activate → Governance activates via MsgActivate +5. Rewards flow → Every block, decayed reward → FeeCollector → validators +6. (Optional) → Pause, unpause, reactivate after refund +``` + +--- + +## Before you start + +You'll need: + +- A running node connected to the network. +- A funded account for submitting proposals, and a validator key (or coordination with validators) for voting. +- The `evmd` binary installed. +- Token amounts are always in base units with 18 decimals. Multiply by 10^18 to convert. For example, 1000 tokens = `1000000000000000000000` ogwei. + +> **Devnet:** Run `./local_node.sh -y` to start a local chain. Home dir is `~/.og-evm-devnet`, chain ID is `10740`. `mykey` is the genesis validator. `dev0` through `dev3` are funded accounts. Voting period is 30 seconds. + +--- + +## Governance basics + +Everything except funding the pool goes through governance. + +1. Someone **submits** a proposal with a deposit. +2. Validators (or delegators) **vote**: yes, no, abstain, or veto. +3. After the voting period, if quorum (33.4%) is met and >50% voted yes, the proposal **passes** and the message runs. +4. If >33.4% vote "NoWithVeto", the deposit is burned. Otherwise it's returned. + +**Get the gov module address** (you'll need this for every proposal template): + +```bash +evmd q auth module-account gov +``` + +Look for the `address` field (e.g. `og10d07y265gmmuvt4z0w9aw880jnsr700jrdya3k`). Use this wherever you see `` in the templates. + +**Get the minimum deposit:** + +```bash +evmd q gov params +``` + +Look for `min_deposit`. Use this wherever you see `` in the templates. + +**Find your proposal ID** after submitting: + +```bash +evmd q gov proposals +``` + +Your proposal is the last one in the list. Note the `id`, you'll need it to vote. + +**Check proposal outcome** with `evmd q gov proposal `: +- `PROPOSAL_STATUS_PASSED`: votes passed and the message executed successfully. +- `PROPOSAL_STATUS_REJECTED`: not enough yes votes, or quorum wasn't met. Deposit is returned (unless vetoed). +- `PROPOSAL_STATUS_FAILED`: votes passed, but the message itself failed (e.g. a guardrail blocked it, or the pool was empty). This is what you'll see when something like `MsgActivate` gets rejected at the keeper level. Fix the issue and submit a new proposal. + +> **Devnet:** Add `--home ~/.og-evm-devnet` to all commands. Only `mykey` has staking power, so use it for voting. Voting period is 30 seconds, so vote right after submitting. + +--- + +## Step 1. Fund the pool + +Anyone can do this. It's the only permissionless operation. On mainnet, tokens get bridged from Base via Hyperlane first, then the bridger calls `fund-pool`. + +```bash +evmd tx svip fund-pool \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +> **Devnet example**, fund 1000 tokens from dev0: +> ```bash +> evmd tx svip fund-pool 1000000000000000000000ogwei \ +> --from dev0 --home ~/.og-evm-devnet --chain-id 10740 \ +> --keyring-backend test --gas 200000 --gas-prices 10000000ogwei --yes +> ``` + +Verify: + +```bash +evmd q svip pool-state +``` + +You should see `pool_balance` with your funded amount. The pool must have funds before you can activate. `MsgActivate` will reject if the balance is zero. + +--- + +## Step 2. Set half-life (governance) + +Before activating, you need to set `half_life_seconds` through a governance proposal. The recommended mainnet value is **15 years** (`473364000` seconds). Minimum allowed is 1 year (`31536000` seconds). + +**2a.** Copy the template and fill in the gov module address: + +```bash +cp evmd/docs/svip_update_params_proposal.json /tmp/svip_set_params.json +``` + +Open `/tmp/svip_set_params.json` and replace `` with the address from the governance basics section. It should look like: + +```json +{ + "messages": [ + { + "@type": "/cosmos.svip.v1.MsgUpdateParams", + "authority": "og10d07y265gmmuvt4z0w9aw880jnsr700jrdya3k", + "params": { + "half_life_seconds": "473364000" + } + } + ], + "deposit": "", + "title": "Set SVIP half-life to 15 years", + "summary": "Configure the SVIP exponential decay half-life before activation." +} +``` + +**2b.** Submit: + +```bash +evmd tx gov submit-proposal /tmp/svip_set_params.json \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**2c.** Find the proposal ID: + +```bash +evmd q gov proposals +``` + +**2d.** Get validators to vote yes before the voting period ends: + +```bash +evmd tx gov vote yes \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**2e.** After the voting period, check the result: + +```bash +evmd q gov proposal +``` + +Status should be `PROPOSAL_STATUS_PASSED`. + +**2f.** Verify the half-life was set: + +```bash +evmd q svip params +``` + +> **Heads up:** Don't be alarmed if this shows `params: {}`. `half_life_seconds` is an integer, and proto3 serialization drops fields that equal their default value (`0`), so the whole thing looks empty even though the value is stored correctly. If you want proof, just move on to step 3. `MsgActivate` will reject with "half_life_seconds must be set before activation" if the value didn't stick. + +> **Devnet:** Use `--from mykey --home ~/.og-evm-devnet --chain-id 10740 --keyring-backend test --gas 300000 --gas-prices 10000000ogwei` for both submit and vote. Deposit is `10000000ogwei`. Wait ~35 seconds after voting. + +**Guardrails:** +- `half_life_seconds` must be at least 1 year. +- After activation, `half_life_seconds` can't change by more than 50% in a single proposal. + +--- + +## Step 3. Activate (governance) + +Activation snapshots the current pool balance and starts the decay curve. Before submitting, make sure: +- `half_life_seconds` is set (step 2). +- The pool has funds (step 1). +- You're ready. Once activated, it can't be deactivated. + +**3a.** Copy the template: + +```bash +cp evmd/docs/svip_activate_proposal.json /tmp/svip_activate.json +``` + +Open `/tmp/svip_activate.json` and replace `` with your gov address. + +**3b.** Submit: + +```bash +evmd tx gov submit-proposal /tmp/svip_activate.json \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**3c.** Find the proposal ID: + +```bash +evmd q gov proposals +``` + +**3d.** Get validators to vote yes: + +```bash +evmd tx gov vote yes \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**3e.** After the voting period, check that rewards are flowing: + +```bash +evmd q svip pool-state +``` + +You should see: +- `activated: true` +- `pool_balance` going down over time +- `total_distributed` going up +- `current_rate_per_second` showing a non-zero value + +To confirm validators are actually getting paid: + +```bash +evmd q distribution rewards +``` + +You should see a non-zero `total` in ogwei. + +> **Devnet:** Same flags as the step 2 devnet note. Quick rewards check: +> ```bash +> ADDR=$(evmd keys show mykey -a --keyring-backend test --home ~/.og-evm-devnet) +> evmd q distribution rewards $ADDR --home ~/.og-evm-devnet +> ``` + +--- + +## Step 4. Pause / unpause (governance) + +Emergency pause stops all rewards immediately. When you unpause later, the module skips over the paused time cleanly. There's no reward spike. + +**To pause:** + +**4a.** Copy the template: + +```bash +cp evmd/docs/svip_pause_proposal.json /tmp/svip_pause.json +``` + +Open `/tmp/svip_pause.json` and replace `` with your gov address. + +**4b.** Submit: + +```bash +evmd tx gov submit-proposal /tmp/svip_pause.json \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**4c.** Find the proposal ID and vote: + +```bash +evmd q gov proposals +``` + +```bash +evmd tx gov vote yes \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**4d.** Verify it's paused: + +```bash +evmd q svip pool-state +``` + +You should see `paused: true`, `current_rate_per_second: 0`, and `total_distributed` frozen. Run the query twice a few seconds apart. The number shouldn't change. + +**To unpause:** Edit `/tmp/svip_pause.json` and change `"paused": true` to `"paused": false`. Then repeat steps 4b through 4d. After unpausing, `paused` will disappear from the output (proto3 hides `false`). Confirm it worked by checking that `current_rate_per_second` is non-zero again. + +--- + +## Step 5. Reactivate (governance) + +If the pool runs dry and you refund it, use `MsgReactivate` to restart the decay curve with a fresh snapshot. This resets `ActivationTime` and `TotalDistributed`. The curve starts over as if you just activated for the first time. + +Why is this needed? The decay formula bases the reward rate on the pool snapshot from activation time. Without reactivating, refunded tokens would trickle out at the tail-end rate of the old curve (basically zero). + +**5a.** Fund the pool again (step 1). + +**5b.** Copy the template: + +```bash +cp evmd/docs/svip_reactivate_proposal.json /tmp/svip_reactivate.json +``` + +Open `/tmp/svip_reactivate.json` and replace `` with your gov address. + +**5c.** Submit: + +```bash +evmd tx gov submit-proposal /tmp/svip_reactivate.json \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**5d.** Find the proposal ID and vote: + +```bash +evmd q gov proposals +``` + +```bash +evmd tx gov vote yes \ + --from \ + --chain-id \ + --keyring-backend \ + --gas auto --gas-adjustment 1.3 \ + --yes +``` + +**5e.** Verify: + +```bash +evmd q svip pool-state +``` + +`activation_time` should show the current time (not the original one), and `total_distributed` should be near zero (counting fresh from the new curve). + +--- + +## Queries + +```bash +# Module parameters (half_life_seconds) +evmd q svip params + +# Pool state (balance, total distributed, current rate, activation time) +evmd q svip pool-state +``` + +> **About `params: {}`:** The params query uses proto3 serialization, which drops fields that equal their default value (`0` for integers). This means you'll see `params: {}` even when `half_life_seconds` is set to 0. Don't worry, the value is stored correctly. Use `q svip pool-state` for the full picture including activated/paused status. + +--- + +## Reward math + +Rewards follow exponential decay. They start high and gradually taper off. With a 100M token pool and a 15-year half-life, roughly half the pool (50M) gets distributed in the first 15 years. After 30 years, 75% is out. The rate keeps slowing down but never hits zero, and the pool can never overpay. The math guarantees total payouts converge to exactly the pool size. diff --git a/evmd/docs/svip_activate_proposal.json b/evmd/docs/svip_activate_proposal.json new file mode 100644 index 00000000..5fe3f5be --- /dev/null +++ b/evmd/docs/svip_activate_proposal.json @@ -0,0 +1,11 @@ +{ + "messages": [ + { + "@type": "/cosmos.svip.v1.MsgActivate", + "authority": "" + } + ], + "deposit": "", + "title": "Activate SVIP reward distribution", + "summary": "Activate the Sustained Validator Incentive Pool. Snapshots the current pool balance and starts the exponential decay reward curve." +} diff --git a/evmd/docs/svip_pause_proposal.json b/evmd/docs/svip_pause_proposal.json new file mode 100644 index 00000000..1dc4205e --- /dev/null +++ b/evmd/docs/svip_pause_proposal.json @@ -0,0 +1,12 @@ +{ + "messages": [ + { + "@type": "/cosmos.svip.v1.MsgPause", + "authority": "", + "paused": true + } + ], + "deposit": "", + "title": "Pause SVIP", + "summary": "Emergency pause of SVIP reward distribution." +} diff --git a/evmd/docs/svip_reactivate_proposal.json b/evmd/docs/svip_reactivate_proposal.json new file mode 100644 index 00000000..47cfd0d8 --- /dev/null +++ b/evmd/docs/svip_reactivate_proposal.json @@ -0,0 +1,11 @@ +{ + "messages": [ + { + "@type": "/cosmos.svip.v1.MsgReactivate", + "authority": "" + } + ], + "deposit": "", + "title": "Reactivate SVIP with refunded pool", + "summary": "Re-snapshot the SVIP pool balance and restart the exponential decay curve. Use after the pool has been exhausted and refunded." +} diff --git a/evmd/docs/svip_update_params_proposal.json b/evmd/docs/svip_update_params_proposal.json new file mode 100644 index 00000000..ebf7c1e3 --- /dev/null +++ b/evmd/docs/svip_update_params_proposal.json @@ -0,0 +1,14 @@ +{ + "messages": [ + { + "@type": "/cosmos.svip.v1.MsgUpdateParams", + "authority": "", + "params": { + "half_life_seconds": "473364000" + } + } + ], + "deposit": "", + "title": "Set SVIP half-life to 15 years", + "summary": "Configure the SVIP exponential decay half-life before activation." +} diff --git a/proto/cosmos/svip/v1/genesis.proto b/proto/cosmos/svip/v1/genesis.proto new file mode 100644 index 00000000..66f913e9 --- /dev/null +++ b/proto/cosmos/svip/v1/genesis.proto @@ -0,0 +1,37 @@ + +syntax = "proto3"; +package cosmos.svip.v1; + +import "amino/amino.proto"; +import "cosmos/svip/v1/svip.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/cosmos/evm/x/svip/types"; + +// GenesisState defines the svip module's genesis state. +message GenesisState { + // params defines all the parameters of the svip module. + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + // total_distributed is tokens sent to FeeCollector since the last (re)activation. + string total_distributed = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // activation_time is when SVIP was activated. Zero if not yet activated. + google.protobuf.Timestamp activation_time = 3 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + // pool_balance_at_activation is the pool snapshot used to derive R₀. + string pool_balance_at_activation = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // last_block_time is the timestamp of the last processed block. + google.protobuf.Timestamp last_block_time = 5 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; + // total_paused_seconds is the cumulative seconds spent in paused state. + int64 total_paused_seconds = 6; + // activated indicates whether SVIP reward distribution is active. + bool activated = 7; + // paused is an emergency pause flag. + bool paused = 8; +} diff --git a/proto/cosmos/svip/v1/query.proto b/proto/cosmos/svip/v1/query.proto new file mode 100644 index 00000000..d3ab2caa --- /dev/null +++ b/proto/cosmos/svip/v1/query.proto @@ -0,0 +1,61 @@ + +syntax = "proto3"; +package cosmos.svip.v1; + +import "amino/amino.proto"; +import "cosmos/svip/v1/svip.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/evm/x/svip/types"; + +// Query defines the gRPC querier service. +service Query { + // Params queries the parameters of x/svip module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/svip/v1/params"; + } + + // PoolState queries the current SVIP pool balance, distribution stats, and + // reward rate. + rpc PoolState(QueryPoolStateRequest) returns (QueryPoolStateResponse) { + option (google.api.http).get = "/cosmos/svip/v1/pool_state"; + } +} + +// QueryParamsRequest defines the request type for querying x/svip parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/svip parameters. +message QueryParamsResponse { + // params define the svip module parameters. + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// QueryPoolStateRequest defines the request type for querying pool state. +message QueryPoolStateRequest {} + +// QueryPoolStateResponse returns the current SVIP pool state. +message QueryPoolStateResponse { + // pool_balance is the current balance in the SVIP module account. + cosmos.base.v1beta1.Coin pool_balance = 1 [ (gogoproto.nullable) = false ]; + // total_distributed is tokens sent to FeeCollector since the last (re)activation. + string total_distributed = 2 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + // current_rate_per_second is the current reward rate after decay. + string current_rate_per_second = 3 [ + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + // activated indicates whether SVIP is active. + bool activated = 4; + // paused indicates whether SVIP is paused. + bool paused = 5; + // activation_time is when SVIP was activated. + google.protobuf.Timestamp activation_time = 6 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; +} diff --git a/proto/cosmos/svip/v1/svip.proto b/proto/cosmos/svip/v1/svip.proto new file mode 100644 index 00000000..18a025d2 --- /dev/null +++ b/proto/cosmos/svip/v1/svip.proto @@ -0,0 +1,16 @@ + +syntax = "proto3"; +package cosmos.svip.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/evm/x/svip/types"; + +// Params defines the x/svip module parameters. +message Params { + option (amino.name) = "cosmos/x/svip/Params"; + + // half_life_seconds is the half-life for exponential decay, in seconds. + int64 half_life_seconds = 3 [(amino.dont_omitempty) = true, (gogoproto.jsontag) = "half_life_seconds"]; +} diff --git a/proto/cosmos/svip/v1/tx.proto b/proto/cosmos/svip/v1/tx.proto new file mode 100644 index 00000000..290cb23e --- /dev/null +++ b/proto/cosmos/svip/v1/tx.proto @@ -0,0 +1,93 @@ + +syntax = "proto3"; +package cosmos.svip.v1; + +import "amino/amino.proto"; +import "cosmos/svip/v1/svip.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/evm/x/svip/types"; + +// Msg defines the svip Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + // UpdateParams updates the x/svip module parameters. Governance-only. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // Activate turns on reward distribution. Snapshots pool balance. + rpc Activate(MsgActivate) returns (MsgActivateResponse); + // Reactivate restarts the decay curve with a fresh pool snapshot. + rpc Reactivate(MsgReactivate) returns (MsgReactivateResponse); + // Pause toggles the emergency pause flag. Governance-only. + rpc Pause(MsgPause) returns (MsgPauseResponse); + // FundPool transfers native tokens into the SVIP pool. Permissionless. + rpc FundPool(MsgFundPool) returns (MsgFundPoolResponse); +} + +// MsgUpdateParams defines a Msg for updating the x/svip module parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos/x/svip/MsgUpdateParams"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // params defines the x/svip parameters to update. + // NOTE: Only half_life_seconds is configurable via this message. + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// MsgUpdateParamsResponse defines the response for MsgUpdateParams. +message MsgUpdateParamsResponse {} + +// MsgActivate activates SVIP reward distribution. Governance-only. +message MsgActivate { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgActivateResponse defines the response for MsgActivate. +message MsgActivateResponse {} + +// MsgReactivate restarts the decay curve with a fresh pool snapshot. +// Governance-only. Used after pool exhaustion and refund. +message MsgReactivate { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgReactivateResponse defines the response for MsgReactivate. +message MsgReactivateResponse {} + +// MsgPause toggles the SVIP emergency pause flag. Governance-only. +message MsgPause { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // paused is the desired pause state. + bool paused = 2; +} + +// MsgPauseResponse defines the response for MsgPause. +message MsgPauseResponse {} + +// MsgFundPool sends native tokens to the SVIP reward pool. Permissionless. +message MsgFundPool { + option (cosmos.msg.v1.signer) = "depositor"; + + // depositor is the address funding the pool. + string depositor = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // amount is the coins to transfer. Only the native denom is accepted. + repeated cosmos.base.v1beta1.Coin amount = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// MsgFundPoolResponse defines the response for MsgFundPool. +message MsgFundPoolResponse {} diff --git a/x/svip/client/cli/tx.go b/x/svip/client/cli/tx.go new file mode 100644 index 00000000..a484cc21 --- /dev/null +++ b/x/svip/client/cli/tx.go @@ -0,0 +1,63 @@ +package cli + +import ( + "github.com/spf13/cobra" + + "github.com/cosmos/evm/x/svip/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewTxCmd returns a root CLI command handler for svip transaction commands. +func NewTxCmd() *cobra.Command { + txCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "svip subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + txCmd.AddCommand( + NewFundPoolCmd(), + ) + return txCmd +} + +// NewFundPoolCmd returns a CLI command handler for funding the SVIP reward pool. +func NewFundPoolCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "fund-pool COINS", + Short: "Fund the SVIP reward pool", + Long: "Fund the SVIP reward pool with the specified coins. Example: ogd tx svip fund-pool 1000000000000000000000ogwei --from dev0", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + cliCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + coins, err := sdk.ParseCoinsNormalized(args[0]) + if err != nil { + return err + } + + msg := &types.MsgFundPool{ + Depositor: cliCtx.GetFromAddress().String(), + Amount: coins, + } + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/x/svip/genesis.go b/x/svip/genesis.go new file mode 100644 index 00000000..cc7346c9 --- /dev/null +++ b/x/svip/genesis.go @@ -0,0 +1,51 @@ +package svip + +import ( + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/evm/x/svip/keeper" + "github.com/cosmos/evm/x/svip/types" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the SVIP module genesis state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, data types.GenesisState) []abci.ValidatorUpdate { + if err := k.SetParams(ctx, data.Params); err != nil { + panic(errorsmod.Wrap(err, "could not set parameters at genesis")) + } + k.SetActivated(ctx, data.Activated) + k.SetPaused(ctx, data.Paused) + if data.TotalDistributed.IsPositive() { + k.SetTotalDistributed(ctx, data.TotalDistributed) + } + if !data.ActivationTime.IsZero() { + k.SetActivationTime(ctx, data.ActivationTime) + if !data.LastBlockTime.IsZero() { + k.SetLastBlockTime(ctx, data.LastBlockTime) + } else { + k.SetLastBlockTime(ctx, data.ActivationTime) + } + } + if data.TotalPausedSeconds > 0 { + k.SetTotalPausedSeconds(ctx, data.TotalPausedSeconds) + } + if data.PoolBalanceAtActivation.IsPositive() { + k.SetPoolBalanceAtActivation(ctx, data.PoolBalanceAtActivation) + } + return []abci.ValidatorUpdate{} +} + +// ExportGenesis exports the SVIP module genesis state. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + return &types.GenesisState{ + Params: k.GetParams(ctx), + TotalDistributed: k.GetTotalDistributed(ctx), + ActivationTime: k.GetActivationTime(ctx), + PoolBalanceAtActivation: k.GetPoolBalanceAtActivation(ctx), + LastBlockTime: k.GetLastBlockTime(ctx), + TotalPausedSeconds: k.GetTotalPausedSeconds(ctx), + Activated: k.GetActivated(ctx), + Paused: k.GetPaused(ctx), + } +} diff --git a/x/svip/keeper/abci.go b/x/svip/keeper/abci.go new file mode 100644 index 00000000..742bd064 --- /dev/null +++ b/x/svip/keeper/abci.go @@ -0,0 +1,75 @@ +package keeper + +import ( + "github.com/cosmos/evm/x/svip/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// BeginBlock distributes decayed rewards to FeeCollector. +func (k Keeper) BeginBlock(ctx sdk.Context) error { + // 1. Guard: skip if not active + if !k.GetActivated(ctx) || k.GetPaused(ctx) { + return nil + } + + params := k.GetParams(ctx) + + // 2. Time context + now := ctx.BlockTime() + activationTime := k.GetActivationTime(ctx) + lastBlockTime := k.GetLastBlockTime(ctx) + + totalPausedSec := float64(k.GetTotalPausedSeconds(ctx)) + totalElapsed := now.Sub(activationTime).Seconds() - totalPausedSec + blockDelta := now.Sub(lastBlockTime).Seconds() + + if totalElapsed <= 0 || blockDelta <= 0 { + return nil + } + + // 3. Calculate reward (exponential decay, hardcoded) + poolAtActivation := k.GetPoolBalanceAtActivation(ctx) + reward := CalculateBlockReward(params.HalfLifeSeconds, poolAtActivation, totalElapsed, blockDelta) + + if reward.IsZero() || reward.IsNegative() { + k.SetLastBlockTime(ctx, now) + return nil + } + + // 4. Cap at actual pool balance + poolBalance := k.getPoolBalance(ctx) + if poolBalance.LT(reward) { + reward = poolBalance + } + if reward.IsZero() { + k.SetLastBlockTime(ctx, now) + return nil + } + + // 5. Transfer: svip → fee_collector + denom := k.getDenom(ctx) + coins := sdk.NewCoins(sdk.NewCoin(denom, reward)) + err := k.bk.SendCoinsFromModuleToModule( + ctx, + types.ModuleName, + authtypes.FeeCollectorName, + coins, + ) + if err != nil { + return err + } + + // 6. Bookkeeping + events + k.AddTotalDistributed(ctx, reward) + k.SetLastBlockTime(ctx, now) + + ctx.EventManager().EmitEvent(sdk.NewEvent( + "svip_reward", + sdk.NewAttribute("amount", coins.String()), + sdk.NewAttribute("pool_remaining", k.getPoolBalance(ctx).String()), + )) + + return nil +} diff --git a/x/svip/keeper/keeper.go b/x/svip/keeper/keeper.go new file mode 100644 index 00000000..be652cbf --- /dev/null +++ b/x/svip/keeper/keeper.go @@ -0,0 +1,221 @@ +package keeper + +import ( + "time" + + "github.com/cosmos/evm/x/svip/types" + evmtypes "github.com/cosmos/evm/x/vm/types" + + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// Keeper grants access to the SVIP module state. +type Keeper struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + authority sdk.AccAddress + bk types.BankKeeper + ak types.AccountKeeper +} + +// NewKeeper creates a new SVIP keeper. +func NewKeeper( + cdc codec.BinaryCodec, + storeKey storetypes.StoreKey, + authority sdk.AccAddress, + bk types.BankKeeper, + ak types.AccountKeeper, +) Keeper { + if err := sdk.VerifyAddressFormat(authority); err != nil { + panic(err) + } + return Keeper{ + cdc: cdc, + storeKey: storeKey, + authority: authority, + bk: bk, + ak: ak, + } +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", types.ModuleName) +} + +// --- State accessors --- + +// GetTotalDistributed returns the amount of tokens distributed since the last (re)activation. +func (k Keeper) GetTotalDistributed(ctx sdk.Context) sdkmath.Int { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.TotalDistributedKey) + if bz == nil { + return sdkmath.ZeroInt() + } + var val sdkmath.Int + if err := val.Unmarshal(bz); err != nil { + panic(err) + } + return val +} + +// SetTotalDistributed sets the amount of tokens distributed since the last (re)activation. +func (k Keeper) SetTotalDistributed(ctx sdk.Context, val sdkmath.Int) { + store := ctx.KVStore(k.storeKey) + bz, err := val.Marshal() + if err != nil { + panic(err) + } + store.Set(types.TotalDistributedKey, bz) +} + +// AddTotalDistributed increments the total distributed counter by amount. +func (k Keeper) AddTotalDistributed(ctx sdk.Context, amount sdkmath.Int) { + current := k.GetTotalDistributed(ctx) + k.SetTotalDistributed(ctx, current.Add(amount)) +} + +// GetActivationTime returns the time SVIP was activated. +func (k Keeper) GetActivationTime(ctx sdk.Context) time.Time { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ActivationTimeKey) + if bz == nil { + return time.Time{} + } + var t time.Time + if err := t.UnmarshalBinary(bz); err != nil { + panic(err) + } + return t +} + +// SetActivationTime stores the time SVIP was activated. +func (k Keeper) SetActivationTime(ctx sdk.Context, t time.Time) { + store := ctx.KVStore(k.storeKey) + bz, err := t.MarshalBinary() + if err != nil { + panic(err) + } + store.Set(types.ActivationTimeKey, bz) +} + +// GetLastBlockTime returns the timestamp of the last processed block. +func (k Keeper) GetLastBlockTime(ctx sdk.Context) time.Time { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.LastBlockTimeKey) + if bz == nil { + return time.Time{} + } + var t time.Time + if err := t.UnmarshalBinary(bz); err != nil { + panic(err) + } + return t +} + +// SetLastBlockTime stores the timestamp of the last processed block. +func (k Keeper) SetLastBlockTime(ctx sdk.Context, t time.Time) { + store := ctx.KVStore(k.storeKey) + bz, err := t.MarshalBinary() + if err != nil { + panic(err) + } + store.Set(types.LastBlockTimeKey, bz) +} + +// GetPoolBalanceAtActivation returns the pool balance snapshot at activation time. +func (k Keeper) GetPoolBalanceAtActivation(ctx sdk.Context) sdkmath.Int { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.PoolBalanceAtActivationKey) + if bz == nil { + return sdkmath.ZeroInt() + } + var val sdkmath.Int + if err := val.Unmarshal(bz); err != nil { + panic(err) + } + return val +} + +// SetPoolBalanceAtActivation stores the pool balance snapshot at activation time. +func (k Keeper) SetPoolBalanceAtActivation(ctx sdk.Context, val sdkmath.Int) { + store := ctx.KVStore(k.storeKey) + bz, err := val.Marshal() + if err != nil { + panic(err) + } + store.Set(types.PoolBalanceAtActivationKey, bz) +} + +// GetTotalPausedSeconds returns the cumulative seconds SVIP has been paused. +func (k Keeper) GetTotalPausedSeconds(ctx sdk.Context) int64 { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.TotalPausedSecondsKey) + if bz == nil { + return 0 + } + var val sdkmath.Int + if err := val.Unmarshal(bz); err != nil { + panic(err) + } + return val.Int64() +} + +// SetTotalPausedSeconds stores the cumulative seconds SVIP has been paused. +func (k Keeper) SetTotalPausedSeconds(ctx sdk.Context, secs int64) { + store := ctx.KVStore(k.storeKey) + val := sdkmath.NewInt(secs) + bz, err := val.Marshal() + if err != nil { + panic(err) + } + store.Set(types.TotalPausedSecondsKey, bz) +} + +var isTrue = []byte("0x01") + +// GetActivated returns whether SVIP reward distribution is active. +func (k Keeper) GetActivated(ctx sdk.Context) bool { + return ctx.KVStore(k.storeKey).Has(types.ActivatedKey) +} + +// SetActivated stores the activated flag using a presence-based pattern. +func (k Keeper) SetActivated(ctx sdk.Context, activated bool) { + store := ctx.KVStore(k.storeKey) + if activated { + store.Set(types.ActivatedKey, isTrue) + return + } + store.Delete(types.ActivatedKey) +} + +// GetPaused returns whether SVIP is in emergency pause state. +func (k Keeper) GetPaused(ctx sdk.Context) bool { + return ctx.KVStore(k.storeKey).Has(types.PausedKey) +} + +// SetPaused stores the paused flag using a presence-based pattern. +func (k Keeper) SetPaused(ctx sdk.Context, paused bool) { + store := ctx.KVStore(k.storeKey) + if paused { + store.Set(types.PausedKey, isTrue) + return + } + store.Delete(types.PausedKey) +} + +// getPoolBalance reads the live pool balance from x/bank (not from custom state). +func (k Keeper) getPoolBalance(ctx sdk.Context) sdkmath.Int { + moduleAddr := k.ak.GetModuleAddress(types.ModuleName) + return k.bk.GetBalance(ctx, moduleAddr, k.getDenom(ctx)).Amount +} + +// getDenom returns the native denom at runtime via the EVM module's global config. +func (k Keeper) getDenom(_ sdk.Context) string { + return evmtypes.GetEVMCoinDenom() +} diff --git a/x/svip/keeper/keeper_test.go b/x/svip/keeper/keeper_test.go new file mode 100644 index 00000000..add652d2 --- /dev/null +++ b/x/svip/keeper/keeper_test.go @@ -0,0 +1,275 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + evmencoding "github.com/cosmos/evm/encoding" + testconstants "github.com/cosmos/evm/testutil/constants" + "github.com/cosmos/evm/x/svip/keeper" + "github.com/cosmos/evm/x/svip/types" + "github.com/cosmos/evm/x/svip/types/mocks" + vmtypes "github.com/cosmos/evm/x/vm/types" + + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +type testData struct { + ctx sdk.Context + keeper keeper.Keeper + storeKey *storetypes.KVStoreKey + bk *mocks.BankKeeper + ak *mocks.AccountKeeper +} + +func newMockedTestData(t *testing.T) testData { + t.Helper() + + storeKey := storetypes.NewKVStoreKey(types.ModuleName) + tKey := storetypes.NewTransientStoreKey("transient_test") + ctx := testutil.DefaultContext(storeKey, tKey) //nolint: staticcheck + + bk := mocks.NewBankKeeper(t) + ak := mocks.NewAccountKeeper(t) + + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + + chainID := testconstants.SixDecimalsChainID.EVMChainID + cfg := evmencoding.MakeConfig(chainID) + cdc := cfg.Codec + k := keeper.NewKeeper(cdc, storeKey, authority, bk, ak) //nolint: staticcheck + evmConfigurator := vmtypes.NewEVMConfigurator(). + WithEVMCoinInfo(testconstants.ExampleChainCoinInfo[testconstants.SixDecimalsChainID]) + evmConfigurator.ResetTestConfig() + err := evmConfigurator.Configure() + require.NoError(t, err) + + return testData{ + ctx: ctx, + keeper: k, + storeKey: storeKey, + bk: bk, + ak: ak, + } +} + +func TestGetSetParams(t *testing.T) { + td := newMockedTestData(t) + + // Default params when nothing set + params := td.keeper.GetParams(td.ctx) + require.Equal(t, types.DefaultParams(), params) + + // Set custom params and read back + custom := types.Params{ + HalfLifeSeconds: 31536000, + } + require.NoError(t, td.keeper.SetParams(td.ctx, custom)) + got := td.keeper.GetParams(td.ctx) + require.Equal(t, custom, got) +} + +func TestGetSetActivated(t *testing.T) { + td := newMockedTestData(t) + + // Default is false + require.False(t, td.keeper.GetActivated(td.ctx)) + + // Set true and read back + td.keeper.SetActivated(td.ctx, true) + require.True(t, td.keeper.GetActivated(td.ctx)) + + // Set false and read back + td.keeper.SetActivated(td.ctx, false) + require.False(t, td.keeper.GetActivated(td.ctx)) +} + +func TestGetSetPaused(t *testing.T) { + td := newMockedTestData(t) + + // Default is false + require.False(t, td.keeper.GetPaused(td.ctx)) + + // Set true and read back + td.keeper.SetPaused(td.ctx, true) + require.True(t, td.keeper.GetPaused(td.ctx)) + + // Set false and read back + td.keeper.SetPaused(td.ctx, false) + require.False(t, td.keeper.GetPaused(td.ctx)) +} + +func TestGetSetTotalDistributed(t *testing.T) { + td := newMockedTestData(t) + + // Default is zero + require.True(t, td.keeper.GetTotalDistributed(td.ctx).IsZero()) + + // Set and read back + td.keeper.SetTotalDistributed(td.ctx, sdkmath.NewInt(500)) + require.Equal(t, sdkmath.NewInt(500), td.keeper.GetTotalDistributed(td.ctx)) + + // AddTotalDistributed accumulates + td.keeper.AddTotalDistributed(td.ctx, sdkmath.NewInt(300)) + require.Equal(t, sdkmath.NewInt(800), td.keeper.GetTotalDistributed(td.ctx)) +} + +func TestGetSetActivationTime(t *testing.T) { + td := newMockedTestData(t) + + // Default is zero time + require.True(t, td.keeper.GetActivationTime(td.ctx).IsZero()) + + // Set and read back + now := time.Now().UTC().Truncate(time.Second) + td.keeper.SetActivationTime(td.ctx, now) + require.Equal(t, now, td.keeper.GetActivationTime(td.ctx).UTC().Truncate(time.Second)) +} + +func TestGetSetLastBlockTime(t *testing.T) { + td := newMockedTestData(t) + + // Default is zero time + require.True(t, td.keeper.GetLastBlockTime(td.ctx).IsZero()) + + // Set and read back + now := time.Now().UTC().Truncate(time.Second) + td.keeper.SetLastBlockTime(td.ctx, now) + require.Equal(t, now, td.keeper.GetLastBlockTime(td.ctx).UTC().Truncate(time.Second)) +} + +func TestGetSetPoolBalanceAtActivation(t *testing.T) { + td := newMockedTestData(t) + + // Default is zero + require.True(t, td.keeper.GetPoolBalanceAtActivation(td.ctx).IsZero()) + + // Set and read back + val := sdkmath.NewInt(1_000_000_000) + td.keeper.SetPoolBalanceAtActivation(td.ctx, val) + require.Equal(t, val, td.keeper.GetPoolBalanceAtActivation(td.ctx)) +} + +func TestBeginBlock_NotActivated(t *testing.T) { + td := newMockedTestData(t) + + // Default params: not activated — should skip without any bank calls + err := td.keeper.BeginBlock(td.ctx) + require.NoError(t, err) + + // Bank keeper should not have been called + td.bk.AssertNotCalled(t, "SendCoinsFromModuleToModule") +} + +func TestBeginBlock_Paused(t *testing.T) { + td := newMockedTestData(t) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) + td.keeper.SetPaused(td.ctx, true) + + err := td.keeper.BeginBlock(td.ctx) + require.NoError(t, err) + + td.bk.AssertNotCalled(t, "SendCoinsFromModuleToModule") +} + +func TestBeginBlock_Distributes(t *testing.T) { + td := newMockedTestData(t) + + denom := vmtypes.GetEVMCoinDenom() + halfLife := int64(31536000) + poolBalance := sdkmath.NewInt(1_000_000_000_000) + + // Set params and activate + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: halfLife})) + td.keeper.SetActivated(td.ctx, true) + + // Set activation state + activationTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + td.keeper.SetActivationTime(td.ctx, activationTime) + td.keeper.SetLastBlockTime(td.ctx, activationTime.Add(95*time.Second)) + td.keeper.SetPoolBalanceAtActivation(td.ctx, poolBalance) + + // Set block time to 100s after activation + blockTime := activationTime.Add(100 * time.Second) + ctx := td.ctx.WithBlockTime(blockTime) + + // Calculate expected reward + reward := keeper.CalculateBlockReward(halfLife, poolBalance, 100, 5) + require.True(t, reward.IsPositive()) + + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + + // Mock: GetModuleAddress returns the svip module addr + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + // Mock: GetBalance returns the pool balance + td.bk.On("GetBalance", ctx, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance)) + // Mock: SendCoinsFromModuleToModule succeeds + td.bk.On("SendCoinsFromModuleToModule", + ctx, + types.ModuleName, + authtypes.FeeCollectorName, + sdk.NewCoins(sdk.NewCoin(denom, reward)), + ).Return(nil) + // Mock: GetBalance for post-distribution event (pool_remaining) + td.bk.On("GetBalance", ctx, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance.Sub(reward))) + + err := td.keeper.BeginBlock(ctx) + require.NoError(t, err) + + // Verify bookkeeping + require.Equal(t, reward, td.keeper.GetTotalDistributed(ctx)) + require.Equal(t, blockTime, td.keeper.GetLastBlockTime(ctx).UTC()) + + td.bk.AssertCalled(t, "SendCoinsFromModuleToModule", + ctx, types.ModuleName, authtypes.FeeCollectorName, + sdk.NewCoins(sdk.NewCoin(denom, reward)), + ) +} + +func TestBeginBlock_CapsAtPoolBalance(t *testing.T) { + td := newMockedTestData(t) + + denom := vmtypes.GetEVMCoinDenom() + halfLife := int64(31536000) + poolAtActivation := sdkmath.NewInt(1_000_000_000_000) + // Remaining pool balance is tiny — smaller than calculated reward + tinyBalance := sdkmath.NewInt(1) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: halfLife})) + td.keeper.SetActivated(td.ctx, true) + + activationTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + td.keeper.SetActivationTime(td.ctx, activationTime) + td.keeper.SetLastBlockTime(td.ctx, activationTime.Add(95*time.Second)) + td.keeper.SetPoolBalanceAtActivation(td.ctx, poolAtActivation) + + blockTime := activationTime.Add(100 * time.Second) + ctx := td.ctx.WithBlockTime(blockTime) + + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", ctx, moduleAddr, denom).Return(sdk.NewCoin(denom, tinyBalance)) + // The send should use tinyBalance (the cap), not the calculated reward + td.bk.On("SendCoinsFromModuleToModule", + ctx, + types.ModuleName, + authtypes.FeeCollectorName, + sdk.NewCoins(sdk.NewCoin(denom, tinyBalance)), + ).Return(nil) + + err := td.keeper.BeginBlock(ctx) + require.NoError(t, err) + + require.Equal(t, tinyBalance, td.keeper.GetTotalDistributed(ctx)) +} diff --git a/x/svip/keeper/msg_server.go b/x/svip/keeper/msg_server.go new file mode 100644 index 00000000..bca76569 --- /dev/null +++ b/x/svip/keeper/msg_server.go @@ -0,0 +1,192 @@ +package keeper + +import ( + "context" + "fmt" + + "github.com/cosmos/evm/x/svip/types" + + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +// msgServer implements the SVIP MsgServer interface. +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the SVIP MsgServer interface. +func NewMsgServerImpl(k Keeper) types.MsgServer { + return &msgServer{Keeper: k} +} + +var _ types.MsgServer = msgServer{} + +// UpdateParams updates the SVIP module parameters. Governance-only. +func (s msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if s.authority.String() != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", s.authority.String(), msg.Authority) + } + ctx := sdk.UnwrapSDKContext(goCtx) + + // Governance guardrails + current := s.GetParams(ctx) + + // After activation, half_life must remain strictly positive. + if s.GetActivated(ctx) && msg.Params.HalfLifeSeconds <= 0 { + return nil, errorsmod.Wrap(govtypes.ErrInvalidProposalMsg, "half_life_seconds must be > 0 while module is activated") + } + + if s.GetActivated(ctx) && current.HalfLifeSeconds > 0 && msg.Params.HalfLifeSeconds > 0 { + // Reject if half_life changes by more than 50% + oldHL := float64(current.HalfLifeSeconds) + newHL := float64(msg.Params.HalfLifeSeconds) + ratio := newHL / oldHL + if ratio < 0.5 || ratio > 1.5 { + return nil, types.ErrHalfLifeChange + } + } + if msg.Params.HalfLifeSeconds > 0 && msg.Params.HalfLifeSeconds < 31536000 { + return nil, errorsmod.Wrap(govtypes.ErrInvalidProposalMsg, "half_life_seconds must be >= 1 year (31536000s)") + } + + if err := s.SetParams(ctx, msg.Params); err != nil { + return nil, err + } + return &types.MsgUpdateParamsResponse{}, nil +} + +// Activate activates SVIP reward distribution. Governance-only. +func (s msgServer) Activate(goCtx context.Context, msg *types.MsgActivate) (*types.MsgActivateResponse, error) { + if s.authority.String() != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", s.authority.String(), msg.Authority) + } + ctx := sdk.UnwrapSDKContext(goCtx) + + if s.GetActivated(ctx) { + return nil, types.ErrAlreadyActivated + } + + params := s.GetParams(ctx) + if params.HalfLifeSeconds <= 0 { + return nil, errorsmod.Wrap(govtypes.ErrInvalidProposalMsg, "half_life_seconds must be set before activation") + } + + // Snapshot pool balance + poolBalance := s.getPoolBalance(ctx) + if poolBalance.IsZero() { + return nil, types.ErrPoolNotFunded + } + s.SetPoolBalanceAtActivation(ctx, poolBalance) + + // Clean any stale pause state before activating (defense-in-depth). + s.SetPaused(ctx, false) + s.SetTotalPausedSeconds(ctx, 0) + + // Activate + s.SetActivated(ctx, true) + s.SetActivationTime(ctx, ctx.BlockTime()) + s.SetLastBlockTime(ctx, ctx.BlockTime()) + + ctx.EventManager().EmitEvent(sdk.NewEvent( + "svip_activated", + sdk.NewAttribute("pool_balance", poolBalance.String()), + sdk.NewAttribute("half_life_seconds", fmt.Sprintf("%d", params.HalfLifeSeconds)), + )) + + return &types.MsgActivateResponse{}, nil +} + +// Reactivate restarts the SVIP decay curve with a fresh pool snapshot. Governance-only. +func (s msgServer) Reactivate(goCtx context.Context, msg *types.MsgReactivate) (*types.MsgReactivateResponse, error) { + if s.authority.String() != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", s.authority.String(), msg.Authority) + } + ctx := sdk.UnwrapSDKContext(goCtx) + + if !s.GetActivated(ctx) { + return nil, types.ErrNotYetActivated + } + + // Defense-in-depth: ensure half_life is valid before restarting the curve. + params := s.GetParams(ctx) + if params.HalfLifeSeconds <= 0 { + return nil, errorsmod.Wrap(govtypes.ErrInvalidProposalMsg, "half_life_seconds must be set before reactivation") + } + + // Re-snapshot pool balance and restart the decay curve + poolBalance := s.getPoolBalance(ctx) + if poolBalance.IsZero() { + return nil, types.ErrPoolNotFunded + } + s.SetPoolBalanceAtActivation(ctx, poolBalance) + s.SetActivationTime(ctx, ctx.BlockTime()) + s.SetLastBlockTime(ctx, ctx.BlockTime()) + + // Reset cumulative counters for the new curve + s.SetTotalDistributed(ctx, sdkmath.ZeroInt()) + s.SetTotalPausedSeconds(ctx, 0) + + // Clear paused state if reactivating while paused + s.SetPaused(ctx, false) + + ctx.EventManager().EmitEvent(sdk.NewEvent( + "svip_reactivated", + sdk.NewAttribute("pool_balance", poolBalance.String()), + sdk.NewAttribute("half_life_seconds", fmt.Sprintf("%d", params.HalfLifeSeconds)), + )) + + return &types.MsgReactivateResponse{}, nil +} + +// Pause sets or clears the emergency pause flag. Governance-only. +func (s msgServer) Pause(goCtx context.Context, msg *types.MsgPause) (*types.MsgPauseResponse, error) { + if s.authority.String() != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", s.authority.String(), msg.Authority) + } + ctx := sdk.UnwrapSDKContext(goCtx) + + if !s.GetActivated(ctx) { + return nil, types.ErrNotYetActivated + } + + wasPaused := s.GetPaused(ctx) + s.SetPaused(ctx, msg.Paused) + + // On unpause: accumulate paused duration + reset LastBlockTime + if wasPaused && !msg.Paused { + lastBlock := s.GetLastBlockTime(ctx) + pausedGap := int64(ctx.BlockTime().Sub(lastBlock).Seconds()) + if pausedGap > 0 { + s.SetTotalPausedSeconds(ctx, s.GetTotalPausedSeconds(ctx)+pausedGap) + } + s.SetLastBlockTime(ctx, ctx.BlockTime()) + } + + return &types.MsgPauseResponse{}, nil +} + +// FundPool deposits coins into the SVIP reward pool. +func (s msgServer) FundPool(goCtx context.Context, msg *types.MsgFundPool) (*types.MsgFundPoolResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + depositor, err := sdk.AccAddressFromBech32(msg.Depositor) + if err != nil { + return nil, err + } + + // Validate that only the native denom is sent to the pool + denom := s.getDenom(ctx) + for _, coin := range msg.Amount { + if coin.Denom != denom { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidCoins, "invalid denom %s, expected %s", coin.Denom, denom) + } + } + + if err := s.bk.SendCoinsFromAccountToModule(ctx, depositor, types.ModuleName, msg.Amount); err != nil { + return nil, err + } + return &types.MsgFundPoolResponse{}, nil +} diff --git a/x/svip/keeper/msg_server_test.go b/x/svip/keeper/msg_server_test.go new file mode 100644 index 00000000..8ecd137c --- /dev/null +++ b/x/svip/keeper/msg_server_test.go @@ -0,0 +1,569 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/cosmos/evm/x/svip/keeper" + "github.com/cosmos/evm/x/svip/types" + vmtypes "github.com/cosmos/evm/x/vm/types" + + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +func govAuthority() string { + return authtypes.NewModuleAddress(govtypes.ModuleName).String() +} + +func TestUpdateParams_InvalidAuthority(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: "invalid", + Params: types.DefaultParams(), + }) + require.ErrorContains(t, err, "invalid authority") +} + +func TestUpdateParams_HalfLifeChangeCap(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 100_000_000})) + td.keeper.SetActivated(td.ctx, true) + + // >50% increase (1.6x) should fail + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{HalfLifeSeconds: 160_000_000}, + }) + require.ErrorIs(t, err, types.ErrHalfLifeChange) + + // >50% decrease (0.4x) should fail + _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{HalfLifeSeconds: 40_000_000}, + }) + require.ErrorIs(t, err, types.ErrHalfLifeChange) + + // Exact 0.5x boundary (ratio == 0.5) should pass + _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{HalfLifeSeconds: 50_000_000}, + }) + require.NoError(t, err) + + // Reset to 100M for next boundary test + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 100_000_000})) + + // Exact 1.5x boundary (ratio == 1.5) should pass + _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{HalfLifeSeconds: 150_000_000}, + }) + require.NoError(t, err) + + // Reset to 100M for next test + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 100_000_000})) + + // Within 50% (1.3x) should pass + _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{HalfLifeSeconds: 130_000_000}, + }) + require.NoError(t, err) +} + +func TestUpdateParams_HalfLifeMinimum(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{HalfLifeSeconds: 1000}, // < 1 year + }) + require.ErrorContains(t, err, "half_life_seconds must be >= 1 year") +} + +func TestUpdateParams_HappyPath(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + newParams := types.Params{HalfLifeSeconds: 63072000} // 2 years + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: newParams, + }) + require.NoError(t, err) + require.Equal(t, newParams, td.keeper.GetParams(td.ctx)) +} + +func TestActivate_InvalidAuthority(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.Activate(td.ctx, &types.MsgActivate{Authority: "bad"}) + require.ErrorContains(t, err, "invalid authority") +} + +func TestActivate_AlreadyActivated(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) + + _, err := srv.Activate(td.ctx, &types.MsgActivate{Authority: govAuthority()}) + require.ErrorIs(t, err, types.ErrAlreadyActivated) +} + +func TestActivate_MissingHalfLife(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Default params: half_life = 0 + _, err := srv.Activate(td.ctx, &types.MsgActivate{Authority: govAuthority()}) + require.ErrorContains(t, err, "half_life_seconds must be set") +} + +func TestActivate_PoolNotFunded(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, sdkmath.ZeroInt())) + + _, err := srv.Activate(td.ctx, &types.MsgActivate{Authority: govAuthority()}) + require.ErrorIs(t, err, types.ErrPoolNotFunded) +} + +func TestActivate_HappyPath(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + halfLife := int64(31536000) + poolBalance := sdkmath.NewInt(1_000_000_000_000) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: halfLife})) + + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance)) + + blockTime := time.Date(2025, 6, 1, 0, 0, 0, 0, time.UTC) + ctx := td.ctx.WithBlockTime(blockTime) + + _, err := srv.Activate(ctx, &types.MsgActivate{Authority: govAuthority()}) + require.NoError(t, err) + + require.True(t, td.keeper.GetActivated(ctx)) + require.Equal(t, poolBalance, td.keeper.GetPoolBalanceAtActivation(ctx)) + require.Equal(t, blockTime, td.keeper.GetActivationTime(ctx).UTC()) + require.Equal(t, blockTime, td.keeper.GetLastBlockTime(ctx).UTC()) +} + +func TestReactivate_NotActivated(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.Reactivate(td.ctx, &types.MsgReactivate{Authority: govAuthority()}) + require.ErrorIs(t, err, types.ErrNotYetActivated) +} + +func TestReactivate_PoolNotFunded(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) + + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, sdkmath.ZeroInt())) + + _, err := srv.Reactivate(td.ctx, &types.MsgReactivate{Authority: govAuthority()}) + require.ErrorIs(t, err, types.ErrPoolNotFunded) +} + +func TestReactivate_ClearsPaused(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) + td.keeper.SetPaused(td.ctx, true) + td.keeper.SetTotalPausedSeconds(td.ctx, 500) + + poolBalance := sdkmath.NewInt(1_000_000_000_000) + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance)) + + blockTime := time.Date(2025, 7, 1, 0, 0, 0, 0, time.UTC) + ctx := td.ctx.WithBlockTime(blockTime) + + _, err := srv.Reactivate(ctx, &types.MsgReactivate{Authority: govAuthority()}) + require.NoError(t, err) + + require.False(t, td.keeper.GetPaused(ctx), "reactivate should clear paused flag") + require.Equal(t, int64(0), td.keeper.GetTotalPausedSeconds(ctx)) + require.True(t, td.keeper.GetTotalDistributed(ctx).IsZero()) +} + +func TestReactivate_HappyPath(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) + td.keeper.SetTotalDistributed(td.ctx, sdkmath.NewInt(5000)) + + newPoolBalance := sdkmath.NewInt(500_000_000_000) + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, newPoolBalance)) + + blockTime := time.Date(2025, 8, 1, 0, 0, 0, 0, time.UTC) + ctx := td.ctx.WithBlockTime(blockTime) + + _, err := srv.Reactivate(ctx, &types.MsgReactivate{Authority: govAuthority()}) + require.NoError(t, err) + + require.Equal(t, newPoolBalance, td.keeper.GetPoolBalanceAtActivation(ctx)) + require.Equal(t, blockTime, td.keeper.GetActivationTime(ctx).UTC()) + require.True(t, td.keeper.GetTotalDistributed(ctx).IsZero()) + require.Equal(t, int64(0), td.keeper.GetTotalPausedSeconds(ctx)) +} + +func TestPause_InvalidAuthority(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.Pause(td.ctx, &types.MsgPause{Authority: "bad", Paused: true}) + require.ErrorContains(t, err, "invalid authority") +} + +func TestPause_AccumulatesPausedDuration(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Start with activated + paused + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) + td.keeper.SetPaused(td.ctx, true) + + pauseStart := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + td.keeper.SetLastBlockTime(td.ctx, pauseStart) + + // Unpause 100 seconds later + unpauseTime := pauseStart.Add(100 * time.Second) + ctx := td.ctx.WithBlockTime(unpauseTime) + + _, err := srv.Pause(ctx, &types.MsgPause{Authority: govAuthority(), Paused: false}) + require.NoError(t, err) + + require.Equal(t, int64(100), td.keeper.GetTotalPausedSeconds(ctx)) + require.Equal(t, unpauseTime, td.keeper.GetLastBlockTime(ctx).UTC()) + + // Verify paused flag cleared + require.False(t, td.keeper.GetPaused(ctx)) +} + +func TestPause_HappyPath(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Must be activated for pause to work + td.keeper.SetActivated(td.ctx, true) + + // Set LastBlockTime so unpause has a valid reference point + td.keeper.SetLastBlockTime(td.ctx, td.ctx.BlockTime()) + + // Pause + _, err := srv.Pause(td.ctx, &types.MsgPause{Authority: govAuthority(), Paused: true}) + require.NoError(t, err) + require.True(t, td.keeper.GetPaused(td.ctx)) + + // Unpause + _, err = srv.Pause(td.ctx, &types.MsgPause{Authority: govAuthority(), Paused: false}) + require.NoError(t, err) + require.False(t, td.keeper.GetPaused(td.ctx)) +} + +func TestFundPool_InvalidDepositor(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + _, err := srv.FundPool(td.ctx, &types.MsgFundPool{ + Depositor: "invalid", + Amount: sdk.NewCoins(sdk.NewInt64Coin("ogwei", 1000)), + }) + require.Error(t, err) +} + +func TestFundPool_WrongDenom(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + depositor := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + _, err := srv.FundPool(td.ctx, &types.MsgFundPool{ + Depositor: depositor, + Amount: sdk.NewCoins(sdk.NewInt64Coin("wrongdenom", 1000)), + }) + require.ErrorContains(t, err, "invalid denom") +} + +func TestFundPool_HappyPath(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + denom := vmtypes.GetEVMCoinDenom() + depositor := authtypes.NewModuleAddress(govtypes.ModuleName) + amount := sdk.NewCoins(sdk.NewInt64Coin(denom, 1000)) + + td.bk.On("SendCoinsFromAccountToModule", td.ctx, depositor, types.ModuleName, amount).Return(nil) + + _, err := srv.FundPool(td.ctx, &types.MsgFundPool{ + Depositor: depositor.String(), + Amount: amount, + }) + require.NoError(t, err) + + td.bk.AssertCalled(t, "SendCoinsFromAccountToModule", td.ctx, depositor, types.ModuleName, amount) +} + +func TestBeginBlock_AfterPauseUnpause(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + denom := vmtypes.GetEVMCoinDenom() + halfLife := int64(31536000) // 1 year + poolBalance := sdkmath.NewInt(1_000_000_000_000_000) + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance)) + td.bk.On("SendCoinsFromModuleToModule", + mock.Anything, types.ModuleName, authtypes.FeeCollectorName, mock.Anything, + ).Return(nil) + + // 1. Activate at T=0 + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: halfLife})) + activationTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + ctx := td.ctx.WithBlockTime(activationTime) + _, err := srv.Activate(ctx, &types.MsgActivate{Authority: govAuthority()}) + require.NoError(t, err) + + // 2. Run BeginBlock at T=100s (normal distribution) + t100 := activationTime.Add(100 * time.Second) + ctx100 := td.ctx.WithBlockTime(t100) + err = td.keeper.BeginBlock(ctx100) + require.NoError(t, err) + + step2Reward := td.keeper.GetTotalDistributed(ctx100) + + // 3. Pause at T=100s + _, err = srv.Pause(ctx100, &types.MsgPause{Authority: govAuthority(), Paused: true}) + require.NoError(t, err) + + // 4. Unpause after a full half-life of pause + pauseDuration := time.Duration(halfLife) * time.Second + tUnpause := activationTime.Add(100*time.Second + pauseDuration) + ctxUnpause := td.ctx.WithBlockTime(tUnpause) + _, err = srv.Pause(ctxUnpause, &types.MsgPause{Authority: govAuthority(), Paused: false}) + require.NoError(t, err) + require.Equal(t, int64(halfLife), td.keeper.GetTotalPausedSeconds(ctxUnpause)) + + // 5. Run BeginBlock 5s after unpause + // Active time = (100 + halfLife + 5) - 0 - halfLife(paused) = 105s, blockDelta = 5s + tPost := tUnpause.Add(5 * time.Second) + ctxPost := td.ctx.WithBlockTime(tPost) + err = td.keeper.BeginBlock(ctxPost) + require.NoError(t, err) + + // 6. Verify the exact reward distributed matches elapsed=105s (not halfLife+105s) + correctReward := keeper.CalculateBlockReward(halfLife, poolBalance, 105, 5) + buggyReward := keeper.CalculateBlockReward(halfLife, poolBalance, float64(halfLife)+105, 5) + + expectedTotal := step2Reward.Add(correctReward) + require.Equal(t, expectedTotal, td.keeper.GetTotalDistributed(ctxPost), + "total distributed should match correct elapsed, not buggy elapsed") + + // Sanity: correct reward must be ~2x buggy reward after 1 half-life pause + require.True(t, correctReward.GT(buggyReward), + "correct reward (%s) should be ~2x buggy reward (%s)", correctReward, buggyReward) +} + +func TestUpdateParams_RejectZeroHalfLifeWhenActivated(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Set a valid half-life and activate + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 31536000})) + td.keeper.SetActivated(td.ctx, true) + + // Attempt to set half_life to 0 while activated — must fail + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{HalfLifeSeconds: 0}, + }) + require.ErrorContains(t, err, "half_life_seconds must be > 0 while module is activated") + + // Params must remain unchanged + require.Equal(t, int64(31536000), td.keeper.GetParams(td.ctx).HalfLifeSeconds) +} + +func TestUpdateParams_AllowZeroHalfLifePreActivation(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Module is not activated — setting to 0 should be allowed (default state) + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{HalfLifeSeconds: 0}, + }) + require.NoError(t, err) + require.Equal(t, int64(0), td.keeper.GetParams(td.ctx).HalfLifeSeconds) +} + +func TestUpdateParams_TwoStepExploitBlocked(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Set a valid half-life and activate + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 100_000_000})) + td.keeper.SetActivated(td.ctx, true) + + // Step 1 of the exploit: try to set half_life to 0 — must be blocked + _, err := srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{HalfLifeSeconds: 0}, + }) + require.Error(t, err, "step 1 of two-step exploit must be blocked") + + // Verify the half-life is still the original value + require.Equal(t, int64(100_000_000), td.keeper.GetParams(td.ctx).HalfLifeSeconds) + + // Step 2 would have been: set to an arbitrary value bypassing the 50% cap. + // Since step 1 is blocked, the exploit is impossible. Verify the 50% cap + // still applies: jumping from 100M to 999B must fail. + _, err = srv.UpdateParams(td.ctx, &types.MsgUpdateParams{ + Authority: govAuthority(), + Params: types.Params{HalfLifeSeconds: 999_999_999_999}, + }) + require.ErrorIs(t, err, types.ErrHalfLifeChange, "50%% cap must still block large jumps") +} + +func TestReactivate_RejectZeroHalfLife(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Force an inconsistent state: activated=true but half_life=0 + // (shouldn't happen with the UpdateParams fix, but tests defense-in-depth) + td.keeper.SetActivated(td.ctx, true) + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: 0})) + + _, err := srv.Reactivate(td.ctx, &types.MsgReactivate{Authority: govAuthority()}) + require.ErrorContains(t, err, "half_life_seconds must be set before reactivation") +} + +func TestPause_RejectedBeforeActivation(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + // Module is not activated — pause must be rejected + _, err := srv.Pause(td.ctx, &types.MsgPause{Authority: govAuthority(), Paused: true}) + require.ErrorIs(t, err, types.ErrNotYetActivated) + + // Unpause also rejected before activation + _, err = srv.Pause(td.ctx, &types.MsgPause{Authority: govAuthority(), Paused: false}) + require.ErrorIs(t, err, types.ErrNotYetActivated) +} + +func TestActivate_ClearsStalePauseState(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + halfLife := int64(31536000) + poolBalance := sdkmath.NewInt(1_000_000_000_000) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: halfLife})) + + // Simulate poisoned pre-activation state (e.g. from genesis import) + td.keeper.SetPaused(td.ctx, true) + td.keeper.SetTotalPausedSeconds(td.ctx, 99999999999) + + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance)) + + blockTime := time.Date(2025, 6, 1, 0, 0, 0, 0, time.UTC) + ctx := td.ctx.WithBlockTime(blockTime) + + _, err := srv.Activate(ctx, &types.MsgActivate{Authority: govAuthority()}) + require.NoError(t, err) + + // Verify activation cleaned the poisoned state + require.False(t, td.keeper.GetPaused(ctx), "activate must clear paused flag") + require.Equal(t, int64(0), td.keeper.GetTotalPausedSeconds(ctx), "activate must reset total_paused_seconds") + require.True(t, td.keeper.GetActivated(ctx)) +} + +func TestPause_PreActivationPoisonFixed(t *testing.T) { + td := newMockedTestData(t) + srv := keeper.NewMsgServerImpl(td.keeper) + + halfLife := int64(31536000) + poolBalance := sdkmath.NewInt(1_000_000_000_000_000) + + require.NoError(t, td.keeper.SetParams(td.ctx, types.Params{HalfLifeSeconds: halfLife})) + + denom := vmtypes.GetEVMCoinDenom() + moduleAddr := authtypes.NewModuleAddress(types.ModuleName) + td.ak.On("GetModuleAddress", types.ModuleName).Return(moduleAddr) + td.bk.On("GetBalance", mock.Anything, moduleAddr, denom).Return(sdk.NewCoin(denom, poolBalance)) + td.bk.On("SendCoinsFromModuleToModule", + mock.Anything, types.ModuleName, authtypes.FeeCollectorName, mock.Anything, + ).Return(nil) + + // 1. Attempt pause before activation — must fail + _, err := srv.Pause(td.ctx, &types.MsgPause{Authority: govAuthority(), Paused: true}) + require.ErrorIs(t, err, types.ErrNotYetActivated) + + // 2. Activate + activationTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) + ctx := td.ctx.WithBlockTime(activationTime) + _, err = srv.Activate(ctx, &types.MsgActivate{Authority: govAuthority()}) + require.NoError(t, err) + + // 3. Verify TotalPausedSeconds is 0 after activation + require.Equal(t, int64(0), td.keeper.GetTotalPausedSeconds(ctx)) + + // 4. Run BeginBlock 10 seconds later — should produce rewards + t10 := activationTime.Add(10 * time.Second) + ctx10 := td.ctx.WithBlockTime(t10) + err = td.keeper.BeginBlock(ctx10) + require.NoError(t, err) + + // 5. Verify rewards were actually distributed (not zero) + distributed := td.keeper.GetTotalDistributed(ctx10) + require.True(t, distributed.IsPositive(), + "rewards must be distributed after clean activation, got %s", distributed) +} diff --git a/x/svip/keeper/params.go b/x/svip/keeper/params.go new file mode 100644 index 00000000..266e3498 --- /dev/null +++ b/x/svip/keeper/params.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "github.com/cosmos/evm/x/svip/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// GetParams returns the total set of SVIP parameters. +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + if bz == nil { + return types.DefaultParams() + } + k.cdc.MustUnmarshal(bz, ¶ms) + return params +} + +// SetParams sets the SVIP parameters. +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { + store := ctx.KVStore(k.storeKey) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err + } + store.Set(types.ParamsKey, bz) + return nil +} diff --git a/x/svip/keeper/query_server.go b/x/svip/keeper/query_server.go new file mode 100644 index 00000000..d8017896 --- /dev/null +++ b/x/svip/keeper/query_server.go @@ -0,0 +1,60 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/evm/x/svip/types" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// queryServer implements the SVIP QueryServer interface. +type queryServer struct { + Keeper +} + +// NewQueryServerImpl returns an implementation of the SVIP QueryServer interface. +func NewQueryServerImpl(k Keeper) types.QueryServer { + return &queryServer{Keeper: k} +} + +var _ types.QueryServer = queryServer{} + +// Params returns the current SVIP module parameters. +func (s queryServer) Params(goCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + return &types.QueryParamsResponse{Params: s.GetParams(ctx)}, nil +} + +// PoolState returns the current SVIP pool state including balance and distribution info. +func (s queryServer) PoolState(goCtx context.Context, _ *types.QueryPoolStateRequest) (*types.QueryPoolStateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + activated := s.GetActivated(ctx) + paused := s.GetPaused(ctx) + denom := s.getDenom(ctx) + moduleAddr := s.ak.GetModuleAddress(types.ModuleName) + balance := s.bk.GetBalance(ctx, moduleAddr, denom) + + var currentRate math.LegacyDec + if activated && !paused { + params := s.GetParams(ctx) + totalPausedSec := float64(s.GetTotalPausedSeconds(ctx)) + elapsed := ctx.BlockTime().Sub(s.GetActivationTime(ctx)).Seconds() - totalPausedSec + poolAtAct := s.GetPoolBalanceAtActivation(ctx) + // Calculate tokens per second at current time + reward := CalculateBlockReward(params.HalfLifeSeconds, poolAtAct, elapsed, 1.0) + currentRate = math.LegacyNewDecFromInt(reward) + } else { + currentRate = math.LegacyZeroDec() + } + + return &types.QueryPoolStateResponse{ + PoolBalance: balance, + TotalDistributed: s.GetTotalDistributed(ctx), + CurrentRatePerSecond: currentRate, + Activated: activated, + Paused: paused, + ActivationTime: s.GetActivationTime(ctx), + }, nil +} diff --git a/x/svip/keeper/reward.go b/x/svip/keeper/reward.go new file mode 100644 index 00000000..6e7cff93 --- /dev/null +++ b/x/svip/keeper/reward.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "fmt" + "math" + + sdkmath "cosmossdk.io/math" +) + +// CalculateBlockReward returns how many tokens (in base denom units) to +// distribute for this block using exponential decay. +// +// poolAtActivation — token balance when SVIP was activated (base denom) +// totalElapsedSec — seconds since SVIP activation +// blockDeltaSec — seconds since the previous block +// +// Exponential decay formula: +// +// R₀ = (ln2 / half_life) × poolAtActivation +// rate(t) = R₀ × e^(-λ × t) +// blockReward = rate(t) × blockDelta +func CalculateBlockReward( + halfLifeSeconds int64, + poolAtActivation sdkmath.Int, + totalElapsedSec float64, + blockDeltaSec float64, +) sdkmath.Int { + if poolAtActivation.IsZero() || blockDeltaSec <= 0 || totalElapsedSec < 0 { + return sdkmath.ZeroInt() + } + + halfLifeSec := float64(halfLifeSeconds) + if halfLifeSec <= 0 { + return sdkmath.ZeroInt() + } + + lambda := math.Log(2) / halfLifeSec + poolFloat := poolAtActivation.ToLegacyDec().MustFloat64() + initialRate := lambda * poolFloat // tokens per second at t=0 + currentRate := initialRate * math.Exp(-lambda*totalElapsedSec) // tokens/sec now + blockReward := currentRate * blockDeltaSec + + if blockReward <= 0 { + return sdkmath.ZeroInt() + } + + // Truncate to integer — we never over-distribute. + rewardStr := fmt.Sprintf("%.0f", math.Floor(blockReward)) + reward, ok := sdkmath.NewIntFromString(rewardStr) + if !ok { + return sdkmath.ZeroInt() + } + return reward +} diff --git a/x/svip/keeper/reward_test.go b/x/svip/keeper/reward_test.go new file mode 100644 index 00000000..1589b12e --- /dev/null +++ b/x/svip/keeper/reward_test.go @@ -0,0 +1,153 @@ +package keeper_test + +import ( + "math" + "testing" + + "github.com/cosmos/evm/x/svip/keeper" + "github.com/stretchr/testify/require" + + sdkmath "cosmossdk.io/math" +) + +func TestCalculateBlockReward(t *testing.T) { + halfLife := int64(31536000) // 1 year in seconds + pool := sdkmath.NewInt(1_000_000_000_000) + + testCases := []struct { + name string + halfLifeSeconds int64 + poolAtActivation sdkmath.Int + totalElapsedSec float64 + blockDeltaSec float64 + expectZero bool + }{ + { + name: "zero pool balance", + halfLifeSeconds: halfLife, + poolAtActivation: sdkmath.ZeroInt(), + totalElapsedSec: 100, + blockDeltaSec: 5, + expectZero: true, + }, + { + name: "zero block delta", + halfLifeSeconds: halfLife, + poolAtActivation: pool, + totalElapsedSec: 100, + blockDeltaSec: 0, + expectZero: true, + }, + { + name: "negative block delta", + halfLifeSeconds: halfLife, + poolAtActivation: pool, + totalElapsedSec: 100, + blockDeltaSec: -5, + expectZero: true, + }, + { + name: "negative elapsed", + halfLifeSeconds: halfLife, + poolAtActivation: pool, + totalElapsedSec: -100, + blockDeltaSec: 5, + expectZero: true, + }, + { + name: "zero half_life", + halfLifeSeconds: 0, + poolAtActivation: pool, + totalElapsedSec: 100, + blockDeltaSec: 5, + expectZero: true, + }, + { + name: "negative half_life", + halfLifeSeconds: -1, + poolAtActivation: pool, + totalElapsedSec: 100, + blockDeltaSec: 5, + expectZero: true, + }, + { + name: "normal case - first block", + halfLifeSeconds: halfLife, + poolAtActivation: pool, + totalElapsedSec: 5, + blockDeltaSec: 5, + expectZero: false, + }, + { + name: "normal case - mid life", + halfLifeSeconds: halfLife, + poolAtActivation: pool, + totalElapsedSec: 1000, + blockDeltaSec: 5, + expectZero: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + reward := keeper.CalculateBlockReward( + tc.halfLifeSeconds, + tc.poolAtActivation, + tc.totalElapsedSec, + tc.blockDeltaSec, + ) + if tc.expectZero { + require.True(t, reward.IsZero(), "expected zero reward, got %s", reward) + } else { + require.True(t, reward.IsPositive(), "expected positive reward, got %s", reward) + } + }) + } +} + +func TestCalculateBlockReward_HalfLifeDecay(t *testing.T) { + halfLife := int64(31536000) + pool := sdkmath.NewInt(1_000_000_000_000_000) // large pool for precision + blockDelta := float64(5) + + // Reward at t=0 + r0 := keeper.CalculateBlockReward(halfLife, pool, blockDelta, blockDelta) + require.True(t, r0.IsPositive()) + + // Reward at t=halfLife + rHalf := keeper.CalculateBlockReward(halfLife, pool, float64(halfLife), blockDelta) + require.True(t, rHalf.IsPositive()) + + // After one half-life, the rate should be ~half of the initial rate. + // Allow 5% tolerance for truncation. + r0Float := r0.ToLegacyDec().MustFloat64() + rHalfFloat := rHalf.ToLegacyDec().MustFloat64() + ratio := rHalfFloat / r0Float + require.InDelta(t, 0.5, ratio, 0.05, "reward after one half-life should be ~50%% of initial, got ratio %f", ratio) +} + +func TestCalculateBlockReward_VeryLargeElapsed(t *testing.T) { + halfLife := int64(31536000) + pool := sdkmath.NewInt(1_000_000_000_000) + + // After 100 half-lives, reward should be effectively zero + elapsed := float64(halfLife) * 100 + reward := keeper.CalculateBlockReward(halfLife, pool, elapsed, 5) + require.True(t, reward.IsZero(), "reward after 100 half-lives should be zero, got %s", reward) +} + +func TestCalculateBlockReward_Monotonic(t *testing.T) { + halfLife := int64(31536000) + pool := sdkmath.NewInt(1_000_000_000_000_000) + blockDelta := float64(5) + + // Rewards should decrease monotonically over time + var prev sdkmath.Int + for elapsed := float64(0); elapsed < float64(halfLife)*3; elapsed += float64(halfLife) / 10 { + r := keeper.CalculateBlockReward(halfLife, pool, math.Max(elapsed, blockDelta), blockDelta) + if !prev.IsNil() && prev.IsPositive() && r.IsPositive() { + require.True(t, r.LTE(prev), "reward should decrease: at elapsed=%f got %s > prev %s", elapsed, r, prev) + } + prev = r + } +} diff --git a/x/svip/module.go b/x/svip/module.go new file mode 100644 index 00000000..b0c593ce --- /dev/null +++ b/x/svip/module.go @@ -0,0 +1,122 @@ +package svip + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/cometbft/cometbft/abci/types" + + "github.com/cosmos/evm/x/svip/client/cli" + "github.com/cosmos/evm/x/svip/keeper" + "github.com/cosmos/evm/x/svip/types" + + "cosmossdk.io/core/appmodule" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" +) + +const consensusVersion = 2 + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.HasABCIGenesis = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} +) + +// AppModuleBasic defines the basic application module used by the SVIP module. +type AppModuleBasic struct{} + +// Name returns the SVIP module's name. +func (AppModuleBasic) Name() string { return types.ModuleName } + +// RegisterLegacyAminoCodec registers the SVIP module's types on the given LegacyAmino codec. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) } + +// ConsensusVersion returns the consensus state-breaking version for the module. +func (AppModuleBasic) ConsensusVersion() uint64 { return consensusVersion } + +// DefaultGenesis returns default genesis state as raw bytes for the SVIP module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the SVIP module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var gs types.GenesisState + if err := cdc.UnmarshalJSON(bz, &gs); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return gs.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the SVIP module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(c client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(c)); err != nil { + panic(err) + } +} + +// RegisterInterfaces registers interfaces and implementations of the SVIP module. +func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +// GetTxCmd returns the root tx command for the svip module. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.NewTxCmd() +} + +// AppModule implements an application module for the SVIP module. +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper +} + +// NewAppModule creates a new AppModule object. +func NewAppModule(k keeper.Keeper) AppModule { + return AppModule{AppModuleBasic: AppModuleBasic{}, keeper: k} +} + +// Name returns the SVIP module's name. +func (AppModule) Name() string { return types.ModuleName } + +// RegisterServices registers the GRPC query and msg services for the SVIP module. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServerImpl(am.keeper)) +} + +// BeginBlock returns the begin blocker for the SVIP module. +func (am AppModule) BeginBlock(ctx context.Context) error { + c := sdk.UnwrapSDKContext(ctx) + return am.keeper.BeginBlock(c) +} + +// InitGenesis performs genesis initialization for the SVIP module. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { + var gs types.GenesisState + cdc.MustUnmarshalJSON(data, &gs) + InitGenesis(ctx, am.keeper, gs) + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the exported genesis state as raw bytes for the SVIP module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(gs) +} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} diff --git a/x/svip/types/codec.go b/x/svip/types/codec.go new file mode 100644 index 00000000..f0547721 --- /dev/null +++ b/x/svip/types/codec.go @@ -0,0 +1,49 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + AminoCdc = codec.NewAminoCodec(amino) +) + +const ( + updateParamsName = "cosmos/svip/MsgUpdateParams" + activateName = "cosmos/svip/MsgActivate" + reactivateName = "cosmos/svip/MsgReactivate" + pauseName = "cosmos/svip/MsgPause" + fundPoolName = "cosmos/svip/MsgFundPool" +) + +func init() { + RegisterLegacyAminoCodec(amino) + amino.Seal() +} + +// RegisterInterfaces registers the SVIP module's interface types. +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgUpdateParams{}, + &MsgActivate{}, + &MsgReactivate{}, + &MsgPause{}, + &MsgFundPool{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +// RegisterLegacyAminoCodec registers the SVIP module's types on the given LegacyAmino codec. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgUpdateParams{}, updateParamsName, nil) + cdc.RegisterConcrete(&MsgActivate{}, activateName, nil) + cdc.RegisterConcrete(&MsgReactivate{}, reactivateName, nil) + cdc.RegisterConcrete(&MsgPause{}, pauseName, nil) + cdc.RegisterConcrete(&MsgFundPool{}, fundPoolName, nil) +} diff --git a/x/svip/types/errors.go b/x/svip/types/errors.go new file mode 100644 index 00000000..262d2536 --- /dev/null +++ b/x/svip/types/errors.go @@ -0,0 +1,14 @@ +package types + +import errorsmod "cosmossdk.io/errors" + +var ( + ErrNotActivated = errorsmod.Register(ModuleName, 2, "svip is not activated") + ErrPaused = errorsmod.Register(ModuleName, 3, "svip is paused") + ErrPoolExhausted = errorsmod.Register(ModuleName, 4, "svip pool is exhausted") + ErrInvalidAuthority = errorsmod.Register(ModuleName, 5, "invalid authority") + ErrAlreadyActivated = errorsmod.Register(ModuleName, 6, "svip is already activated") + ErrPoolNotFunded = errorsmod.Register(ModuleName, 7, "svip pool has no funds") + ErrNotYetActivated = errorsmod.Register(ModuleName, 8, "svip has not been activated yet") + ErrHalfLifeChange = errorsmod.Register(ModuleName, 9, "half_life_seconds change exceeds 50% limit") +) diff --git a/x/svip/types/expected_keepers.go b/x/svip/types/expected_keepers.go new file mode 100644 index 00000000..da3824ad --- /dev/null +++ b/x/svip/types/expected_keepers.go @@ -0,0 +1,20 @@ +package types + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// BankKeeper defines the expected bank keeper interface. +// In app.go, pass PreciseBankKeeper which implements this. +type BankKeeper interface { + SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin +} + +// AccountKeeper defines the expected account keeper interface. +type AccountKeeper interface { + GetModuleAddress(moduleName string) sdk.AccAddress +} diff --git a/x/svip/types/genesis.pb.go b/x/svip/types/genesis.pb.go new file mode 100644 index 00000000..67f7a849 --- /dev/null +++ b/x/svip/types/genesis.pb.go @@ -0,0 +1,664 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/svip/v1/genesis.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the svip module's genesis state. +type GenesisState struct { + // params defines all the parameters of the svip module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // total_distributed is tokens sent to FeeCollector since the last (re)activation. + TotalDistributed cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=total_distributed,json=totalDistributed,proto3,customtype=cosmossdk.io/math.Int" json:"total_distributed"` + // activation_time is when SVIP was activated. Zero if not yet activated. + ActivationTime time.Time `protobuf:"bytes,3,opt,name=activation_time,json=activationTime,proto3,stdtime" json:"activation_time"` + // pool_balance_at_activation is the pool snapshot used to derive R₀. + PoolBalanceAtActivation cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=pool_balance_at_activation,json=poolBalanceAtActivation,proto3,customtype=cosmossdk.io/math.Int" json:"pool_balance_at_activation"` + // last_block_time is the timestamp of the last processed block. + LastBlockTime time.Time `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time"` + // total_paused_seconds is the cumulative seconds spent in paused state. + TotalPausedSeconds int64 `protobuf:"varint,6,opt,name=total_paused_seconds,json=totalPausedSeconds,proto3" json:"total_paused_seconds,omitempty"` + // activated indicates whether SVIP reward distribution is active. + Activated bool `protobuf:"varint,7,opt,name=activated,proto3" json:"activated,omitempty"` + // paused is an emergency pause flag. + Paused bool `protobuf:"varint,8,opt,name=paused,proto3" json:"paused,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_9fc4f2cc3c482b1c, []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) GetActivationTime() time.Time { + if m != nil { + return m.ActivationTime + } + return time.Time{} +} + +func (m *GenesisState) GetLastBlockTime() time.Time { + if m != nil { + return m.LastBlockTime + } + return time.Time{} +} + +func (m *GenesisState) GetTotalPausedSeconds() int64 { + if m != nil { + return m.TotalPausedSeconds + } + return 0 +} + +func (m *GenesisState) GetActivated() bool { + if m != nil { + return m.Activated + } + return false +} + +func (m *GenesisState) GetPaused() bool { + if m != nil { + return m.Paused + } + return false +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.svip.v1.GenesisState") +} + +func init() { proto.RegisterFile("cosmos/svip/v1/genesis.proto", fileDescriptor_9fc4f2cc3c482b1c) } + +var fileDescriptor_9fc4f2cc3c482b1c = []byte{ + // 449 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x6e, 0xd4, 0x30, + 0x1c, 0xc6, 0xcf, 0x1c, 0x1c, 0x77, 0x06, 0x5a, 0x6a, 0x95, 0x12, 0x4e, 0x25, 0x77, 0xea, 0x74, + 0x62, 0xb0, 0x29, 0x4c, 0x48, 0x2c, 0x8d, 0x90, 0x10, 0x08, 0xa4, 0x2a, 0x65, 0xea, 0x12, 0x39, + 0x89, 0x49, 0xad, 0x26, 0xf9, 0x47, 0xe7, 0xff, 0x45, 0xf0, 0x16, 0x7d, 0x0c, 0x46, 0x1e, 0xa3, + 0x63, 0x47, 0xc4, 0x50, 0xd0, 0xdd, 0xc0, 0x1b, 0x30, 0x23, 0xdb, 0x29, 0x27, 0x98, 0x60, 0x89, + 0x6c, 0x7f, 0xdf, 0xef, 0x9f, 0xef, 0x4b, 0x4c, 0x77, 0x33, 0x30, 0x15, 0x18, 0x61, 0x5a, 0xdd, + 0x88, 0x76, 0x5f, 0x14, 0xaa, 0x56, 0x46, 0x1b, 0xde, 0xcc, 0x01, 0x81, 0x6d, 0x78, 0x95, 0x5b, + 0x95, 0xb7, 0xfb, 0xe3, 0x2d, 0x59, 0xe9, 0x1a, 0x84, 0x7b, 0x7a, 0xcb, 0xf8, 0xc1, 0x5f, 0x03, + 0x9c, 0xd5, 0x4b, 0xdb, 0x05, 0x14, 0xe0, 0x96, 0xc2, 0xae, 0xba, 0xd3, 0x49, 0x01, 0x50, 0x94, + 0x4a, 0xb8, 0x5d, 0xba, 0x78, 0x2f, 0x50, 0x57, 0xca, 0xa0, 0xac, 0x3a, 0x6c, 0xef, 0x67, 0x9f, + 0xde, 0x7e, 0xe9, 0x63, 0x1c, 0xa1, 0x44, 0xc5, 0x9e, 0xd1, 0x41, 0x23, 0xe7, 0xb2, 0x32, 0x01, + 0x99, 0x92, 0xd9, 0xad, 0x27, 0x3b, 0xfc, 0xcf, 0x58, 0xfc, 0xd0, 0xa9, 0xd1, 0xe8, 0xfc, 0x72, + 0xd2, 0xfb, 0xf4, 0xe3, 0xf3, 0x23, 0x12, 0x77, 0x00, 0x7b, 0x4d, 0xb7, 0x10, 0x50, 0x96, 0x49, + 0xae, 0x0d, 0xce, 0x75, 0xba, 0x40, 0x95, 0x07, 0xd7, 0xa6, 0x64, 0x36, 0x8a, 0x1e, 0x5a, 0xf7, + 0xd7, 0xcb, 0xc9, 0x3d, 0x3f, 0xcc, 0xe4, 0xa7, 0x5c, 0x83, 0xa8, 0x24, 0x9e, 0xf0, 0x57, 0x35, + 0xc6, 0x77, 0x1d, 0xf7, 0x62, 0x8d, 0xb1, 0xb7, 0x74, 0x53, 0x66, 0xa8, 0x5b, 0x89, 0x1a, 0xea, + 0xc4, 0xa6, 0x0e, 0xfa, 0x2e, 0xcf, 0x98, 0xfb, 0x4a, 0xfc, 0xaa, 0x12, 0x7f, 0x77, 0x55, 0x29, + 0x1a, 0xda, 0xb7, 0x9c, 0x7d, 0x9b, 0x90, 0x78, 0x63, 0x0d, 0x5b, 0x99, 0x1d, 0xd3, 0x71, 0x03, + 0x50, 0x26, 0xa9, 0x2c, 0x65, 0x9d, 0xa9, 0x44, 0x62, 0xb2, 0x76, 0x04, 0xd7, 0xff, 0x25, 0xe3, + 0x7d, 0x3b, 0x20, 0xf2, 0xfc, 0x01, 0x1e, 0xfc, 0xa6, 0xd9, 0x1b, 0xba, 0x59, 0x4a, 0x83, 0x49, + 0x5a, 0x42, 0x76, 0xea, 0xa3, 0xde, 0xf8, 0x8f, 0xa8, 0x77, 0x2c, 0x1c, 0x59, 0xd6, 0x25, 0x7d, + 0x4c, 0xb7, 0xfd, 0x47, 0x6c, 0xe4, 0xc2, 0xa8, 0x3c, 0x31, 0x2a, 0x83, 0x3a, 0x37, 0xc1, 0x60, + 0x4a, 0x66, 0xfd, 0x98, 0x39, 0xed, 0xd0, 0x49, 0x47, 0x5e, 0x61, 0xbb, 0x74, 0xd4, 0x75, 0x51, + 0x79, 0x70, 0x73, 0x4a, 0x66, 0xc3, 0x78, 0x7d, 0xc0, 0x76, 0xec, 0xff, 0xb4, 0xf6, 0x60, 0xe8, + 0xa4, 0x6e, 0x17, 0x3d, 0x3f, 0x5f, 0x86, 0xe4, 0x62, 0x19, 0x92, 0xef, 0xcb, 0x90, 0x9c, 0xad, + 0xc2, 0xde, 0xc5, 0x2a, 0xec, 0x7d, 0x59, 0x85, 0xbd, 0xe3, 0xbd, 0x42, 0xe3, 0xc9, 0x22, 0xe5, + 0x19, 0x54, 0xa2, 0xbb, 0x6f, 0xaa, 0xad, 0xc4, 0x07, 0x7f, 0xeb, 0xf0, 0x63, 0xa3, 0x4c, 0x3a, + 0x70, 0x95, 0x9e, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x5b, 0xbd, 0x69, 0x30, 0xd2, 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.Paused { + i-- + if m.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.Activated { + i-- + if m.Activated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.TotalPausedSeconds != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.TotalPausedSeconds)) + i-- + dAtA[i] = 0x30 + } + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastBlockTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintGenesis(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x2a + { + size := m.PoolBalanceAtActivation.Size() + i -= size + if _, err := m.PoolBalanceAtActivation.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ActivationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivationTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintGenesis(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x1a + { + size := m.TotalDistributed.Size() + i -= size + if _, err := m.TotalDistributed.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + 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)) + l = m.TotalDistributed.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivationTime) + n += 1 + l + sovGenesis(uint64(l)) + l = m.PoolBalanceAtActivation.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastBlockTime) + n += 1 + l + sovGenesis(uint64(l)) + if m.TotalPausedSeconds != 0 { + n += 1 + sovGenesis(uint64(m.TotalPausedSeconds)) + } + if m.Activated { + n += 2 + } + if m.Paused { + n += 2 + } + 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 TotalDistributed", 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 + } + if err := m.TotalDistributed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActivationTime", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.ActivationTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolBalanceAtActivation", 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 + } + if err := m.PoolBalanceAtActivation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastBlockTime", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.LastBlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalPausedSeconds", wireType) + } + m.TotalPausedSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalPausedSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Activated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Activated = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Paused", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Paused = bool(v != 0) + 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/svip/types/genesis_logic.go b/x/svip/types/genesis_logic.go new file mode 100644 index 00000000..f74dc793 --- /dev/null +++ b/x/svip/types/genesis_logic.go @@ -0,0 +1,39 @@ +package types + +import ( + "fmt" + "time" + + sdkmath "cosmossdk.io/math" +) + +// DefaultGenesisState returns the default SVIP genesis state. +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + TotalDistributed: sdkmath.ZeroInt(), + ActivationTime: time.Time{}, + PoolBalanceAtActivation: sdkmath.ZeroInt(), + LastBlockTime: time.Time{}, + TotalPausedSeconds: 0, + Activated: false, + Paused: false, + } +} + +// Validate performs basic genesis state validation. +func (gs GenesisState) Validate() error { + if err := gs.Params.Validate(); err != nil { + return err + } + if gs.TotalDistributed.IsNegative() { + return ErrPoolExhausted.Wrap("total_distributed cannot be negative") + } + if gs.TotalPausedSeconds < 0 { + return fmt.Errorf("total_paused_seconds cannot be negative: %d", gs.TotalPausedSeconds) + } + if gs.Activated && gs.Params.HalfLifeSeconds == 0 { + return fmt.Errorf("half_life_seconds must be set when activated") + } + return nil +} diff --git a/x/svip/types/genesis_test.go b/x/svip/types/genesis_test.go new file mode 100644 index 00000000..2af46862 --- /dev/null +++ b/x/svip/types/genesis_test.go @@ -0,0 +1,85 @@ +package types_test + +import ( + "testing" + + "github.com/cosmos/evm/x/svip/types" + "github.com/stretchr/testify/suite" + + sdkmath "cosmossdk.io/math" +) + +type GenesisTestSuite struct { + suite.Suite +} + +func TestGenesisTestSuite(t *testing.T) { + suite.Run(t, new(GenesisTestSuite)) +} + +func (suite *GenesisTestSuite) TestDefaultGenesisState() { + gs := types.DefaultGenesisState() + suite.Require().NotNil(gs) + suite.Require().NoError(gs.Validate()) +} + +func (suite *GenesisTestSuite) TestGenesisStateValidate() { + testCases := []struct { + name string + genesis types.GenesisState + expError bool + }{ + { + "valid - default genesis", + *types.DefaultGenesisState(), + false, + }, + { + "valid - positive total_distributed", + types.GenesisState{ + Params: types.DefaultParams(), + TotalDistributed: sdkmath.NewInt(1000), + PoolBalanceAtActivation: sdkmath.ZeroInt(), + }, + false, + }, + { + "invalid - negative total_distributed", + types.GenesisState{ + Params: types.DefaultParams(), + TotalDistributed: sdkmath.NewInt(-1), + PoolBalanceAtActivation: sdkmath.ZeroInt(), + }, + true, + }, + { + "invalid - activated with half_life=0", + types.GenesisState{ + Params: types.Params{HalfLifeSeconds: 0}, + Activated: true, + TotalDistributed: sdkmath.ZeroInt(), + PoolBalanceAtActivation: sdkmath.ZeroInt(), + }, + true, + }, + { + "valid - activated with half_life set", + types.GenesisState{ + Params: types.Params{HalfLifeSeconds: 31536000}, + Activated: true, + TotalDistributed: sdkmath.ZeroInt(), + PoolBalanceAtActivation: sdkmath.ZeroInt(), + }, + false, + }, + } + + for _, tc := range testCases { + err := tc.genesis.Validate() + if tc.expError { + suite.Require().Error(err, tc.name) + } else { + suite.Require().NoError(err, tc.name) + } + } +} diff --git a/x/svip/types/keys.go b/x/svip/types/keys.go new file mode 100644 index 00000000..6fab1871 --- /dev/null +++ b/x/svip/types/keys.go @@ -0,0 +1,30 @@ +package types + +const ( + ModuleName = "svip" + StoreKey = ModuleName + RouterKey = ModuleName +) + +// KV store key prefixes +const ( + prefixParams = iota + 1 + prefixTotalDistributed + prefixActivationTime + prefixLastBlockTime + prefixPoolBalanceAtActivation + prefixTotalPausedSeconds + prefixActivated + prefixPaused +) + +var ( + ParamsKey = []byte{prefixParams} + TotalDistributedKey = []byte{prefixTotalDistributed} + ActivationTimeKey = []byte{prefixActivationTime} + LastBlockTimeKey = []byte{prefixLastBlockTime} + PoolBalanceAtActivationKey = []byte{prefixPoolBalanceAtActivation} + TotalPausedSecondsKey = []byte{prefixTotalPausedSeconds} + ActivatedKey = []byte{prefixActivated} + PausedKey = []byte{prefixPaused} +) diff --git a/x/svip/types/mocks/MockAccountKeeper.go b/x/svip/types/mocks/MockAccountKeeper.go new file mode 100644 index 00000000..8ad9ca22 --- /dev/null +++ b/x/svip/types/mocks/MockAccountKeeper.go @@ -0,0 +1,28 @@ +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + + types "github.com/cosmos/cosmos-sdk/types" +) + +// AccountKeeper is a mock type for the AccountKeeper interface. +type AccountKeeper struct { + mock.Mock +} + +// NewAccountKeeper creates a new AccountKeeper mock and registers cleanup. +func NewAccountKeeper(t interface { + mock.TestingT + Cleanup(func()) +}) *AccountKeeper { + m := &AccountKeeper{} + m.Mock.Test(t) + t.Cleanup(func() { m.AssertExpectations(t) }) + return m +} + +func (_m *AccountKeeper) GetModuleAddress(moduleName string) types.AccAddress { + ret := _m.Called(moduleName) + return ret.Get(0).(types.AccAddress) +} diff --git a/x/svip/types/mocks/MockBankKeeper.go b/x/svip/types/mocks/MockBankKeeper.go new file mode 100644 index 00000000..892a1e49 --- /dev/null +++ b/x/svip/types/mocks/MockBankKeeper.go @@ -0,0 +1,40 @@ +package mocks + +import ( + "context" + + mock "github.com/stretchr/testify/mock" + + types "github.com/cosmos/cosmos-sdk/types" +) + +// BankKeeper is a mock type for the BankKeeper interface. +type BankKeeper struct { + mock.Mock +} + +// NewBankKeeper creates a new BankKeeper mock and registers cleanup. +func NewBankKeeper(t interface { + mock.TestingT + Cleanup(func()) +}) *BankKeeper { + m := &BankKeeper{} + m.Mock.Test(t) + t.Cleanup(func() { m.AssertExpectations(t) }) + return m +} + +func (_m *BankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt types.Coins) error { + ret := _m.Called(ctx, senderModule, recipientModule, amt) + return ret.Error(0) +} + +func (_m *BankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { + ret := _m.Called(ctx, senderAddr, recipientModule, amt) + return ret.Error(0) +} + +func (_m *BankKeeper) GetBalance(ctx context.Context, addr types.AccAddress, denom string) types.Coin { + ret := _m.Called(ctx, addr, denom) + return ret.Get(0).(types.Coin) +} diff --git a/x/svip/types/msgs.go b/x/svip/types/msgs.go new file mode 100644 index 00000000..1d9746ea --- /dev/null +++ b/x/svip/types/msgs.go @@ -0,0 +1,61 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var ( + _ sdk.Msg = &MsgUpdateParams{} + _ sdk.Msg = &MsgActivate{} + _ sdk.Msg = &MsgReactivate{} + _ sdk.Msg = &MsgPause{} + _ sdk.Msg = &MsgFundPool{} +) + +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + return m.Params.Validate() +} + +func (m *MsgActivate) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + return nil +} + +func (m *MsgReactivate) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + return nil +} + +func (m *MsgPause) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + return nil +} + +func (m *MsgFundPool) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Depositor); err != nil { + return errorsmod.Wrap(err, "invalid depositor address") + } + coins := sdk.Coins(m.Amount) + if !coins.IsValid() || coins.IsZero() { + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, "invalid fund amount") + } + return nil +} + +// GetSignBytes implementations for EIP-712 support +func (m MsgUpdateParams) GetSignBytes() []byte { return AminoCdc.MustMarshalJSON(&m) } +func (m MsgActivate) GetSignBytes() []byte { return AminoCdc.MustMarshalJSON(&m) } +func (m MsgReactivate) GetSignBytes() []byte { return AminoCdc.MustMarshalJSON(&m) } +func (m MsgPause) GetSignBytes() []byte { return AminoCdc.MustMarshalJSON(&m) } +func (m MsgFundPool) GetSignBytes() []byte { return AminoCdc.MustMarshalJSON(&m) } diff --git a/x/svip/types/msgs_test.go b/x/svip/types/msgs_test.go new file mode 100644 index 00000000..9ba31b46 --- /dev/null +++ b/x/svip/types/msgs_test.go @@ -0,0 +1,185 @@ +package types_test + +import ( + "testing" + + "github.com/cosmos/evm/x/svip/types" + "github.com/stretchr/testify/suite" + + sdkmath "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +type MsgsTestSuite struct { + suite.Suite +} + +func TestMsgsTestSuite(t *testing.T) { + suite.Run(t, new(MsgsTestSuite)) +} + +func (suite *MsgsTestSuite) TestMsgUpdateParamsValidateBasic() { + govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + testCases := []struct { + name string + msg *types.MsgUpdateParams + expPass bool + }{ + { + "fail - invalid authority", + &types.MsgUpdateParams{Authority: "invalid", Params: types.DefaultParams()}, + false, + }, + { + "fail - valid authority but invalid params", + &types.MsgUpdateParams{Authority: govAddr, Params: types.Params{HalfLifeSeconds: -1}}, + false, + }, + { + "pass - valid authority and params", + &types.MsgUpdateParams{Authority: govAddr, Params: types.DefaultParams()}, + true, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) + } +} + +func (suite *MsgsTestSuite) TestMsgActivateValidateBasic() { + govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + testCases := []struct { + name string + msg *types.MsgActivate + expPass bool + }{ + {"fail - invalid authority", &types.MsgActivate{Authority: "invalid"}, false}, + {"pass - valid authority", &types.MsgActivate{Authority: govAddr}, true}, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) + } +} + +func (suite *MsgsTestSuite) TestMsgReactivateValidateBasic() { + govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + testCases := []struct { + name string + msg *types.MsgReactivate + expPass bool + }{ + {"fail - invalid authority", &types.MsgReactivate{Authority: "invalid"}, false}, + {"pass - valid authority", &types.MsgReactivate{Authority: govAddr}, true}, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) + } +} + +func (suite *MsgsTestSuite) TestMsgPauseValidateBasic() { + govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + testCases := []struct { + name string + msg *types.MsgPause + expPass bool + }{ + {"fail - invalid authority", &types.MsgPause{Authority: "invalid"}, false}, + {"pass - valid authority", &types.MsgPause{Authority: govAddr, Paused: true}, true}, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) + } +} + +func (suite *MsgsTestSuite) TestMsgFundPoolValidateBasic() { + validAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() + + testCases := []struct { + name string + msg *types.MsgFundPool + expPass bool + }{ + { + "fail - invalid depositor", + &types.MsgFundPool{ + Depositor: "invalid", + Amount: sdk.NewCoins(sdk.NewInt64Coin("aevmos", 1000)), + }, + false, + }, + { + "fail - zero coins", + &types.MsgFundPool{ + Depositor: validAddr, + Amount: sdk.Coins{}, + }, + false, + }, + { + "fail - invalid coins (negative)", + &types.MsgFundPool{ + Depositor: validAddr, + Amount: sdk.Coins{sdk.Coin{Denom: "aevmos", Amount: sdkmath.NewInt(-1)}}, + }, + false, + }, + { + "pass - valid msg", + &types.MsgFundPool{ + Depositor: validAddr, + Amount: sdk.NewCoins(sdk.NewInt64Coin("aevmos", 1000)), + }, + true, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.msg.ValidateBasic() + if tc.expPass { + suite.NoError(err) + } else { + suite.Error(err) + } + }) + } +} diff --git a/x/svip/types/params.go b/x/svip/types/params.go new file mode 100644 index 00000000..ebe9ac25 --- /dev/null +++ b/x/svip/types/params.go @@ -0,0 +1,18 @@ +package types + +import "fmt" + +// DefaultParams returns the default SVIP module parameters. +func DefaultParams() Params { + return Params{ + HalfLifeSeconds: 0, // set before activation + } +} + +// Validate checks that the SVIP parameters are valid. +func (p Params) Validate() error { + if p.HalfLifeSeconds < 0 { + return fmt.Errorf("half_life_seconds cannot be negative: %d", p.HalfLifeSeconds) + } + return nil +} diff --git a/x/svip/types/params_test.go b/x/svip/types/params_test.go new file mode 100644 index 00000000..0390b41f --- /dev/null +++ b/x/svip/types/params_test.go @@ -0,0 +1,54 @@ +package types_test + +import ( + "testing" + + "github.com/cosmos/evm/x/svip/types" + "github.com/stretchr/testify/suite" +) + +type ParamsTestSuite struct { + suite.Suite +} + +func TestParamsTestSuite(t *testing.T) { + suite.Run(t, new(ParamsTestSuite)) +} + +func (suite *ParamsTestSuite) TestParamsValidate() { + testCases := []struct { + name string + params types.Params + expError bool + }{ + { + "default params valid", + types.DefaultParams(), + false, + }, + { + "negative half_life", + types.Params{HalfLifeSeconds: -1}, + true, + }, + { + "half_life=0 valid", + types.Params{HalfLifeSeconds: 0}, + false, + }, + { + "valid half_life", + types.Params{HalfLifeSeconds: 31536000}, + false, + }, + } + + for _, tc := range testCases { + err := tc.params.Validate() + if tc.expError { + suite.Require().Error(err, tc.name) + } else { + suite.Require().NoError(err, tc.name) + } + } +} diff --git a/x/svip/types/query.pb.go b/x/svip/types/query.pb.go new file mode 100644 index 00000000..f9098134 --- /dev/null +++ b/x/svip/types/query.pb.go @@ -0,0 +1,1127 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/svip/v1/query.proto + +package types + +import ( + context "context" + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + 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" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest defines the request type for querying x/svip parameters. +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_fcdeace1067afd47, []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 defines the response type for querying x/svip parameters. +type QueryParamsResponse struct { + // params define the svip module parameters. + 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_fcdeace1067afd47, []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{} +} + +// QueryPoolStateRequest defines the request type for querying pool state. +type QueryPoolStateRequest struct { +} + +func (m *QueryPoolStateRequest) Reset() { *m = QueryPoolStateRequest{} } +func (m *QueryPoolStateRequest) String() string { return proto.CompactTextString(m) } +func (*QueryPoolStateRequest) ProtoMessage() {} +func (*QueryPoolStateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fcdeace1067afd47, []int{2} +} +func (m *QueryPoolStateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPoolStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPoolStateRequest.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 *QueryPoolStateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPoolStateRequest.Merge(m, src) +} +func (m *QueryPoolStateRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryPoolStateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPoolStateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPoolStateRequest proto.InternalMessageInfo + +// QueryPoolStateResponse returns the current SVIP pool state. +type QueryPoolStateResponse struct { + // pool_balance is the current balance in the SVIP module account. + PoolBalance types.Coin `protobuf:"bytes,1,opt,name=pool_balance,json=poolBalance,proto3" json:"pool_balance"` + // total_distributed is tokens sent to FeeCollector since the last (re)activation. + TotalDistributed cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=total_distributed,json=totalDistributed,proto3,customtype=cosmossdk.io/math.Int" json:"total_distributed"` + // current_rate_per_second is the current reward rate after decay. + CurrentRatePerSecond cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=current_rate_per_second,json=currentRatePerSecond,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"current_rate_per_second"` + // activated indicates whether SVIP is active. + Activated bool `protobuf:"varint,4,opt,name=activated,proto3" json:"activated,omitempty"` + // paused indicates whether SVIP is paused. + Paused bool `protobuf:"varint,5,opt,name=paused,proto3" json:"paused,omitempty"` + // activation_time is when SVIP was activated. + ActivationTime time.Time `protobuf:"bytes,6,opt,name=activation_time,json=activationTime,proto3,stdtime" json:"activation_time"` +} + +func (m *QueryPoolStateResponse) Reset() { *m = QueryPoolStateResponse{} } +func (m *QueryPoolStateResponse) String() string { return proto.CompactTextString(m) } +func (*QueryPoolStateResponse) ProtoMessage() {} +func (*QueryPoolStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fcdeace1067afd47, []int{3} +} +func (m *QueryPoolStateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPoolStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPoolStateResponse.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 *QueryPoolStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPoolStateResponse.Merge(m, src) +} +func (m *QueryPoolStateResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryPoolStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPoolStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPoolStateResponse proto.InternalMessageInfo + +func (m *QueryPoolStateResponse) GetPoolBalance() types.Coin { + if m != nil { + return m.PoolBalance + } + return types.Coin{} +} + +func (m *QueryPoolStateResponse) GetActivated() bool { + if m != nil { + return m.Activated + } + return false +} + +func (m *QueryPoolStateResponse) GetPaused() bool { + if m != nil { + return m.Paused + } + return false +} + +func (m *QueryPoolStateResponse) GetActivationTime() time.Time { + if m != nil { + return m.ActivationTime + } + return time.Time{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.svip.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.svip.v1.QueryParamsResponse") + proto.RegisterType((*QueryPoolStateRequest)(nil), "cosmos.svip.v1.QueryPoolStateRequest") + proto.RegisterType((*QueryPoolStateResponse)(nil), "cosmos.svip.v1.QueryPoolStateResponse") +} + +func init() { proto.RegisterFile("cosmos/svip/v1/query.proto", fileDescriptor_fcdeace1067afd47) } + +var fileDescriptor_fcdeace1067afd47 = []byte{ + // 586 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x3d, 0x6f, 0xd3, 0x4c, + 0x1c, 0x8f, 0xfb, 0x12, 0x35, 0xd7, 0x47, 0x7d, 0xe8, 0xd1, 0xa6, 0xa9, 0x29, 0x4e, 0xe5, 0x0a, + 0x54, 0x31, 0xdc, 0x29, 0x65, 0x42, 0x62, 0x32, 0x5d, 0x40, 0x20, 0x15, 0x97, 0xa9, 0x4b, 0x74, + 0x76, 0x0e, 0xf7, 0x44, 0x7c, 0xe7, 0xfa, 0xce, 0x16, 0x5d, 0x18, 0xd8, 0xd8, 0x2a, 0xf1, 0x25, + 0x18, 0xf9, 0x18, 0x1d, 0x2b, 0xb1, 0x20, 0x86, 0x82, 0x5a, 0x24, 0xbe, 0x03, 0x13, 0xba, 0x17, + 0x53, 0x35, 0x41, 0xb0, 0x44, 0xf6, 0xfd, 0xde, 0xfc, 0xbf, 0xff, 0x2f, 0xc0, 0x4f, 0x85, 0xcc, + 0x85, 0xc4, 0xb2, 0x66, 0x05, 0xae, 0x07, 0xf8, 0xa8, 0xa2, 0xe5, 0x31, 0x2a, 0x4a, 0xa1, 0x04, + 0x5c, 0xb2, 0x18, 0xd2, 0x18, 0xaa, 0x07, 0xfe, 0x32, 0xc9, 0x19, 0x17, 0xd8, 0xfc, 0x5a, 0x8a, + 0xbf, 0x3e, 0x21, 0x37, 0x54, 0x0b, 0xad, 0x64, 0x22, 0x13, 0xe6, 0x11, 0xeb, 0x27, 0x77, 0xba, + 0x91, 0x09, 0x91, 0x8d, 0x29, 0x26, 0x05, 0xc3, 0x84, 0x73, 0xa1, 0x88, 0x62, 0x82, 0x4b, 0x87, + 0xf6, 0x1d, 0x6a, 0xde, 0x92, 0xea, 0x25, 0x56, 0x2c, 0xa7, 0x52, 0x91, 0xbc, 0x31, 0x0d, 0x5c, + 0x5e, 0x42, 0x24, 0xc5, 0xf5, 0x20, 0xa1, 0x8a, 0x0c, 0x70, 0x2a, 0x18, 0xb7, 0x78, 0xb8, 0x02, + 0xe0, 0x73, 0x3d, 0xc1, 0x1e, 0x29, 0x49, 0x2e, 0x63, 0x7a, 0x54, 0x51, 0xa9, 0xc2, 0x3d, 0x70, + 0xf3, 0xda, 0xa9, 0x2c, 0x04, 0x97, 0x14, 0x3e, 0x00, 0xed, 0xc2, 0x9c, 0xf4, 0xbc, 0x4d, 0x6f, + 0x7b, 0x71, 0xa7, 0x8b, 0xae, 0x0f, 0x8c, 0x2c, 0x3f, 0xea, 0x9c, 0x9e, 0xf7, 0x5b, 0x1f, 0x7e, + 0x7c, 0xbc, 0xe7, 0xc5, 0x4e, 0x10, 0xae, 0x81, 0x55, 0xeb, 0x28, 0xc4, 0x78, 0x5f, 0x11, 0x45, + 0x9b, 0xa8, 0x77, 0xb3, 0xa0, 0x3b, 0x89, 0xb8, 0xb8, 0x08, 0xfc, 0x57, 0x08, 0x31, 0x1e, 0x26, + 0x64, 0x4c, 0x78, 0x4a, 0x5d, 0xe8, 0x7a, 0x13, 0xaa, 0x47, 0x42, 0x6e, 0x24, 0xf4, 0x48, 0x30, + 0x1e, 0xcd, 0xe9, 0xdc, 0x78, 0x51, 0x8b, 0x22, 0xab, 0x81, 0x4f, 0xc0, 0xb2, 0x12, 0x8a, 0x8c, + 0x87, 0x23, 0x26, 0x55, 0xc9, 0x92, 0x4a, 0xd1, 0x51, 0x6f, 0x66, 0xd3, 0xdb, 0xee, 0x44, 0xb7, + 0x35, 0xfb, 0xcb, 0x79, 0x7f, 0xd5, 0xfa, 0xc9, 0xd1, 0x2b, 0xc4, 0x04, 0xce, 0x89, 0x3a, 0x44, + 0x8f, 0xb9, 0x8a, 0x6f, 0x18, 0xdd, 0xee, 0x95, 0x0c, 0x1e, 0x80, 0xb5, 0xb4, 0x2a, 0x4b, 0xca, + 0xd5, 0xb0, 0x24, 0x8a, 0x0e, 0x0b, 0x5a, 0x0e, 0x25, 0x4d, 0x05, 0x1f, 0xf5, 0x66, 0x8d, 0xe3, + 0x96, 0x73, 0xbc, 0x35, 0xed, 0xf8, 0x94, 0x66, 0x24, 0x3d, 0xde, 0xa5, 0x69, 0xbc, 0xe2, 0x3c, + 0x62, 0xa2, 0xe8, 0x1e, 0x2d, 0xf7, 0x8d, 0x01, 0xdc, 0x00, 0x1d, 0x92, 0x2a, 0x56, 0x13, 0xfd, + 0x7d, 0x73, 0x9b, 0xde, 0xf6, 0x42, 0x7c, 0x75, 0x00, 0xbb, 0xfa, 0xe2, 0x2b, 0x49, 0x47, 0xbd, + 0x79, 0x03, 0xb9, 0x37, 0xf8, 0x0c, 0xfc, 0xef, 0x48, 0x4c, 0xf0, 0xa1, 0xde, 0x7d, 0xaf, 0x6d, + 0x2e, 0xc9, 0x47, 0xb6, 0x18, 0xa8, 0x29, 0x06, 0x7a, 0xd1, 0x14, 0x23, 0x5a, 0xd0, 0x5f, 0x79, + 0xf2, 0xb5, 0xef, 0xc5, 0x4b, 0x57, 0x62, 0x0d, 0xef, 0xfc, 0xf4, 0xc0, 0xbc, 0xd9, 0x05, 0x3c, + 0x02, 0x6d, 0xbb, 0x4b, 0x18, 0x4e, 0xee, 0x78, 0xba, 0x2e, 0xfe, 0xd6, 0x5f, 0x39, 0x76, 0x9b, + 0x61, 0xf0, 0xf6, 0xd3, 0xf7, 0xf7, 0x33, 0x3d, 0xd8, 0xc5, 0x13, 0x7f, 0x01, 0xdb, 0x10, 0xf8, + 0x06, 0x74, 0x7e, 0x57, 0x00, 0xde, 0xf9, 0xb3, 0xe3, 0x44, 0x79, 0xfc, 0xbb, 0xff, 0xa2, 0xb9, + 0xec, 0xd0, 0x64, 0x6f, 0x40, 0x7f, 0x2a, 0x5b, 0xf7, 0x4b, 0x6a, 0x6e, 0xf4, 0xf0, 0xf4, 0x22, + 0xf0, 0xce, 0x2e, 0x02, 0xef, 0xdb, 0x45, 0xe0, 0x9d, 0x5c, 0x06, 0xad, 0xb3, 0xcb, 0xa0, 0xf5, + 0xf9, 0x32, 0x68, 0x1d, 0x84, 0x19, 0x53, 0x87, 0x55, 0x82, 0x52, 0x91, 0x37, 0x7a, 0x5a, 0xe7, + 0xf8, 0xb5, 0x75, 0x51, 0xc7, 0x05, 0x95, 0x49, 0xdb, 0x5c, 0xf4, 0xfd, 0x5f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xa5, 0x62, 0xe6, 0x7b, 0x1f, 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 + +// 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 { + // Params queries the parameters of x/svip module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // PoolState queries the current SVIP pool balance, distribution stats, and + // reward rate. + PoolState(ctx context.Context, in *QueryPoolStateRequest, opts ...grpc.CallOption) (*QueryPoolStateResponse, 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, "/cosmos.svip.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) PoolState(ctx context.Context, in *QueryPoolStateRequest, opts ...grpc.CallOption) (*QueryPoolStateResponse, error) { + out := new(QueryPoolStateResponse) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Query/PoolState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params queries the parameters of x/svip module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // PoolState queries the current SVIP pool balance, distribution stats, and + // reward rate. + PoolState(context.Context, *QueryPoolStateRequest) (*QueryPoolStateResponse, 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) PoolState(ctx context.Context, req *QueryPoolStateRequest) (*QueryPoolStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PoolState 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: "/cosmos.svip.v1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_PoolState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPoolStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PoolState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.svip.v1.Query/PoolState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PoolState(ctx, req.(*QueryPoolStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.svip.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "PoolState", + Handler: _Query_PoolState_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/svip/v1/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 *QueryPoolStateRequest) 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 *QueryPoolStateRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPoolStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryPoolStateResponse) 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 *QueryPoolStateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPoolStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ActivationTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivationTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintQuery(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x32 + if m.Paused { + i-- + if m.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Activated { + i-- + if m.Activated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + { + size := m.CurrentRatePerSecond.Size() + i -= size + if _, err := m.CurrentRatePerSecond.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.TotalDistributed.Size() + i -= size + if _, err := m.TotalDistributed.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.PoolBalance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *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 *QueryPoolStateRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryPoolStateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PoolBalance.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.TotalDistributed.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.CurrentRatePerSecond.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.Activated { + n += 2 + } + if m.Paused { + n += 2 + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivationTime) + 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 *QueryPoolStateRequest) 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: QueryPoolStateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPoolStateRequest: 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 *QueryPoolStateResponse) 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: QueryPoolStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPoolStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolBalance", 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.PoolBalance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalDistributed", 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 + } + if err := m.TotalDistributed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentRatePerSecond", 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 + } + if err := m.CurrentRatePerSecond.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Activated", 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.Activated = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Paused", 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.Paused = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActivationTime", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.ActivationTime, 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/svip/types/query.pb.gw.go b/x/svip/types/query.pb.gw.go new file mode 100644 index 00000000..a2052090 --- /dev/null +++ b/x/svip/types/query.pb.gw.go @@ -0,0 +1,218 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/svip/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_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_PoolState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPoolStateRequest + var metadata runtime.ServerMetadata + + msg, err := client.PoolState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_PoolState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryPoolStateRequest + var metadata runtime.ServerMetadata + + msg, err := server.PoolState(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_PoolState_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_PoolState_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_PoolState_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_PoolState_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_PoolState_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_PoolState_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{"cosmos", "svip", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_PoolState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "svip", "v1", "pool_state"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_PoolState_0 = runtime.ForwardResponseMessage +) diff --git a/x/svip/types/svip.pb.go b/x/svip/types/svip.pb.go new file mode 100644 index 00000000..ee86760a --- /dev/null +++ b/x/svip/types/svip.pb.go @@ -0,0 +1,306 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/svip/v1/svip.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// Params defines the x/svip module parameters. +type Params struct { + // half_life_seconds is the half-life for exponential decay, in seconds. + HalfLifeSeconds int64 `protobuf:"varint,3,opt,name=half_life_seconds,json=halfLifeSeconds,proto3" json:"half_life_seconds"` +} + +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_37b8c507ba0d74ab, []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) GetHalfLifeSeconds() int64 { + if m != nil { + return m.HalfLifeSeconds + } + return 0 +} + +func init() { + proto.RegisterType((*Params)(nil), "cosmos.svip.v1.Params") +} + +func init() { proto.RegisterFile("cosmos/svip/v1/svip.proto", fileDescriptor_37b8c507ba0d74ab) } + +var fileDescriptor_37b8c507ba0d74ab = []byte{ + // 213 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x2f, 0x2e, 0xcb, 0x2c, 0xd0, 0x2f, 0x33, 0x04, 0xd3, 0x7a, 0x05, 0x45, 0xf9, + 0x25, 0xf9, 0x42, 0x7c, 0x10, 0x29, 0x3d, 0xb0, 0x50, 0x99, 0xa1, 0x94, 0x60, 0x62, 0x6e, 0x66, + 0x5e, 0xbe, 0x3e, 0x98, 0x84, 0x28, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, + 0x2c, 0x88, 0xa8, 0x52, 0x36, 0x17, 0x5b, 0x40, 0x62, 0x51, 0x62, 0x6e, 0xb1, 0x90, 0x1b, 0x97, + 0x60, 0x46, 0x62, 0x4e, 0x5a, 0x7c, 0x4e, 0x66, 0x5a, 0x6a, 0x7c, 0x71, 0x6a, 0x72, 0x7e, 0x5e, + 0x4a, 0xb1, 0x04, 0xb3, 0x02, 0xa3, 0x06, 0xb3, 0x93, 0xd4, 0xab, 0x7b, 0xf2, 0x98, 0x92, 0x2b, + 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0xe2, 0x07, 0x89, 0xfb, 0x64, 0xa6, 0xa5, 0x06, 0x43, 0x44, 0xad, + 0x24, 0xbb, 0x9e, 0x6f, 0xd0, 0x12, 0x81, 0x3a, 0xb5, 0x02, 0xe2, 0x58, 0x88, 0x15, 0x4e, 0x36, + 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, 0x94, 0x9e, 0x59, 0x92, 0x51, + 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0xd5, 0x9a, 0x5a, 0x96, 0x0b, 0xd3, 0x5e, 0x52, 0x59, + 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xb1, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xf7, 0x95, + 0x32, 0x07, 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.HalfLifeSeconds != 0 { + i = encodeVarintSvip(dAtA, i, uint64(m.HalfLifeSeconds)) + i-- + dAtA[i] = 0x18 + } + return len(dAtA) - i, nil +} + +func encodeVarintSvip(dAtA []byte, offset int, v uint64) int { + offset -= sovSvip(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 + if m.HalfLifeSeconds != 0 { + n += 1 + sovSvip(uint64(m.HalfLifeSeconds)) + } + return n +} + +func sovSvip(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSvip(x uint64) (n int) { + return sovSvip(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 ErrIntOverflowSvip + } + 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 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HalfLifeSeconds", wireType) + } + m.HalfLifeSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSvip + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HalfLifeSeconds |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSvip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSvip + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSvip(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, ErrIntOverflowSvip + } + 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, ErrIntOverflowSvip + } + 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, ErrIntOverflowSvip + } + 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, ErrInvalidLengthSvip + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSvip + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSvip + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSvip = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSvip = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSvip = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/svip/types/tx.pb.go b/x/svip/types/tx.pb.go new file mode 100644 index 00000000..59a3788a --- /dev/null +++ b/x/svip/types/tx.pb.go @@ -0,0 +1,2035 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/svip/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "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" + 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 Msg for updating the x/svip 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"` + // params defines the x/svip parameters to update. + // NOTE: Only half_life_seconds is configurable via this message. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_53f7d4525d63aef9, []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) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response for MsgUpdateParams. +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_53f7d4525d63aef9, []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 + +// MsgActivate activates SVIP reward distribution. Governance-only. +type MsgActivate struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgActivate) Reset() { *m = MsgActivate{} } +func (m *MsgActivate) String() string { return proto.CompactTextString(m) } +func (*MsgActivate) ProtoMessage() {} +func (*MsgActivate) Descriptor() ([]byte, []int) { + return fileDescriptor_53f7d4525d63aef9, []int{2} +} +func (m *MsgActivate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgActivate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgActivate.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 *MsgActivate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgActivate.Merge(m, src) +} +func (m *MsgActivate) XXX_Size() int { + return m.Size() +} +func (m *MsgActivate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgActivate.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgActivate proto.InternalMessageInfo + +func (m *MsgActivate) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +// MsgActivateResponse defines the response for MsgActivate. +type MsgActivateResponse struct { +} + +func (m *MsgActivateResponse) Reset() { *m = MsgActivateResponse{} } +func (m *MsgActivateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgActivateResponse) ProtoMessage() {} +func (*MsgActivateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_53f7d4525d63aef9, []int{3} +} +func (m *MsgActivateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgActivateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgActivateResponse.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 *MsgActivateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgActivateResponse.Merge(m, src) +} +func (m *MsgActivateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgActivateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgActivateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgActivateResponse proto.InternalMessageInfo + +// MsgReactivate restarts the decay curve with a fresh pool snapshot. +// Governance-only. Used after pool exhaustion and refund. +type MsgReactivate struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgReactivate) Reset() { *m = MsgReactivate{} } +func (m *MsgReactivate) String() string { return proto.CompactTextString(m) } +func (*MsgReactivate) ProtoMessage() {} +func (*MsgReactivate) Descriptor() ([]byte, []int) { + return fileDescriptor_53f7d4525d63aef9, []int{4} +} +func (m *MsgReactivate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReactivate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReactivate.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 *MsgReactivate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReactivate.Merge(m, src) +} +func (m *MsgReactivate) XXX_Size() int { + return m.Size() +} +func (m *MsgReactivate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReactivate.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReactivate proto.InternalMessageInfo + +func (m *MsgReactivate) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +// MsgReactivateResponse defines the response for MsgReactivate. +type MsgReactivateResponse struct { +} + +func (m *MsgReactivateResponse) Reset() { *m = MsgReactivateResponse{} } +func (m *MsgReactivateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgReactivateResponse) ProtoMessage() {} +func (*MsgReactivateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_53f7d4525d63aef9, []int{5} +} +func (m *MsgReactivateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReactivateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReactivateResponse.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 *MsgReactivateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReactivateResponse.Merge(m, src) +} +func (m *MsgReactivateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgReactivateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReactivateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReactivateResponse proto.InternalMessageInfo + +// MsgPause toggles the SVIP emergency pause flag. Governance-only. +type MsgPause struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // paused is the desired pause state. + Paused bool `protobuf:"varint,2,opt,name=paused,proto3" json:"paused,omitempty"` +} + +func (m *MsgPause) Reset() { *m = MsgPause{} } +func (m *MsgPause) String() string { return proto.CompactTextString(m) } +func (*MsgPause) ProtoMessage() {} +func (*MsgPause) Descriptor() ([]byte, []int) { + return fileDescriptor_53f7d4525d63aef9, []int{6} +} +func (m *MsgPause) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPause) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPause.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 *MsgPause) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPause.Merge(m, src) +} +func (m *MsgPause) XXX_Size() int { + return m.Size() +} +func (m *MsgPause) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPause.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPause proto.InternalMessageInfo + +func (m *MsgPause) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgPause) GetPaused() bool { + if m != nil { + return m.Paused + } + return false +} + +// MsgPauseResponse defines the response for MsgPause. +type MsgPauseResponse struct { +} + +func (m *MsgPauseResponse) Reset() { *m = MsgPauseResponse{} } +func (m *MsgPauseResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPauseResponse) ProtoMessage() {} +func (*MsgPauseResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_53f7d4525d63aef9, []int{7} +} +func (m *MsgPauseResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPauseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPauseResponse.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 *MsgPauseResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPauseResponse.Merge(m, src) +} +func (m *MsgPauseResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPauseResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPauseResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPauseResponse proto.InternalMessageInfo + +// MsgFundPool sends native tokens to the SVIP reward pool. Permissionless. +type MsgFundPool struct { + // depositor is the address funding the pool. + Depositor string `protobuf:"bytes,1,opt,name=depositor,proto3" json:"depositor,omitempty"` + // amount is the coins to transfer. Only the native denom is accepted. + Amount []types.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount"` +} + +func (m *MsgFundPool) Reset() { *m = MsgFundPool{} } +func (m *MsgFundPool) String() string { return proto.CompactTextString(m) } +func (*MsgFundPool) ProtoMessage() {} +func (*MsgFundPool) Descriptor() ([]byte, []int) { + return fileDescriptor_53f7d4525d63aef9, []int{8} +} +func (m *MsgFundPool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundPool.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 *MsgFundPool) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundPool.Merge(m, src) +} +func (m *MsgFundPool) XXX_Size() int { + return m.Size() +} +func (m *MsgFundPool) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundPool.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundPool proto.InternalMessageInfo + +func (m *MsgFundPool) GetDepositor() string { + if m != nil { + return m.Depositor + } + return "" +} + +func (m *MsgFundPool) GetAmount() []types.Coin { + if m != nil { + return m.Amount + } + return nil +} + +// MsgFundPoolResponse defines the response for MsgFundPool. +type MsgFundPoolResponse struct { +} + +func (m *MsgFundPoolResponse) Reset() { *m = MsgFundPoolResponse{} } +func (m *MsgFundPoolResponse) String() string { return proto.CompactTextString(m) } +func (*MsgFundPoolResponse) ProtoMessage() {} +func (*MsgFundPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_53f7d4525d63aef9, []int{9} +} +func (m *MsgFundPoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundPoolResponse.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 *MsgFundPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundPoolResponse.Merge(m, src) +} +func (m *MsgFundPoolResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgFundPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundPoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundPoolResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.svip.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.svip.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgActivate)(nil), "cosmos.svip.v1.MsgActivate") + proto.RegisterType((*MsgActivateResponse)(nil), "cosmos.svip.v1.MsgActivateResponse") + proto.RegisterType((*MsgReactivate)(nil), "cosmos.svip.v1.MsgReactivate") + proto.RegisterType((*MsgReactivateResponse)(nil), "cosmos.svip.v1.MsgReactivateResponse") + proto.RegisterType((*MsgPause)(nil), "cosmos.svip.v1.MsgPause") + proto.RegisterType((*MsgPauseResponse)(nil), "cosmos.svip.v1.MsgPauseResponse") + proto.RegisterType((*MsgFundPool)(nil), "cosmos.svip.v1.MsgFundPool") + proto.RegisterType((*MsgFundPoolResponse)(nil), "cosmos.svip.v1.MsgFundPoolResponse") +} + +func init() { proto.RegisterFile("cosmos/svip/v1/tx.proto", fileDescriptor_53f7d4525d63aef9) } + +var fileDescriptor_53f7d4525d63aef9 = []byte{ + // 571 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x41, 0x8b, 0xd3, 0x40, + 0x14, 0x6e, 0xb6, 0x6c, 0x69, 0xa7, 0xba, 0x6a, 0xdc, 0xdd, 0xb6, 0x91, 0xcd, 0x96, 0x8a, 0x58, + 0x0a, 0x26, 0xb6, 0x82, 0xe0, 0xb2, 0x97, 0xed, 0x82, 0x27, 0x0b, 0x25, 0xb2, 0x28, 0x5e, 0x64, + 0xda, 0x0c, 0xb3, 0x11, 0x93, 0x09, 0x79, 0x93, 0xb0, 0x7b, 0x13, 0x8f, 0x9e, 0x04, 0x8f, 0xfe, + 0x01, 0x8f, 0x3d, 0x88, 0xbf, 0x61, 0x8f, 0x8b, 0x27, 0x4f, 0x22, 0xed, 0xa1, 0x7f, 0x43, 0x92, + 0x4c, 0xd2, 0x26, 0xd6, 0x5d, 0x58, 0xf6, 0x52, 0x9a, 0xf9, 0xde, 0xfb, 0xbe, 0xef, 0xcd, 0xfb, + 0x18, 0x54, 0x1b, 0x33, 0xb0, 0x19, 0xe8, 0x10, 0x58, 0xae, 0x1e, 0x74, 0x75, 0x7e, 0xa2, 0xb9, + 0x1e, 0xe3, 0x4c, 0xde, 0x88, 0x01, 0x2d, 0x04, 0xb4, 0xa0, 0xab, 0xdc, 0xc1, 0xb6, 0xe5, 0x30, + 0x3d, 0xfa, 0x8d, 0x4b, 0x94, 0x46, 0xae, 0x37, 0x2a, 0x8d, 0xa1, 0x84, 0xd6, 0x06, 0x1a, 0x22, + 0x36, 0xd0, 0x6c, 0xcf, 0xdb, 0xe8, 0x4b, 0x17, 0x1a, 0x31, 0xb4, 0x49, 0x19, 0x65, 0xf1, 0x79, + 0xf8, 0x4f, 0x9c, 0xaa, 0x82, 0x69, 0x84, 0x81, 0xe8, 0x41, 0x77, 0x44, 0x38, 0xee, 0xea, 0x63, + 0x66, 0x39, 0x31, 0xde, 0xfa, 0x21, 0xa1, 0x5b, 0x03, 0xa0, 0x47, 0xae, 0x89, 0x39, 0x19, 0x62, + 0x0f, 0xdb, 0x20, 0x3f, 0x45, 0x15, 0xec, 0xf3, 0x63, 0xe6, 0x59, 0xfc, 0xb4, 0x2e, 0x35, 0xa5, + 0x76, 0xa5, 0x5f, 0xff, 0xf9, 0xfd, 0xd1, 0xa6, 0x90, 0x3b, 0x30, 0x4d, 0x8f, 0x00, 0xbc, 0xe4, + 0x9e, 0xe5, 0x50, 0x63, 0x51, 0x2a, 0x3f, 0x43, 0x25, 0x37, 0x62, 0xa8, 0xaf, 0x35, 0xa5, 0x76, + 0xb5, 0xb7, 0xad, 0x65, 0x2f, 0x41, 0x8b, 0xf9, 0xfb, 0x95, 0xb3, 0xdf, 0xbb, 0x85, 0x6f, 0xf3, + 0x49, 0x47, 0x32, 0x44, 0xc3, 0xde, 0xe3, 0x8f, 0xf3, 0x49, 0x67, 0x41, 0xf5, 0x69, 0x3e, 0xe9, + 0xec, 0x08, 0xe7, 0x27, 0xf1, 0x05, 0xe5, 0x4c, 0xb6, 0x1a, 0xa8, 0x96, 0x3b, 0x32, 0x08, 0xb8, + 0xcc, 0x01, 0xd2, 0x3a, 0x42, 0xd5, 0x01, 0xd0, 0x83, 0x31, 0xb7, 0x02, 0xcc, 0xc9, 0x55, 0xc7, + 0xd9, 0xdb, 0xc8, 0x7a, 0x6a, 0x6d, 0xa1, 0xbb, 0x4b, 0xb4, 0xa9, 0xda, 0x2b, 0x74, 0x73, 0x00, + 0xd4, 0x20, 0xf8, 0xba, 0xf5, 0x6a, 0x68, 0x2b, 0x43, 0x9c, 0x2a, 0xbe, 0x43, 0xe5, 0x01, 0xd0, + 0x21, 0xf6, 0xe1, 0xca, 0x62, 0xf2, 0x76, 0xb8, 0x2b, 0x1f, 0x88, 0x19, 0xed, 0xaa, 0x6c, 0x88, + 0xaf, 0x7f, 0x4c, 0xc8, 0xe8, 0x76, 0xa2, 0x95, 0xea, 0x7f, 0x91, 0xa2, 0x0b, 0x7e, 0xee, 0x3b, + 0xe6, 0x90, 0xb1, 0xf7, 0xa1, 0x07, 0x93, 0xb8, 0x0c, 0x2c, 0xce, 0xbc, 0xcb, 0x3d, 0xa4, 0xa5, + 0xf2, 0x3e, 0x2a, 0x61, 0x9b, 0xf9, 0x0e, 0xaf, 0xaf, 0x35, 0x8b, 0xed, 0x6a, 0xaf, 0x91, 0xe4, + 0x25, 0x0c, 0xab, 0x26, 0xc2, 0xaa, 0x1d, 0x32, 0xcb, 0xc9, 0x44, 0x26, 0xee, 0x11, 0x4e, 0x53, + 0x36, 0xb1, 0x9e, 0xc4, 0x54, 0x62, 0xb6, 0xf7, 0xb5, 0x88, 0x8a, 0x03, 0xa0, 0xf2, 0x6b, 0x74, + 0x23, 0x13, 0xf2, 0xdd, 0x7c, 0x38, 0x73, 0x69, 0x52, 0x1e, 0x5e, 0x52, 0x90, 0x28, 0xc8, 0x2f, + 0x50, 0x39, 0xcd, 0xda, 0xbd, 0x15, 0x4d, 0x09, 0xa8, 0xdc, 0xbf, 0x00, 0x4c, 0xd9, 0x0c, 0x84, + 0x96, 0xb2, 0xb4, 0xb3, 0xa2, 0x65, 0x01, 0x2b, 0x0f, 0x2e, 0x84, 0x53, 0xce, 0x43, 0xb4, 0x1e, + 0xa7, 0xa5, 0xbe, 0xa2, 0x3e, 0x42, 0x94, 0xe6, 0xff, 0x90, 0xe5, 0x31, 0xd3, 0x8d, 0xaf, 0x1a, + 0x33, 0x01, 0x57, 0x8e, 0x99, 0x5f, 0x8b, 0xb2, 0xfe, 0x21, 0x5c, 0x66, 0x7f, 0xff, 0x6c, 0xaa, + 0x4a, 0xe7, 0x53, 0x55, 0xfa, 0x33, 0x55, 0xa5, 0xcf, 0x33, 0xb5, 0x70, 0x3e, 0x53, 0x0b, 0xbf, + 0x66, 0x6a, 0xe1, 0x4d, 0x8b, 0x5a, 0xfc, 0xd8, 0x1f, 0x69, 0x63, 0x66, 0x8b, 0x77, 0x4e, 0x27, + 0x81, 0x9d, 0xbc, 0x06, 0xfc, 0xd4, 0x25, 0x30, 0x2a, 0x45, 0x6f, 0xd8, 0x93, 0xbf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x52, 0xb7, 0xef, 0x3f, 0x86, 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 + +// 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 updates the x/svip module parameters. Governance-only. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // Activate turns on reward distribution. Snapshots pool balance. + Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) + // Reactivate restarts the decay curve with a fresh pool snapshot. + Reactivate(ctx context.Context, in *MsgReactivate, opts ...grpc.CallOption) (*MsgReactivateResponse, error) + // Pause toggles the emergency pause flag. Governance-only. + Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) + // FundPool transfers native tokens into the SVIP pool. Permissionless. + FundPool(ctx context.Context, in *MsgFundPool, opts ...grpc.CallOption) (*MsgFundPoolResponse, 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, "/cosmos.svip.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Activate(ctx context.Context, in *MsgActivate, opts ...grpc.CallOption) (*MsgActivateResponse, error) { + out := new(MsgActivateResponse) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Msg/Activate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Reactivate(ctx context.Context, in *MsgReactivate, opts ...grpc.CallOption) (*MsgReactivateResponse, error) { + out := new(MsgReactivateResponse) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Msg/Reactivate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Pause(ctx context.Context, in *MsgPause, opts ...grpc.CallOption) (*MsgPauseResponse, error) { + out := new(MsgPauseResponse) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Msg/Pause", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FundPool(ctx context.Context, in *MsgFundPool, opts ...grpc.CallOption) (*MsgFundPoolResponse, error) { + out := new(MsgFundPoolResponse) + err := c.cc.Invoke(ctx, "/cosmos.svip.v1.Msg/FundPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams updates the x/svip module parameters. Governance-only. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // Activate turns on reward distribution. Snapshots pool balance. + Activate(context.Context, *MsgActivate) (*MsgActivateResponse, error) + // Reactivate restarts the decay curve with a fresh pool snapshot. + Reactivate(context.Context, *MsgReactivate) (*MsgReactivateResponse, error) + // Pause toggles the emergency pause flag. Governance-only. + Pause(context.Context, *MsgPause) (*MsgPauseResponse, error) + // FundPool transfers native tokens into the SVIP pool. Permissionless. + FundPool(context.Context, *MsgFundPool) (*MsgFundPoolResponse, 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) Activate(ctx context.Context, req *MsgActivate) (*MsgActivateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Activate not implemented") +} +func (*UnimplementedMsgServer) Reactivate(ctx context.Context, req *MsgReactivate) (*MsgReactivateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Reactivate not implemented") +} +func (*UnimplementedMsgServer) Pause(ctx context.Context, req *MsgPause) (*MsgPauseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Pause not implemented") +} +func (*UnimplementedMsgServer) FundPool(ctx context.Context, req *MsgFundPool) (*MsgFundPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundPool 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: "/cosmos.svip.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Activate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgActivate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Activate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.svip.v1.Msg/Activate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Activate(ctx, req.(*MsgActivate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Reactivate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReactivate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Reactivate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.svip.v1.Msg/Reactivate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Reactivate(ctx, req.(*MsgReactivate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Pause_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPause) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Pause(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.svip.v1.Msg/Pause", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Pause(ctx, req.(*MsgPause)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FundPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFundPool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FundPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.svip.v1.Msg/FundPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FundPool(ctx, req.(*MsgFundPool)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.svip.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "Activate", + Handler: _Msg_Activate_Handler, + }, + { + MethodName: "Reactivate", + Handler: _Msg_Reactivate_Handler, + }, + { + MethodName: "Pause", + Handler: _Msg_Pause_Handler, + }, + { + MethodName: "FundPool", + Handler: _Msg_FundPool_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/svip/v1/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 + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgActivate) 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 *MsgActivate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgActivate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *MsgActivateResponse) 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 *MsgActivateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgActivateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgReactivate) 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 *MsgReactivate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReactivate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *MsgReactivateResponse) 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 *MsgReactivateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReactivateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgPause) 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 *MsgPause) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPause) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Paused { + i-- + if m.Paused { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + 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 *MsgPauseResponse) 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 *MsgPauseResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPauseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgFundPool) 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 *MsgFundPool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgFundPoolResponse) 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 *MsgFundPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundPoolResponse) 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 = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgActivate) 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)) + } + return n +} + +func (m *MsgActivateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgReactivate) 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)) + } + return n +} + +func (m *MsgReactivateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgPause) 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)) + } + if m.Paused { + n += 2 + } + return n +} + +func (m *MsgPauseResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgFundPool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgFundPoolResponse) 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 Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgActivate) 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: MsgActivate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgActivate: 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 + 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 *MsgActivateResponse) 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: MsgActivateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgActivateResponse: 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 *MsgReactivate) 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: MsgReactivate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReactivate: 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 + 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 *MsgReactivateResponse) 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: MsgReactivateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReactivateResponse: 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 *MsgPause) 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: MsgPause: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPause: 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Paused", 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.Paused = 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 *MsgPauseResponse) 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: MsgPauseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPauseResponse: 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 *MsgFundPool) 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: MsgFundPool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundPool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Depositor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = append(m.Amount, types.Coin{}) + if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgFundPoolResponse) 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: MsgFundPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundPoolResponse: 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") +)