diff --git a/api/regen/data/v1/events.pulsar.go b/api/regen/data/v1/events.pulsar.go index d87f881c81..efd874e6e0 100644 --- a/api/regen/data/v1/events.pulsar.go +++ b/api/regen/data/v1/events.pulsar.go @@ -916,6 +916,878 @@ func (x *fastReflection_EventAttest) ProtoMethods() *protoiface.Methods { } } +var ( + md_EventDefineResolver protoreflect.MessageDescriptor + fd_EventDefineResolver_id protoreflect.FieldDescriptor +) + +func init() { + file_regen_data_v1_events_proto_init() + md_EventDefineResolver = File_regen_data_v1_events_proto.Messages().ByName("EventDefineResolver") + fd_EventDefineResolver_id = md_EventDefineResolver.Fields().ByName("id") +} + +var _ protoreflect.Message = (*fastReflection_EventDefineResolver)(nil) + +type fastReflection_EventDefineResolver EventDefineResolver + +func (x *EventDefineResolver) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventDefineResolver)(x) +} + +func (x *EventDefineResolver) slowProtoReflect() protoreflect.Message { + mi := &file_regen_data_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_EventDefineResolver_messageType fastReflection_EventDefineResolver_messageType +var _ protoreflect.MessageType = fastReflection_EventDefineResolver_messageType{} + +type fastReflection_EventDefineResolver_messageType struct{} + +func (x fastReflection_EventDefineResolver_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventDefineResolver)(nil) +} +func (x fastReflection_EventDefineResolver_messageType) New() protoreflect.Message { + return new(fastReflection_EventDefineResolver) +} +func (x fastReflection_EventDefineResolver_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventDefineResolver +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventDefineResolver) Descriptor() protoreflect.MessageDescriptor { + return md_EventDefineResolver +} + +// 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_EventDefineResolver) Type() protoreflect.MessageType { + return _fastReflection_EventDefineResolver_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventDefineResolver) New() protoreflect.Message { + return new(fastReflection_EventDefineResolver) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventDefineResolver) Interface() protoreflect.ProtoMessage { + return (*EventDefineResolver)(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_EventDefineResolver) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_EventDefineResolver_id, 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_EventDefineResolver) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "regen.data.v1.EventDefineResolver.id": + return x.Id != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventDefineResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventDefineResolver 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_EventDefineResolver) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "regen.data.v1.EventDefineResolver.id": + x.Id = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventDefineResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventDefineResolver 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_EventDefineResolver) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "regen.data.v1.EventDefineResolver.id": + value := x.Id + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventDefineResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventDefineResolver 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_EventDefineResolver) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "regen.data.v1.EventDefineResolver.id": + x.Id = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventDefineResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventDefineResolver 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_EventDefineResolver) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.data.v1.EventDefineResolver.id": + panic(fmt.Errorf("field id of message regen.data.v1.EventDefineResolver is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventDefineResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventDefineResolver 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_EventDefineResolver) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.data.v1.EventDefineResolver.id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventDefineResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventDefineResolver 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_EventDefineResolver) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.data.v1.EventDefineResolver", 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_EventDefineResolver) 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_EventDefineResolver) 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_EventDefineResolver) 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_EventDefineResolver) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventDefineResolver) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) + } + 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().(*EventDefineResolver) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Id != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + i-- + dAtA[i] = 0x8 + } + 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().(*EventDefineResolver) + 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: EventDefineResolver: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventDefineResolver: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + x.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventRegisterResolver protoreflect.MessageDescriptor + fd_EventRegisterResolver_id protoreflect.FieldDescriptor + fd_EventRegisterResolver_iri protoreflect.FieldDescriptor +) + +func init() { + file_regen_data_v1_events_proto_init() + md_EventRegisterResolver = File_regen_data_v1_events_proto.Messages().ByName("EventRegisterResolver") + fd_EventRegisterResolver_id = md_EventRegisterResolver.Fields().ByName("id") + fd_EventRegisterResolver_iri = md_EventRegisterResolver.Fields().ByName("iri") +} + +var _ protoreflect.Message = (*fastReflection_EventRegisterResolver)(nil) + +type fastReflection_EventRegisterResolver EventRegisterResolver + +func (x *EventRegisterResolver) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventRegisterResolver)(x) +} + +func (x *EventRegisterResolver) slowProtoReflect() protoreflect.Message { + mi := &file_regen_data_v1_events_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventRegisterResolver_messageType fastReflection_EventRegisterResolver_messageType +var _ protoreflect.MessageType = fastReflection_EventRegisterResolver_messageType{} + +type fastReflection_EventRegisterResolver_messageType struct{} + +func (x fastReflection_EventRegisterResolver_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventRegisterResolver)(nil) +} +func (x fastReflection_EventRegisterResolver_messageType) New() protoreflect.Message { + return new(fastReflection_EventRegisterResolver) +} +func (x fastReflection_EventRegisterResolver_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventRegisterResolver +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventRegisterResolver) Descriptor() protoreflect.MessageDescriptor { + return md_EventRegisterResolver +} + +// 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_EventRegisterResolver) Type() protoreflect.MessageType { + return _fastReflection_EventRegisterResolver_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventRegisterResolver) New() protoreflect.Message { + return new(fastReflection_EventRegisterResolver) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventRegisterResolver) Interface() protoreflect.ProtoMessage { + return (*EventRegisterResolver)(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_EventRegisterResolver) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_EventRegisterResolver_id, value) { + return + } + } + if x.Iri != "" { + value := protoreflect.ValueOfString(x.Iri) + if !f(fd_EventRegisterResolver_iri, 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_EventRegisterResolver) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "regen.data.v1.EventRegisterResolver.id": + return x.Id != uint64(0) + case "regen.data.v1.EventRegisterResolver.iri": + return x.Iri != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventRegisterResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventRegisterResolver 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_EventRegisterResolver) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "regen.data.v1.EventRegisterResolver.id": + x.Id = uint64(0) + case "regen.data.v1.EventRegisterResolver.iri": + x.Iri = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventRegisterResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventRegisterResolver 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_EventRegisterResolver) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "regen.data.v1.EventRegisterResolver.id": + value := x.Id + return protoreflect.ValueOfUint64(value) + case "regen.data.v1.EventRegisterResolver.iri": + value := x.Iri + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventRegisterResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventRegisterResolver 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_EventRegisterResolver) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "regen.data.v1.EventRegisterResolver.id": + x.Id = value.Uint() + case "regen.data.v1.EventRegisterResolver.iri": + x.Iri = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventRegisterResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventRegisterResolver 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_EventRegisterResolver) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.data.v1.EventRegisterResolver.id": + panic(fmt.Errorf("field id of message regen.data.v1.EventRegisterResolver is not mutable")) + case "regen.data.v1.EventRegisterResolver.iri": + panic(fmt.Errorf("field iri of message regen.data.v1.EventRegisterResolver is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventRegisterResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventRegisterResolver 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_EventRegisterResolver) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.data.v1.EventRegisterResolver.id": + return protoreflect.ValueOfUint64(uint64(0)) + case "regen.data.v1.EventRegisterResolver.iri": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.data.v1.EventRegisterResolver")) + } + panic(fmt.Errorf("message regen.data.v1.EventRegisterResolver 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_EventRegisterResolver) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.data.v1.EventRegisterResolver", 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_EventRegisterResolver) 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_EventRegisterResolver) 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_EventRegisterResolver) 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_EventRegisterResolver) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventRegisterResolver) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) + } + l = len(x.Iri) + 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().(*EventRegisterResolver) + 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.Iri) > 0 { + i -= len(x.Iri) + copy(dAtA[i:], x.Iri) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Iri))) + i-- + dAtA[i] = 0x12 + } + if x.Id != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + i-- + dAtA[i] = 0x8 + } + 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().(*EventRegisterResolver) + 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: EventRegisterResolver: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRegisterResolver: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + x.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Iri", 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.Iri = 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 @@ -1013,6 +1885,89 @@ func (x *EventAttest) GetAttestor() string { return "" } +// EventDefineResolver is an event emitted when a resolved is defined on chain. +type EventDefineResolver struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id is the ID of the defined resolver. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *EventDefineResolver) Reset() { + *x = EventDefineResolver{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_data_v1_events_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventDefineResolver) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventDefineResolver) ProtoMessage() {} + +// Deprecated: Use EventDefineResolver.ProtoReflect.Descriptor instead. +func (*EventDefineResolver) Descriptor() ([]byte, []int) { + return file_regen_data_v1_events_proto_rawDescGZIP(), []int{2} +} + +func (x *EventDefineResolver) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +// EventRegisterResolver is an event emitted when data is registered to a resolver on chain. +type EventRegisterResolver struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id is the ID of the resolver that the data was registered to. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // iri is the IRI of the data that was registered. + Iri string `protobuf:"bytes,2,opt,name=iri,proto3" json:"iri,omitempty"` +} + +func (x *EventRegisterResolver) Reset() { + *x = EventRegisterResolver{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_data_v1_events_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventRegisterResolver) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventRegisterResolver) ProtoMessage() {} + +// Deprecated: Use EventRegisterResolver.ProtoReflect.Descriptor instead. +func (*EventRegisterResolver) Descriptor() ([]byte, []int) { + return file_regen_data_v1_events_proto_rawDescGZIP(), []int{3} +} + +func (x *EventRegisterResolver) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *EventRegisterResolver) GetIri() string { + if x != nil { + return x.Iri + } + return "" +} + var File_regen_data_v1_events_proto protoreflect.FileDescriptor var file_regen_data_v1_events_proto_rawDesc = []byte{ @@ -1024,19 +1979,25 @@ var file_regen_data_v1_events_proto_rawDesc = []byte{ 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x72, 0x69, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x42, 0xb6, 0x01, 0x0a, 0x11, 0x63, 0x6f, - 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x42, - 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, - 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, 0x6c, - 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, - 0x64, 0x61, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x61, 0x74, 0x61, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x52, 0x44, 0x58, 0xaa, 0x02, 0x0d, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x44, 0x61, 0x74, - 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x44, 0x61, 0x74, - 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x44, 0x61, 0x74, - 0x61, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x0f, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x44, 0x61, 0x74, 0x61, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x08, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x22, 0x25, 0x0a, 0x13, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x39, 0x0a, 0x15, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x72, 0x69, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x72, 0x69, 0x42, 0xb6, 0x01, 0x0a, 0x11, + 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x76, + 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, + 0x65, 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, + 0x6e, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x61, 0x74, 0x61, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x52, 0x44, 0x58, 0xaa, 0x02, 0x0d, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x44, + 0x61, 0x74, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x44, + 0x61, 0x74, 0x61, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0f, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x44, 0x61, 0x74, 0x61, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1051,10 +2012,12 @@ func file_regen_data_v1_events_proto_rawDescGZIP() []byte { return file_regen_data_v1_events_proto_rawDescData } -var file_regen_data_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_regen_data_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_regen_data_v1_events_proto_goTypes = []interface{}{ - (*EventAnchor)(nil), // 0: regen.data.v1.EventAnchor - (*EventAttest)(nil), // 1: regen.data.v1.EventAttest + (*EventAnchor)(nil), // 0: regen.data.v1.EventAnchor + (*EventAttest)(nil), // 1: regen.data.v1.EventAttest + (*EventDefineResolver)(nil), // 2: regen.data.v1.EventDefineResolver + (*EventRegisterResolver)(nil), // 3: regen.data.v1.EventRegisterResolver } var file_regen_data_v1_events_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -1094,6 +2057,30 @@ func file_regen_data_v1_events_proto_init() { return nil } } + file_regen_data_v1_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventDefineResolver); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_regen_data_v1_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventRegisterResolver); 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{ @@ -1101,7 +2088,7 @@ func file_regen_data_v1_events_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_regen_data_v1_events_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/regen/data/v1/events.proto b/proto/regen/data/v1/events.proto index a1afb0ea5c..e59b389bcc 100644 --- a/proto/regen/data/v1/events.proto +++ b/proto/regen/data/v1/events.proto @@ -19,3 +19,18 @@ message EventAttest { // the data. string attestor = 2; } + +// EventDefineResolver is an event emitted when a resolved is defined on chain. +message EventDefineResolver { + // id is the ID of the defined resolver. + uint64 id = 1; +} + +// EventRegisterResolver is an event emitted when data is registered to a resolver on chain. +message EventRegisterResolver { + // id is the ID of the resolver that the data was registered to. + uint64 id = 1; + + // iri is the IRI of the data that was registered. + string iri = 2; +} diff --git a/x/data/events.pb.go b/x/data/events.pb.go index bf169841a4..c533fafd61 100644 --- a/x/data/events.pb.go +++ b/x/data/events.pb.go @@ -124,27 +124,133 @@ func (m *EventAttest) GetAttestor() string { return "" } +// EventDefineResolver is an event emitted when a resolved is defined on chain. +type EventDefineResolver struct { + // id is the ID of the defined resolver. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *EventDefineResolver) Reset() { *m = EventDefineResolver{} } +func (m *EventDefineResolver) String() string { return proto.CompactTextString(m) } +func (*EventDefineResolver) ProtoMessage() {} +func (*EventDefineResolver) Descriptor() ([]byte, []int) { + return fileDescriptor_3e110e0930a307df, []int{2} +} +func (m *EventDefineResolver) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventDefineResolver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventDefineResolver.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 *EventDefineResolver) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDefineResolver.Merge(m, src) +} +func (m *EventDefineResolver) XXX_Size() int { + return m.Size() +} +func (m *EventDefineResolver) XXX_DiscardUnknown() { + xxx_messageInfo_EventDefineResolver.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDefineResolver proto.InternalMessageInfo + +func (m *EventDefineResolver) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +// EventRegisterResolver is an event emitted when data is registered to a resolver on chain. +type EventRegisterResolver struct { + // id is the ID of the resolver that the data was registered to. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // iri is the IRI of the data that was registered. + Iri string `protobuf:"bytes,2,opt,name=iri,proto3" json:"iri,omitempty"` +} + +func (m *EventRegisterResolver) Reset() { *m = EventRegisterResolver{} } +func (m *EventRegisterResolver) String() string { return proto.CompactTextString(m) } +func (*EventRegisterResolver) ProtoMessage() {} +func (*EventRegisterResolver) Descriptor() ([]byte, []int) { + return fileDescriptor_3e110e0930a307df, []int{3} +} +func (m *EventRegisterResolver) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRegisterResolver) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRegisterResolver.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 *EventRegisterResolver) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRegisterResolver.Merge(m, src) +} +func (m *EventRegisterResolver) XXX_Size() int { + return m.Size() +} +func (m *EventRegisterResolver) XXX_DiscardUnknown() { + xxx_messageInfo_EventRegisterResolver.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRegisterResolver proto.InternalMessageInfo + +func (m *EventRegisterResolver) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *EventRegisterResolver) GetIri() string { + if m != nil { + return m.Iri + } + return "" +} + func init() { proto.RegisterType((*EventAnchor)(nil), "regen.data.v1.EventAnchor") proto.RegisterType((*EventAttest)(nil), "regen.data.v1.EventAttest") + proto.RegisterType((*EventDefineResolver)(nil), "regen.data.v1.EventDefineResolver") + proto.RegisterType((*EventRegisterResolver)(nil), "regen.data.v1.EventRegisterResolver") } func init() { proto.RegisterFile("regen/data/v1/events.proto", fileDescriptor_3e110e0930a307df) } var fileDescriptor_3e110e0930a307df = []byte{ - // 184 bytes of a gzipped FileDescriptorProto + // 239 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0x4a, 0x4d, 0x4f, 0xcd, 0xd3, 0x4f, 0x49, 0x2c, 0x49, 0xd4, 0x2f, 0x33, 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x05, 0xcb, 0xe9, 0x81, 0xe4, 0xf4, 0xca, 0x0c, 0x95, 0xe4, 0xb9, 0xb8, 0x5d, 0x41, 0xd2, 0x8e, 0x79, 0xc9, 0x19, 0xf9, 0x45, 0x42, 0x02, 0x5c, 0xcc, 0x99, 0x45, 0x99, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x20, 0xa6, 0x92, 0x35, 0x4c, 0x41, 0x49, 0x49, 0x6a, 0x71, 0x09, 0xa6, 0x02, 0x21, 0x29, 0x2e, 0x8e, 0x44, 0xb0, 0x5c, 0x7e, - 0x91, 0x04, 0x13, 0x58, 0x18, 0xce, 0x77, 0x72, 0x3b, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, - 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, - 0x39, 0x86, 0x28, 0x9d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xb0, - 0x8b, 0x74, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xa1, 0xbc, 0x9c, 0xd4, 0x94, 0xf4, 0xd4, - 0x22, 0xfd, 0x0a, 0xb0, 0x27, 0x92, 0xd8, 0xc0, 0x6e, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, - 0x83, 0x85, 0x5e, 0x98, 0xd9, 0x00, 0x00, 0x00, + 0x91, 0x04, 0x13, 0x58, 0x18, 0xce, 0x57, 0x52, 0xe5, 0x12, 0x06, 0x6b, 0x76, 0x49, 0x4d, 0xcb, + 0xcc, 0x4b, 0x0d, 0x4a, 0x2d, 0xce, 0xcf, 0x29, 0x4b, 0x2d, 0x12, 0xe2, 0xe3, 0x62, 0xca, 0x4c, + 0x01, 0x9b, 0xc1, 0x12, 0xc4, 0x94, 0x99, 0xa2, 0x64, 0xc9, 0x25, 0x0a, 0x56, 0x16, 0x94, 0x9a, + 0x9e, 0x59, 0x5c, 0x92, 0x5a, 0x84, 0x4b, 0x21, 0xcc, 0x76, 0x26, 0xb8, 0xed, 0x4e, 0x6e, 0x27, + 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, + 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x93, 0x9e, 0x59, 0x92, 0x51, 0x9a, + 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0xf6, 0xb3, 0x6e, 0x5e, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0x36, + 0x94, 0x97, 0x93, 0x9a, 0x92, 0x9e, 0x5a, 0xa4, 0x5f, 0x01, 0x0e, 0xa6, 0x24, 0x36, 0x70, 0xe8, + 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x69, 0x64, 0x71, 0x3b, 0x01, 0x00, 0x00, } func (m *EventAnchor) Marshal() (dAtA []byte, err error) { @@ -214,6 +320,69 @@ func (m *EventAttest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventDefineResolver) 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 *EventDefineResolver) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventDefineResolver) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventRegisterResolver) 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 *EventRegisterResolver) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRegisterResolver) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Iri) > 0 { + i -= len(m.Iri) + copy(dAtA[i:], m.Iri) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Iri))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -255,6 +424,34 @@ func (m *EventAttest) Size() (n int) { return n } +func (m *EventDefineResolver) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovEvents(uint64(m.Id)) + } + return n +} + +func (m *EventRegisterResolver) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovEvents(uint64(m.Id)) + } + l = len(m.Iri) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -457,6 +654,176 @@ func (m *EventAttest) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventDefineResolver) 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: EventDefineResolver: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventDefineResolver: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *EventRegisterResolver) 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: EventRegisterResolver: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRegisterResolver: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Iri", 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.Iri = 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 diff --git a/x/data/server/msg_define_resolver.go b/x/data/server/msg_define_resolver.go index 1fd46c9a62..dd30218a93 100644 --- a/x/data/server/msg_define_resolver.go +++ b/x/data/server/msg_define_resolver.go @@ -24,5 +24,12 @@ func (s serverImpl) DefineResolver(ctx context.Context, msg *data.MsgDefineResol return nil, data.ErrResolverURLExists } + err = sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&data.EventDefineResolver{ + Id: id, + }) + if err != nil { + return nil, err + } + return &data.MsgDefineResolverResponse{ResolverId: id}, nil } diff --git a/x/data/server/msg_register_resolver.go b/x/data/server/msg_register_resolver.go index 173f0f11af..c73f2351b7 100644 --- a/x/data/server/msg_register_resolver.go +++ b/x/data/server/msg_register_resolver.go @@ -27,8 +27,10 @@ func (s serverImpl) RegisterResolver(ctx context.Context, msg *data.MsgRegisterR return nil, data.ErrUnauthorizedResolverManager } + sdkCtx := sdk.UnwrapSDKContext(ctx) + for _, ch := range msg.ContentHashes { - _, id, _, err := s.anchorAndGetIRI(ctx, ch) + iri, id, _, err := s.anchorAndGetIRI(ctx, ch) if err != nil { return nil, err } @@ -44,7 +46,15 @@ func (s serverImpl) RegisterResolver(ctx context.Context, msg *data.MsgRegisterR return nil, err } - sdk.UnwrapSDKContext(ctx).GasMeter().ConsumeGas(data.GasCostPerIteration, "data/RegisterResolver content hash iteration") + err = sdkCtx.EventManager().EmitTypedEvent(&data.EventRegisterResolver{ + Id: msg.ResolverId, + Iri: iri, + }) + if err != nil { + return nil, err + } + + sdkCtx.GasMeter().ConsumeGas(data.GasCostPerIteration, "data/RegisterResolver content hash iteration") } return &data.MsgRegisterResolverResponse{}, nil