From 744ae290bf5b2264d86acf2a978641508782f157 Mon Sep 17 00:00:00 2001 From: John Letey Date: Tue, 21 May 2024 08:10:00 +0200 Subject: [PATCH] refactor: add events --- api/noble/forwarding/v1/events.pulsar.go | 2014 ++++++++++++++++++++++ proto/noble/forwarding/v1/events.proto | 38 + x/forwarding/keeper/keeper.go | 4 + x/forwarding/keeper/msg_server.go | 25 +- x/forwarding/module.go | 3 + x/forwarding/types/events.pb.go | 938 ++++++++++ 6 files changed, 3018 insertions(+), 4 deletions(-) create mode 100644 api/noble/forwarding/v1/events.pulsar.go create mode 100644 proto/noble/forwarding/v1/events.proto create mode 100644 x/forwarding/types/events.pb.go diff --git a/api/noble/forwarding/v1/events.pulsar.go b/api/noble/forwarding/v1/events.pulsar.go new file mode 100644 index 0000000..a0fdcb2 --- /dev/null +++ b/api/noble/forwarding/v1/events.pulsar.go @@ -0,0 +1,2014 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package forwardingv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_AccountRegistered protoreflect.MessageDescriptor + fd_AccountRegistered_address protoreflect.FieldDescriptor + fd_AccountRegistered_channel protoreflect.FieldDescriptor + fd_AccountRegistered_recipient protoreflect.FieldDescriptor + fd_AccountRegistered_fallback protoreflect.FieldDescriptor +) + +func init() { + file_noble_forwarding_v1_events_proto_init() + md_AccountRegistered = File_noble_forwarding_v1_events_proto.Messages().ByName("AccountRegistered") + fd_AccountRegistered_address = md_AccountRegistered.Fields().ByName("address") + fd_AccountRegistered_channel = md_AccountRegistered.Fields().ByName("channel") + fd_AccountRegistered_recipient = md_AccountRegistered.Fields().ByName("recipient") + fd_AccountRegistered_fallback = md_AccountRegistered.Fields().ByName("fallback") +} + +var _ protoreflect.Message = (*fastReflection_AccountRegistered)(nil) + +type fastReflection_AccountRegistered AccountRegistered + +func (x *AccountRegistered) ProtoReflect() protoreflect.Message { + return (*fastReflection_AccountRegistered)(x) +} + +func (x *AccountRegistered) slowProtoReflect() protoreflect.Message { + mi := &file_noble_forwarding_v1_events_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_AccountRegistered_messageType fastReflection_AccountRegistered_messageType +var _ protoreflect.MessageType = fastReflection_AccountRegistered_messageType{} + +type fastReflection_AccountRegistered_messageType struct{} + +func (x fastReflection_AccountRegistered_messageType) Zero() protoreflect.Message { + return (*fastReflection_AccountRegistered)(nil) +} +func (x fastReflection_AccountRegistered_messageType) New() protoreflect.Message { + return new(fastReflection_AccountRegistered) +} +func (x fastReflection_AccountRegistered_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AccountRegistered +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AccountRegistered) Descriptor() protoreflect.MessageDescriptor { + return md_AccountRegistered +} + +// 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_AccountRegistered) Type() protoreflect.MessageType { + return _fastReflection_AccountRegistered_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AccountRegistered) New() protoreflect.Message { + return new(fastReflection_AccountRegistered) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AccountRegistered) Interface() protoreflect.ProtoMessage { + return (*AccountRegistered)(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_AccountRegistered) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_AccountRegistered_address, value) { + return + } + } + if x.Channel != "" { + value := protoreflect.ValueOfString(x.Channel) + if !f(fd_AccountRegistered_channel, value) { + return + } + } + if x.Recipient != "" { + value := protoreflect.ValueOfString(x.Recipient) + if !f(fd_AccountRegistered_recipient, value) { + return + } + } + if x.Fallback != "" { + value := protoreflect.ValueOfString(x.Fallback) + if !f(fd_AccountRegistered_fallback, 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_AccountRegistered) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "noble.forwarding.v1.AccountRegistered.address": + return x.Address != "" + case "noble.forwarding.v1.AccountRegistered.channel": + return x.Channel != "" + case "noble.forwarding.v1.AccountRegistered.recipient": + return x.Recipient != "" + case "noble.forwarding.v1.AccountRegistered.fallback": + return x.Fallback != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountRegistered")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountRegistered 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_AccountRegistered) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "noble.forwarding.v1.AccountRegistered.address": + x.Address = "" + case "noble.forwarding.v1.AccountRegistered.channel": + x.Channel = "" + case "noble.forwarding.v1.AccountRegistered.recipient": + x.Recipient = "" + case "noble.forwarding.v1.AccountRegistered.fallback": + x.Fallback = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountRegistered")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountRegistered 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_AccountRegistered) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "noble.forwarding.v1.AccountRegistered.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "noble.forwarding.v1.AccountRegistered.channel": + value := x.Channel + return protoreflect.ValueOfString(value) + case "noble.forwarding.v1.AccountRegistered.recipient": + value := x.Recipient + return protoreflect.ValueOfString(value) + case "noble.forwarding.v1.AccountRegistered.fallback": + value := x.Fallback + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountRegistered")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountRegistered 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_AccountRegistered) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "noble.forwarding.v1.AccountRegistered.address": + x.Address = value.Interface().(string) + case "noble.forwarding.v1.AccountRegistered.channel": + x.Channel = value.Interface().(string) + case "noble.forwarding.v1.AccountRegistered.recipient": + x.Recipient = value.Interface().(string) + case "noble.forwarding.v1.AccountRegistered.fallback": + x.Fallback = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountRegistered")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountRegistered 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_AccountRegistered) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "noble.forwarding.v1.AccountRegistered.address": + panic(fmt.Errorf("field address of message noble.forwarding.v1.AccountRegistered is not mutable")) + case "noble.forwarding.v1.AccountRegistered.channel": + panic(fmt.Errorf("field channel of message noble.forwarding.v1.AccountRegistered is not mutable")) + case "noble.forwarding.v1.AccountRegistered.recipient": + panic(fmt.Errorf("field recipient of message noble.forwarding.v1.AccountRegistered is not mutable")) + case "noble.forwarding.v1.AccountRegistered.fallback": + panic(fmt.Errorf("field fallback of message noble.forwarding.v1.AccountRegistered is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountRegistered")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountRegistered 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_AccountRegistered) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "noble.forwarding.v1.AccountRegistered.address": + return protoreflect.ValueOfString("") + case "noble.forwarding.v1.AccountRegistered.channel": + return protoreflect.ValueOfString("") + case "noble.forwarding.v1.AccountRegistered.recipient": + return protoreflect.ValueOfString("") + case "noble.forwarding.v1.AccountRegistered.fallback": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountRegistered")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountRegistered 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_AccountRegistered) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in noble.forwarding.v1.AccountRegistered", 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_AccountRegistered) 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_AccountRegistered) 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_AccountRegistered) 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_AccountRegistered) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AccountRegistered) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Channel) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Recipient) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Fallback) + 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().(*AccountRegistered) + 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.Fallback) > 0 { + i -= len(x.Fallback) + copy(dAtA[i:], x.Fallback) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Fallback))) + i-- + dAtA[i] = 0x22 + } + if len(x.Recipient) > 0 { + i -= len(x.Recipient) + copy(dAtA[i:], x.Recipient) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Recipient))) + i-- + dAtA[i] = 0x1a + } + if len(x.Channel) > 0 { + i -= len(x.Channel) + copy(dAtA[i:], x.Channel) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Channel))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*AccountRegistered) + 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: AccountRegistered: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountRegistered: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Channel", 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.Channel = 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 Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Fallback", 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.Fallback = 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_AccountCleared protoreflect.MessageDescriptor + fd_AccountCleared_address protoreflect.FieldDescriptor + fd_AccountCleared_recipient protoreflect.FieldDescriptor +) + +func init() { + file_noble_forwarding_v1_events_proto_init() + md_AccountCleared = File_noble_forwarding_v1_events_proto.Messages().ByName("AccountCleared") + fd_AccountCleared_address = md_AccountCleared.Fields().ByName("address") + fd_AccountCleared_recipient = md_AccountCleared.Fields().ByName("recipient") +} + +var _ protoreflect.Message = (*fastReflection_AccountCleared)(nil) + +type fastReflection_AccountCleared AccountCleared + +func (x *AccountCleared) ProtoReflect() protoreflect.Message { + return (*fastReflection_AccountCleared)(x) +} + +func (x *AccountCleared) slowProtoReflect() protoreflect.Message { + mi := &file_noble_forwarding_v1_events_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_AccountCleared_messageType fastReflection_AccountCleared_messageType +var _ protoreflect.MessageType = fastReflection_AccountCleared_messageType{} + +type fastReflection_AccountCleared_messageType struct{} + +func (x fastReflection_AccountCleared_messageType) Zero() protoreflect.Message { + return (*fastReflection_AccountCleared)(nil) +} +func (x fastReflection_AccountCleared_messageType) New() protoreflect.Message { + return new(fastReflection_AccountCleared) +} +func (x fastReflection_AccountCleared_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AccountCleared +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AccountCleared) Descriptor() protoreflect.MessageDescriptor { + return md_AccountCleared +} + +// 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_AccountCleared) Type() protoreflect.MessageType { + return _fastReflection_AccountCleared_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AccountCleared) New() protoreflect.Message { + return new(fastReflection_AccountCleared) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AccountCleared) Interface() protoreflect.ProtoMessage { + return (*AccountCleared)(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_AccountCleared) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_AccountCleared_address, value) { + return + } + } + if x.Recipient != "" { + value := protoreflect.ValueOfString(x.Recipient) + if !f(fd_AccountCleared_recipient, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_AccountCleared) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "noble.forwarding.v1.AccountCleared.address": + return x.Address != "" + case "noble.forwarding.v1.AccountCleared.recipient": + return x.Recipient != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountCleared")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountCleared 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_AccountCleared) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "noble.forwarding.v1.AccountCleared.address": + x.Address = "" + case "noble.forwarding.v1.AccountCleared.recipient": + x.Recipient = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountCleared")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountCleared 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_AccountCleared) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "noble.forwarding.v1.AccountCleared.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "noble.forwarding.v1.AccountCleared.recipient": + value := x.Recipient + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountCleared")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountCleared 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_AccountCleared) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "noble.forwarding.v1.AccountCleared.address": + x.Address = value.Interface().(string) + case "noble.forwarding.v1.AccountCleared.recipient": + x.Recipient = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountCleared")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountCleared 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_AccountCleared) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "noble.forwarding.v1.AccountCleared.address": + panic(fmt.Errorf("field address of message noble.forwarding.v1.AccountCleared is not mutable")) + case "noble.forwarding.v1.AccountCleared.recipient": + panic(fmt.Errorf("field recipient of message noble.forwarding.v1.AccountCleared is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountCleared")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountCleared 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_AccountCleared) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "noble.forwarding.v1.AccountCleared.address": + return protoreflect.ValueOfString("") + case "noble.forwarding.v1.AccountCleared.recipient": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AccountCleared")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AccountCleared 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_AccountCleared) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in noble.forwarding.v1.AccountCleared", 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_AccountCleared) 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_AccountCleared) 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_AccountCleared) 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_AccountCleared) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AccountCleared) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Recipient) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*AccountCleared) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Recipient) > 0 { + i -= len(x.Recipient) + copy(dAtA[i:], x.Recipient) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Recipient))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*AccountCleared) + 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: AccountCleared: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AccountCleared: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_AllowedDenomsConfigured_1_list)(nil) + +type _AllowedDenomsConfigured_1_list struct { + list *[]string +} + +func (x *_AllowedDenomsConfigured_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_AllowedDenomsConfigured_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_AllowedDenomsConfigured_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_AllowedDenomsConfigured_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_AllowedDenomsConfigured_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message AllowedDenomsConfigured at list field PreviousDenoms as it is not of Message kind")) +} + +func (x *_AllowedDenomsConfigured_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_AllowedDenomsConfigured_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_AllowedDenomsConfigured_1_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_AllowedDenomsConfigured_2_list)(nil) + +type _AllowedDenomsConfigured_2_list struct { + list *[]string +} + +func (x *_AllowedDenomsConfigured_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_AllowedDenomsConfigured_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_AllowedDenomsConfigured_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_AllowedDenomsConfigured_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_AllowedDenomsConfigured_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message AllowedDenomsConfigured at list field CurrentDenoms as it is not of Message kind")) +} + +func (x *_AllowedDenomsConfigured_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_AllowedDenomsConfigured_2_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_AllowedDenomsConfigured_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_AllowedDenomsConfigured protoreflect.MessageDescriptor + fd_AllowedDenomsConfigured_previous_denoms protoreflect.FieldDescriptor + fd_AllowedDenomsConfigured_current_denoms protoreflect.FieldDescriptor +) + +func init() { + file_noble_forwarding_v1_events_proto_init() + md_AllowedDenomsConfigured = File_noble_forwarding_v1_events_proto.Messages().ByName("AllowedDenomsConfigured") + fd_AllowedDenomsConfigured_previous_denoms = md_AllowedDenomsConfigured.Fields().ByName("previous_denoms") + fd_AllowedDenomsConfigured_current_denoms = md_AllowedDenomsConfigured.Fields().ByName("current_denoms") +} + +var _ protoreflect.Message = (*fastReflection_AllowedDenomsConfigured)(nil) + +type fastReflection_AllowedDenomsConfigured AllowedDenomsConfigured + +func (x *AllowedDenomsConfigured) ProtoReflect() protoreflect.Message { + return (*fastReflection_AllowedDenomsConfigured)(x) +} + +func (x *AllowedDenomsConfigured) slowProtoReflect() protoreflect.Message { + mi := &file_noble_forwarding_v1_events_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_AllowedDenomsConfigured_messageType fastReflection_AllowedDenomsConfigured_messageType +var _ protoreflect.MessageType = fastReflection_AllowedDenomsConfigured_messageType{} + +type fastReflection_AllowedDenomsConfigured_messageType struct{} + +func (x fastReflection_AllowedDenomsConfigured_messageType) Zero() protoreflect.Message { + return (*fastReflection_AllowedDenomsConfigured)(nil) +} +func (x fastReflection_AllowedDenomsConfigured_messageType) New() protoreflect.Message { + return new(fastReflection_AllowedDenomsConfigured) +} +func (x fastReflection_AllowedDenomsConfigured_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_AllowedDenomsConfigured +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_AllowedDenomsConfigured) Descriptor() protoreflect.MessageDescriptor { + return md_AllowedDenomsConfigured +} + +// 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_AllowedDenomsConfigured) Type() protoreflect.MessageType { + return _fastReflection_AllowedDenomsConfigured_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_AllowedDenomsConfigured) New() protoreflect.Message { + return new(fastReflection_AllowedDenomsConfigured) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_AllowedDenomsConfigured) Interface() protoreflect.ProtoMessage { + return (*AllowedDenomsConfigured)(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_AllowedDenomsConfigured) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.PreviousDenoms) != 0 { + value := protoreflect.ValueOfList(&_AllowedDenomsConfigured_1_list{list: &x.PreviousDenoms}) + if !f(fd_AllowedDenomsConfigured_previous_denoms, value) { + return + } + } + if len(x.CurrentDenoms) != 0 { + value := protoreflect.ValueOfList(&_AllowedDenomsConfigured_2_list{list: &x.CurrentDenoms}) + if !f(fd_AllowedDenomsConfigured_current_denoms, 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_AllowedDenomsConfigured) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "noble.forwarding.v1.AllowedDenomsConfigured.previous_denoms": + return len(x.PreviousDenoms) != 0 + case "noble.forwarding.v1.AllowedDenomsConfigured.current_denoms": + return len(x.CurrentDenoms) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AllowedDenomsConfigured")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AllowedDenomsConfigured 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_AllowedDenomsConfigured) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "noble.forwarding.v1.AllowedDenomsConfigured.previous_denoms": + x.PreviousDenoms = nil + case "noble.forwarding.v1.AllowedDenomsConfigured.current_denoms": + x.CurrentDenoms = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AllowedDenomsConfigured")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AllowedDenomsConfigured 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_AllowedDenomsConfigured) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "noble.forwarding.v1.AllowedDenomsConfigured.previous_denoms": + if len(x.PreviousDenoms) == 0 { + return protoreflect.ValueOfList(&_AllowedDenomsConfigured_1_list{}) + } + listValue := &_AllowedDenomsConfigured_1_list{list: &x.PreviousDenoms} + return protoreflect.ValueOfList(listValue) + case "noble.forwarding.v1.AllowedDenomsConfigured.current_denoms": + if len(x.CurrentDenoms) == 0 { + return protoreflect.ValueOfList(&_AllowedDenomsConfigured_2_list{}) + } + listValue := &_AllowedDenomsConfigured_2_list{list: &x.CurrentDenoms} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AllowedDenomsConfigured")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AllowedDenomsConfigured 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_AllowedDenomsConfigured) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "noble.forwarding.v1.AllowedDenomsConfigured.previous_denoms": + lv := value.List() + clv := lv.(*_AllowedDenomsConfigured_1_list) + x.PreviousDenoms = *clv.list + case "noble.forwarding.v1.AllowedDenomsConfigured.current_denoms": + lv := value.List() + clv := lv.(*_AllowedDenomsConfigured_2_list) + x.CurrentDenoms = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AllowedDenomsConfigured")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AllowedDenomsConfigured 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_AllowedDenomsConfigured) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "noble.forwarding.v1.AllowedDenomsConfigured.previous_denoms": + if x.PreviousDenoms == nil { + x.PreviousDenoms = []string{} + } + value := &_AllowedDenomsConfigured_1_list{list: &x.PreviousDenoms} + return protoreflect.ValueOfList(value) + case "noble.forwarding.v1.AllowedDenomsConfigured.current_denoms": + if x.CurrentDenoms == nil { + x.CurrentDenoms = []string{} + } + value := &_AllowedDenomsConfigured_2_list{list: &x.CurrentDenoms} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AllowedDenomsConfigured")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AllowedDenomsConfigured 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_AllowedDenomsConfigured) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "noble.forwarding.v1.AllowedDenomsConfigured.previous_denoms": + list := []string{} + return protoreflect.ValueOfList(&_AllowedDenomsConfigured_1_list{list: &list}) + case "noble.forwarding.v1.AllowedDenomsConfigured.current_denoms": + list := []string{} + return protoreflect.ValueOfList(&_AllowedDenomsConfigured_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: noble.forwarding.v1.AllowedDenomsConfigured")) + } + panic(fmt.Errorf("message noble.forwarding.v1.AllowedDenomsConfigured 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_AllowedDenomsConfigured) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in noble.forwarding.v1.AllowedDenomsConfigured", 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_AllowedDenomsConfigured) 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_AllowedDenomsConfigured) 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_AllowedDenomsConfigured) 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_AllowedDenomsConfigured) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*AllowedDenomsConfigured) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.PreviousDenoms) > 0 { + for _, s := range x.PreviousDenoms { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CurrentDenoms) > 0 { + for _, s := range x.CurrentDenoms { + l = len(s) + 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().(*AllowedDenomsConfigured) + 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.CurrentDenoms) > 0 { + for iNdEx := len(x.CurrentDenoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CurrentDenoms[iNdEx]) + copy(dAtA[i:], x.CurrentDenoms[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CurrentDenoms[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.PreviousDenoms) > 0 { + for iNdEx := len(x.PreviousDenoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.PreviousDenoms[iNdEx]) + copy(dAtA[i:], x.PreviousDenoms[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PreviousDenoms[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*AllowedDenomsConfigured) + 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: AllowedDenomsConfigured: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AllowedDenomsConfigured: 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 PreviousDenoms", 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.PreviousDenoms = append(x.PreviousDenoms, 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 CurrentDenoms", 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.CurrentDenoms = append(x.CurrentDenoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: noble/forwarding/v1/events.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) +) + +// AccountRegistered is emitted whenever a new forwarding account is registered. +type AccountRegistered struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address is the address of the forwarding account. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // channel is the channel id that funds are forwarded through. + Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` + // recipient is the address of the recipient of forwards. + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` + // fallback is the address of the fallback account. + Fallback string `protobuf:"bytes,4,opt,name=fallback,proto3" json:"fallback,omitempty"` +} + +func (x *AccountRegistered) Reset() { + *x = AccountRegistered{} + if protoimpl.UnsafeEnabled { + mi := &file_noble_forwarding_v1_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountRegistered) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountRegistered) ProtoMessage() {} + +// Deprecated: Use AccountRegistered.ProtoReflect.Descriptor instead. +func (*AccountRegistered) Descriptor() ([]byte, []int) { + return file_noble_forwarding_v1_events_proto_rawDescGZIP(), []int{0} +} + +func (x *AccountRegistered) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *AccountRegistered) GetChannel() string { + if x != nil { + return x.Channel + } + return "" +} + +func (x *AccountRegistered) GetRecipient() string { + if x != nil { + return x.Recipient + } + return "" +} + +func (x *AccountRegistered) GetFallback() string { + if x != nil { + return x.Fallback + } + return "" +} + +// AccountCleared is emitted whenever a forwarding account is cleared. +type AccountCleared struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // address is the address of the forwarding account. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // recipient is the address of the fallback account. + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (x *AccountCleared) Reset() { + *x = AccountCleared{} + if protoimpl.UnsafeEnabled { + mi := &file_noble_forwarding_v1_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountCleared) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountCleared) ProtoMessage() {} + +// Deprecated: Use AccountCleared.ProtoReflect.Descriptor instead. +func (*AccountCleared) Descriptor() ([]byte, []int) { + return file_noble_forwarding_v1_events_proto_rawDescGZIP(), []int{1} +} + +func (x *AccountCleared) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *AccountCleared) GetRecipient() string { + if x != nil { + return x.Recipient + } + return "" +} + +// AllowedDenomsConfigured is emitted whenever the allowed denoms are updated. +type AllowedDenomsConfigured struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // previous_denoms is the list of previously allowed denoms. + PreviousDenoms []string `protobuf:"bytes,1,rep,name=previous_denoms,json=previousDenoms,proto3" json:"previous_denoms,omitempty"` + // current_denoms is the list of currently allowed denoms. + CurrentDenoms []string `protobuf:"bytes,2,rep,name=current_denoms,json=currentDenoms,proto3" json:"current_denoms,omitempty"` +} + +func (x *AllowedDenomsConfigured) Reset() { + *x = AllowedDenomsConfigured{} + if protoimpl.UnsafeEnabled { + mi := &file_noble_forwarding_v1_events_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AllowedDenomsConfigured) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AllowedDenomsConfigured) ProtoMessage() {} + +// Deprecated: Use AllowedDenomsConfigured.ProtoReflect.Descriptor instead. +func (*AllowedDenomsConfigured) Descriptor() ([]byte, []int) { + return file_noble_forwarding_v1_events_proto_rawDescGZIP(), []int{2} +} + +func (x *AllowedDenomsConfigured) GetPreviousDenoms() []string { + if x != nil { + return x.PreviousDenoms + } + return nil +} + +func (x *AllowedDenomsConfigured) GetCurrentDenoms() []string { + if x != nil { + return x.CurrentDenoms + } + return nil +} + +var File_noble_forwarding_v1_events_proto protoreflect.FileDescriptor + +var file_noble_forwarding_v1_events_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x6e, 0x6f, 0x62, 0x6c, 0x65, 0x2f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, + 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x13, 0x6e, 0x6f, 0x62, 0x6c, 0x65, 0x2e, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, + 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x22, 0x81, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x65, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x22, 0x48, 0x0a, 0x0e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x65, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, + 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x22, 0x69, 0x0a, 0x17, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, + 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x64, + 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x76, 0x69, + 0x6f, 0x75, 0x73, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, + 0x42, 0xe0, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x6f, 0x62, 0x6c, 0x65, 0x2e, 0x66, + 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x6f, 0x62, 0x6c, 0x65, 0x2d, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x2f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, + 0x76, 0x32, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x6f, 0x62, 0x6c, 0x65, 0x2f, 0x66, 0x6f, 0x72, + 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x6f, 0x72, 0x77, 0x61, + 0x72, 0x64, 0x69, 0x6e, 0x67, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, 0x46, 0x58, 0xaa, 0x02, 0x13, + 0x4e, 0x6f, 0x62, 0x6c, 0x65, 0x2e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x4e, 0x6f, 0x62, 0x6c, 0x65, 0x5c, 0x46, 0x6f, 0x72, 0x77, + 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x4e, 0x6f, 0x62, 0x6c, + 0x65, 0x5c, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x4e, 0x6f, + 0x62, 0x6c, 0x65, 0x3a, 0x3a, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_noble_forwarding_v1_events_proto_rawDescOnce sync.Once + file_noble_forwarding_v1_events_proto_rawDescData = file_noble_forwarding_v1_events_proto_rawDesc +) + +func file_noble_forwarding_v1_events_proto_rawDescGZIP() []byte { + file_noble_forwarding_v1_events_proto_rawDescOnce.Do(func() { + file_noble_forwarding_v1_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_noble_forwarding_v1_events_proto_rawDescData) + }) + return file_noble_forwarding_v1_events_proto_rawDescData +} + +var file_noble_forwarding_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_noble_forwarding_v1_events_proto_goTypes = []interface{}{ + (*AccountRegistered)(nil), // 0: noble.forwarding.v1.AccountRegistered + (*AccountCleared)(nil), // 1: noble.forwarding.v1.AccountCleared + (*AllowedDenomsConfigured)(nil), // 2: noble.forwarding.v1.AllowedDenomsConfigured +} +var file_noble_forwarding_v1_events_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_noble_forwarding_v1_events_proto_init() } +func file_noble_forwarding_v1_events_proto_init() { + if File_noble_forwarding_v1_events_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_noble_forwarding_v1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountRegistered); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_noble_forwarding_v1_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountCleared); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_noble_forwarding_v1_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AllowedDenomsConfigured); 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_noble_forwarding_v1_events_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_noble_forwarding_v1_events_proto_goTypes, + DependencyIndexes: file_noble_forwarding_v1_events_proto_depIdxs, + MessageInfos: file_noble_forwarding_v1_events_proto_msgTypes, + }.Build() + File_noble_forwarding_v1_events_proto = out.File + file_noble_forwarding_v1_events_proto_rawDesc = nil + file_noble_forwarding_v1_events_proto_goTypes = nil + file_noble_forwarding_v1_events_proto_depIdxs = nil +} diff --git a/proto/noble/forwarding/v1/events.proto b/proto/noble/forwarding/v1/events.proto new file mode 100644 index 0000000..6e6fd0d --- /dev/null +++ b/proto/noble/forwarding/v1/events.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package noble.forwarding.v1; + +option go_package = "github.com/noble-assets/forwarding/v2/x/forwarding/types"; + +// AccountRegistered is emitted whenever a new forwarding account is registered. +message AccountRegistered { + // address is the address of the forwarding account. + string address = 1; + + // channel is the channel id that funds are forwarded through. + string channel = 2; + + // recipient is the address of the recipient of forwards. + string recipient = 3; + + // fallback is the address of the fallback account. + string fallback = 4; +} + +// AccountCleared is emitted whenever a forwarding account is cleared. +message AccountCleared { + // address is the address of the forwarding account. + string address = 1; + + // recipient is the address of the fallback account. + string recipient = 2; +} + +// AllowedDenomsConfigured is emitted whenever the allowed denoms are updated. +message AllowedDenomsConfigured { + // previous_denoms is the list of previously allowed denoms. + repeated string previous_denoms = 1; + + // current_denoms is the list of currently allowed denoms. + repeated string current_denoms = 2; +} diff --git a/x/forwarding/keeper/keeper.go b/x/forwarding/keeper/keeper.go index 767aa64..e7b2bc4 100644 --- a/x/forwarding/keeper/keeper.go +++ b/x/forwarding/keeper/keeper.go @@ -5,6 +5,7 @@ import ( "fmt" "cosmossdk.io/collections" + "cosmossdk.io/core/event" "cosmossdk.io/core/header" "cosmossdk.io/core/store" "cosmossdk.io/log" @@ -23,6 +24,7 @@ type Keeper struct { storeService store.KVStoreService transientService store.TransientStoreService headerService header.Service + eventService event.Service authority string @@ -47,6 +49,7 @@ func NewKeeper( storeService store.KVStoreService, transientService store.TransientStoreService, headerService header.Service, + eventService event.Service, authority string, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, @@ -62,6 +65,7 @@ func NewKeeper( storeService: storeService, transientService: transientService, headerService: headerService, + eventService: eventService, authority: authority, diff --git a/x/forwarding/keeper/msg_server.go b/x/forwarding/keeper/msg_server.go index 2cd5241..61d21ef 100644 --- a/x/forwarding/keeper/msg_server.go +++ b/x/forwarding/keeper/msg_server.go @@ -66,7 +66,12 @@ func (k *Keeper) RegisterAccount(ctx context.Context, msg *types.MsgRegisterAcco } } - return &types.MsgRegisterAccountResponse{Address: address.String()}, nil + return &types.MsgRegisterAccountResponse{Address: address.String()}, k.eventService.EventManager(ctx).Emit(ctx, &types.AccountRegistered{ + Address: address.String(), + Channel: msg.Channel, + Recipient: msg.Recipient, + Fallback: msg.Fallback, + }) } base := k.accountKeeper.NewAccountWithAddress(ctx, address) @@ -81,7 +86,12 @@ func (k *Keeper) RegisterAccount(ctx context.Context, msg *types.MsgRegisterAcco k.accountKeeper.SetAccount(ctx, &account) k.IncrementNumOfAccounts(ctx, msg.Channel) - return &types.MsgRegisterAccountResponse{Address: address.String()}, nil + return &types.MsgRegisterAccountResponse{Address: address.String()}, k.eventService.EventManager(ctx).Emit(ctx, &types.AccountRegistered{ + Address: address.String(), + Channel: account.Channel, + Recipient: account.Recipient, + Fallback: account.Fallback, + }) } func (k *Keeper) ClearAccount(ctx context.Context, msg *types.MsgClearAccount) (*types.MsgClearAccountResponse, error) { @@ -118,7 +128,10 @@ func (k *Keeper) ClearAccount(ctx context.Context, msg *types.MsgClearAccount) ( return nil, errors.New("failed to clear balance to fallback account") } - return &types.MsgClearAccountResponse{}, nil + return &types.MsgClearAccountResponse{}, k.eventService.EventManager(ctx).Emit(ctx, &types.AccountCleared{ + Address: msg.Address, + Recipient: account.Fallback, + }) } func (k *Keeper) SetAllowedDenoms(ctx context.Context, msg *types.MsgSetAllowedDenoms) (*types.MsgSetAllowedDenomsResponse, error) { @@ -130,6 +143,7 @@ func (k *Keeper) SetAllowedDenoms(ctx context.Context, msg *types.MsgSetAllowedD return nil, sdkerrors.Wrap(types.ErrInvalidDenoms, err.Error()) } + previousDenoms := k.GetAllowedDenoms(ctx) if err := k.AllowedDenoms.Clear(ctx, nil); err != nil { return nil, errors.New("failed to clear allowed denoms from state") } @@ -140,5 +154,8 @@ func (k *Keeper) SetAllowedDenoms(ctx context.Context, msg *types.MsgSetAllowedD } } - return &types.MsgSetAllowedDenomsResponse{}, nil + return &types.MsgSetAllowedDenomsResponse{}, k.eventService.EventManager(ctx).Emit(ctx, &types.AllowedDenomsConfigured{ + PreviousDenoms: previousDenoms, + CurrentDenoms: msg.Denoms, + }) } diff --git a/x/forwarding/module.go b/x/forwarding/module.go index d488910..ce6eb5d 100644 --- a/x/forwarding/module.go +++ b/x/forwarding/module.go @@ -7,6 +7,7 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/event" "cosmossdk.io/core/header" "cosmossdk.io/core/store" "cosmossdk.io/depinject" @@ -220,6 +221,7 @@ type ModuleInputs struct { StoreService store.KVStoreService TransientService store.TransientStoreService HeaderService header.Service + EventService event.Service AccountKeeper types.AccountKeeper BankKeeper types.BankKeeper @@ -245,6 +247,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { in.StoreService, in.TransientService, in.HeaderService, + in.EventService, authority.String(), in.AccountKeeper, in.BankKeeper, diff --git a/x/forwarding/types/events.pb.go b/x/forwarding/types/events.pb.go new file mode 100644 index 0000000..41fd45e --- /dev/null +++ b/x/forwarding/types/events.pb.go @@ -0,0 +1,938 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: noble/forwarding/v1/events.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// AccountRegistered is emitted whenever a new forwarding account is registered. +type AccountRegistered struct { + // address is the address of the forwarding account. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // channel is the channel id that funds are forwarded through. + Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` + // recipient is the address of the recipient of forwards. + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` + // fallback is the address of the fallback account. + Fallback string `protobuf:"bytes,4,opt,name=fallback,proto3" json:"fallback,omitempty"` +} + +func (m *AccountRegistered) Reset() { *m = AccountRegistered{} } +func (m *AccountRegistered) String() string { return proto.CompactTextString(m) } +func (*AccountRegistered) ProtoMessage() {} +func (*AccountRegistered) Descriptor() ([]byte, []int) { + return fileDescriptor_f58759da7cd78060, []int{0} +} +func (m *AccountRegistered) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AccountRegistered) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccountRegistered.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 *AccountRegistered) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountRegistered.Merge(m, src) +} +func (m *AccountRegistered) XXX_Size() int { + return m.Size() +} +func (m *AccountRegistered) XXX_DiscardUnknown() { + xxx_messageInfo_AccountRegistered.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountRegistered proto.InternalMessageInfo + +func (m *AccountRegistered) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *AccountRegistered) GetChannel() string { + if m != nil { + return m.Channel + } + return "" +} + +func (m *AccountRegistered) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *AccountRegistered) GetFallback() string { + if m != nil { + return m.Fallback + } + return "" +} + +// AccountCleared is emitted whenever a forwarding account is cleared. +type AccountCleared struct { + // address is the address of the forwarding account. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // recipient is the address of the fallback account. + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (m *AccountCleared) Reset() { *m = AccountCleared{} } +func (m *AccountCleared) String() string { return proto.CompactTextString(m) } +func (*AccountCleared) ProtoMessage() {} +func (*AccountCleared) Descriptor() ([]byte, []int) { + return fileDescriptor_f58759da7cd78060, []int{1} +} +func (m *AccountCleared) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AccountCleared) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccountCleared.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 *AccountCleared) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountCleared.Merge(m, src) +} +func (m *AccountCleared) XXX_Size() int { + return m.Size() +} +func (m *AccountCleared) XXX_DiscardUnknown() { + xxx_messageInfo_AccountCleared.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountCleared proto.InternalMessageInfo + +func (m *AccountCleared) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *AccountCleared) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +// AllowedDenomsConfigured is emitted whenever the allowed denoms are updated. +type AllowedDenomsConfigured struct { + // previous_denoms is the list of previously allowed denoms. + PreviousDenoms []string `protobuf:"bytes,1,rep,name=previous_denoms,json=previousDenoms,proto3" json:"previous_denoms,omitempty"` + // current_denoms is the list of currently allowed denoms. + CurrentDenoms []string `protobuf:"bytes,2,rep,name=current_denoms,json=currentDenoms,proto3" json:"current_denoms,omitempty"` +} + +func (m *AllowedDenomsConfigured) Reset() { *m = AllowedDenomsConfigured{} } +func (m *AllowedDenomsConfigured) String() string { return proto.CompactTextString(m) } +func (*AllowedDenomsConfigured) ProtoMessage() {} +func (*AllowedDenomsConfigured) Descriptor() ([]byte, []int) { + return fileDescriptor_f58759da7cd78060, []int{2} +} +func (m *AllowedDenomsConfigured) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllowedDenomsConfigured) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AllowedDenomsConfigured.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 *AllowedDenomsConfigured) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllowedDenomsConfigured.Merge(m, src) +} +func (m *AllowedDenomsConfigured) XXX_Size() int { + return m.Size() +} +func (m *AllowedDenomsConfigured) XXX_DiscardUnknown() { + xxx_messageInfo_AllowedDenomsConfigured.DiscardUnknown(m) +} + +var xxx_messageInfo_AllowedDenomsConfigured proto.InternalMessageInfo + +func (m *AllowedDenomsConfigured) GetPreviousDenoms() []string { + if m != nil { + return m.PreviousDenoms + } + return nil +} + +func (m *AllowedDenomsConfigured) GetCurrentDenoms() []string { + if m != nil { + return m.CurrentDenoms + } + return nil +} + +func init() { + proto.RegisterType((*AccountRegistered)(nil), "noble.forwarding.v1.AccountRegistered") + proto.RegisterType((*AccountCleared)(nil), "noble.forwarding.v1.AccountCleared") + proto.RegisterType((*AllowedDenomsConfigured)(nil), "noble.forwarding.v1.AllowedDenomsConfigured") +} + +func init() { proto.RegisterFile("noble/forwarding/v1/events.proto", fileDescriptor_f58759da7cd78060) } + +var fileDescriptor_f58759da7cd78060 = []byte{ + // 309 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0x31, 0x4f, 0x32, 0x31, + 0x18, 0xc7, 0x29, 0xbc, 0x79, 0x95, 0x26, 0x62, 0x3c, 0x07, 0x1b, 0x63, 0x1a, 0x42, 0x62, 0x64, + 0xf1, 0x2e, 0xe8, 0xe2, 0x8a, 0x38, 0x38, 0xdf, 0xe8, 0x62, 0x7a, 0xed, 0xc3, 0xd1, 0x58, 0xda, + 0x4b, 0xdb, 0x3b, 0x74, 0xf4, 0x1b, 0xf8, 0xb1, 0x1c, 0x19, 0x1d, 0x0d, 0x7c, 0x11, 0x43, 0xe1, + 0x44, 0x1c, 0x1c, 0xff, 0xcf, 0xef, 0xd7, 0xfe, 0x9b, 0x3e, 0xb8, 0xab, 0x4d, 0xa6, 0x20, 0x19, + 0x1b, 0x3b, 0x63, 0x56, 0x48, 0x9d, 0x27, 0xd5, 0x20, 0x81, 0x0a, 0xb4, 0x77, 0x71, 0x61, 0x8d, + 0x37, 0xd1, 0x71, 0x30, 0xe2, 0xad, 0x11, 0x57, 0x83, 0xde, 0x2b, 0xc2, 0x47, 0x43, 0xce, 0x4d, + 0xa9, 0x7d, 0x0a, 0xb9, 0x74, 0x1e, 0x2c, 0x88, 0x88, 0xe0, 0x3d, 0x26, 0x84, 0x05, 0xe7, 0x08, + 0xea, 0xa2, 0x7e, 0x3b, 0xad, 0xe3, 0x8a, 0xf0, 0x09, 0xd3, 0x1a, 0x14, 0x69, 0xae, 0xc9, 0x26, + 0x46, 0x67, 0xb8, 0x6d, 0x81, 0xcb, 0x42, 0x82, 0xf6, 0xa4, 0x15, 0xd8, 0x76, 0x10, 0x9d, 0xe2, + 0xfd, 0x31, 0x53, 0x2a, 0x63, 0xfc, 0x89, 0xfc, 0x0b, 0xf0, 0x3b, 0xf7, 0xee, 0x71, 0x67, 0xf3, + 0x84, 0x91, 0x02, 0xf6, 0x77, 0xff, 0x4e, 0x4b, 0xf3, 0x57, 0x4b, 0x4f, 0xe2, 0x93, 0xa1, 0x52, + 0x66, 0x06, 0xe2, 0x0e, 0xb4, 0x99, 0xba, 0x91, 0xd1, 0x63, 0x99, 0x97, 0xab, 0x2b, 0x2f, 0xf0, + 0x61, 0x61, 0xa1, 0x92, 0xa6, 0x74, 0x8f, 0x22, 0x40, 0x82, 0xba, 0xad, 0x7e, 0x3b, 0xed, 0xd4, + 0xe3, 0xf5, 0x91, 0xe8, 0x1c, 0x77, 0x78, 0x69, 0x2d, 0x68, 0x5f, 0x7b, 0xcd, 0xe0, 0x1d, 0x6c, + 0xa6, 0x6b, 0xed, 0x36, 0x7d, 0x5f, 0x50, 0x34, 0x5f, 0x50, 0xf4, 0xb9, 0xa0, 0xe8, 0x6d, 0x49, + 0x1b, 0xf3, 0x25, 0x6d, 0x7c, 0x2c, 0x69, 0xe3, 0xe1, 0x26, 0x97, 0x7e, 0x52, 0x66, 0x31, 0x37, + 0xd3, 0x24, 0x7c, 0xf9, 0x25, 0x73, 0x0e, 0xbc, 0xdb, 0xd9, 0xcd, 0x55, 0xf2, 0xfc, 0x33, 0xfb, + 0x97, 0x02, 0x5c, 0xf6, 0x3f, 0x2c, 0xea, 0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x2f, 0xc1, + 0xb8, 0xcc, 0x01, 0x00, 0x00, +} + +func (m *AccountRegistered) 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 *AccountRegistered) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccountRegistered) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Fallback) > 0 { + i -= len(m.Fallback) + copy(dAtA[i:], m.Fallback) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Fallback))) + i-- + dAtA[i] = 0x22 + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x1a + } + if len(m.Channel) > 0 { + i -= len(m.Channel) + copy(dAtA[i:], m.Channel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Channel))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AccountCleared) 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 *AccountCleared) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccountCleared) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AllowedDenomsConfigured) 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 *AllowedDenomsConfigured) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllowedDenomsConfigured) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CurrentDenoms) > 0 { + for iNdEx := len(m.CurrentDenoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CurrentDenoms[iNdEx]) + copy(dAtA[i:], m.CurrentDenoms[iNdEx]) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CurrentDenoms[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.PreviousDenoms) > 0 { + for iNdEx := len(m.PreviousDenoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PreviousDenoms[iNdEx]) + copy(dAtA[i:], m.PreviousDenoms[iNdEx]) + i = encodeVarintEvents(dAtA, i, uint64(len(m.PreviousDenoms[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AccountRegistered) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Channel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Fallback) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *AccountCleared) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *AllowedDenomsConfigured) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PreviousDenoms) > 0 { + for _, s := range m.PreviousDenoms { + l = len(s) + n += 1 + l + sovEvents(uint64(l)) + } + } + if len(m.CurrentDenoms) > 0 { + for _, s := range m.CurrentDenoms { + l = len(s) + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AccountRegistered) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AccountRegistered: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccountRegistered: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fallback", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fallback = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AccountCleared) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AccountCleared: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccountCleared: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllowedDenomsConfigured) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllowedDenomsConfigured: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllowedDenomsConfigured: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviousDenoms", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PreviousDenoms = append(m.PreviousDenoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentDenoms", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CurrentDenoms = append(m.CurrentDenoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +)