diff --git a/.github/workflows/run-goreleaser.yml b/.github/workflows/run-goreleaser.yml index 922b8da9d..62d613367 100644 --- a/.github/workflows/run-goreleaser.yml +++ b/.github/workflows/run-goreleaser.yml @@ -26,6 +26,7 @@ jobs: - uses: actions/setup-go@v5 with: go-version: "1.22" + check-latest: true - name: Clean up dist directory run: rm -rf dist diff --git a/Makefile b/Makefile index 514762be5..94e3268b0 100644 --- a/Makefile +++ b/Makefile @@ -297,7 +297,7 @@ sh-testnet: mod-tidy ### templ & vault ### ############################################################################### -.PHONY: dwn motr templ +.PHONY: dwn motr templ pkl nebula motr: @echo "(motr) Building motr gateway" @@ -312,10 +312,14 @@ templ: go install github.com/a-h/templ/cmd/templ@latest templ generate +nebula: + @echo "(nebula) Building nebula" + cd pkg/nebula && bun run build + pkl: @echo "(pkl) Building PKL" - go run github.com/apple/pkl-go/cmd/pkl-gen-go ./app/config/pkl/dwn.pkl - go run github.com/apple/pkl-go/cmd/pkl-gen-go ./app/config/pkl/orm.pkl + go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/dwn.pkl + go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/orm.pkl start-caddy: @echo "(start-caddy) Starting caddy" diff --git a/api/did/v1/query.pulsar.go b/api/did/v1/query.pulsar.go index 9b9743ba9..27ed636fe 100644 --- a/api/did/v1/query.pulsar.go +++ b/api/did/v1/query.pulsar.go @@ -1495,6 +1495,2252 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods } } +var ( + md_QuerySignRequest protoreflect.MessageDescriptor + fd_QuerySignRequest_did protoreflect.FieldDescriptor + fd_QuerySignRequest_origin protoreflect.FieldDescriptor + fd_QuerySignRequest_key protoreflect.FieldDescriptor + fd_QuerySignRequest_asset protoreflect.FieldDescriptor + fd_QuerySignRequest_message protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QuerySignRequest = File_did_v1_query_proto.Messages().ByName("QuerySignRequest") + fd_QuerySignRequest_did = md_QuerySignRequest.Fields().ByName("did") + fd_QuerySignRequest_origin = md_QuerySignRequest.Fields().ByName("origin") + fd_QuerySignRequest_key = md_QuerySignRequest.Fields().ByName("key") + fd_QuerySignRequest_asset = md_QuerySignRequest.Fields().ByName("asset") + fd_QuerySignRequest_message = md_QuerySignRequest.Fields().ByName("message") +} + +var _ protoreflect.Message = (*fastReflection_QuerySignRequest)(nil) + +type fastReflection_QuerySignRequest QuerySignRequest + +func (x *QuerySignRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QuerySignRequest)(x) +} + +func (x *QuerySignRequest) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QuerySignRequest_messageType fastReflection_QuerySignRequest_messageType +var _ protoreflect.MessageType = fastReflection_QuerySignRequest_messageType{} + +type fastReflection_QuerySignRequest_messageType struct{} + +func (x fastReflection_QuerySignRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QuerySignRequest)(nil) +} +func (x fastReflection_QuerySignRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QuerySignRequest) +} +func (x fastReflection_QuerySignRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySignRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QuerySignRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySignRequest +} + +// 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_QuerySignRequest) Type() protoreflect.MessageType { + return _fastReflection_QuerySignRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QuerySignRequest) New() protoreflect.Message { + return new(fastReflection_QuerySignRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QuerySignRequest) Interface() protoreflect.ProtoMessage { + return (*QuerySignRequest)(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_QuerySignRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_QuerySignRequest_did, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_QuerySignRequest_origin, value) { + return + } + } + if x.Key != "" { + value := protoreflect.ValueOfString(x.Key) + if !f(fd_QuerySignRequest_key, value) { + return + } + } + if x.Asset != "" { + value := protoreflect.ValueOfString(x.Asset) + if !f(fd_QuerySignRequest_asset, value) { + return + } + } + if x.Message != "" { + value := protoreflect.ValueOfString(x.Message) + if !f(fd_QuerySignRequest_message, 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_QuerySignRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QuerySignRequest.did": + return x.Did != "" + case "did.v1.QuerySignRequest.origin": + return x.Origin != "" + case "did.v1.QuerySignRequest.key": + return x.Key != "" + case "did.v1.QuerySignRequest.asset": + return x.Asset != "" + case "did.v1.QuerySignRequest.message": + return x.Message != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignRequest")) + } + panic(fmt.Errorf("message did.v1.QuerySignRequest 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_QuerySignRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QuerySignRequest.did": + x.Did = "" + case "did.v1.QuerySignRequest.origin": + x.Origin = "" + case "did.v1.QuerySignRequest.key": + x.Key = "" + case "did.v1.QuerySignRequest.asset": + x.Asset = "" + case "did.v1.QuerySignRequest.message": + x.Message = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignRequest")) + } + panic(fmt.Errorf("message did.v1.QuerySignRequest 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_QuerySignRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QuerySignRequest.did": + value := x.Did + return protoreflect.ValueOfString(value) + case "did.v1.QuerySignRequest.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.QuerySignRequest.key": + value := x.Key + return protoreflect.ValueOfString(value) + case "did.v1.QuerySignRequest.asset": + value := x.Asset + return protoreflect.ValueOfString(value) + case "did.v1.QuerySignRequest.message": + value := x.Message + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignRequest")) + } + panic(fmt.Errorf("message did.v1.QuerySignRequest 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_QuerySignRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QuerySignRequest.did": + x.Did = value.Interface().(string) + case "did.v1.QuerySignRequest.origin": + x.Origin = value.Interface().(string) + case "did.v1.QuerySignRequest.key": + x.Key = value.Interface().(string) + case "did.v1.QuerySignRequest.asset": + x.Asset = value.Interface().(string) + case "did.v1.QuerySignRequest.message": + x.Message = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignRequest")) + } + panic(fmt.Errorf("message did.v1.QuerySignRequest 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_QuerySignRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QuerySignRequest.did": + panic(fmt.Errorf("field did of message did.v1.QuerySignRequest is not mutable")) + case "did.v1.QuerySignRequest.origin": + panic(fmt.Errorf("field origin of message did.v1.QuerySignRequest is not mutable")) + case "did.v1.QuerySignRequest.key": + panic(fmt.Errorf("field key of message did.v1.QuerySignRequest is not mutable")) + case "did.v1.QuerySignRequest.asset": + panic(fmt.Errorf("field asset of message did.v1.QuerySignRequest is not mutable")) + case "did.v1.QuerySignRequest.message": + panic(fmt.Errorf("field message of message did.v1.QuerySignRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignRequest")) + } + panic(fmt.Errorf("message did.v1.QuerySignRequest 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_QuerySignRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QuerySignRequest.did": + return protoreflect.ValueOfString("") + case "did.v1.QuerySignRequest.origin": + return protoreflect.ValueOfString("") + case "did.v1.QuerySignRequest.key": + return protoreflect.ValueOfString("") + case "did.v1.QuerySignRequest.asset": + return protoreflect.ValueOfString("") + case "did.v1.QuerySignRequest.message": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignRequest")) + } + panic(fmt.Errorf("message did.v1.QuerySignRequest 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_QuerySignRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QuerySignRequest", 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_QuerySignRequest) 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_QuerySignRequest) 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_QuerySignRequest) 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_QuerySignRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QuerySignRequest) + 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.Did) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Key) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Asset) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Message) + 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().(*QuerySignRequest) + 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.Message) > 0 { + i -= len(x.Message) + copy(dAtA[i:], x.Message) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Message))) + i-- + dAtA[i] = 0x2a + } + if len(x.Asset) > 0 { + i -= len(x.Asset) + copy(dAtA[i:], x.Asset) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Asset))) + i-- + dAtA[i] = 0x22 + } + if len(x.Key) > 0 { + i -= len(x.Key) + copy(dAtA[i:], x.Key) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key))) + i-- + dAtA[i] = 0x1a + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + 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().(*QuerySignRequest) + 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: QuerySignRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySignRequest: 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 Did", 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.Did = 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 Origin", 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.Origin = 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 Key", 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.Key = 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 Asset", 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.Asset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Message", 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.Message = 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_QuerySignResponse protoreflect.MessageDescriptor + fd_QuerySignResponse_signature protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QuerySignResponse = File_did_v1_query_proto.Messages().ByName("QuerySignResponse") + fd_QuerySignResponse_signature = md_QuerySignResponse.Fields().ByName("signature") +} + +var _ protoreflect.Message = (*fastReflection_QuerySignResponse)(nil) + +type fastReflection_QuerySignResponse QuerySignResponse + +func (x *QuerySignResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QuerySignResponse)(x) +} + +func (x *QuerySignResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QuerySignResponse_messageType fastReflection_QuerySignResponse_messageType +var _ protoreflect.MessageType = fastReflection_QuerySignResponse_messageType{} + +type fastReflection_QuerySignResponse_messageType struct{} + +func (x fastReflection_QuerySignResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QuerySignResponse)(nil) +} +func (x fastReflection_QuerySignResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QuerySignResponse) +} +func (x fastReflection_QuerySignResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySignResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QuerySignResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySignResponse +} + +// 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_QuerySignResponse) Type() protoreflect.MessageType { + return _fastReflection_QuerySignResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QuerySignResponse) New() protoreflect.Message { + return new(fastReflection_QuerySignResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QuerySignResponse) Interface() protoreflect.ProtoMessage { + return (*QuerySignResponse)(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_QuerySignResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Signature != "" { + value := protoreflect.ValueOfString(x.Signature) + if !f(fd_QuerySignResponse_signature, 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_QuerySignResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QuerySignResponse.signature": + return x.Signature != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignResponse")) + } + panic(fmt.Errorf("message did.v1.QuerySignResponse 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_QuerySignResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QuerySignResponse.signature": + x.Signature = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignResponse")) + } + panic(fmt.Errorf("message did.v1.QuerySignResponse 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_QuerySignResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QuerySignResponse.signature": + value := x.Signature + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignResponse")) + } + panic(fmt.Errorf("message did.v1.QuerySignResponse 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_QuerySignResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QuerySignResponse.signature": + x.Signature = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignResponse")) + } + panic(fmt.Errorf("message did.v1.QuerySignResponse 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_QuerySignResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QuerySignResponse.signature": + panic(fmt.Errorf("field signature of message did.v1.QuerySignResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignResponse")) + } + panic(fmt.Errorf("message did.v1.QuerySignResponse 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_QuerySignResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QuerySignResponse.signature": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QuerySignResponse")) + } + panic(fmt.Errorf("message did.v1.QuerySignResponse 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_QuerySignResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QuerySignResponse", 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_QuerySignResponse) 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_QuerySignResponse) 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_QuerySignResponse) 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_QuerySignResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QuerySignResponse) + 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.Signature) + 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().(*QuerySignResponse) + 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.Signature) > 0 { + i -= len(x.Signature) + copy(dAtA[i:], x.Signature) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signature))) + 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().(*QuerySignResponse) + 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: QuerySignResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySignResponse: 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 Signature", 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.Signature = 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_QueryVerifyRequest protoreflect.MessageDescriptor + fd_QueryVerifyRequest_did protoreflect.FieldDescriptor + fd_QueryVerifyRequest_origin protoreflect.FieldDescriptor + fd_QueryVerifyRequest_key protoreflect.FieldDescriptor + fd_QueryVerifyRequest_asset protoreflect.FieldDescriptor + fd_QueryVerifyRequest_message protoreflect.FieldDescriptor + fd_QueryVerifyRequest_signature protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryVerifyRequest = File_did_v1_query_proto.Messages().ByName("QueryVerifyRequest") + fd_QueryVerifyRequest_did = md_QueryVerifyRequest.Fields().ByName("did") + fd_QueryVerifyRequest_origin = md_QueryVerifyRequest.Fields().ByName("origin") + fd_QueryVerifyRequest_key = md_QueryVerifyRequest.Fields().ByName("key") + fd_QueryVerifyRequest_asset = md_QueryVerifyRequest.Fields().ByName("asset") + fd_QueryVerifyRequest_message = md_QueryVerifyRequest.Fields().ByName("message") + fd_QueryVerifyRequest_signature = md_QueryVerifyRequest.Fields().ByName("signature") +} + +var _ protoreflect.Message = (*fastReflection_QueryVerifyRequest)(nil) + +type fastReflection_QueryVerifyRequest QueryVerifyRequest + +func (x *QueryVerifyRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryVerifyRequest)(x) +} + +func (x *QueryVerifyRequest) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryVerifyRequest_messageType fastReflection_QueryVerifyRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryVerifyRequest_messageType{} + +type fastReflection_QueryVerifyRequest_messageType struct{} + +func (x fastReflection_QueryVerifyRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryVerifyRequest)(nil) +} +func (x fastReflection_QueryVerifyRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryVerifyRequest) +} +func (x fastReflection_QueryVerifyRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryVerifyRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryVerifyRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryVerifyRequest +} + +// 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_QueryVerifyRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryVerifyRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryVerifyRequest) New() protoreflect.Message { + return new(fastReflection_QueryVerifyRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryVerifyRequest) Interface() protoreflect.ProtoMessage { + return (*QueryVerifyRequest)(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_QueryVerifyRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_QueryVerifyRequest_did, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_QueryVerifyRequest_origin, value) { + return + } + } + if x.Key != "" { + value := protoreflect.ValueOfString(x.Key) + if !f(fd_QueryVerifyRequest_key, value) { + return + } + } + if x.Asset != "" { + value := protoreflect.ValueOfString(x.Asset) + if !f(fd_QueryVerifyRequest_asset, value) { + return + } + } + if x.Message != "" { + value := protoreflect.ValueOfString(x.Message) + if !f(fd_QueryVerifyRequest_message, value) { + return + } + } + if x.Signature != "" { + value := protoreflect.ValueOfString(x.Signature) + if !f(fd_QueryVerifyRequest_signature, 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_QueryVerifyRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryVerifyRequest.did": + return x.Did != "" + case "did.v1.QueryVerifyRequest.origin": + return x.Origin != "" + case "did.v1.QueryVerifyRequest.key": + return x.Key != "" + case "did.v1.QueryVerifyRequest.asset": + return x.Asset != "" + case "did.v1.QueryVerifyRequest.message": + return x.Message != "" + case "did.v1.QueryVerifyRequest.signature": + return x.Signature != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyRequest")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyRequest 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_QueryVerifyRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryVerifyRequest.did": + x.Did = "" + case "did.v1.QueryVerifyRequest.origin": + x.Origin = "" + case "did.v1.QueryVerifyRequest.key": + x.Key = "" + case "did.v1.QueryVerifyRequest.asset": + x.Asset = "" + case "did.v1.QueryVerifyRequest.message": + x.Message = "" + case "did.v1.QueryVerifyRequest.signature": + x.Signature = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyRequest")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyRequest 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_QueryVerifyRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryVerifyRequest.did": + value := x.Did + return protoreflect.ValueOfString(value) + case "did.v1.QueryVerifyRequest.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.QueryVerifyRequest.key": + value := x.Key + return protoreflect.ValueOfString(value) + case "did.v1.QueryVerifyRequest.asset": + value := x.Asset + return protoreflect.ValueOfString(value) + case "did.v1.QueryVerifyRequest.message": + value := x.Message + return protoreflect.ValueOfString(value) + case "did.v1.QueryVerifyRequest.signature": + value := x.Signature + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyRequest")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyRequest 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_QueryVerifyRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryVerifyRequest.did": + x.Did = value.Interface().(string) + case "did.v1.QueryVerifyRequest.origin": + x.Origin = value.Interface().(string) + case "did.v1.QueryVerifyRequest.key": + x.Key = value.Interface().(string) + case "did.v1.QueryVerifyRequest.asset": + x.Asset = value.Interface().(string) + case "did.v1.QueryVerifyRequest.message": + x.Message = value.Interface().(string) + case "did.v1.QueryVerifyRequest.signature": + x.Signature = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyRequest")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyRequest 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_QueryVerifyRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryVerifyRequest.did": + panic(fmt.Errorf("field did of message did.v1.QueryVerifyRequest is not mutable")) + case "did.v1.QueryVerifyRequest.origin": + panic(fmt.Errorf("field origin of message did.v1.QueryVerifyRequest is not mutable")) + case "did.v1.QueryVerifyRequest.key": + panic(fmt.Errorf("field key of message did.v1.QueryVerifyRequest is not mutable")) + case "did.v1.QueryVerifyRequest.asset": + panic(fmt.Errorf("field asset of message did.v1.QueryVerifyRequest is not mutable")) + case "did.v1.QueryVerifyRequest.message": + panic(fmt.Errorf("field message of message did.v1.QueryVerifyRequest is not mutable")) + case "did.v1.QueryVerifyRequest.signature": + panic(fmt.Errorf("field signature of message did.v1.QueryVerifyRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyRequest")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyRequest 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_QueryVerifyRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryVerifyRequest.did": + return protoreflect.ValueOfString("") + case "did.v1.QueryVerifyRequest.origin": + return protoreflect.ValueOfString("") + case "did.v1.QueryVerifyRequest.key": + return protoreflect.ValueOfString("") + case "did.v1.QueryVerifyRequest.asset": + return protoreflect.ValueOfString("") + case "did.v1.QueryVerifyRequest.message": + return protoreflect.ValueOfString("") + case "did.v1.QueryVerifyRequest.signature": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyRequest")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyRequest 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_QueryVerifyRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryVerifyRequest", 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_QueryVerifyRequest) 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_QueryVerifyRequest) 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_QueryVerifyRequest) 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_QueryVerifyRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryVerifyRequest) + 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.Did) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Key) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Asset) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Message) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Signature) + 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().(*QueryVerifyRequest) + 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.Signature) > 0 { + i -= len(x.Signature) + copy(dAtA[i:], x.Signature) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signature))) + i-- + dAtA[i] = 0x32 + } + if len(x.Message) > 0 { + i -= len(x.Message) + copy(dAtA[i:], x.Message) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Message))) + i-- + dAtA[i] = 0x2a + } + if len(x.Asset) > 0 { + i -= len(x.Asset) + copy(dAtA[i:], x.Asset) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Asset))) + i-- + dAtA[i] = 0x22 + } + if len(x.Key) > 0 { + i -= len(x.Key) + copy(dAtA[i:], x.Key) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key))) + i-- + dAtA[i] = 0x1a + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + 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().(*QueryVerifyRequest) + 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: QueryVerifyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryVerifyRequest: 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 Did", 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.Did = 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 Origin", 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.Origin = 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 Key", 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.Key = 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 Asset", 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.Asset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Message", 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.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signature", 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.Signature = 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_QueryVerifyResponse protoreflect.MessageDescriptor + fd_QueryVerifyResponse_valid protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryVerifyResponse = File_did_v1_query_proto.Messages().ByName("QueryVerifyResponse") + fd_QueryVerifyResponse_valid = md_QueryVerifyResponse.Fields().ByName("valid") +} + +var _ protoreflect.Message = (*fastReflection_QueryVerifyResponse)(nil) + +type fastReflection_QueryVerifyResponse QueryVerifyResponse + +func (x *QueryVerifyResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryVerifyResponse)(x) +} + +func (x *QueryVerifyResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryVerifyResponse_messageType fastReflection_QueryVerifyResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryVerifyResponse_messageType{} + +type fastReflection_QueryVerifyResponse_messageType struct{} + +func (x fastReflection_QueryVerifyResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryVerifyResponse)(nil) +} +func (x fastReflection_QueryVerifyResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryVerifyResponse) +} +func (x fastReflection_QueryVerifyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryVerifyResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryVerifyResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryVerifyResponse +} + +// 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_QueryVerifyResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryVerifyResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryVerifyResponse) New() protoreflect.Message { + return new(fastReflection_QueryVerifyResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryVerifyResponse) Interface() protoreflect.ProtoMessage { + return (*QueryVerifyResponse)(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_QueryVerifyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Valid != false { + value := protoreflect.ValueOfBool(x.Valid) + if !f(fd_QueryVerifyResponse_valid, 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_QueryVerifyResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryVerifyResponse.valid": + return x.Valid != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyResponse 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_QueryVerifyResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryVerifyResponse.valid": + x.Valid = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyResponse 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_QueryVerifyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryVerifyResponse.valid": + value := x.Valid + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyResponse 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_QueryVerifyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryVerifyResponse.valid": + x.Valid = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyResponse 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_QueryVerifyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryVerifyResponse.valid": + panic(fmt.Errorf("field valid of message did.v1.QueryVerifyResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyResponse 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_QueryVerifyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryVerifyResponse.valid": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryVerifyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryVerifyResponse 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_QueryVerifyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryVerifyResponse", 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_QueryVerifyResponse) 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_QueryVerifyResponse) 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_QueryVerifyResponse) 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_QueryVerifyResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryVerifyResponse) + 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.Valid { + n += 2 + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryVerifyResponse) + 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.Valid { + i-- + if x.Valid { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + 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().(*QueryVerifyResponse) + 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: QueryVerifyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryVerifyResponse: 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 Valid", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Valid = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + var _ protoreflect.List = (*_Document_3_list)(nil) type _Document_3_list struct { @@ -1757,7 +4003,7 @@ func (x *Document) ProtoReflect() protoreflect.Message { } func (x *Document) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[3] + mi := &file_did_v1_query_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2746,6 +4992,224 @@ func (x *QueryResolveResponse) GetDocument() *Document { return nil } +// QuerySignRequest is the request type for the Query/Sign RPC method. +type QuerySignRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Asset string `protobuf:"bytes,4,opt,name=asset,proto3" json:"asset,omitempty"` + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *QuerySignRequest) Reset() { + *x = QuerySignRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuerySignRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuerySignRequest) ProtoMessage() {} + +// Deprecated: Use QuerySignRequest.ProtoReflect.Descriptor instead. +func (*QuerySignRequest) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QuerySignRequest) GetDid() string { + if x != nil { + return x.Did + } + return "" +} + +func (x *QuerySignRequest) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *QuerySignRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *QuerySignRequest) GetAsset() string { + if x != nil { + return x.Asset + } + return "" +} + +func (x *QuerySignRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// QuerySignResponse is the response type for the Query/Sign RPC method. +type QuerySignResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // signature is the signature of the message + Signature string `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *QuerySignResponse) Reset() { + *x = QuerySignResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuerySignResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuerySignResponse) ProtoMessage() {} + +// Deprecated: Use QuerySignResponse.ProtoReflect.Descriptor instead. +func (*QuerySignResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QuerySignResponse) GetSignature() string { + if x != nil { + return x.Signature + } + return "" +} + +// QueryVerifyRequest is the request type for the Query/Verify RPC method. +type QueryVerifyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Asset string `protobuf:"bytes,4,opt,name=asset,proto3" json:"asset,omitempty"` + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` + Signature string `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *QueryVerifyRequest) Reset() { + *x = QueryVerifyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryVerifyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryVerifyRequest) ProtoMessage() {} + +// Deprecated: Use QueryVerifyRequest.ProtoReflect.Descriptor instead. +func (*QueryVerifyRequest) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryVerifyRequest) GetDid() string { + if x != nil { + return x.Did + } + return "" +} + +func (x *QueryVerifyRequest) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *QueryVerifyRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *QueryVerifyRequest) GetAsset() string { + if x != nil { + return x.Asset + } + return "" +} + +func (x *QueryVerifyRequest) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *QueryVerifyRequest) GetSignature() string { + if x != nil { + return x.Signature + } + return "" +} + +// QueryVerifyResponse is the response type for the Query/Verify RPC method. +type QueryVerifyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // valid is the validity of the signature + Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` +} + +func (x *QueryVerifyResponse) Reset() { + *x = QueryVerifyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryVerifyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryVerifyResponse) ProtoMessage() {} + +// Deprecated: Use QueryVerifyResponse.ProtoReflect.Descriptor instead. +func (*QueryVerifyResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryVerifyResponse) GetValid() bool { + if x != nil { + return x.Valid + } + return false +} + // Document defines a DID document type Document struct { state protoimpl.MessageState @@ -2764,7 +5228,7 @@ type Document struct { func (x *Document) Reset() { *x = Document{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[3] + mi := &file_did_v1_query_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2778,7 +5242,7 @@ func (*Document) ProtoMessage() {} // Deprecated: Use Document.ProtoReflect.Descriptor instead. func (*Document) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{3} + return file_did_v1_query_proto_rawDescGZIP(), []int{7} } func (x *Document) GetId() string { @@ -2852,43 +5316,78 @@ var file_did_v1_query_proto_rawDesc = []byte{ 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x91, 0x02, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x75, - 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, - 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x15, - 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x32, 0xa8, 0x01, 0x0a, 0x05, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x4c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x7e, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, 0x18, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x31, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x12, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x2b, 0x0a, 0x13, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x22, 0x91, 0x02, 0x0a, 0x08, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, + 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, + 0x10, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, + 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, + 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x32, 0xdc, 0x02, 0x0a, + 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x4c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x51, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x51, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x14, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x64, 0x69, 0x64, - 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, - 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, - 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, - 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x64, 0x69, + 0x64, 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x12, 0x54, 0x0a, 0x04, 0x53, 0x69, 0x67, 0x6e, 0x12, + 0x18, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, + 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x22, 0x0f, 0x2f, 0x64, + 0x69, 0x64, 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x5c, 0x0a, + 0x06, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x7b, + 0x64, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x42, 0x7a, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, + 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2903,23 +5402,31 @@ func file_did_v1_query_proto_rawDescGZIP() []byte { return file_did_v1_query_proto_rawDescData } -var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_did_v1_query_proto_goTypes = []interface{}{ (*QueryRequest)(nil), // 0: did.v1.QueryRequest (*QueryParamsResponse)(nil), // 1: did.v1.QueryParamsResponse (*QueryResolveResponse)(nil), // 2: did.v1.QueryResolveResponse - (*Document)(nil), // 3: did.v1.Document - (*Params)(nil), // 4: did.v1.Params + (*QuerySignRequest)(nil), // 3: did.v1.QuerySignRequest + (*QuerySignResponse)(nil), // 4: did.v1.QuerySignResponse + (*QueryVerifyRequest)(nil), // 5: did.v1.QueryVerifyRequest + (*QueryVerifyResponse)(nil), // 6: did.v1.QueryVerifyResponse + (*Document)(nil), // 7: did.v1.Document + (*Params)(nil), // 8: did.v1.Params } var file_did_v1_query_proto_depIdxs = []int32{ - 4, // 0: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params - 3, // 1: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document + 8, // 0: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params + 7, // 1: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document 0, // 2: did.v1.Query.Params:input_type -> did.v1.QueryRequest 0, // 3: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest - 1, // 4: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse - 2, // 5: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type + 3, // 4: did.v1.Query.Sign:input_type -> did.v1.QuerySignRequest + 5, // 5: did.v1.Query.Verify:input_type -> did.v1.QueryVerifyRequest + 1, // 6: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse + 2, // 7: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse + 4, // 8: did.v1.Query.Sign:output_type -> did.v1.QuerySignResponse + 6, // 9: did.v1.Query.Verify:output_type -> did.v1.QueryVerifyResponse + 6, // [6:10] is the sub-list for method output_type + 2, // [2:6] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name @@ -2969,6 +5476,54 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuerySignRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuerySignResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryVerifyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryVerifyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Document); i { case 0: return &v.state @@ -2987,7 +5542,7 @@ func file_did_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/api/did/v1/query_grpc.pb.go b/api/did/v1/query_grpc.pb.go index 60ab53114..2c1db75cd 100644 --- a/api/did/v1/query_grpc.pb.go +++ b/api/did/v1/query_grpc.pb.go @@ -21,6 +21,8 @@ const _ = grpc.SupportPackageIsVersion7 const ( Query_Params_FullMethodName = "/did.v1.Query/Params" Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" + Query_Sign_FullMethodName = "/did.v1.Query/Sign" + Query_Verify_FullMethodName = "/did.v1.Query/Verify" ) // QueryClient is the client API for Query service. @@ -31,6 +33,10 @@ type QueryClient interface { Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) + // Sign signs a message with the DID document + Sign(ctx context.Context, in *QuerySignRequest, opts ...grpc.CallOption) (*QuerySignResponse, error) + // Verify verifies a message with the DID document + Verify(ctx context.Context, in *QueryVerifyRequest, opts ...grpc.CallOption) (*QueryVerifyResponse, error) } type queryClient struct { @@ -59,6 +65,24 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grp return out, nil } +func (c *queryClient) Sign(ctx context.Context, in *QuerySignRequest, opts ...grpc.CallOption) (*QuerySignResponse, error) { + out := new(QuerySignResponse) + err := c.cc.Invoke(ctx, Query_Sign_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Verify(ctx context.Context, in *QueryVerifyRequest, opts ...grpc.CallOption) (*QueryVerifyResponse, error) { + out := new(QueryVerifyResponse) + err := c.cc.Invoke(ctx, Query_Verify_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility @@ -67,6 +91,10 @@ type QueryServer interface { Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) + // Sign signs a message with the DID document + Sign(context.Context, *QuerySignRequest) (*QuerySignResponse, error) + // Verify verifies a message with the DID document + Verify(context.Context, *QueryVerifyRequest) (*QueryVerifyResponse, error) mustEmbedUnimplementedQueryServer() } @@ -80,6 +108,12 @@ func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryPa func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } +func (UnimplementedQueryServer) Sign(context.Context, *QuerySignRequest) (*QuerySignResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sign not implemented") +} +func (UnimplementedQueryServer) Verify(context.Context, *QueryVerifyRequest) (*QueryVerifyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Verify not implemented") +} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -129,6 +163,42 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Query_Sign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySignRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Sign(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Sign_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Sign(ctx, req.(*QuerySignRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Verify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVerifyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Verify(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Verify_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Verify(ctx, req.(*QueryVerifyRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -144,6 +214,14 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Resolve", Handler: _Query_Resolve_Handler, }, + { + MethodName: "Sign", + Handler: _Query_Sign_Handler, + }, + { + MethodName: "Verify", + Handler: _Query_Verify_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "did/v1/query.proto", diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index 83408a5e2..c5f1b1c25 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -10,15 +10,101 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" reflect "reflect" + sort "sort" sync "sync" ) +var _ protoreflect.Map = (*_Authentication_6_map)(nil) + +type _Authentication_6_map struct { + m *map[string]string +} + +func (x *_Authentication_6_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_Authentication_6_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfString(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_Authentication_6_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_Authentication_6_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_Authentication_6_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfString(v) +} + +func (x *_Authentication_6_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_Authentication_6_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") +} + +func (x *_Authentication_6_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Authentication_6_map) IsValid() bool { + return x.m != nil +} + var ( - md_Authentication protoreflect.MessageDescriptor - fd_Authentication_did protoreflect.FieldDescriptor - fd_Authentication_controller protoreflect.FieldDescriptor - fd_Authentication_subject protoreflect.FieldDescriptor - fd_Authentication_public_key protoreflect.FieldDescriptor + md_Authentication protoreflect.MessageDescriptor + fd_Authentication_did protoreflect.FieldDescriptor + fd_Authentication_controller protoreflect.FieldDescriptor + fd_Authentication_subject protoreflect.FieldDescriptor + fd_Authentication_public_key protoreflect.FieldDescriptor + fd_Authentication_credential_id protoreflect.FieldDescriptor + fd_Authentication_metadata protoreflect.FieldDescriptor + fd_Authentication_creation_block protoreflect.FieldDescriptor ) func init() { @@ -28,6 +114,9 @@ func init() { fd_Authentication_controller = md_Authentication.Fields().ByName("controller") fd_Authentication_subject = md_Authentication.Fields().ByName("subject") fd_Authentication_public_key = md_Authentication.Fields().ByName("public_key") + fd_Authentication_credential_id = md_Authentication.Fields().ByName("credential_id") + fd_Authentication_metadata = md_Authentication.Fields().ByName("metadata") + fd_Authentication_creation_block = md_Authentication.Fields().ByName("creation_block") } var _ protoreflect.Message = (*fastReflection_Authentication)(nil) @@ -119,6 +208,24 @@ func (x *fastReflection_Authentication) Range(f func(protoreflect.FieldDescripto return } } + if len(x.CredentialId) != 0 { + value := protoreflect.ValueOfBytes(x.CredentialId) + if !f(fd_Authentication_credential_id, value) { + return + } + } + if len(x.Metadata) != 0 { + value := protoreflect.ValueOfMap(&_Authentication_6_map{m: &x.Metadata}) + if !f(fd_Authentication_metadata, value) { + return + } + } + if x.CreationBlock != int64(0) { + value := protoreflect.ValueOfInt64(x.CreationBlock) + if !f(fd_Authentication_creation_block, value) { + return + } + } } // Has reports whether a field is populated. @@ -142,6 +249,12 @@ func (x *fastReflection_Authentication) Has(fd protoreflect.FieldDescriptor) boo return x.Subject != "" case "did.v1.Authentication.public_key": return x.PublicKey != nil + case "did.v1.Authentication.credential_id": + return len(x.CredentialId) != 0 + case "did.v1.Authentication.metadata": + return len(x.Metadata) != 0 + case "did.v1.Authentication.creation_block": + return x.CreationBlock != int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) @@ -166,6 +279,12 @@ func (x *fastReflection_Authentication) Clear(fd protoreflect.FieldDescriptor) { x.Subject = "" case "did.v1.Authentication.public_key": x.PublicKey = nil + case "did.v1.Authentication.credential_id": + x.CredentialId = nil + case "did.v1.Authentication.metadata": + x.Metadata = nil + case "did.v1.Authentication.creation_block": + x.CreationBlock = int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) @@ -194,6 +313,18 @@ func (x *fastReflection_Authentication) Get(descriptor protoreflect.FieldDescrip case "did.v1.Authentication.public_key": value := x.PublicKey return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.Authentication.credential_id": + value := x.CredentialId + return protoreflect.ValueOfBytes(value) + case "did.v1.Authentication.metadata": + if len(x.Metadata) == 0 { + return protoreflect.ValueOfMap(&_Authentication_6_map{}) + } + mapValue := &_Authentication_6_map{m: &x.Metadata} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.Authentication.creation_block": + value := x.CreationBlock + return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) @@ -222,6 +353,14 @@ func (x *fastReflection_Authentication) Set(fd protoreflect.FieldDescriptor, val x.Subject = value.Interface().(string) case "did.v1.Authentication.public_key": x.PublicKey = value.Message().Interface().(*PubKey) + case "did.v1.Authentication.credential_id": + x.CredentialId = value.Bytes() + case "did.v1.Authentication.metadata": + mv := value.Map() + cmv := mv.(*_Authentication_6_map) + x.Metadata = *cmv.m + case "did.v1.Authentication.creation_block": + x.CreationBlock = value.Int() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) @@ -247,12 +386,22 @@ func (x *fastReflection_Authentication) Mutable(fd protoreflect.FieldDescriptor) x.PublicKey = new(PubKey) } return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) + case "did.v1.Authentication.metadata": + if x.Metadata == nil { + x.Metadata = make(map[string]string) + } + value := &_Authentication_6_map{m: &x.Metadata} + return protoreflect.ValueOfMap(value) case "did.v1.Authentication.did": panic(fmt.Errorf("field did of message did.v1.Authentication is not mutable")) case "did.v1.Authentication.controller": panic(fmt.Errorf("field controller of message did.v1.Authentication is not mutable")) case "did.v1.Authentication.subject": panic(fmt.Errorf("field subject of message did.v1.Authentication is not mutable")) + case "did.v1.Authentication.credential_id": + panic(fmt.Errorf("field credential_id of message did.v1.Authentication is not mutable")) + case "did.v1.Authentication.creation_block": + panic(fmt.Errorf("field creation_block of message did.v1.Authentication is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) @@ -275,6 +424,13 @@ func (x *fastReflection_Authentication) NewField(fd protoreflect.FieldDescriptor case "did.v1.Authentication.public_key": m := new(PubKey) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.Authentication.credential_id": + return protoreflect.ValueOfBytes(nil) + case "did.v1.Authentication.metadata": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_Authentication_6_map{m: &m}) + case "did.v1.Authentication.creation_block": + return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Authentication")) @@ -360,6 +516,34 @@ func (x *fastReflection_Authentication) ProtoMethods() *protoiface.Methods { l = options.Size(x.PublicKey) n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.CredentialId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Metadata) > 0 { + SiZeMaP := func(k string, v string) { + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Metadata)) + for k := range x.Metadata { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Metadata[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Metadata { + SiZeMaP(k, v) + } + } + } + if x.CreationBlock != 0 { + n += 1 + runtime.Sov(uint64(x.CreationBlock)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -389,6 +573,61 @@ func (x *fastReflection_Authentication) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.CreationBlock != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CreationBlock)) + i-- + dAtA[i] = 0x38 + } + if len(x.Metadata) > 0 { + MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForMetadata := make([]string, 0, len(x.Metadata)) + for k := range x.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + sort.Slice(keysForMetadata, func(i, j int) bool { + return keysForMetadata[i] < keysForMetadata[j] + }) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := x.Metadata[string(keysForMetadata[iNdEx])] + out, err := MaRsHaLmAp(keysForMetadata[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Metadata { + v := x.Metadata[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if len(x.CredentialId) > 0 { + i -= len(x.CredentialId) + copy(dAtA[i:], x.CredentialId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CredentialId))) + i-- + dAtA[i] = 0x2a + } if x.PublicKey != nil { encoded, err := options.Marshal(x.PublicKey) if err != nil { @@ -605,6 +844,186 @@ func (x *fastReflection_Authentication) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CredentialId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + 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.CredentialId = append(x.CredentialId[:0], dAtA[iNdEx:postIndex]...) + if x.CredentialId == nil { + x.CredentialId = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Metadata == nil { + x.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey 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++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapkey > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue 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++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + 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) > postIndex { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + x.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) + } + x.CreationBlock = 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.CreationBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -641,15 +1060,16 @@ func (x *fastReflection_Authentication) ProtoMethods() *protoiface.Methods { } var ( - md_Controller protoreflect.MessageDescriptor - fd_Controller_number protoreflect.FieldDescriptor - fd_Controller_did protoreflect.FieldDescriptor - fd_Controller_sonr_address protoreflect.FieldDescriptor - fd_Controller_eth_address protoreflect.FieldDescriptor - fd_Controller_btc_address protoreflect.FieldDescriptor - fd_Controller_public_key protoreflect.FieldDescriptor - fd_Controller_ks_val protoreflect.FieldDescriptor - fd_Controller_claimed protoreflect.FieldDescriptor + md_Controller protoreflect.MessageDescriptor + fd_Controller_number protoreflect.FieldDescriptor + fd_Controller_did protoreflect.FieldDescriptor + fd_Controller_sonr_address protoreflect.FieldDescriptor + fd_Controller_eth_address protoreflect.FieldDescriptor + fd_Controller_btc_address protoreflect.FieldDescriptor + fd_Controller_public_key protoreflect.FieldDescriptor + fd_Controller_ks_val protoreflect.FieldDescriptor + fd_Controller_claimed_block protoreflect.FieldDescriptor + fd_Controller_creation_block protoreflect.FieldDescriptor ) func init() { @@ -662,7 +1082,8 @@ func init() { fd_Controller_btc_address = md_Controller.Fields().ByName("btc_address") fd_Controller_public_key = md_Controller.Fields().ByName("public_key") fd_Controller_ks_val = md_Controller.Fields().ByName("ks_val") - fd_Controller_claimed = md_Controller.Fields().ByName("claimed") + fd_Controller_claimed_block = md_Controller.Fields().ByName("claimed_block") + fd_Controller_creation_block = md_Controller.Fields().ByName("creation_block") } var _ protoreflect.Message = (*fastReflection_Controller)(nil) @@ -772,9 +1193,15 @@ func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, p return } } - if x.Claimed != false { - value := protoreflect.ValueOfBool(x.Claimed) - if !f(fd_Controller_claimed, value) { + if x.ClaimedBlock != int64(0) { + value := protoreflect.ValueOfInt64(x.ClaimedBlock) + if !f(fd_Controller_claimed_block, value) { + return + } + } + if x.CreationBlock != int64(0) { + value := protoreflect.ValueOfInt64(x.CreationBlock) + if !f(fd_Controller_creation_block, value) { return } } @@ -807,8 +1234,10 @@ func (x *fastReflection_Controller) Has(fd protoreflect.FieldDescriptor) bool { return x.PublicKey != nil case "did.v1.Controller.ks_val": return x.KsVal != "" - case "did.v1.Controller.claimed": - return x.Claimed != false + case "did.v1.Controller.claimed_block": + return x.ClaimedBlock != int64(0) + case "did.v1.Controller.creation_block": + return x.CreationBlock != int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -839,8 +1268,10 @@ func (x *fastReflection_Controller) Clear(fd protoreflect.FieldDescriptor) { x.PublicKey = nil case "did.v1.Controller.ks_val": x.KsVal = "" - case "did.v1.Controller.claimed": - x.Claimed = false + case "did.v1.Controller.claimed_block": + x.ClaimedBlock = int64(0) + case "did.v1.Controller.creation_block": + x.CreationBlock = int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -878,9 +1309,12 @@ func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) case "did.v1.Controller.ks_val": value := x.KsVal return protoreflect.ValueOfString(value) - case "did.v1.Controller.claimed": - value := x.Claimed - return protoreflect.ValueOfBool(value) + case "did.v1.Controller.claimed_block": + value := x.ClaimedBlock + return protoreflect.ValueOfInt64(value) + case "did.v1.Controller.creation_block": + value := x.CreationBlock + return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -915,8 +1349,10 @@ func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value p x.PublicKey = value.Message().Interface().(*PubKey) case "did.v1.Controller.ks_val": x.KsVal = value.Interface().(string) - case "did.v1.Controller.claimed": - x.Claimed = value.Bool() + case "did.v1.Controller.claimed_block": + x.ClaimedBlock = value.Int() + case "did.v1.Controller.creation_block": + x.CreationBlock = value.Int() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -954,8 +1390,10 @@ func (x *fastReflection_Controller) Mutable(fd protoreflect.FieldDescriptor) pro panic(fmt.Errorf("field btc_address of message did.v1.Controller is not mutable")) case "did.v1.Controller.ks_val": panic(fmt.Errorf("field ks_val of message did.v1.Controller is not mutable")) - case "did.v1.Controller.claimed": - panic(fmt.Errorf("field claimed of message did.v1.Controller is not mutable")) + case "did.v1.Controller.claimed_block": + panic(fmt.Errorf("field claimed_block of message did.v1.Controller is not mutable")) + case "did.v1.Controller.creation_block": + panic(fmt.Errorf("field creation_block of message did.v1.Controller is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -984,8 +1422,10 @@ func (x *fastReflection_Controller) NewField(fd protoreflect.FieldDescriptor) pr return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.Controller.ks_val": return protoreflect.ValueOfString("") - case "did.v1.Controller.claimed": - return protoreflect.ValueOfBool(false) + case "did.v1.Controller.claimed_block": + return protoreflect.ValueOfInt64(int64(0)) + case "did.v1.Controller.creation_block": + return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -1082,8 +1522,11 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Claimed { - n += 2 + if x.ClaimedBlock != 0 { + n += 1 + runtime.Sov(uint64(x.ClaimedBlock)) + } + if x.CreationBlock != 0 { + n += 1 + runtime.Sov(uint64(x.CreationBlock)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -1114,13 +1557,13 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Claimed { + if x.CreationBlock != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CreationBlock)) i-- - if x.Claimed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + dAtA[i] = 0x48 + } + if x.ClaimedBlock != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedBlock)) i-- dAtA[i] = 0x40 } @@ -1444,9 +1887,9 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 8: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Claimed", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedBlock", wireType) } - var v int + x.ClaimedBlock = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1456,12 +1899,30 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + x.ClaimedBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) + } + x.CreationBlock = 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.CreationBlock |= int64(b&0x7F) << shift if b < 0x80 { break } } - x.Claimed = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1497,6 +1958,88 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.Map = (*_Verification_8_map)(nil) + +type _Verification_8_map struct { + m *map[string]string +} + +func (x *_Verification_8_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_Verification_8_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfString(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_Verification_8_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_Verification_8_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_Verification_8_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfString(v) +} + +func (x *_Verification_8_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_Verification_8_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") +} + +func (x *_Verification_8_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Verification_8_map) IsValid() bool { + return x.m != nil +} + var ( md_Verification protoreflect.MessageDescriptor fd_Verification_did protoreflect.FieldDescriptor @@ -1506,6 +2049,8 @@ var ( fd_Verification_subject protoreflect.FieldDescriptor fd_Verification_public_key protoreflect.FieldDescriptor fd_Verification_verification_type protoreflect.FieldDescriptor + fd_Verification_metadata protoreflect.FieldDescriptor + fd_Verification_creation_block protoreflect.FieldDescriptor ) func init() { @@ -1518,6 +2063,8 @@ func init() { fd_Verification_subject = md_Verification.Fields().ByName("subject") fd_Verification_public_key = md_Verification.Fields().ByName("public_key") fd_Verification_verification_type = md_Verification.Fields().ByName("verification_type") + fd_Verification_metadata = md_Verification.Fields().ByName("metadata") + fd_Verification_creation_block = md_Verification.Fields().ByName("creation_block") } var _ protoreflect.Message = (*fastReflection_Verification)(nil) @@ -1627,6 +2174,18 @@ func (x *fastReflection_Verification) Range(f func(protoreflect.FieldDescriptor, return } } + if len(x.Metadata) != 0 { + value := protoreflect.ValueOfMap(&_Verification_8_map{m: &x.Metadata}) + if !f(fd_Verification_metadata, value) { + return + } + } + if x.CreationBlock != int64(0) { + value := protoreflect.ValueOfInt64(x.CreationBlock) + if !f(fd_Verification_creation_block, value) { + return + } + } } // Has reports whether a field is populated. @@ -1656,6 +2215,10 @@ func (x *fastReflection_Verification) Has(fd protoreflect.FieldDescriptor) bool return x.PublicKey != nil case "did.v1.Verification.verification_type": return x.VerificationType != "" + case "did.v1.Verification.metadata": + return len(x.Metadata) != 0 + case "did.v1.Verification.creation_block": + return x.CreationBlock != int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) @@ -1686,6 +2249,10 @@ func (x *fastReflection_Verification) Clear(fd protoreflect.FieldDescriptor) { x.PublicKey = nil case "did.v1.Verification.verification_type": x.VerificationType = "" + case "did.v1.Verification.metadata": + x.Metadata = nil + case "did.v1.Verification.creation_block": + x.CreationBlock = int64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) @@ -1723,6 +2290,15 @@ func (x *fastReflection_Verification) Get(descriptor protoreflect.FieldDescripto case "did.v1.Verification.verification_type": value := x.VerificationType return protoreflect.ValueOfString(value) + case "did.v1.Verification.metadata": + if len(x.Metadata) == 0 { + return protoreflect.ValueOfMap(&_Verification_8_map{}) + } + mapValue := &_Verification_8_map{m: &x.Metadata} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.Verification.creation_block": + value := x.CreationBlock + return protoreflect.ValueOfInt64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) @@ -1757,6 +2333,12 @@ func (x *fastReflection_Verification) Set(fd protoreflect.FieldDescriptor, value x.PublicKey = value.Message().Interface().(*PubKey) case "did.v1.Verification.verification_type": x.VerificationType = value.Interface().(string) + case "did.v1.Verification.metadata": + mv := value.Map() + cmv := mv.(*_Verification_8_map) + x.Metadata = *cmv.m + case "did.v1.Verification.creation_block": + x.CreationBlock = value.Int() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) @@ -1782,6 +2364,12 @@ func (x *fastReflection_Verification) Mutable(fd protoreflect.FieldDescriptor) p x.PublicKey = new(PubKey) } return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) + case "did.v1.Verification.metadata": + if x.Metadata == nil { + x.Metadata = make(map[string]string) + } + value := &_Verification_8_map{m: &x.Metadata} + return protoreflect.ValueOfMap(value) case "did.v1.Verification.did": panic(fmt.Errorf("field did of message did.v1.Verification is not mutable")) case "did.v1.Verification.controller": @@ -1794,6 +2382,8 @@ func (x *fastReflection_Verification) Mutable(fd protoreflect.FieldDescriptor) p panic(fmt.Errorf("field subject of message did.v1.Verification is not mutable")) case "did.v1.Verification.verification_type": panic(fmt.Errorf("field verification_type of message did.v1.Verification is not mutable")) + case "did.v1.Verification.creation_block": + panic(fmt.Errorf("field creation_block of message did.v1.Verification is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) @@ -1822,6 +2412,11 @@ func (x *fastReflection_Verification) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.Verification.verification_type": return protoreflect.ValueOfString("") + case "did.v1.Verification.metadata": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_Verification_8_map{m: &m}) + case "did.v1.Verification.creation_block": + return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Verification")) @@ -1919,6 +2514,30 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.Metadata) > 0 { + SiZeMaP := func(k string, v string) { + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Metadata)) + for k := range x.Metadata { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Metadata[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Metadata { + SiZeMaP(k, v) + } + } + } + if x.CreationBlock != 0 { + n += 1 + runtime.Sov(uint64(x.CreationBlock)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1948,6 +2567,54 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.CreationBlock != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CreationBlock)) + i-- + dAtA[i] = 0x48 + } + if len(x.Metadata) > 0 { + MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForMetadata := make([]string, 0, len(x.Metadata)) + for k := range x.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + sort.Slice(keysForMetadata, func(i, j int) bool { + return keysForMetadata[i] < keysForMetadata[j] + }) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := x.Metadata[string(keysForMetadata[iNdEx])] + out, err := MaRsHaLmAp(keysForMetadata[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Metadata { + v := x.Metadata[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } if len(x.VerificationType) > 0 { i -= len(x.VerificationType) copy(dAtA[i:], x.VerificationType) @@ -2281,6 +2948,684 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { } x.VerificationType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Metadata == nil { + x.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey 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++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapkey > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue 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++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + 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) > postIndex { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + x.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) + } + x.CreationBlock = 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.CreationBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_Keyshares protoreflect.MessageDescriptor + fd_Keyshares_validator_cid protoreflect.FieldDescriptor + fd_Keyshares_user_cid protoreflect.FieldDescriptor + fd_Keyshares_last_updated_block protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_state_proto_init() + md_Keyshares = File_did_v1_state_proto.Messages().ByName("Keyshares") + fd_Keyshares_validator_cid = md_Keyshares.Fields().ByName("validator_cid") + fd_Keyshares_user_cid = md_Keyshares.Fields().ByName("user_cid") + fd_Keyshares_last_updated_block = md_Keyshares.Fields().ByName("last_updated_block") +} + +var _ protoreflect.Message = (*fastReflection_Keyshares)(nil) + +type fastReflection_Keyshares Keyshares + +func (x *Keyshares) ProtoReflect() protoreflect.Message { + return (*fastReflection_Keyshares)(x) +} + +func (x *Keyshares) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_state_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_Keyshares_messageType fastReflection_Keyshares_messageType +var _ protoreflect.MessageType = fastReflection_Keyshares_messageType{} + +type fastReflection_Keyshares_messageType struct{} + +func (x fastReflection_Keyshares_messageType) Zero() protoreflect.Message { + return (*fastReflection_Keyshares)(nil) +} +func (x fastReflection_Keyshares_messageType) New() protoreflect.Message { + return new(fastReflection_Keyshares) +} +func (x fastReflection_Keyshares_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Keyshares +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Keyshares) Descriptor() protoreflect.MessageDescriptor { + return md_Keyshares +} + +// 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_Keyshares) Type() protoreflect.MessageType { + return _fastReflection_Keyshares_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Keyshares) New() protoreflect.Message { + return new(fastReflection_Keyshares) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Keyshares) Interface() protoreflect.ProtoMessage { + return (*Keyshares)(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_Keyshares) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ValidatorCid != "" { + value := protoreflect.ValueOfString(x.ValidatorCid) + if !f(fd_Keyshares_validator_cid, value) { + return + } + } + if x.UserCid != "" { + value := protoreflect.ValueOfString(x.UserCid) + if !f(fd_Keyshares_user_cid, value) { + return + } + } + if x.LastUpdatedBlock != int64(0) { + value := protoreflect.ValueOfInt64(x.LastUpdatedBlock) + if !f(fd_Keyshares_last_updated_block, 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_Keyshares) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Keyshares.validator_cid": + return x.ValidatorCid != "" + case "did.v1.Keyshares.user_cid": + return x.UserCid != "" + case "did.v1.Keyshares.last_updated_block": + return x.LastUpdatedBlock != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) + } + panic(fmt.Errorf("message did.v1.Keyshares 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_Keyshares) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Keyshares.validator_cid": + x.ValidatorCid = "" + case "did.v1.Keyshares.user_cid": + x.UserCid = "" + case "did.v1.Keyshares.last_updated_block": + x.LastUpdatedBlock = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) + } + panic(fmt.Errorf("message did.v1.Keyshares 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_Keyshares) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Keyshares.validator_cid": + value := x.ValidatorCid + return protoreflect.ValueOfString(value) + case "did.v1.Keyshares.user_cid": + value := x.UserCid + return protoreflect.ValueOfString(value) + case "did.v1.Keyshares.last_updated_block": + value := x.LastUpdatedBlock + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) + } + panic(fmt.Errorf("message did.v1.Keyshares 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_Keyshares) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Keyshares.validator_cid": + x.ValidatorCid = value.Interface().(string) + case "did.v1.Keyshares.user_cid": + x.UserCid = value.Interface().(string) + case "did.v1.Keyshares.last_updated_block": + x.LastUpdatedBlock = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) + } + panic(fmt.Errorf("message did.v1.Keyshares 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_Keyshares) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Keyshares.validator_cid": + panic(fmt.Errorf("field validator_cid of message did.v1.Keyshares is not mutable")) + case "did.v1.Keyshares.user_cid": + panic(fmt.Errorf("field user_cid of message did.v1.Keyshares is not mutable")) + case "did.v1.Keyshares.last_updated_block": + panic(fmt.Errorf("field last_updated_block of message did.v1.Keyshares is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) + } + panic(fmt.Errorf("message did.v1.Keyshares 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_Keyshares) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Keyshares.validator_cid": + return protoreflect.ValueOfString("") + case "did.v1.Keyshares.user_cid": + return protoreflect.ValueOfString("") + case "did.v1.Keyshares.last_updated_block": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) + } + panic(fmt.Errorf("message did.v1.Keyshares 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_Keyshares) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Keyshares", 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_Keyshares) 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_Keyshares) 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_Keyshares) 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_Keyshares) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Keyshares) + 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.ValidatorCid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.UserCid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.LastUpdatedBlock != 0 { + n += 1 + runtime.Sov(uint64(x.LastUpdatedBlock)) + } + 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().(*Keyshares) + 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.LastUpdatedBlock != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.LastUpdatedBlock)) + i-- + dAtA[i] = 0x18 + } + if len(x.UserCid) > 0 { + i -= len(x.UserCid) + copy(dAtA[i:], x.UserCid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.UserCid))) + i-- + dAtA[i] = 0x12 + } + if len(x.ValidatorCid) > 0 { + i -= len(x.ValidatorCid) + copy(dAtA[i:], x.ValidatorCid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorCid))) + 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().(*Keyshares) + 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: Keyshares: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Keyshares: 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 ValidatorCid", 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.ValidatorCid = 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 UserCid", 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.UserCid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastUpdatedBlock", wireType) + } + x.LastUpdatedBlock = 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.LastUpdatedBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2342,7 +3687,7 @@ func (x *PubKey) ProtoReflect() protoreflect.Message { } func (x *PubKey) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[3] + mi := &file_did_v1_state_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2988,7 +4333,7 @@ func (x *JSONWebKey) ProtoReflect() protoreflect.Message { } func (x *JSONWebKey) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[4] + mi := &file_did_v1_state_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3724,7 +5069,7 @@ func (x *RawKey) ProtoReflect() protoreflect.Message { } func (x *RawKey) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[5] + mi := &file_did_v1_state_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4338,6 +5683,12 @@ type Authentication struct { Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` // PubKey is the verification method PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // CredentialID is the byte representation of the credential ID + CredentialId []byte `protobuf:"bytes,5,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` + // Metadata of the authentication + Metadata map[string]string `protobuf:"bytes,6,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // CreationBlock is the block number of the creation of the authentication + CreationBlock int64 `protobuf:"varint,7,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` } func (x *Authentication) Reset() { @@ -4388,6 +5739,27 @@ func (x *Authentication) GetPublicKey() *PubKey { return nil } +func (x *Authentication) GetCredentialId() []byte { + if x != nil { + return x.CredentialId + } + return nil +} + +func (x *Authentication) GetMetadata() map[string]string { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Authentication) GetCreationBlock() int64 { + if x != nil { + return x.CreationBlock + } + return 0 +} + // Controller represents a Sonr DWN Vault type Controller struct { state protoimpl.MessageState @@ -4406,10 +5778,12 @@ type Controller struct { BtcAddress string `protobuf:"bytes,5,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` // PubKey is the verification method PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // Val Keyshare + // Pointer to the Keyshares KsVal string `protobuf:"bytes,7,opt,name=ks_val,json=ksVal,proto3" json:"ks_val,omitempty"` - // The Status of the claims for the controller - Claimed bool `protobuf:"varint,8,opt,name=claimed,proto3" json:"claimed,omitempty"` + // The block number of when a user claimed the controller + ClaimedBlock int64 `protobuf:"varint,8,opt,name=claimed_block,json=claimedBlock,proto3" json:"claimed_block,omitempty"` + // CreationBlock is the block number of the creation of the controller + CreationBlock int64 `protobuf:"varint,9,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` } func (x *Controller) Reset() { @@ -4481,14 +5855,21 @@ func (x *Controller) GetKsVal() string { return "" } -func (x *Controller) GetClaimed() bool { +func (x *Controller) GetClaimedBlock() int64 { if x != nil { - return x.Claimed + return x.ClaimedBlock } - return false + return 0 } -// Verification reprsents a method of verifying membership in a DID +func (x *Controller) GetCreationBlock() int64 { + if x != nil { + return x.CreationBlock + } + return 0 +} + +// Verification represents a verification method type Verification struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4506,9 +5887,12 @@ type Verification struct { Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The public key of the verification PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The Verification Type (Authentication, Assertion, CapabilityDelegation, - // CapabilityInvocation) + // The verification method type VerificationType string `protobuf:"bytes,7,opt,name=verification_type,json=verificationType,proto3" json:"verification_type,omitempty"` + // Metadata of the verification + Metadata map[string]string `protobuf:"bytes,8,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // CreationBlock is the block number of the creation of the controller + CreationBlock int64 `protobuf:"varint,9,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` } func (x *Verification) Reset() { @@ -4580,6 +5964,71 @@ func (x *Verification) GetVerificationType() string { return "" } +func (x *Verification) GetMetadata() map[string]string { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Verification) GetCreationBlock() int64 { + if x != nil { + return x.CreationBlock + } + return 0 +} + +type Keyshares struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ValidatorCid string `protobuf:"bytes,1,opt,name=validator_cid,json=validatorCid,proto3" json:"validator_cid,omitempty"` + UserCid string `protobuf:"bytes,2,opt,name=user_cid,json=userCid,proto3" json:"user_cid,omitempty"` + LastUpdatedBlock int64 `protobuf:"varint,3,opt,name=last_updated_block,json=lastUpdatedBlock,proto3" json:"last_updated_block,omitempty"` +} + +func (x *Keyshares) Reset() { + *x = Keyshares{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_state_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Keyshares) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Keyshares) ProtoMessage() {} + +// Deprecated: Use Keyshares.ProtoReflect.Descriptor instead. +func (*Keyshares) Descriptor() ([]byte, []int) { + return file_did_v1_state_proto_rawDescGZIP(), []int{3} +} + +func (x *Keyshares) GetValidatorCid() string { + if x != nil { + return x.ValidatorCid + } + return "" +} + +func (x *Keyshares) GetUserCid() string { + if x != nil { + return x.UserCid + } + return "" +} + +func (x *Keyshares) GetLastUpdatedBlock() int64 { + if x != nil { + return x.LastUpdatedBlock + } + return 0 +} + // PubKey defines a public key for a did type PubKey struct { state protoimpl.MessageState @@ -4595,7 +6044,7 @@ type PubKey struct { func (x *PubKey) Reset() { *x = PubKey{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[3] + mi := &file_did_v1_state_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4609,7 +6058,7 @@ func (*PubKey) ProtoMessage() {} // Deprecated: Use PubKey.ProtoReflect.Descriptor instead. func (*PubKey) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{3} + return file_did_v1_state_proto_rawDescGZIP(), []int{4} } func (x *PubKey) GetRole() string { @@ -4657,7 +6106,7 @@ type JSONWebKey struct { func (x *JSONWebKey) Reset() { *x = JSONWebKey{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[4] + mi := &file_did_v1_state_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4671,7 +6120,7 @@ func (*JSONWebKey) ProtoMessage() {} // Deprecated: Use JSONWebKey.ProtoReflect.Descriptor instead. func (*JSONWebKey) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{4} + return file_did_v1_state_proto_rawDescGZIP(), []int{5} } func (x *JSONWebKey) GetKty() string { @@ -4730,7 +6179,7 @@ type RawKey struct { func (x *RawKey) Reset() { *x = RawKey{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[5] + mi := &file_did_v1_state_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4744,7 +6193,7 @@ func (*RawKey) ProtoMessage() {} // Deprecated: Use RawKey.ProtoReflect.Descriptor instead. func (*RawKey) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{5} + return file_did_v1_state_proto_rawDescGZIP(), []int{6} } func (x *RawKey) GetAlgorithm() string { @@ -4781,7 +6230,7 @@ var file_did_v1_state_proto_rawDesc = []byte{ 0x0a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb6, 0x01, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, 0x03, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, @@ -4790,83 +6239,117 @@ var file_did_v1_state_proto_rawDesc = []byte{ 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x3a, 0x29, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x23, 0x0a, 0x05, 0x0a, 0x03, 0x64, - 0x69, 0x64, 0x12, 0x18, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, - 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0xd6, - 0x02, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, - 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, - 0x6f, 0x6e, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x74, - 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x65, 0x74, 0x68, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, - 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x62, 0x74, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2d, 0x0a, 0x0a, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, - 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6b, - 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x73, 0x56, - 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x3a, 0x59, 0xf2, 0x9e, - 0xd3, 0x8e, 0x03, 0x53, 0x0a, 0x0a, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x10, 0x01, - 0x12, 0x12, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x10, 0x01, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x10, 0x02, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x03, 0x18, 0x01, 0x12, 0x09, 0x0a, 0x03, 0x64, 0x69, - 0x64, 0x10, 0x04, 0x18, 0x01, 0x18, 0x02, 0x22, 0xe0, 0x02, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, - 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x64, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, - 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x71, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x6b, 0x0a, - 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, - 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x12, 0x22, 0x0a, 0x1c, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x64, 0x69, 0x64, 0x5f, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x02, 0x18, 0x01, - 0x12, 0x26, 0x0a, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x69, 0x73, - 0x73, 0x75, 0x65, 0x72, 0x10, 0x03, 0x18, 0x01, 0x18, 0x04, 0x22, 0x86, 0x01, 0x0a, 0x06, 0x50, - 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x72, 0x61, 0x77, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x61, 0x77, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x72, 0x61, 0x77, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, - 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x57, 0x65, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x03, - 0x6a, 0x77, 0x6b, 0x22, 0x68, 0x0a, 0x0a, 0x4a, 0x53, 0x4f, 0x4e, 0x57, 0x65, 0x62, 0x4b, 0x65, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x63, 0x72, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, - 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6e, 0x12, - 0x0c, 0x0a, 0x01, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, 0x6a, 0x0a, - 0x06, 0x52, 0x61, 0x77, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, - 0x69, 0x74, 0x68, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, - 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, - 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, - 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, - 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, - 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x29, + 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x23, 0x0a, 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x18, 0x0a, + 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0x88, 0x03, 0x0a, 0x0a, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, + 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x6e, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x74, 0x63, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x73, 0x5f, 0x76, 0x61, 0x6c, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x73, 0x56, 0x61, 0x6c, 0x12, 0x23, 0x0a, + 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, 0x59, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, + 0x53, 0x0a, 0x0a, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x10, 0x01, 0x12, 0x12, 0x0a, + 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x18, + 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x10, 0x02, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x10, 0x03, 0x18, 0x01, 0x12, 0x09, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x10, 0x04, + 0x18, 0x01, 0x18, 0x02, 0x22, 0x84, 0x04, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x64, 0x5f, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x64, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x71, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x6b, + 0x0a, 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x69, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x12, 0x22, 0x0a, + 0x1c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x64, 0x69, 0x64, 0x5f, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x02, 0x18, + 0x01, 0x12, 0x26, 0x0a, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x69, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x03, 0x18, 0x01, 0x18, 0x04, 0x22, 0x79, 0x0a, 0x09, 0x4b, + 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x69, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x43, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x86, 0x01, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x4b, 0x65, + 0x79, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x27, 0x0a, 0x07, 0x72, 0x61, 0x77, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x4b, 0x65, + 0x79, 0x52, 0x06, 0x72, 0x61, 0x77, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x4a, 0x53, 0x4f, 0x4e, 0x57, 0x65, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x22, + 0x68, 0x0a, 0x0a, 0x4a, 0x53, 0x4f, 0x4e, 0x57, 0x65, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x74, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, + 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, + 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, + 0x01, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, 0x6a, 0x0a, 0x06, 0x52, 0x61, 0x77, + 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, + 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, + 0x72, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, + 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4881,26 +6364,31 @@ func file_did_v1_state_proto_rawDescGZIP() []byte { return file_did_v1_state_proto_rawDescData } -var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_did_v1_state_proto_goTypes = []interface{}{ (*Authentication)(nil), // 0: did.v1.Authentication (*Controller)(nil), // 1: did.v1.Controller (*Verification)(nil), // 2: did.v1.Verification - (*PubKey)(nil), // 3: did.v1.PubKey - (*JSONWebKey)(nil), // 4: did.v1.JSONWebKey - (*RawKey)(nil), // 5: did.v1.RawKey + (*Keyshares)(nil), // 3: did.v1.Keyshares + (*PubKey)(nil), // 4: did.v1.PubKey + (*JSONWebKey)(nil), // 5: did.v1.JSONWebKey + (*RawKey)(nil), // 6: did.v1.RawKey + nil, // 7: did.v1.Authentication.MetadataEntry + nil, // 8: did.v1.Verification.MetadataEntry } var file_did_v1_state_proto_depIdxs = []int32{ - 3, // 0: did.v1.Authentication.public_key:type_name -> did.v1.PubKey - 3, // 1: did.v1.Controller.public_key:type_name -> did.v1.PubKey - 3, // 2: did.v1.Verification.public_key:type_name -> did.v1.PubKey - 5, // 3: did.v1.PubKey.raw_key:type_name -> did.v1.RawKey - 4, // 4: did.v1.PubKey.jwk:type_name -> did.v1.JSONWebKey - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 4, // 0: did.v1.Authentication.public_key:type_name -> did.v1.PubKey + 7, // 1: did.v1.Authentication.metadata:type_name -> did.v1.Authentication.MetadataEntry + 4, // 2: did.v1.Controller.public_key:type_name -> did.v1.PubKey + 4, // 3: did.v1.Verification.public_key:type_name -> did.v1.PubKey + 8, // 4: did.v1.Verification.metadata:type_name -> did.v1.Verification.MetadataEntry + 6, // 5: did.v1.PubKey.raw_key:type_name -> did.v1.RawKey + 5, // 6: did.v1.PubKey.jwk:type_name -> did.v1.JSONWebKey + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_did_v1_state_proto_init() } @@ -4946,7 +6434,7 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PubKey); i { + switch v := v.(*Keyshares); i { case 0: return &v.state case 1: @@ -4958,7 +6446,7 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JSONWebKey); i { + switch v := v.(*PubKey); i { case 0: return &v.state case 1: @@ -4970,6 +6458,18 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JSONWebKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_state_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RawKey); i { case 0: return &v.state @@ -4988,7 +6488,7 @@ func file_did_v1_state_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_state_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/api/macaroon/v1/tx.pulsar.go b/api/macaroon/v1/tx.pulsar.go index 66e98b8ce..ca34b72e5 100644 --- a/api/macaroon/v1/tx.pulsar.go +++ b/api/macaroon/v1/tx.pulsar.go @@ -2290,7 +2290,7 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_macaroon_v1_tx_proto_rawDescGZIP(), []int{1} } -// MsgIssueMacaroon is the message type for the AuthorizeService RPC. +// MsgIssueMacaroon is the message type for the IssueMacaroon RPC. type MsgIssueMacaroon struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2354,7 +2354,7 @@ func (x *MsgIssueMacaroon) GetToken() string { return "" } -// MsgIssueMacaroonResponse is the response type for the AuthorizeService +// MsgIssueMacaroonResponse is the response type for the IssueMacaroon // RPC. type MsgIssueMacaroonResponse struct { state protoimpl.MessageState @@ -2443,29 +2443,29 @@ var file_macaroon_v1_tx_proto_rawDesc = []byte{ 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xba, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xb7, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x52, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x24, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x41, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1d, - 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x1a, 0x25, 0x2e, - 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x49, - 0x73, 0x73, 0x75, 0x65, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x9a, 0x01, 0x0a, 0x0f, - 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, - 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, - 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x61, 0x63, 0x61, - 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0d, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x6d, 0x61, + 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x1a, 0x25, 0x2e, 0x6d, 0x61, 0x63, + 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x9a, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, + 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, + 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, + 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4d, + 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, + 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2493,9 +2493,9 @@ var file_macaroon_v1_tx_proto_depIdxs = []int32{ 5, // 0: macaroon.v1.MsgUpdateParams.params:type_name -> macaroon.v1.Params 4, // 1: macaroon.v1.MsgIssueMacaroon.permissions:type_name -> macaroon.v1.MsgIssueMacaroon.PermissionsEntry 0, // 2: macaroon.v1.Msg.UpdateParams:input_type -> macaroon.v1.MsgUpdateParams - 2, // 3: macaroon.v1.Msg.AuthorizeService:input_type -> macaroon.v1.MsgIssueMacaroon + 2, // 3: macaroon.v1.Msg.IssueMacaroon:input_type -> macaroon.v1.MsgIssueMacaroon 1, // 4: macaroon.v1.Msg.UpdateParams:output_type -> macaroon.v1.MsgUpdateParamsResponse - 3, // 5: macaroon.v1.Msg.AuthorizeService:output_type -> macaroon.v1.MsgIssueMacaroonResponse + 3, // 5: macaroon.v1.Msg.IssueMacaroon:output_type -> macaroon.v1.MsgIssueMacaroonResponse 4, // [4:6] is the sub-list for method output_type 2, // [2:4] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name diff --git a/api/macaroon/v1/tx_grpc.pb.go b/api/macaroon/v1/tx_grpc.pb.go index 5bf0578f5..930026957 100644 --- a/api/macaroon/v1/tx_grpc.pb.go +++ b/api/macaroon/v1/tx_grpc.pb.go @@ -19,8 +19,8 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_UpdateParams_FullMethodName = "/macaroon.v1.Msg/UpdateParams" - Msg_AuthorizeService_FullMethodName = "/macaroon.v1.Msg/AuthorizeService" + Msg_UpdateParams_FullMethodName = "/macaroon.v1.Msg/UpdateParams" + Msg_IssueMacaroon_FullMethodName = "/macaroon.v1.Msg/IssueMacaroon" ) // MsgClient is the client API for Msg service. @@ -31,9 +31,9 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - // AuthorizeService asserts the given controller is the owner of the given + // IssueMacaroon asserts the given controller is the owner of the given // address. - AuthorizeService(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error) + IssueMacaroon(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error) } type msgClient struct { @@ -53,9 +53,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } -func (c *msgClient) AuthorizeService(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error) { +func (c *msgClient) IssueMacaroon(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error) { out := new(MsgIssueMacaroonResponse) - err := c.cc.Invoke(ctx, Msg_AuthorizeService_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_IssueMacaroon_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -70,9 +70,9 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - // AuthorizeService asserts the given controller is the owner of the given + // IssueMacaroon asserts the given controller is the owner of the given // address. - AuthorizeService(context.Context, *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error) + IssueMacaroon(context.Context, *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error) mustEmbedUnimplementedMsgServer() } @@ -83,8 +83,8 @@ type UnimplementedMsgServer struct { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } -func (UnimplementedMsgServer) AuthorizeService(context.Context, *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AuthorizeService not implemented") +func (UnimplementedMsgServer) IssueMacaroon(context.Context, *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IssueMacaroon not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} @@ -117,20 +117,20 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Msg_AuthorizeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_IssueMacaroon_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgIssueMacaroon) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).AuthorizeService(ctx, in) + return srv.(MsgServer).IssueMacaroon(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_AuthorizeService_FullMethodName, + FullMethod: Msg_IssueMacaroon_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AuthorizeService(ctx, req.(*MsgIssueMacaroon)) + return srv.(MsgServer).IssueMacaroon(ctx, req.(*MsgIssueMacaroon)) } return interceptor(ctx, in, info, handler) } @@ -147,8 +147,8 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ Handler: _Msg_UpdateParams_Handler, }, { - MethodName: "AuthorizeService", - Handler: _Msg_AuthorizeService_Handler, + MethodName: "IssueMacaroon", + Handler: _Msg_IssueMacaroon_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/api/vault/v1/state.cosmos_orm.go b/api/vault/v1/state.cosmos_orm.go index 0e6141446..c4d222026 100644 --- a/api/vault/v1/state.cosmos_orm.go +++ b/api/vault/v1/state.cosmos_orm.go @@ -11,12 +11,20 @@ import ( type DWNTable interface { Insert(ctx context.Context, dWN *DWN) error + InsertReturningId(ctx context.Context, dWN *DWN) (uint64, error) + LastInsertedSequence(ctx context.Context) (uint64, error) Update(ctx context.Context, dWN *DWN) error Save(ctx context.Context, dWN *DWN) error Delete(ctx context.Context, dWN *DWN) error - Has(ctx context.Context, account []byte) (found bool, err error) + Has(ctx context.Context, id uint64) (found bool, err error) // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, account []byte) (*DWN, error) + Get(ctx context.Context, id uint64) (*DWN, error) + HasByAlias(ctx context.Context, alias string) (found bool, err error) + // GetByAlias returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByAlias(ctx context.Context, alias string) (*DWN, error) + HasByCid(ctx context.Context, cid string) (found bool, err error) + // GetByCid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByCid(ctx context.Context, cid string) (*DWN, error) List(ctx context.Context, prefixKey DWNIndexKey, opts ...ormlist.Option) (DWNIterator, error) ListRange(ctx context.Context, from, to DWNIndexKey, opts ...ormlist.Option) (DWNIterator, error) DeleteBy(ctx context.Context, prefixKey DWNIndexKey) error @@ -42,36 +50,49 @@ type DWNIndexKey interface { } // primary key starting index.. -type DWNPrimaryKey = DWNAccountIndexKey +type DWNPrimaryKey = DWNIdIndexKey -type DWNAccountIndexKey struct { +type DWNIdIndexKey struct { vs []interface{} } -func (x DWNAccountIndexKey) id() uint32 { return 0 } -func (x DWNAccountIndexKey) values() []interface{} { return x.vs } -func (x DWNAccountIndexKey) dWNIndexKey() {} +func (x DWNIdIndexKey) id() uint32 { return 0 } +func (x DWNIdIndexKey) values() []interface{} { return x.vs } +func (x DWNIdIndexKey) dWNIndexKey() {} -func (this DWNAccountIndexKey) WithAccount(account []byte) DWNAccountIndexKey { - this.vs = []interface{}{account} +func (this DWNIdIndexKey) WithId(id uint64) DWNIdIndexKey { + this.vs = []interface{}{id} return this } -type DWNAmountIndexKey struct { +type DWNAliasIndexKey struct { vs []interface{} } -func (x DWNAmountIndexKey) id() uint32 { return 1 } -func (x DWNAmountIndexKey) values() []interface{} { return x.vs } -func (x DWNAmountIndexKey) dWNIndexKey() {} +func (x DWNAliasIndexKey) id() uint32 { return 1 } +func (x DWNAliasIndexKey) values() []interface{} { return x.vs } +func (x DWNAliasIndexKey) dWNIndexKey() {} -func (this DWNAmountIndexKey) WithAmount(amount uint64) DWNAmountIndexKey { - this.vs = []interface{}{amount} +func (this DWNAliasIndexKey) WithAlias(alias string) DWNAliasIndexKey { + this.vs = []interface{}{alias} + return this +} + +type DWNCidIndexKey struct { + vs []interface{} +} + +func (x DWNCidIndexKey) id() uint32 { return 2 } +func (x DWNCidIndexKey) values() []interface{} { return x.vs } +func (x DWNCidIndexKey) dWNIndexKey() {} + +func (this DWNCidIndexKey) WithCid(cid string) DWNCidIndexKey { + this.vs = []interface{}{cid} return this } type dWNTable struct { - table ormtable.Table + table ormtable.AutoIncrementTable } func (this dWNTable) Insert(ctx context.Context, dWN *DWN) error { @@ -90,13 +111,61 @@ func (this dWNTable) Delete(ctx context.Context, dWN *DWN) error { return this.table.Delete(ctx, dWN) } -func (this dWNTable) Has(ctx context.Context, account []byte) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, account) +func (this dWNTable) InsertReturningId(ctx context.Context, dWN *DWN) (uint64, error) { + return this.table.InsertReturningPKey(ctx, dWN) } -func (this dWNTable) Get(ctx context.Context, account []byte) (*DWN, error) { +func (this dWNTable) LastInsertedSequence(ctx context.Context) (uint64, error) { + return this.table.LastInsertedSequence(ctx) +} + +func (this dWNTable) Has(ctx context.Context, id uint64) (found bool, err error) { + return this.table.PrimaryKey().Has(ctx, id) +} + +func (this dWNTable) Get(ctx context.Context, id uint64) (*DWN, error) { var dWN DWN - found, err := this.table.PrimaryKey().Get(ctx, &dWN, account) + found, err := this.table.PrimaryKey().Get(ctx, &dWN, id) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &dWN, nil +} + +func (this dWNTable) HasByAlias(ctx context.Context, alias string) (found bool, err error) { + return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, + alias, + ) +} + +func (this dWNTable) GetByAlias(ctx context.Context, alias string) (*DWN, error) { + var dWN DWN + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &dWN, + alias, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &dWN, nil +} + +func (this dWNTable) HasByCid(ctx context.Context, cid string) (found bool, err error) { + return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, + cid, + ) +} + +func (this dWNTable) GetByCid(ctx context.Context, cid string) (*DWN, error) { + var dWN DWN + found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &dWN, + cid, + ) if err != nil { return nil, err } @@ -133,7 +202,7 @@ func NewDWNTable(db ormtable.Schema) (DWNTable, error) { if table == nil { return nil, ormerrors.TableNotFound.Wrap(string((&DWN{}).ProtoReflect().Descriptor().FullName())) } - return dWNTable{table}, nil + return dWNTable{table.(ormtable.AutoIncrementTable)}, nil } type StateStore interface { diff --git a/api/vault/v1/state.pulsar.go b/api/vault/v1/state.pulsar.go index b99a0cbe6..2287907c4 100644 --- a/api/vault/v1/state.pulsar.go +++ b/api/vault/v1/state.pulsar.go @@ -14,16 +14,18 @@ import ( ) var ( - md_DWN protoreflect.MessageDescriptor - fd_DWN_account protoreflect.FieldDescriptor - fd_DWN_amount protoreflect.FieldDescriptor + md_DWN protoreflect.MessageDescriptor + fd_DWN_id protoreflect.FieldDescriptor + fd_DWN_alias protoreflect.FieldDescriptor + fd_DWN_cid protoreflect.FieldDescriptor ) func init() { file_vault_v1_state_proto_init() md_DWN = File_vault_v1_state_proto.Messages().ByName("DWN") - fd_DWN_account = md_DWN.Fields().ByName("account") - fd_DWN_amount = md_DWN.Fields().ByName("amount") + fd_DWN_id = md_DWN.Fields().ByName("id") + fd_DWN_alias = md_DWN.Fields().ByName("alias") + fd_DWN_cid = md_DWN.Fields().ByName("cid") } var _ protoreflect.Message = (*fastReflection_DWN)(nil) @@ -91,15 +93,21 @@ func (x *fastReflection_DWN) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_DWN) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Account) != 0 { - value := protoreflect.ValueOfBytes(x.Account) - if !f(fd_DWN_account, value) { + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_DWN_id, value) { return } } - if x.Amount != uint64(0) { - value := protoreflect.ValueOfUint64(x.Amount) - if !f(fd_DWN_amount, value) { + if x.Alias != "" { + value := protoreflect.ValueOfString(x.Alias) + if !f(fd_DWN_alias, value) { + return + } + } + if x.Cid != "" { + value := protoreflect.ValueOfString(x.Cid) + if !f(fd_DWN_cid, value) { return } } @@ -118,10 +126,12 @@ func (x *fastReflection_DWN) Range(f func(protoreflect.FieldDescriptor, protoref // a repeated field is populated if it is non-empty. func (x *fastReflection_DWN) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "vault.v1.DWN.account": - return len(x.Account) != 0 - case "vault.v1.DWN.amount": - return x.Amount != uint64(0) + case "vault.v1.DWN.id": + return x.Id != uint64(0) + case "vault.v1.DWN.alias": + return x.Alias != "" + case "vault.v1.DWN.cid": + return x.Cid != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) @@ -138,10 +148,12 @@ func (x *fastReflection_DWN) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_DWN) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "vault.v1.DWN.account": - x.Account = nil - case "vault.v1.DWN.amount": - x.Amount = uint64(0) + case "vault.v1.DWN.id": + x.Id = uint64(0) + case "vault.v1.DWN.alias": + x.Alias = "" + case "vault.v1.DWN.cid": + x.Cid = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) @@ -158,12 +170,15 @@ func (x *fastReflection_DWN) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_DWN) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "vault.v1.DWN.account": - value := x.Account - return protoreflect.ValueOfBytes(value) - case "vault.v1.DWN.amount": - value := x.Amount + case "vault.v1.DWN.id": + value := x.Id return protoreflect.ValueOfUint64(value) + case "vault.v1.DWN.alias": + value := x.Alias + return protoreflect.ValueOfString(value) + case "vault.v1.DWN.cid": + value := x.Cid + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) @@ -184,10 +199,12 @@ func (x *fastReflection_DWN) Get(descriptor protoreflect.FieldDescriptor) protor // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_DWN) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "vault.v1.DWN.account": - x.Account = value.Bytes() - case "vault.v1.DWN.amount": - x.Amount = value.Uint() + case "vault.v1.DWN.id": + x.Id = value.Uint() + case "vault.v1.DWN.alias": + x.Alias = value.Interface().(string) + case "vault.v1.DWN.cid": + x.Cid = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) @@ -208,10 +225,12 @@ func (x *fastReflection_DWN) Set(fd protoreflect.FieldDescriptor, value protoref // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_DWN) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "vault.v1.DWN.account": - panic(fmt.Errorf("field account of message vault.v1.DWN is not mutable")) - case "vault.v1.DWN.amount": - panic(fmt.Errorf("field amount of message vault.v1.DWN is not mutable")) + case "vault.v1.DWN.id": + panic(fmt.Errorf("field id of message vault.v1.DWN is not mutable")) + case "vault.v1.DWN.alias": + panic(fmt.Errorf("field alias of message vault.v1.DWN is not mutable")) + case "vault.v1.DWN.cid": + panic(fmt.Errorf("field cid of message vault.v1.DWN is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) @@ -225,10 +244,12 @@ func (x *fastReflection_DWN) Mutable(fd protoreflect.FieldDescriptor) protorefle // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_DWN) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "vault.v1.DWN.account": - return protoreflect.ValueOfBytes(nil) - case "vault.v1.DWN.amount": + case "vault.v1.DWN.id": return protoreflect.ValueOfUint64(uint64(0)) + case "vault.v1.DWN.alias": + return protoreflect.ValueOfString("") + case "vault.v1.DWN.cid": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN")) @@ -298,12 +319,16 @@ func (x *fastReflection_DWN) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Account) + if x.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) + } + l = len(x.Alias) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Amount != 0 { - n += 1 + runtime.Sov(uint64(x.Amount)) + l = len(x.Cid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -334,17 +359,24 @@ func (x *fastReflection_DWN) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Amount != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Amount)) + if len(x.Cid) > 0 { + i -= len(x.Cid) + copy(dAtA[i:], x.Cid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cid))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x1a } - if len(x.Account) > 0 { - i -= len(x.Account) - copy(dAtA[i:], x.Account) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Account))) + if len(x.Alias) > 0 { + i -= len(x.Alias) + copy(dAtA[i:], x.Alias) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Alias))) i-- - dAtA[i] = 0xa + 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...) @@ -396,10 +428,10 @@ func (x *fastReflection_DWN) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var byteLen int + x.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -409,31 +441,48 @@ func (x *fastReflection_DWN) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + x.Id |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Alias", 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 + byteLen + 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.Account = append(x.Account[:0], dAtA[iNdEx:postIndex]...) - if x.Account == nil { - x.Account = []byte{} - } + x.Alias = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) } - x.Amount = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -443,11 +492,24 @@ func (x *fastReflection_DWN) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Amount |= uint64(b&0x7F) << shift + 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.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -501,8 +563,9 @@ type DWN struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Alias string `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"` + Cid string `protobuf:"bytes,3,opt,name=cid,proto3" json:"cid,omitempty"` } func (x *DWN) Reset() { @@ -525,42 +588,50 @@ func (*DWN) Descriptor() ([]byte, []int) { return file_vault_v1_state_proto_rawDescGZIP(), []int{0} } -func (x *DWN) GetAccount() []byte { +func (x *DWN) GetId() uint64 { if x != nil { - return x.Account - } - return nil -} - -func (x *DWN) GetAmount() uint64 { - if x != nil { - return x.Amount + return x.Id } return 0 } +func (x *DWN) GetAlias() string { + if x != nil { + return x.Alias + } + return "" +} + +func (x *DWN) GetCid() string { + if x != nil { + return x.Cid + } + return "" +} + var File_vault_v1_state_proto protoreflect.FileDescriptor var file_vault_v1_state_proto_rawDesc = []byte{ 0x0a, 0x14, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, - 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x03, 0x44, 0x57, 0x4e, - 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x3a, 0x1f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x19, 0x0a, 0x09, 0x0a, 0x07, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x10, - 0x01, 0x18, 0x01, 0x42, 0x88, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, - 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, - 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x56, 0x61, - 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x67, 0x0a, 0x03, 0x44, 0x57, 0x4e, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x3a, 0x28, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x22, + 0x0a, 0x06, 0x0a, 0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, + 0x73, 0x10, 0x01, 0x18, 0x01, 0x12, 0x09, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x10, 0x02, 0x18, 0x01, + 0x18, 0x01, 0x42, 0x88, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, + 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x61, + 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x56, 0x61, 0x75, + 0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/proxy/proxycmd.go b/app/proxy/proxycmd.go index 180216a75..b98c9b894 100644 --- a/app/proxy/proxycmd.go +++ b/app/proxy/proxycmd.go @@ -9,9 +9,10 @@ import ( "github.com/labstack/echo/v4" "github.com/labstack/gommon/log" - "github.com/onsonr/sonr/nebula" - "github.com/onsonr/sonr/nebula/pages" "github.com/spf13/cobra" + + "github.com/onsonr/sonr/pkg/nebula" + "github.com/onsonr/sonr/pkg/nebula/pages" ) func NewProxyCmd() *cobra.Command { diff --git a/cmd/motr/proxy.go b/cmd/motr/proxy.go index 718397ff9..200db70ee 100644 --- a/cmd/motr/proxy.go +++ b/cmd/motr/proxy.go @@ -9,9 +9,10 @@ import ( "github.com/labstack/echo/v4" "github.com/labstack/gommon/log" - "github.com/onsonr/sonr/nebula" - "github.com/onsonr/sonr/nebula/pages" "github.com/spf13/cobra" + + "github.com/onsonr/sonr/pkg/nebula" + "github.com/onsonr/sonr/pkg/nebula/pages" ) func NewProxyCmd() *cobra.Command { diff --git a/devbox.json b/devbox.json index ddd6b7abc..2f0712ade 100644 --- a/devbox.json +++ b/devbox.json @@ -26,15 +26,36 @@ }, "shell": { "scripts": { - "build:docker": ["make local-image"], - "build:motr": ["cd nebula && bun run build", "make motr"], - "build:nebula": ["cd nebula && bun run build"], - "build:sonrd": ["make dwn", "make build"], - "gen:proto": ["make proto-gen"], - "gen:pkl": ["make pkl"], - "gen:templ": ["make templ"], - "start:motr": ["make templ", "make motr", "make start-motr"], - "start:testnet": ["make templ", "make install", "make sh-testnet"] + "build:docker": [ + "make local-image" + ], + "build:motr": [ + "make nebula", + "make motr" + ], + "build:sonrd": [ + "make dwn", + "make build" + ], + "gen:proto": [ + "make proto-gen" + ], + "gen:pkl": [ + "make pkl" + ], + "gen:templ": [ + "make templ" + ], + "start:motr": [ + "make templ", + "make motr", + "make start-motr" + ], + "start:testnet": [ + "make templ", + "make install", + "make sh-testnet" + ] } } } diff --git a/nebula/blocks/footer_templ.go b/nebula/blocks/footer_templ.go deleted file mode 100644 index 51e614c0f..000000000 --- a/nebula/blocks/footer_templ.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package blocks - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func FooterMarketingNav() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/nebula/blocks/layout.templ b/nebula/blocks/layout.templ deleted file mode 100644 index 6ba65ffc9..000000000 --- a/nebula/blocks/layout.templ +++ /dev/null @@ -1,21 +0,0 @@ -package blocks - -templ Layout(title string, remote bool) { - - - - @Alpine(remote) - @Htmx(remote) - @Styles(remote) - - - - { title } - - -
- { children... } -
- - -} diff --git a/nebula/blocks/layout_templ.go b/nebula/blocks/layout_templ.go deleted file mode 100644 index 3a70a2eb1..000000000 --- a/nebula/blocks/layout_templ.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package blocks - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func Layout(title string, remote bool) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Alpine(remote).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Htmx(remote).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Styles(remote).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/layout.templ`, Line: 13, Col: 17} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/nebula/blocks/sections_templ.go b/nebula/blocks/sections_templ.go deleted file mode 100644 index ed91b5d1a..000000000 --- a/nebula/blocks/sections_templ.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package blocks - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func SectionHero() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

The creative platform for cross-functional work

Turbocharge your creative process with a powerful AI design platform that gives creatives the power of creating without limits.

\"Hero\"

0K

Assets packed with power beyond your imagination.

0K

Assets packed with power beyond your imagination.

0M+

Assets packed with power beyond your imagination.

0K

Assets packed with power beyond your imagination.

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/nebula/pages/home.templ b/nebula/pages/home.templ deleted file mode 100644 index 2fe4a92c0..000000000 --- a/nebula/pages/home.templ +++ /dev/null @@ -1,32 +0,0 @@ -package pages - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/nebula/blocks" -) - -func Home(c echo.Context) error { - return echoResponse(c, homeView()) -} - -templ homeView() { - @blocks.Layout("Sonr.ID", true) { - @blocks.HeaderMarketingNav() - @blocks.SectionHero() - @blocks.Card("home-view", blocks.SizeLarge) { - @blocks.H1("Sonr.ID") - @blocks.Text("A Decentralized Web Node Client for the Sonr Network.") - @blocks.Spacer() -
- @blocks.Button(blocks.GET("/register", "#home-view"), blocks.PrimaryButtonStyle()) { - @blocks.Text("Get Started") - } - @blocks.Button(blocks.GET("/login", "#home-view")) { - @blocks.Text("Login") - } -
- @blocks.PoweredBySonr() - } - @blocks.FooterMarketingNav() - } -} diff --git a/nebula/pages/home_templ.go b/nebula/pages/home_templ.go deleted file mode 100644 index 051559e9e..000000000 --- a/nebula/pages/home_templ.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package pages - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/nebula/blocks" -) - -func Home(c echo.Context) error { - return echoResponse(c, homeView()) -} - -func homeView() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.HeaderMarketingNav().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.SectionHero().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.Text("A Decentralized Web Node Client for the Sonr Network.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.Spacer().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.Text("Get Started").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Button(blocks.GET("/register", "#home-view"), blocks.PrimaryButtonStyle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.Text("Login").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Button(blocks.GET("/login", "#home-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.PoweredBySonr().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Card("home-view", blocks.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.FooterMarketingNav().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/app/config/dwn/Config.pkl.go b/pkg/dwn/Config.pkl.go similarity index 100% rename from app/config/dwn/Config.pkl.go rename to pkg/dwn/Config.pkl.go diff --git a/app/config/dwn/Dwn.pkl.go b/pkg/dwn/Dwn.pkl.go similarity index 100% rename from app/config/dwn/Dwn.pkl.go rename to pkg/dwn/Dwn.pkl.go diff --git a/app/config/dwn/IPFS.pkl.go b/pkg/dwn/IPFS.pkl.go similarity index 100% rename from app/config/dwn/IPFS.pkl.go rename to pkg/dwn/IPFS.pkl.go diff --git a/app/config/dwn/Motr.pkl.go b/pkg/dwn/Motr.pkl.go similarity index 100% rename from app/config/dwn/Motr.pkl.go rename to pkg/dwn/Motr.pkl.go diff --git a/app/config/dwn/Schema.pkl.go b/pkg/dwn/Schema.pkl.go similarity index 100% rename from app/config/dwn/Schema.pkl.go rename to pkg/dwn/Schema.pkl.go diff --git a/app/config/dwn/Sonr.pkl.go b/pkg/dwn/Sonr.pkl.go similarity index 100% rename from app/config/dwn/Sonr.pkl.go rename to pkg/dwn/Sonr.pkl.go diff --git a/app/config/dwn/init.pkl.go b/pkg/dwn/init.pkl.go similarity index 100% rename from app/config/dwn/init.pkl.go rename to pkg/dwn/init.pkl.go diff --git a/nebula/.deps.mjs b/pkg/nebula/.deps.mjs similarity index 100% rename from nebula/.deps.mjs rename to pkg/nebula/.deps.mjs diff --git a/nebula/README.md b/pkg/nebula/README.md similarity index 100% rename from nebula/README.md rename to pkg/nebula/README.md diff --git a/nebula/assets/css/styles.css b/pkg/nebula/assets/css/styles.css similarity index 100% rename from nebula/assets/css/styles.css rename to pkg/nebula/assets/css/styles.css diff --git a/nebula/assets/js/alpine.min.js b/pkg/nebula/assets/js/alpine.min.js similarity index 100% rename from nebula/assets/js/alpine.min.js rename to pkg/nebula/assets/js/alpine.min.js diff --git a/nebula/assets/js/htmx.min.js b/pkg/nebula/assets/js/htmx.min.js similarity index 100% rename from nebula/assets/js/htmx.min.js rename to pkg/nebula/assets/js/htmx.min.js diff --git a/nebula/assets/js/motr.js b/pkg/nebula/assets/js/motr.js similarity index 100% rename from nebula/assets/js/motr.js rename to pkg/nebula/assets/js/motr.js diff --git a/nebula/bun.lockb b/pkg/nebula/bun.lockb similarity index 100% rename from nebula/bun.lockb rename to pkg/nebula/bun.lockb diff --git a/nebula/blocks/alert.templ b/pkg/nebula/components/blocks/alert.templ similarity index 100% rename from nebula/blocks/alert.templ rename to pkg/nebula/components/blocks/alert.templ diff --git a/nebula/blocks/alert_templ.go b/pkg/nebula/components/blocks/alert_templ.go similarity index 96% rename from nebula/blocks/alert_templ.go rename to pkg/nebula/components/blocks/alert_templ.go index dee2fc99b..1fb33d230 100644 --- a/nebula/blocks/alert_templ.go +++ b/pkg/nebula/components/blocks/alert_templ.go @@ -56,7 +56,7 @@ func alertElement(attrs templ.Attributes, title, message string, icon templ.Comp var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/alert.templ`, Line: 10, Col: 66} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/alert.templ`, Line: 10, Col: 66} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -69,7 +69,7 @@ func alertElement(attrs templ.Attributes, title, message string, icon templ.Comp var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(message) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/alert.templ`, Line: 11, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/alert.templ`, Line: 11, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { diff --git a/nebula/blocks/badge.templ b/pkg/nebula/components/blocks/badge.templ similarity index 100% rename from nebula/blocks/badge.templ rename to pkg/nebula/components/blocks/badge.templ diff --git a/nebula/blocks/badge_templ.go b/pkg/nebula/components/blocks/badge_templ.go similarity index 100% rename from nebula/blocks/badge_templ.go rename to pkg/nebula/components/blocks/badge_templ.go diff --git a/nebula/blocks/button.templ b/pkg/nebula/components/blocks/button.templ similarity index 100% rename from nebula/blocks/button.templ rename to pkg/nebula/components/blocks/button.templ diff --git a/nebula/blocks/button_templ.go b/pkg/nebula/components/blocks/button_templ.go similarity index 94% rename from nebula/blocks/button_templ.go rename to pkg/nebula/components/blocks/button_templ.go index e4911b7a9..b7a09278a 100644 --- a/nebula/blocks/button_templ.go +++ b/pkg/nebula/components/blocks/button_templ.go @@ -157,7 +157,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxGet) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 25} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/button.templ`, Line: 86, Col: 25} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -170,7 +170,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTarget) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 69} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/button.templ`, Line: 86, Col: 69} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -183,7 +183,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTrigger) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 96} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/button.templ`, Line: 86, Col: 96} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -196,7 +196,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxSwap) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 117} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/button.templ`, Line: 86, Col: 117} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -254,7 +254,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxPost) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/button.templ`, Line: 92, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -267,7 +267,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTarget) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 52} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/button.templ`, Line: 92, Col: 52} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -280,7 +280,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTrigger) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 79} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/button.templ`, Line: 92, Col: 79} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -293,7 +293,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxSwap) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 100} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/button.templ`, Line: 92, Col: 100} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { diff --git a/nebula/blocks/card.templ b/pkg/nebula/components/blocks/card.templ similarity index 100% rename from nebula/blocks/card.templ rename to pkg/nebula/components/blocks/card.templ diff --git a/nebula/blocks/card_templ.go b/pkg/nebula/components/blocks/card_templ.go similarity index 98% rename from nebula/blocks/card_templ.go rename to pkg/nebula/components/blocks/card_templ.go index d3a390579..54797c7cc 100644 --- a/nebula/blocks/card_templ.go +++ b/pkg/nebula/components/blocks/card_templ.go @@ -40,7 +40,7 @@ func renderCard(id string, attrs templ.Attributes) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(id) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/card.templ`, Line: 8, Col: 13} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/card.templ`, Line: 8, Col: 13} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { diff --git a/nebula/blocks/fonts.templ b/pkg/nebula/components/blocks/fonts.templ similarity index 100% rename from nebula/blocks/fonts.templ rename to pkg/nebula/components/blocks/fonts.templ diff --git a/nebula/blocks/fonts_templ.go b/pkg/nebula/components/blocks/fonts_templ.go similarity index 92% rename from nebula/blocks/fonts_templ.go rename to pkg/nebula/components/blocks/fonts_templ.go index 9a2c2ef29..564baf691 100644 --- a/nebula/blocks/fonts_templ.go +++ b/pkg/nebula/components/blocks/fonts_templ.go @@ -54,7 +54,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 23, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 23, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -72,7 +72,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 27, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 27, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -90,7 +90,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 31, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 31, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -108,7 +108,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 35, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 35, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -159,7 +159,7 @@ func renderLink(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 42, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 42, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -209,7 +209,7 @@ func renderStrong(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 48, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 48, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -259,7 +259,7 @@ func renderEmphasis(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 54, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 54, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -309,7 +309,7 @@ func renderCode(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 60, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 60, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { diff --git a/nebula/blocks/global.templ b/pkg/nebula/components/blocks/head.templ similarity index 100% rename from nebula/blocks/global.templ rename to pkg/nebula/components/blocks/head.templ diff --git a/nebula/blocks/global_templ.go b/pkg/nebula/components/blocks/head_templ.go similarity index 100% rename from nebula/blocks/global_templ.go rename to pkg/nebula/components/blocks/head_templ.go diff --git a/nebula/blocks/icons.templ b/pkg/nebula/components/blocks/icons.templ similarity index 100% rename from nebula/blocks/icons.templ rename to pkg/nebula/components/blocks/icons.templ diff --git a/nebula/blocks/icons_templ.go b/pkg/nebula/components/blocks/icons_templ.go similarity index 100% rename from nebula/blocks/icons_templ.go rename to pkg/nebula/components/blocks/icons_templ.go diff --git a/nebula/blocks/inputs.templ b/pkg/nebula/components/blocks/inputs.templ similarity index 100% rename from nebula/blocks/inputs.templ rename to pkg/nebula/components/blocks/inputs.templ diff --git a/nebula/blocks/inputs_templ.go b/pkg/nebula/components/blocks/inputs_templ.go similarity index 92% rename from nebula/blocks/inputs_templ.go rename to pkg/nebula/components/blocks/inputs_templ.go index e29a695a0..c1ae1dc56 100644 --- a/nebula/blocks/inputs_templ.go +++ b/pkg/nebula/components/blocks/inputs_templ.go @@ -46,7 +46,7 @@ func TextInput(state InputState, label string, placeholder string) templ.Compone var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/inputs.templ`, Line: 15, Col: 128} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/inputs.templ`, Line: 15, Col: 128} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -64,7 +64,7 @@ func TextInput(state InputState, label string, placeholder string) templ.Compone var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/inputs.templ`, Line: 20, Col: 128} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/inputs.templ`, Line: 20, Col: 128} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -82,7 +82,7 @@ func TextInput(state InputState, label string, placeholder string) templ.Compone var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/inputs.templ`, Line: 25, Col: 128} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/inputs.templ`, Line: 25, Col: 128} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/components/blocks/layout.templ b/pkg/nebula/components/blocks/layout.templ new file mode 100644 index 000000000..7840db804 --- /dev/null +++ b/pkg/nebula/components/blocks/layout.templ @@ -0,0 +1,45 @@ +package blocks + +templ Layout(title string, remote bool) { + + + + @Alpine(remote) + @Htmx(remote) + @Styles(remote) + + + + { title } + + + + + +
+ { children... } +
+ + +} + +templ LayoutNoBody(title string, remote bool) { + + + + @Alpine(remote) + @Htmx(remote) + @Styles(remote) + + + + { title } + + + + +
+ { children... } +
+ +} diff --git a/pkg/nebula/components/blocks/layout_templ.go b/pkg/nebula/components/blocks/layout_templ.go new file mode 100644 index 000000000..8fac4dac5 --- /dev/null +++ b/pkg/nebula/components/blocks/layout_templ.go @@ -0,0 +1,143 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package blocks + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Layout(title string, remote bool) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Alpine(remote).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Htmx(remote).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Styles(remote).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/layout.templ`, Line: 13, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func LayoutNoBody(title string, remote bool) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Alpine(remote).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Htmx(remote).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Styles(remote).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/layout.templ`, Line: 36, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/blocks/panel.templ b/pkg/nebula/components/blocks/panel.templ similarity index 100% rename from nebula/blocks/panel.templ rename to pkg/nebula/components/blocks/panel.templ diff --git a/nebula/blocks/panel_templ.go b/pkg/nebula/components/blocks/panel_templ.go similarity index 97% rename from nebula/blocks/panel_templ.go rename to pkg/nebula/components/blocks/panel_templ.go index d6c417bfa..420409a2c 100644 --- a/nebula/blocks/panel_templ.go +++ b/pkg/nebula/components/blocks/panel_templ.go @@ -100,7 +100,7 @@ func breadcrumbItem(title string, active bool) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/panel.templ`, Line: 25, Col: 126} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/panel.templ`, Line: 25, Col: 126} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -118,7 +118,7 @@ func breadcrumbItem(title string, active bool) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/panel.templ`, Line: 27, Col: 118} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/panel.templ`, Line: 27, Col: 118} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { diff --git a/nebula/blocks/radios.templ b/pkg/nebula/components/blocks/radios.templ similarity index 100% rename from nebula/blocks/radios.templ rename to pkg/nebula/components/blocks/radios.templ diff --git a/nebula/blocks/radios_templ.go b/pkg/nebula/components/blocks/radios_templ.go similarity index 100% rename from nebula/blocks/radios_templ.go rename to pkg/nebula/components/blocks/radios_templ.go diff --git a/nebula/blocks/sizes.templ b/pkg/nebula/components/blocks/sizes.templ similarity index 100% rename from nebula/blocks/sizes.templ rename to pkg/nebula/components/blocks/sizes.templ diff --git a/nebula/blocks/sizes_templ.go b/pkg/nebula/components/blocks/sizes_templ.go similarity index 100% rename from nebula/blocks/sizes_templ.go rename to pkg/nebula/components/blocks/sizes_templ.go diff --git a/nebula/blocks/tabs.templ b/pkg/nebula/components/blocks/tabs.templ similarity index 100% rename from nebula/blocks/tabs.templ rename to pkg/nebula/components/blocks/tabs.templ diff --git a/nebula/blocks/tabs_templ.go b/pkg/nebula/components/blocks/tabs_templ.go similarity index 100% rename from nebula/blocks/tabs_templ.go rename to pkg/nebula/components/blocks/tabs_templ.go diff --git a/nebula/blocks/footer.templ b/pkg/nebula/components/sections/footer.templ similarity index 96% rename from nebula/blocks/footer.templ rename to pkg/nebula/components/sections/footer.templ index e3aaf4f19..5e8ac1142 100644 --- a/nebula/blocks/footer.templ +++ b/pkg/nebula/components/sections/footer.templ @@ -1,4 +1,4 @@ -package blocks +package sections templ FooterMarketingNav() { @@ -10,8 +10,8 @@ templ FooterMarketingNav() {
- - Logo + + Logo
© Cruip.com. All rights reserved.
diff --git a/pkg/nebula/components/sections/footer_templ.go b/pkg/nebula/components/sections/footer_templ.go new file mode 100644 index 000000000..5f22cb597 --- /dev/null +++ b/pkg/nebula/components/sections/footer_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package sections + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func FooterMarketingNav() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/blocks/headers.templ b/pkg/nebula/components/sections/header.templ similarity index 88% rename from nebula/blocks/headers.templ rename to pkg/nebula/components/sections/header.templ index 531250649..2bd244dfc 100644 --- a/nebula/blocks/headers.templ +++ b/pkg/nebula/components/sections/header.templ @@ -1,4 +1,4 @@ -package blocks +package sections templ HeaderMarketingNav() { @@ -9,8 +9,8 @@ templ HeaderMarketingNav() {
- - Logo + + Logo
diff --git a/nebula/blocks/headers_templ.go b/pkg/nebula/components/sections/header_templ.go similarity index 73% rename from nebula/blocks/headers_templ.go rename to pkg/nebula/components/sections/header_templ.go index 5ef91ea96..4c782e2fd 100644 --- a/nebula/blocks/headers_templ.go +++ b/pkg/nebula/components/sections/header_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -29,7 +29,7 @@ func HeaderMarketingNav() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/nebula/blocks/sections.templ b/pkg/nebula/components/sections/hero.templ similarity index 91% rename from nebula/blocks/sections.templ rename to pkg/nebula/components/sections/hero.templ index a027777ec..3fb404ba2 100644 --- a/nebula/blocks/sections.templ +++ b/pkg/nebula/components/sections/hero.templ @@ -1,6 +1,19 @@ -package blocks +package sections -templ SectionHero() { +type Hero struct { + TitleFirst string + TitleEmphasis string + TitleSecond string + Subtitle string + + PrimaryButtonText string + PrimaryButtonLink string + + SecondaryButtonText string + SecondaryButtonLink string +} + +templ SectionHero(hero Hero) {
@@ -9,24 +22,24 @@ templ SectionHero() {

- The creative + { hero.TitleFirst } - platform + { hero.TitleEmphasis } - for cross-functional work + { hero.TitleSecond }

- Turbocharge your creative process with a powerful AI design platform that gives creatives the power of creating without limits. + { hero.Subtitle }

@@ -34,7 +47,7 @@ templ SectionHero() {
- Hero + Hero
@@ -60,9 +73,14 @@ templ SectionHero() {

Assets packed with power beyond your imagination.

- - -
- - } diff --git a/pkg/nebula/components/sections/hero_templ.go b/pkg/nebula/components/sections/hero_templ.go new file mode 100644 index 000000000..2a248bda9 --- /dev/null +++ b/pkg/nebula/components/sections/hero_templ.go @@ -0,0 +1,214 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package sections + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +type Hero struct { + TitleFirst string + TitleEmphasis string + TitleSecond string + Subtitle string + + PrimaryButtonText string + PrimaryButtonLink string + + SecondaryButtonText string + SecondaryButtonLink string +} + +func SectionHero(hero Hero) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleFirst) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/sections/hero.templ`, Line: 25, Col: 24} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleEmphasis) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/sections/hero.templ`, Line: 27, Col: 28} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleSecond) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/sections/hero.templ`, Line: 32, Col: 25} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Subtitle) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/sections/hero.templ`, Line: 35, Col: 22} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

\"Hero\"

0K

Assets packed with power beyond your imagination.

0K

Assets packed with power beyond your imagination.

0M+

Assets packed with power beyond your imagination.

0K

Assets packed with power beyond your imagination.

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = counterAnimation().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func counterAnimation() templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_counterAnimation_57a0`, + Function: `function __templ_counterAnimation_57a0(){document.addEventListener('alpine:init', () => { + Alpine.data('counter', (target = 0, duration = 3000) => ({ + startTimestamp: null, + step: null, + rawValue: 0, + counterValue: 0, + target: target, + precision: (target % 1 === 0) ? 0 : (target.toString().split('.')[1] || []).length, + animationRequestId: null, + animationCompleted: false, + observer: null, + init() { + // Intersection observer to watch visibility + this.observer = new IntersectionObserver(entries => { + entries.forEach(entry => { + // Check if element is in view + if (entry.isIntersecting && !this.animationCompleted) { + this.startAnimation() + } + }) + }) + this.observer.observe(this.$el) + }, + startAnimation() { + this.step = (timestamp) => { + if (!this.startTimestamp) this.startTimestamp = timestamp + const progress = Math.min((timestamp - this.startTimestamp) / duration, 1) + const easedProgress = this.easeOut(progress) + this.rawValue = parseFloat((easedProgress * this.target).toFixed(this.precision)) + this.counterValue = this.rawValue.toFixed(this.precision) + if (progress < 1) { + this.animationRequestId = window.requestAnimationFrame(this.step) + } else { + this.animationCompleted = true + } + } + this.animationRequestId = window.requestAnimationFrame(this.step); + }, + easeOut(t) { + return 1 - Math.pow(1 - t, 5) + }, + destroy() { + // Detach the handler, avoiding memory and side-effect leakage + this.animationRequestId && window.cancelAnimationFrame(this.step) + this.observer && this.observer.disconnect() + }, + })) + }) +}`, + Call: templ.SafeScript(`__templ_counterAnimation_57a0`), + CallInline: templ.SafeScriptInline(`__templ_counterAnimation_57a0`), + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/nebula.go b/pkg/nebula/nebula.go similarity index 100% rename from nebula/nebula.go rename to pkg/nebula/nebula.go diff --git a/nebula/package.json b/pkg/nebula/package.json similarity index 100% rename from nebula/package.json rename to pkg/nebula/package.json diff --git a/pkg/nebula/pages/home.templ b/pkg/nebula/pages/home.templ new file mode 100644 index 000000000..940cba5ec --- /dev/null +++ b/pkg/nebula/pages/home.templ @@ -0,0 +1,29 @@ +package pages + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/pkg/nebula/components/sections" +) + +func Home(c echo.Context) error { + hero := sections.Hero{ + TitleFirst: "Sonr.ID", + TitleEmphasis: "platform", + TitleSecond: "for cross-functional work", + Subtitle: "Turbocharge your creative process with a powerful AI design platform that gives creatives the power of creating without limits.", + PrimaryButtonText: "Request Demo", + PrimaryButtonLink: "request-demo.html", + SecondaryButtonText: "Try for Free", + SecondaryButtonLink: "#0", + } + return echoResponse(c, homeView(hero)) +} + +templ homeView(hero sections.Hero) { + @blocks.LayoutNoBody("Sonr.ID", true) { + @sections.HeaderMarketingNav() + @sections.SectionHero(hero) + @sections.FooterMarketingNav() + } +} diff --git a/pkg/nebula/pages/home_templ.go b/pkg/nebula/pages/home_templ.go new file mode 100644 index 000000000..80f9e660f --- /dev/null +++ b/pkg/nebula/pages/home_templ.go @@ -0,0 +1,94 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package pages + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/pkg/nebula/components/sections" +) + +func Home(c echo.Context) error { + hero := sections.Hero{ + TitleFirst: "Sonr.ID", + TitleEmphasis: "platform", + TitleSecond: "for cross-functional work", + Subtitle: "Turbocharge your creative process with a powerful AI design platform that gives creatives the power of creating without limits.", + PrimaryButtonText: "Request Demo", + PrimaryButtonLink: "request-demo.html", + SecondaryButtonText: "Try for Free", + SecondaryButtonLink: "#0", + } + return echoResponse(c, homeView(hero)) +} + +func homeView(hero sections.Hero) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = sections.HeaderMarketingNav().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.SectionHero(hero).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.FooterMarketingNav().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = blocks.LayoutNoBody("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/pages/login.templ b/pkg/nebula/pages/login.templ similarity index 89% rename from nebula/pages/login.templ rename to pkg/nebula/pages/login.templ index 782a8f8a1..290cf78e3 100644 --- a/nebula/pages/login.templ +++ b/pkg/nebula/pages/login.templ @@ -2,7 +2,7 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/nebula/blocks" + "github.com/onsonr/sonr/pkg/nebula/components/blocks" ) func Login(c echo.Context) error { diff --git a/nebula/pages/login_templ.go b/pkg/nebula/pages/login_templ.go similarity index 99% rename from nebula/pages/login_templ.go rename to pkg/nebula/pages/login_templ.go index d6c91bb1b..a3c85fbee 100644 --- a/nebula/pages/login_templ.go +++ b/pkg/nebula/pages/login_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/nebula/blocks" + "github.com/onsonr/sonr/pkg/nebula/components/blocks" ) func Login(c echo.Context) error { diff --git a/nebula/pages/openid.templ b/pkg/nebula/pages/openid.templ similarity index 86% rename from nebula/pages/openid.templ rename to pkg/nebula/pages/openid.templ index 80a947c5c..db54ae970 100644 --- a/nebula/pages/openid.templ +++ b/pkg/nebula/pages/openid.templ @@ -2,7 +2,7 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/nebula/blocks" + "github.com/onsonr/sonr/pkg/nebula/components/blocks" ) func Authorize(c echo.Context) error { diff --git a/nebula/pages/openid_templ.go b/pkg/nebula/pages/openid_templ.go similarity index 98% rename from nebula/pages/openid_templ.go rename to pkg/nebula/pages/openid_templ.go index 42c275f0b..6aa854f2a 100644 --- a/nebula/pages/openid_templ.go +++ b/pkg/nebula/pages/openid_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/nebula/blocks" + "github.com/onsonr/sonr/pkg/nebula/components/blocks" ) func Authorize(c echo.Context) error { diff --git a/nebula/pages/pages.go b/pkg/nebula/pages/pages.go similarity index 100% rename from nebula/pages/pages.go rename to pkg/nebula/pages/pages.go diff --git a/nebula/pages/profile.templ b/pkg/nebula/pages/profile.templ similarity index 85% rename from nebula/pages/profile.templ rename to pkg/nebula/pages/profile.templ index 17b69dd05..82d6961b0 100644 --- a/nebula/pages/profile.templ +++ b/pkg/nebula/pages/profile.templ @@ -2,7 +2,7 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/nebula/blocks" + "github.com/onsonr/sonr/pkg/nebula/components/blocks" ) func Profile(c echo.Context) error { diff --git a/nebula/pages/profile_templ.go b/pkg/nebula/pages/profile_templ.go similarity index 98% rename from nebula/pages/profile_templ.go rename to pkg/nebula/pages/profile_templ.go index b133cb59f..d19329074 100644 --- a/nebula/pages/profile_templ.go +++ b/pkg/nebula/pages/profile_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/nebula/blocks" + "github.com/onsonr/sonr/pkg/nebula/components/blocks" ) func Profile(c echo.Context) error { diff --git a/nebula/pages/register.templ b/pkg/nebula/pages/register.templ similarity index 97% rename from nebula/pages/register.templ rename to pkg/nebula/pages/register.templ index 3e0a636f9..83c3c2120 100644 --- a/nebula/pages/register.templ +++ b/pkg/nebula/pages/register.templ @@ -2,7 +2,7 @@ package pages import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/nebula/blocks" + "github.com/onsonr/sonr/pkg/nebula/components/blocks" ) type FormState string diff --git a/nebula/pages/register_templ.go b/pkg/nebula/pages/register_templ.go similarity index 99% rename from nebula/pages/register_templ.go rename to pkg/nebula/pages/register_templ.go index c777252da..6e53e51bc 100644 --- a/nebula/pages/register_templ.go +++ b/pkg/nebula/pages/register_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/nebula/blocks" + "github.com/onsonr/sonr/pkg/nebula/components/blocks" ) type FormState string diff --git a/nebula/src/motr.ts b/pkg/nebula/src/motr.ts similarity index 100% rename from nebula/src/motr.ts rename to pkg/nebula/src/motr.ts diff --git a/nebula/src/styles.css b/pkg/nebula/src/styles.css similarity index 100% rename from nebula/src/styles.css rename to pkg/nebula/src/styles.css diff --git a/nebula/tailwind.config.js b/pkg/nebula/tailwind.config.js similarity index 100% rename from nebula/tailwind.config.js rename to pkg/nebula/tailwind.config.js diff --git a/nebula/tsconfig.json b/pkg/nebula/tsconfig.json similarity index 100% rename from nebula/tsconfig.json rename to pkg/nebula/tsconfig.json diff --git a/x/did/types/orm/Account.pkl.go b/pkg/orm/Account.pkl.go similarity index 100% rename from x/did/types/orm/Account.pkl.go rename to pkg/orm/Account.pkl.go diff --git a/x/did/types/orm/Asset.pkl.go b/pkg/orm/Asset.pkl.go similarity index 100% rename from x/did/types/orm/Asset.pkl.go rename to pkg/orm/Asset.pkl.go diff --git a/x/did/types/orm/Chain.pkl.go b/pkg/orm/Chain.pkl.go similarity index 100% rename from x/did/types/orm/Chain.pkl.go rename to pkg/orm/Chain.pkl.go diff --git a/x/did/types/orm/Credential.pkl.go b/pkg/orm/Credential.pkl.go similarity index 100% rename from x/did/types/orm/Credential.pkl.go rename to pkg/orm/Credential.pkl.go diff --git a/x/did/types/orm/Grant.pkl.go b/pkg/orm/Grant.pkl.go similarity index 100% rename from x/did/types/orm/Grant.pkl.go rename to pkg/orm/Grant.pkl.go diff --git a/x/did/types/orm/JWK.pkl.go b/pkg/orm/JWK.pkl.go similarity index 100% rename from x/did/types/orm/JWK.pkl.go rename to pkg/orm/JWK.pkl.go diff --git a/x/did/types/orm/Keyshare.pkl.go b/pkg/orm/Keyshare.pkl.go similarity index 100% rename from x/did/types/orm/Keyshare.pkl.go rename to pkg/orm/Keyshare.pkl.go diff --git a/x/did/types/orm/Models.pkl.go b/pkg/orm/Models.pkl.go similarity index 100% rename from x/did/types/orm/Models.pkl.go rename to pkg/orm/Models.pkl.go diff --git a/x/did/types/orm/Profile.pkl.go b/pkg/orm/Profile.pkl.go similarity index 100% rename from x/did/types/orm/Profile.pkl.go rename to pkg/orm/Profile.pkl.go diff --git a/x/did/types/orm/PublicKey.pkl.go b/pkg/orm/PublicKey.pkl.go similarity index 61% rename from x/did/types/orm/PublicKey.pkl.go rename to pkg/orm/PublicKey.pkl.go index c07beb191..81cdf961a 100644 --- a/x/did/types/orm/PublicKey.pkl.go +++ b/pkg/orm/PublicKey.pkl.go @@ -2,11 +2,11 @@ package orm import ( - "github.com/onsonr/sonr/x/did/types/orm/keyalgorithm" - "github.com/onsonr/sonr/x/did/types/orm/keycurve" - "github.com/onsonr/sonr/x/did/types/orm/keyencoding" - "github.com/onsonr/sonr/x/did/types/orm/keyrole" - "github.com/onsonr/sonr/x/did/types/orm/keytype" + "github.com/onsonr/sonr/pkg/orm/keyalgorithm" + "github.com/onsonr/sonr/pkg/orm/keycurve" + "github.com/onsonr/sonr/pkg/orm/keyencoding" + "github.com/onsonr/sonr/pkg/orm/keyrole" + "github.com/onsonr/sonr/pkg/orm/keytype" ) type PublicKey struct { diff --git a/x/did/types/orm/assettype/AssetType.pkl.go b/pkg/orm/assettype/AssetType.pkl.go similarity index 100% rename from x/did/types/orm/assettype/AssetType.pkl.go rename to pkg/orm/assettype/AssetType.pkl.go diff --git a/x/did/types/orm/didmethod/DIDMethod.pkl.go b/pkg/orm/didmethod/DIDMethod.pkl.go similarity index 100% rename from x/did/types/orm/didmethod/DIDMethod.pkl.go rename to pkg/orm/didmethod/DIDMethod.pkl.go diff --git a/x/did/types/orm/init.pkl.go b/pkg/orm/init.pkl.go similarity index 100% rename from x/did/types/orm/init.pkl.go rename to pkg/orm/init.pkl.go diff --git a/x/did/types/orm/keyalgorithm/KeyAlgorithm.pkl.go b/pkg/orm/keyalgorithm/KeyAlgorithm.pkl.go similarity index 100% rename from x/did/types/orm/keyalgorithm/KeyAlgorithm.pkl.go rename to pkg/orm/keyalgorithm/KeyAlgorithm.pkl.go diff --git a/x/did/types/orm/keycurve/KeyCurve.pkl.go b/pkg/orm/keycurve/KeyCurve.pkl.go similarity index 100% rename from x/did/types/orm/keycurve/KeyCurve.pkl.go rename to pkg/orm/keycurve/KeyCurve.pkl.go diff --git a/x/did/types/orm/keyencoding/KeyEncoding.pkl.go b/pkg/orm/keyencoding/KeyEncoding.pkl.go similarity index 100% rename from x/did/types/orm/keyencoding/KeyEncoding.pkl.go rename to pkg/orm/keyencoding/KeyEncoding.pkl.go diff --git a/x/did/types/orm/keyrole/KeyRole.pkl.go b/pkg/orm/keyrole/KeyRole.pkl.go similarity index 100% rename from x/did/types/orm/keyrole/KeyRole.pkl.go rename to pkg/orm/keyrole/KeyRole.pkl.go diff --git a/x/did/types/orm/keysharerole/KeyShareRole.pkl.go b/pkg/orm/keysharerole/KeyShareRole.pkl.go similarity index 100% rename from x/did/types/orm/keysharerole/KeyShareRole.pkl.go rename to pkg/orm/keysharerole/KeyShareRole.pkl.go diff --git a/x/did/types/orm/keytype/KeyType.pkl.go b/pkg/orm/keytype/KeyType.pkl.go similarity index 100% rename from x/did/types/orm/keytype/KeyType.pkl.go rename to pkg/orm/keytype/KeyType.pkl.go diff --git a/x/did/types/orm/permissiongrant/PermissionGrant.pkl.go b/pkg/orm/permissiongrant/PermissionGrant.pkl.go similarity index 100% rename from x/did/types/orm/permissiongrant/PermissionGrant.pkl.go rename to pkg/orm/permissiongrant/PermissionGrant.pkl.go diff --git a/x/did/types/orm/permissionscope/PermissionScope.pkl.go b/pkg/orm/permissionscope/PermissionScope.pkl.go similarity index 100% rename from x/did/types/orm/permissionscope/PermissionScope.pkl.go rename to pkg/orm/permissionscope/PermissionScope.pkl.go diff --git a/app/config/pkl/dwn.pkl b/pkl/dwn.pkl similarity index 94% rename from app/config/pkl/dwn.pkl rename to pkl/dwn.pkl index 93f8f3a83..636baaab9 100644 --- a/app/config/pkl/dwn.pkl +++ b/pkl/dwn.pkl @@ -1,4 +1,4 @@ -@go.Package { name = "github.com/onsonr/sonr/app/config/dwn" } +@go.Package { name = "github.com/onsonr/sonr/pkg/dwn" } module dwn diff --git a/app/config/pkl/orm.pkl b/pkl/orm.pkl similarity index 98% rename from app/config/pkl/orm.pkl rename to pkl/orm.pkl index d08735d6d..b71100c9f 100644 --- a/app/config/pkl/orm.pkl +++ b/pkl/orm.pkl @@ -1,4 +1,4 @@ -@go.Package { name = "github.com/onsonr/sonr/x/did/types/orm" } +@go.Package { name = "github.com/onsonr/sonr/pkg/orm" } module models diff --git a/app/config/pkl/txns.pkl b/pkl/txns.pkl similarity index 100% rename from app/config/pkl/txns.pkl rename to pkl/txns.pkl diff --git a/proto/did/v1/query.proto b/proto/did/v1/query.proto index 259bfcf17..9aa6410a8 100644 --- a/proto/did/v1/query.proto +++ b/proto/did/v1/query.proto @@ -17,6 +17,16 @@ service Query { rpc Resolve(QueryRequest) returns (QueryResolveResponse) { option (google.api.http).get = "/did/{did}"; } + + // Sign signs a message with the DID document + rpc Sign(QuerySignRequest) returns (QuerySignResponse) { + option (google.api.http).post = "/did/{did}/sign"; + } + + // Verify verifies a message with the DID document + rpc Verify(QueryVerifyRequest) returns (QueryVerifyResponse) { + option (google.api.http).post = "/did/{did}/verify"; + } } // Queryequest is the request type for the Query/Params RPC method. @@ -39,6 +49,37 @@ message QueryResolveResponse { Document document = 1; } +// QuerySignRequest is the request type for the Query/Sign RPC method. +message QuerySignRequest { + string did = 1; + string origin = 2; + string key = 3; + string asset = 4; + string message = 5; +} + +// QuerySignResponse is the response type for the Query/Sign RPC method. +message QuerySignResponse { + // signature is the signature of the message + string signature = 1; +} + +// QueryVerifyRequest is the request type for the Query/Verify RPC method. +message QueryVerifyRequest { + string did = 1; + string origin = 2; + string key = 3; + string asset = 4; + string message = 5; + string signature = 6; +} + +// QueryVerifyResponse is the response type for the Query/Verify RPC method. +message QueryVerifyResponse { + // valid is the validity of the signature + bool valid = 1; +} + // Document defines a DID document message Document { string id = 1; diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index 1f1266684..069b111b3 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -28,6 +28,15 @@ message Authentication { // PubKey is the verification method PubKey public_key = 4; + + // CredentialID is the byte representation of the credential ID + bytes credential_id = 5; + + // Metadata of the authentication + map metadata = 6; + + // CreationBlock is the block number of the creation of the authentication + int64 creation_block = 7; } // Controller represents a Sonr DWN Vault @@ -78,14 +87,17 @@ message Controller { // PubKey is the verification method PubKey public_key = 6; - // Val Keyshare + // Pointer to the Keyshares string ks_val = 7; - // The Status of the claims for the controller - bool claimed = 8; + // The block number of when a user claimed the controller + int64 claimed_block = 8; + + // CreationBlock is the block number of the creation of the controller + int64 creation_block = 9; } -// Verification reprsents a method of verifying membership in a DID +// Verification represents a verification method message Verification { option (cosmos.orm.v1.table) = { id: 4 @@ -125,9 +137,20 @@ message Verification { // The public key of the verification PubKey public_key = 6; - // The Verification Type (Authentication, Assertion, CapabilityDelegation, - // CapabilityInvocation) + // The verification method type string verification_type = 7; + + // Metadata of the verification + map metadata = 8; + + // CreationBlock is the block number of the creation of the controller + int64 creation_block = 9; +} + +message Keyshares { + string validator_cid = 1; + string user_cid = 2; + int64 last_updated_block = 3; } // PubKey defines a public key for a did diff --git a/proto/macaroon/v1/tx.proto b/proto/macaroon/v1/tx.proto index cb8578254..45d67e340 100644 --- a/proto/macaroon/v1/tx.proto +++ b/proto/macaroon/v1/tx.proto @@ -17,9 +17,9 @@ service Msg { // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // AuthorizeService asserts the given controller is the owner of the given + // IssueMacaroon asserts the given controller is the owner of the given // address. - rpc AuthorizeService(MsgIssueMacaroon) returns (MsgIssueMacaroonResponse); + rpc IssueMacaroon(MsgIssueMacaroon) returns (MsgIssueMacaroonResponse); } // MsgUpdateParams is the Msg/UpdateParams request type. @@ -43,7 +43,7 @@ message MsgUpdateParams { // Since: cosmos-sdk 0.47 message MsgUpdateParamsResponse {} -// MsgIssueMacaroon is the message type for the AuthorizeService RPC. +// MsgIssueMacaroon is the message type for the IssueMacaroon RPC. message MsgIssueMacaroon { option (cosmos.msg.v1.signer) = "controller"; @@ -60,7 +60,7 @@ message MsgIssueMacaroon { string token = 4; } -// MsgIssueMacaroonResponse is the response type for the AuthorizeService +// MsgIssueMacaroonResponse is the response type for the IssueMacaroon // RPC. message MsgIssueMacaroonResponse { bool success = 1; diff --git a/proto/vault/v1/state.proto b/proto/vault/v1/state.proto index fa0f67600..ee0a35a3e 100644 --- a/proto/vault/v1/state.proto +++ b/proto/vault/v1/state.proto @@ -10,13 +10,22 @@ option go_package = "github.com/onsonr/sonr/x/vault/types"; message DWN { option (cosmos.orm.v1.table) = { id: 1 - primary_key: {fields: "account"} + primary_key: { + fields: "id" + auto_increment: true + } index: { id: 1 - fields: "amount" + fields: "alias" + unique: true + } + index: { + id: 2 + fields: "cid" + unique: true } }; - - bytes account = 1; - uint64 amount = 2; + uint64 id = 1; + string alias = 2; + string cid = 3; } diff --git a/x/did/keeper/querier.go b/x/did/keeper/querier.go index ef7ec9cfe..ba193897e 100644 --- a/x/did/keeper/querier.go +++ b/x/did/keeper/querier.go @@ -31,3 +31,17 @@ func (k Querier) Params(goCtx context.Context, req *types.QueryRequest) (*types. func (k Querier) Resolve(goCtx context.Context, req *types.QueryRequest) (*types.QueryResolveResponse, error) { return &types.QueryResolveResponse{}, nil } + +// Sign implements types.QueryServer. +func (k Querier) Sign(goCtx context.Context, req *types.QuerySignRequest) (*types.QuerySignResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("Sign is unimplemented") + return &types.QuerySignResponse{}, nil +} + +// Verify implements types.QueryServer. +func (k Querier) Verify(goCtx context.Context, req *types.QueryVerifyRequest) (*types.QueryVerifyResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("Verify is unimplemented") + return &types.QueryVerifyResponse{}, nil +} diff --git a/x/did/types/controller.go b/x/did/types/controller.go index cb9d95acb..2c7702a47 100644 --- a/x/did/types/controller.go +++ b/x/did/types/controller.go @@ -4,6 +4,7 @@ import ( fmt "fmt" "github.com/onsonr/crypto/mpc" + didv1 "github.com/onsonr/sonr/api/did/v1" ) diff --git a/x/did/types/params.go b/x/did/types/params.go index 5cf378218..309248c95 100644 --- a/x/did/types/params.go +++ b/x/did/types/params.go @@ -4,10 +4,10 @@ import ( "encoding/json" fmt "fmt" - "github.com/onsonr/sonr/x/did/types/orm/keyalgorithm" - "github.com/onsonr/sonr/x/did/types/orm/keycurve" - "github.com/onsonr/sonr/x/did/types/orm/keyencoding" - "github.com/onsonr/sonr/x/did/types/orm/keyrole" + "github.com/onsonr/sonr/pkg/orm/keyalgorithm" + "github.com/onsonr/sonr/pkg/orm/keycurve" + "github.com/onsonr/sonr/pkg/orm/keyencoding" + "github.com/onsonr/sonr/pkg/orm/keyrole" ) // DefaultParams returns default module parameters. diff --git a/x/did/types/query.pb.go b/x/did/types/query.pb.go index e25bf55ba..cbe55aeda 100644 --- a/x/did/types/query.pb.go +++ b/x/did/types/query.pb.go @@ -189,6 +189,260 @@ func (m *QueryResolveResponse) GetDocument() *Document { return nil } +// QuerySignRequest is the request type for the Query/Sign RPC method. +type QuerySignRequest struct { + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Asset string `protobuf:"bytes,4,opt,name=asset,proto3" json:"asset,omitempty"` + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` +} + +func (m *QuerySignRequest) Reset() { *m = QuerySignRequest{} } +func (m *QuerySignRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySignRequest) ProtoMessage() {} +func (*QuerySignRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{3} +} +func (m *QuerySignRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySignRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySignRequest.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 *QuerySignRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySignRequest.Merge(m, src) +} +func (m *QuerySignRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySignRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySignRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySignRequest proto.InternalMessageInfo + +func (m *QuerySignRequest) GetDid() string { + if m != nil { + return m.Did + } + return "" +} + +func (m *QuerySignRequest) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *QuerySignRequest) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *QuerySignRequest) GetAsset() string { + if m != nil { + return m.Asset + } + return "" +} + +func (m *QuerySignRequest) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +// QuerySignResponse is the response type for the Query/Sign RPC method. +type QuerySignResponse struct { + // signature is the signature of the message + Signature string `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *QuerySignResponse) Reset() { *m = QuerySignResponse{} } +func (m *QuerySignResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySignResponse) ProtoMessage() {} +func (*QuerySignResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{4} +} +func (m *QuerySignResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySignResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySignResponse.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 *QuerySignResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySignResponse.Merge(m, src) +} +func (m *QuerySignResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySignResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySignResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySignResponse proto.InternalMessageInfo + +func (m *QuerySignResponse) GetSignature() string { + if m != nil { + return m.Signature + } + return "" +} + +// QueryVerifyRequest is the request type for the Query/Verify RPC method. +type QueryVerifyRequest struct { + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Asset string `protobuf:"bytes,4,opt,name=asset,proto3" json:"asset,omitempty"` + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` + Signature string `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *QueryVerifyRequest) Reset() { *m = QueryVerifyRequest{} } +func (m *QueryVerifyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryVerifyRequest) ProtoMessage() {} +func (*QueryVerifyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{5} +} +func (m *QueryVerifyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVerifyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVerifyRequest.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 *QueryVerifyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVerifyRequest.Merge(m, src) +} +func (m *QueryVerifyRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryVerifyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVerifyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVerifyRequest proto.InternalMessageInfo + +func (m *QueryVerifyRequest) GetDid() string { + if m != nil { + return m.Did + } + return "" +} + +func (m *QueryVerifyRequest) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *QueryVerifyRequest) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *QueryVerifyRequest) GetAsset() string { + if m != nil { + return m.Asset + } + return "" +} + +func (m *QueryVerifyRequest) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *QueryVerifyRequest) GetSignature() string { + if m != nil { + return m.Signature + } + return "" +} + +// QueryVerifyResponse is the response type for the Query/Verify RPC method. +type QueryVerifyResponse struct { + // valid is the validity of the signature + Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` +} + +func (m *QueryVerifyResponse) Reset() { *m = QueryVerifyResponse{} } +func (m *QueryVerifyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryVerifyResponse) ProtoMessage() {} +func (*QueryVerifyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{6} +} +func (m *QueryVerifyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVerifyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVerifyResponse.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 *QueryVerifyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVerifyResponse.Merge(m, src) +} +func (m *QueryVerifyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryVerifyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVerifyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVerifyResponse proto.InternalMessageInfo + +func (m *QueryVerifyResponse) GetValid() bool { + if m != nil { + return m.Valid + } + return false +} + // Document defines a DID document type Document struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -204,7 +458,7 @@ func (m *Document) Reset() { *m = Document{} } func (m *Document) String() string { return proto.CompactTextString(m) } func (*Document) ProtoMessage() {} func (*Document) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{3} + return fileDescriptor_ae1fa9bb626e2869, []int{7} } func (m *Document) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -286,44 +540,57 @@ func init() { proto.RegisterType((*QueryRequest)(nil), "did.v1.QueryRequest") proto.RegisterType((*QueryParamsResponse)(nil), "did.v1.QueryParamsResponse") proto.RegisterType((*QueryResolveResponse)(nil), "did.v1.QueryResolveResponse") + proto.RegisterType((*QuerySignRequest)(nil), "did.v1.QuerySignRequest") + proto.RegisterType((*QuerySignResponse)(nil), "did.v1.QuerySignResponse") + proto.RegisterType((*QueryVerifyRequest)(nil), "did.v1.QueryVerifyRequest") + proto.RegisterType((*QueryVerifyResponse)(nil), "did.v1.QueryVerifyResponse") proto.RegisterType((*Document)(nil), "did.v1.Document") } func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) } var fileDescriptor_ae1fa9bb626e2869 = []byte{ - // 484 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0xeb, 0xa4, 0x71, 0x9a, 0xa1, 0x4a, 0xa3, 0xc5, 0x20, 0x2b, 0x54, 0x56, 0xe5, 0x43, - 0x55, 0x24, 0x64, 0xab, 0xed, 0x15, 0x2e, 0x28, 0x17, 0x24, 0x90, 0xa8, 0x8f, 0x5c, 0x8a, 0xe3, - 0x1d, 0x39, 0xab, 0x3a, 0xbb, 0xae, 0x77, 0x6d, 0x61, 0x21, 0x2e, 0x3c, 0x01, 0x88, 0x97, 0xe0, - 0x51, 0x38, 0x56, 0xe2, 0xc2, 0x11, 0x25, 0x3c, 0x08, 0xf2, 0x7a, 0x63, 0x9a, 0x48, 0x5c, 0x2c, - 0xcf, 0xf7, 0xff, 0x33, 0xbb, 0x33, 0xb3, 0x40, 0x28, 0xa3, 0x61, 0x75, 0x1e, 0xde, 0x96, 0x58, - 0xd4, 0x41, 0x5e, 0x08, 0x25, 0x88, 0x4d, 0x19, 0x0d, 0xaa, 0xf3, 0xa9, 0x63, 0xb4, 0x14, 0x39, - 0x4a, 0x26, 0x5b, 0x75, 0x7a, 0x9c, 0x0a, 0x91, 0x66, 0x18, 0xc6, 0x39, 0x0b, 0x63, 0xce, 0x85, - 0x8a, 0x15, 0x13, 0xdc, 0xa8, 0xfe, 0x7b, 0x38, 0xbc, 0x6a, 0x4a, 0x45, 0x78, 0x5b, 0xa2, 0x54, - 0x64, 0x02, 0x7d, 0xca, 0xa8, 0x6b, 0x9d, 0x58, 0x67, 0xa3, 0xa8, 0xf9, 0x25, 0x8f, 0xc1, 0x16, - 0x05, 0x4b, 0x19, 0x77, 0x7b, 0x1a, 0x9a, 0xa8, 0x71, 0xde, 0x60, 0xed, 0xf6, 0x5b, 0xe7, 0x0d, - 0xd6, 0xc4, 0x81, 0x41, 0x2c, 0x25, 0x2a, 0x77, 0x5f, 0xb3, 0x36, 0xf0, 0x5f, 0xc0, 0x43, 0x7d, - 0xc2, 0xdb, 0xb8, 0x88, 0x97, 0x32, 0x42, 0x99, 0x0b, 0x2e, 0x91, 0x9c, 0x82, 0x9d, 0x6b, 0xa2, - 0xcf, 0x7a, 0x70, 0x31, 0x0e, 0xda, 0x2e, 0x02, 0xe3, 0x33, 0xaa, 0x3f, 0x03, 0xc7, 0x5c, 0x50, - 0x8a, 0xac, 0xc2, 0x2e, 0xff, 0x19, 0x1c, 0x50, 0x91, 0x94, 0x4b, 0xe4, 0xca, 0x54, 0x98, 0x6c, - 0x2a, 0xcc, 0x0c, 0x8f, 0x3a, 0x87, 0xff, 0xb5, 0x07, 0x07, 0x1b, 0x4c, 0xc6, 0xd0, 0xeb, 0x5a, - 0xec, 0x31, 0x4a, 0x3c, 0x80, 0x44, 0x70, 0x55, 0x88, 0x2c, 0xc3, 0xc2, 0x74, 0x79, 0x8f, 0x90, - 0x53, 0x18, 0xc7, 0xa5, 0x5a, 0x20, 0x57, 0x2c, 0xd1, 0xc3, 0x73, 0xfb, 0x27, 0xfd, 0xb3, 0x51, - 0xb4, 0x43, 0xc9, 0x53, 0x98, 0x34, 0x2d, 0x17, 0x4d, 0x70, 0xbd, 0x44, 0xb5, 0x10, 0xd4, 0xdd, - 0xd7, 0xce, 0xa3, 0x8e, 0xbf, 0xd1, 0x98, 0x5c, 0xc2, 0xa3, 0x24, 0xce, 0xe3, 0x39, 0xcb, 0x98, - 0xaa, 0xaf, 0x29, 0x66, 0x98, 0xb6, 0x95, 0x07, 0xda, 0xef, 0xfc, 0x13, 0x67, 0x9d, 0xb6, 0x93, - 0xc4, 0x78, 0x25, 0xcc, 0x75, 0xec, 0xdd, 0xa4, 0x57, 0x9d, 0x46, 0x5c, 0x18, 0x4a, 0x2c, 0x2a, - 0x96, 0xa0, 0x3b, 0xd4, 0xb6, 0x4d, 0x78, 0xf1, 0xdd, 0x82, 0x81, 0x1e, 0x2d, 0x79, 0x0d, 0x76, - 0x3b, 0x75, 0xe2, 0x6c, 0x66, 0x78, 0xff, 0x51, 0x4c, 0x9f, 0x6c, 0xd1, 0xed, 0x45, 0xfa, 0x47, - 0x9f, 0x7f, 0xfe, 0xf9, 0xd6, 0x1b, 0x91, 0x61, 0xd8, 0x6e, 0x8c, 0x5c, 0xc1, 0xd0, 0x2c, 0xeb, - 0x3f, 0xe5, 0x8e, 0x77, 0xe8, 0xd6, 0x62, 0x7d, 0xa2, 0xeb, 0x1d, 0x12, 0x08, 0x9b, 0xe7, 0xfc, - 0x91, 0x32, 0xfa, 0xe9, 0xe5, 0xf3, 0x1f, 0x2b, 0xcf, 0xba, 0x5b, 0x79, 0xd6, 0xef, 0x95, 0x67, - 0x7d, 0x59, 0x7b, 0x7b, 0x77, 0x6b, 0x6f, 0xef, 0xd7, 0xda, 0xdb, 0x7b, 0xe7, 0xa7, 0x4c, 0x2d, - 0xca, 0x79, 0x90, 0x88, 0x65, 0x28, 0xb8, 0x14, 0xbc, 0x08, 0xf5, 0xe7, 0x83, 0xce, 0x56, 0x75, - 0x8e, 0x72, 0x6e, 0xeb, 0xa7, 0x7e, 0xf9, 0x37, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x85, 0xed, 0xe7, - 0x3c, 0x03, 0x00, 0x00, + // 625 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0x6e, 0x92, 0x66, 0xd3, 0x3c, 0x4b, 0x9b, 0x4e, 0xa3, 0x6e, 0x63, 0x59, 0xca, 0x1c, 0x4a, + 0x45, 0xc9, 0xd2, 0xf6, 0xaa, 0x17, 0xe9, 0x45, 0x50, 0xb0, 0x51, 0x3c, 0x88, 0x50, 0xa7, 0x99, + 0xe7, 0x76, 0xe8, 0x66, 0x26, 0xdd, 0x99, 0x2c, 0x06, 0xd1, 0x83, 0xbf, 0x40, 0xf1, 0xee, 0xef, + 0xf1, 0x58, 0xf0, 0xe2, 0xc1, 0x83, 0xb4, 0xfe, 0x10, 0xd9, 0xd9, 0xc9, 0x36, 0xbb, 0xe8, 0x51, + 0xbc, 0x84, 0xbc, 0xef, 0xbd, 0xf7, 0xcd, 0xfb, 0x76, 0xbe, 0x37, 0x40, 0xb8, 0xe0, 0x61, 0xba, + 0x1b, 0x9e, 0x4d, 0x30, 0x99, 0xf6, 0xc7, 0x89, 0x32, 0x8a, 0x78, 0x5c, 0xf0, 0x7e, 0xba, 0xdb, + 0xeb, 0xba, 0x5c, 0x84, 0x12, 0xb5, 0xd0, 0x79, 0xb6, 0xb7, 0x19, 0x29, 0x15, 0xc5, 0x18, 0xb2, + 0xb1, 0x08, 0x99, 0x94, 0xca, 0x30, 0x23, 0x94, 0x74, 0x59, 0xfa, 0x0a, 0x96, 0x0f, 0x33, 0xaa, + 0x01, 0x9e, 0x4d, 0x50, 0x1b, 0xd2, 0x81, 0x06, 0x17, 0xdc, 0xaf, 0x6d, 0xd5, 0x76, 0xda, 0x83, + 0xec, 0x2f, 0xb9, 0x01, 0x9e, 0x4a, 0x44, 0x24, 0xa4, 0x5f, 0xb7, 0xa0, 0x8b, 0xb2, 0xca, 0x53, + 0x9c, 0xfa, 0x8d, 0xbc, 0xf2, 0x14, 0xa7, 0xa4, 0x0b, 0x4d, 0xa6, 0x35, 0x1a, 0x7f, 0xd1, 0x62, + 0x79, 0x40, 0xef, 0xc3, 0xba, 0x3d, 0xe1, 0x09, 0x4b, 0xd8, 0x48, 0x0f, 0x50, 0x8f, 0x95, 0xd4, + 0x48, 0xb6, 0xc1, 0x1b, 0x5b, 0xc4, 0x9e, 0x75, 0x6d, 0x6f, 0xa5, 0x9f, 0xab, 0xe8, 0xbb, 0x3a, + 0x97, 0xa5, 0x07, 0xd0, 0x75, 0x03, 0x6a, 0x15, 0xa7, 0x58, 0xf4, 0xdf, 0x85, 0x25, 0xae, 0x86, + 0x93, 0x11, 0x4a, 0xe3, 0x18, 0x3a, 0x33, 0x86, 0x03, 0x87, 0x0f, 0x8a, 0x0a, 0xfa, 0x1e, 0x3a, + 0x96, 0xe5, 0xa9, 0x88, 0xe4, 0x3f, 0x93, 0x4a, 0x7c, 0x68, 0x8d, 0x50, 0x6b, 0x16, 0xa1, 0xdf, + 0xb4, 0xf8, 0x2c, 0xa4, 0xbb, 0xb0, 0x36, 0x77, 0xbe, 0x93, 0xb0, 0x09, 0x6d, 0x2d, 0x22, 0xc9, + 0xcc, 0x24, 0x41, 0x37, 0xc6, 0x15, 0x40, 0xbf, 0xd4, 0x80, 0xd8, 0x9e, 0xe7, 0x98, 0x88, 0xd7, + 0xd3, 0xff, 0x30, 0x75, 0x79, 0x40, 0xaf, 0x3a, 0xe0, 0x1d, 0x77, 0xb1, 0xb3, 0xf9, 0x9c, 0xaa, + 0x2e, 0x34, 0x53, 0x16, 0xbb, 0x11, 0x97, 0x06, 0x79, 0x40, 0x3f, 0xd5, 0x61, 0x69, 0x76, 0x2f, + 0x64, 0x05, 0xea, 0x85, 0x84, 0xba, 0xe0, 0x24, 0x00, 0x18, 0x2a, 0x69, 0x12, 0x15, 0xc7, 0x98, + 0x38, 0x15, 0x73, 0x08, 0xd9, 0x86, 0x15, 0x36, 0x31, 0x27, 0x28, 0x8d, 0x18, 0x5a, 0xf7, 0xfa, + 0x8d, 0xad, 0xc6, 0x4e, 0x7b, 0x50, 0x41, 0xc9, 0x6d, 0xe8, 0x64, 0x92, 0x92, 0x2c, 0x38, 0x1a, + 0xa1, 0x39, 0x51, 0xdc, 0x5f, 0xb4, 0x95, 0xab, 0x05, 0xfe, 0xd8, 0xc2, 0x64, 0x1f, 0xae, 0x0f, + 0xd9, 0x98, 0x1d, 0x8b, 0x58, 0x98, 0xe9, 0x11, 0xc7, 0x18, 0xa3, 0x9c, 0xb9, 0x69, 0xeb, 0xbb, + 0x57, 0xc9, 0x83, 0x22, 0x57, 0x69, 0x12, 0x32, 0x55, 0x6e, 0x1c, 0xaf, 0xda, 0xf4, 0xb0, 0xc8, + 0x65, 0x9f, 0x57, 0x63, 0x92, 0x8a, 0x21, 0xfa, 0x2d, 0x5b, 0x36, 0x0b, 0xf7, 0x7e, 0xd4, 0xa1, + 0x69, 0xbf, 0x20, 0x79, 0x04, 0x5e, 0x6e, 0x7b, 0xd2, 0x9d, 0x99, 0x78, 0x7e, 0x2b, 0x7b, 0xb7, + 0x4a, 0x68, 0x79, 0x93, 0xe8, 0xea, 0x87, 0x6f, 0xbf, 0x3e, 0xd7, 0xdb, 0xa4, 0x15, 0xe6, 0x2b, + 0x43, 0x0e, 0xa1, 0xe5, 0xb6, 0xe5, 0x2f, 0x74, 0x9b, 0x15, 0xb4, 0xb4, 0x59, 0x94, 0x58, 0xbe, + 0x65, 0x02, 0x61, 0xf6, 0x9e, 0xbc, 0xe5, 0x82, 0xbf, 0x23, 0xcf, 0x60, 0x31, 0xb3, 0x2e, 0xf1, + 0x4b, 0x9d, 0x73, 0xdb, 0xd4, 0xdb, 0xf8, 0x43, 0xc6, 0x11, 0xde, 0xb4, 0x84, 0x6b, 0x74, 0xf5, + 0x8a, 0x30, 0xcc, 0x6c, 0x44, 0x5e, 0x82, 0x97, 0x9b, 0x87, 0xf4, 0x4a, 0xdd, 0x25, 0xc7, 0x57, + 0xc4, 0x97, 0xdd, 0x46, 0x37, 0x2c, 0xf7, 0x3a, 0x5d, 0x9b, 0xe3, 0x4e, 0x6d, 0xc9, 0x83, 0x7b, + 0x5f, 0x2f, 0x82, 0xda, 0xf9, 0x45, 0x50, 0xfb, 0x79, 0x11, 0xd4, 0x3e, 0x5e, 0x06, 0x0b, 0xe7, + 0x97, 0xc1, 0xc2, 0xf7, 0xcb, 0x60, 0xe1, 0x05, 0x8d, 0x84, 0x39, 0x99, 0x1c, 0xf7, 0x87, 0x6a, + 0x14, 0x2a, 0xa9, 0x95, 0x4c, 0x42, 0xfb, 0xf3, 0xc6, 0x92, 0x98, 0xe9, 0x18, 0xf5, 0xb1, 0x67, + 0xdf, 0xc7, 0xfd, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd0, 0xfc, 0xed, 0xdf, 0x71, 0x05, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -342,6 +609,10 @@ type QueryClient interface { Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) + // Sign signs a message with the DID document + Sign(ctx context.Context, in *QuerySignRequest, opts ...grpc.CallOption) (*QuerySignResponse, error) + // Verify verifies a message with the DID document + Verify(ctx context.Context, in *QueryVerifyRequest, opts ...grpc.CallOption) (*QueryVerifyResponse, error) } type queryClient struct { @@ -370,12 +641,34 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grp return out, nil } +func (c *queryClient) Sign(ctx context.Context, in *QuerySignRequest, opts ...grpc.CallOption) (*QuerySignResponse, error) { + out := new(QuerySignResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/Sign", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Verify(ctx context.Context, in *QueryVerifyRequest, opts ...grpc.CallOption) (*QueryVerifyResponse, error) { + out := new(QueryVerifyResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/Verify", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Params queries all parameters of the module. Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) + // Sign signs a message with the DID document + Sign(context.Context, *QuerySignRequest) (*QuerySignResponse, error) + // Verify verifies a message with the DID document + Verify(context.Context, *QueryVerifyRequest) (*QueryVerifyResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -388,6 +681,12 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryRequest) func (*UnimplementedQueryServer) Resolve(ctx context.Context, req *QueryRequest) (*QueryResolveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } +func (*UnimplementedQueryServer) Sign(ctx context.Context, req *QuerySignRequest) (*QuerySignResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sign not implemented") +} +func (*UnimplementedQueryServer) Verify(ctx context.Context, req *QueryVerifyRequest) (*QueryVerifyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Verify not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -429,6 +728,42 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Query_Sign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySignRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Sign(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/Sign", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Sign(ctx, req.(*QuerySignRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Verify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVerifyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Verify(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/Verify", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Verify(ctx, req.(*QueryVerifyRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "did.v1.Query", HandlerType: (*QueryServer)(nil), @@ -441,6 +776,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Resolve", Handler: _Query_Resolve_Handler, }, + { + MethodName: "Sign", + Handler: _Query_Sign_Handler, + }, + { + MethodName: "Verify", + Handler: _Query_Verify_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "did/v1/query.proto", @@ -567,6 +910,192 @@ func (m *QueryResolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QuerySignRequest) 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 *QuerySignRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySignRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x2a + } + if len(m.Asset) > 0 { + i -= len(m.Asset) + copy(dAtA[i:], m.Asset) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Asset))) + i-- + dAtA[i] = 0x22 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x1a + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySignResponse) 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 *QuerySignResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySignResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryVerifyRequest) 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 *QueryVerifyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVerifyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x32 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x2a + } + if len(m.Asset) > 0 { + i -= len(m.Asset) + copy(dAtA[i:], m.Asset) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Asset))) + i-- + dAtA[i] = 0x22 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x1a + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryVerifyResponse) 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 *QueryVerifyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVerifyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Valid { + i-- + if m.Valid { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *Document) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -711,6 +1240,93 @@ func (m *QueryResolveResponse) Size() (n int) { return n } +func (m *QuerySignRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Did) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Asset) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySignResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVerifyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Did) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Asset) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVerifyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Valid { + n += 2 + } + return n +} + func (m *Document) Size() (n int) { if m == nil { return 0 @@ -1114,6 +1730,610 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QuerySignRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySignRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySignRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Asset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySignResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySignResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySignResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVerifyRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryVerifyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVerifyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Asset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVerifyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryVerifyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVerifyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Valid", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Valid = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Document) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/did/types/query.pb.gw.go b/x/did/types/query.pb.gw.go index 224c10b85..eb2b6c633 100644 --- a/x/did/types/query.pb.gw.go +++ b/x/did/types/query.pb.gw.go @@ -141,6 +141,150 @@ func local_request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marsha } +var ( + filter_Query_Sign_0 = &utilities.DoubleArray{Encoding: map[string]int{"did": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Sign_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySignRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sign_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Sign(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Sign_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySignRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sign_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Sign(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Verify_0 = &utilities.DoubleArray{Encoding: map[string]int{"did": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Verify_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryVerifyRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Verify_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Verify(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Verify_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryVerifyRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Verify_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Verify(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -193,6 +337,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("POST", pattern_Query_Sign_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Sign_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Sign_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Query_Verify_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Verify_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Verify_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -274,6 +464,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("POST", pattern_Query_Sign_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Sign_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Sign_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Query_Verify_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Verify_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Verify_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -281,10 +511,18 @@ var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Resolve_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0}, []string{"did"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Sign_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 2, 1}, []string{"did", "sign"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Verify_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 2, 1}, []string{"did", "verify"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage forward_Query_Resolve_0 = runtime.ForwardResponseMessage + + forward_Query_Sign_0 = runtime.ForwardResponseMessage + + forward_Query_Verify_0 = runtime.ForwardResponseMessage ) diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index ad7152563..cb22e3892 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -32,6 +32,12 @@ type Authentication struct { Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` // PubKey is the verification method PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // CredentialID is the byte representation of the credential ID + CredentialId []byte `protobuf:"bytes,5,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` + // Metadata of the authentication + Metadata map[string]string `protobuf:"bytes,6,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // CreationBlock is the block number of the creation of the authentication + CreationBlock int64 `protobuf:"varint,7,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` } func (m *Authentication) Reset() { *m = Authentication{} } @@ -95,6 +101,27 @@ func (m *Authentication) GetPublicKey() *PubKey { return nil } +func (m *Authentication) GetCredentialId() []byte { + if m != nil { + return m.CredentialId + } + return nil +} + +func (m *Authentication) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Authentication) GetCreationBlock() int64 { + if m != nil { + return m.CreationBlock + } + return 0 +} + // Controller represents a Sonr DWN Vault type Controller struct { // The unique identifier of the controller @@ -109,10 +136,12 @@ type Controller struct { BtcAddress string `protobuf:"bytes,5,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` // PubKey is the verification method PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // Val Keyshare + // Pointer to the Keyshares KsVal string `protobuf:"bytes,7,opt,name=ks_val,json=ksVal,proto3" json:"ks_val,omitempty"` - // The Status of the claims for the controller - Claimed bool `protobuf:"varint,8,opt,name=claimed,proto3" json:"claimed,omitempty"` + // The block number of when a user claimed the controller + ClaimedBlock int64 `protobuf:"varint,8,opt,name=claimed_block,json=claimedBlock,proto3" json:"claimed_block,omitempty"` + // CreationBlock is the block number of the creation of the controller + CreationBlock int64 `protobuf:"varint,9,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` } func (m *Controller) Reset() { *m = Controller{} } @@ -197,14 +226,21 @@ func (m *Controller) GetKsVal() string { return "" } -func (m *Controller) GetClaimed() bool { +func (m *Controller) GetClaimedBlock() int64 { if m != nil { - return m.Claimed + return m.ClaimedBlock } - return false + return 0 } -// Verification reprsents a method of verifying membership in a DID +func (m *Controller) GetCreationBlock() int64 { + if m != nil { + return m.CreationBlock + } + return 0 +} + +// Verification represents a verification method type Verification struct { // The unique identifier of the verification Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` @@ -218,9 +254,12 @@ type Verification struct { Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The public key of the verification PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // The Verification Type (Authentication, Assertion, CapabilityDelegation, - // CapabilityInvocation) + // The verification method type VerificationType string `protobuf:"bytes,7,opt,name=verification_type,json=verificationType,proto3" json:"verification_type,omitempty"` + // Metadata of the verification + Metadata map[string]string `protobuf:"bytes,8,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // CreationBlock is the block number of the creation of the controller + CreationBlock int64 `protobuf:"varint,9,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` } func (m *Verification) Reset() { *m = Verification{} } @@ -305,6 +344,80 @@ func (m *Verification) GetVerificationType() string { return "" } +func (m *Verification) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Verification) GetCreationBlock() int64 { + if m != nil { + return m.CreationBlock + } + return 0 +} + +type Keyshares struct { + ValidatorCid string `protobuf:"bytes,1,opt,name=validator_cid,json=validatorCid,proto3" json:"validator_cid,omitempty"` + UserCid string `protobuf:"bytes,2,opt,name=user_cid,json=userCid,proto3" json:"user_cid,omitempty"` + LastUpdatedBlock int64 `protobuf:"varint,3,opt,name=last_updated_block,json=lastUpdatedBlock,proto3" json:"last_updated_block,omitempty"` +} + +func (m *Keyshares) Reset() { *m = Keyshares{} } +func (m *Keyshares) String() string { return proto.CompactTextString(m) } +func (*Keyshares) ProtoMessage() {} +func (*Keyshares) Descriptor() ([]byte, []int) { + return fileDescriptor_f44bb702879c34b4, []int{3} +} +func (m *Keyshares) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Keyshares) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Keyshares.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 *Keyshares) XXX_Merge(src proto.Message) { + xxx_messageInfo_Keyshares.Merge(m, src) +} +func (m *Keyshares) XXX_Size() int { + return m.Size() +} +func (m *Keyshares) XXX_DiscardUnknown() { + xxx_messageInfo_Keyshares.DiscardUnknown(m) +} + +var xxx_messageInfo_Keyshares proto.InternalMessageInfo + +func (m *Keyshares) GetValidatorCid() string { + if m != nil { + return m.ValidatorCid + } + return "" +} + +func (m *Keyshares) GetUserCid() string { + if m != nil { + return m.UserCid + } + return "" +} + +func (m *Keyshares) GetLastUpdatedBlock() int64 { + if m != nil { + return m.LastUpdatedBlock + } + return 0 +} + // PubKey defines a public key for a did type PubKey struct { Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` @@ -317,7 +430,7 @@ func (m *PubKey) Reset() { *m = PubKey{} } func (m *PubKey) String() string { return proto.CompactTextString(m) } func (*PubKey) ProtoMessage() {} func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{3} + return fileDescriptor_f44bb702879c34b4, []int{4} } func (m *PubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -388,7 +501,7 @@ func (m *JSONWebKey) Reset() { *m = JSONWebKey{} } func (m *JSONWebKey) String() string { return proto.CompactTextString(m) } func (*JSONWebKey) ProtoMessage() {} func (*JSONWebKey) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{4} + return fileDescriptor_f44bb702879c34b4, []int{5} } func (m *JSONWebKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -470,7 +583,7 @@ func (m *RawKey) Reset() { *m = RawKey{} } func (m *RawKey) String() string { return proto.CompactTextString(m) } func (*RawKey) ProtoMessage() {} func (*RawKey) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{5} + return fileDescriptor_f44bb702879c34b4, []int{6} } func (m *RawKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -529,8 +642,11 @@ func (m *RawKey) GetKey() []byte { func init() { proto.RegisterType((*Authentication)(nil), "did.v1.Authentication") + proto.RegisterMapType((map[string]string)(nil), "did.v1.Authentication.MetadataEntry") proto.RegisterType((*Controller)(nil), "did.v1.Controller") proto.RegisterType((*Verification)(nil), "did.v1.Verification") + proto.RegisterMapType((map[string]string)(nil), "did.v1.Verification.MetadataEntry") + proto.RegisterType((*Keyshares)(nil), "did.v1.Keyshares") proto.RegisterType((*PubKey)(nil), "did.v1.PubKey") proto.RegisterType((*JSONWebKey)(nil), "did.v1.JSONWebKey") proto.RegisterType((*RawKey)(nil), "did.v1.RawKey") @@ -539,51 +655,63 @@ func init() { func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ - // 699 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0xee, 0xe4, 0xc7, 0x49, 0x4e, 0xa3, 0x2a, 0x1d, 0xf5, 0xde, 0x3b, 0xb7, 0x2a, 0x21, 0x18, - 0x04, 0x45, 0x94, 0x44, 0x85, 0x5d, 0xc5, 0xa6, 0xb0, 0xa3, 0xe2, 0x47, 0x29, 0x2a, 0x82, 0x4d, - 0x64, 0x7b, 0x86, 0xc6, 0xf5, 0xcf, 0x84, 0xf1, 0xd8, 0xad, 0x5f, 0x80, 0x25, 0xe2, 0x09, 0x78, - 0x0c, 0x9e, 0x81, 0x65, 0x25, 0x24, 0xc4, 0xb2, 0x6a, 0xdf, 0x80, 0x27, 0x40, 0x33, 0x1e, 0x37, - 0x8e, 0x90, 0xa8, 0xc4, 0xc6, 0x9e, 0x73, 0xe6, 0xd3, 0x9c, 0xef, 0xfb, 0xce, 0x99, 0x01, 0x4c, - 0x7d, 0x3a, 0xca, 0xb6, 0x47, 0x89, 0x74, 0x24, 0x1b, 0xce, 0x04, 0x97, 0x1c, 0x5b, 0xd4, 0xa7, - 0xc3, 0x6c, 0x7b, 0xfd, 0x3f, 0x8f, 0x27, 0x11, 0x4f, 0x46, 0x5c, 0x44, 0x0a, 0xc2, 0x45, 0x54, - 0x00, 0xec, 0x2f, 0x08, 0x56, 0x76, 0x53, 0x39, 0x65, 0xb1, 0xf4, 0x3d, 0x47, 0xfa, 0x3c, 0xc6, - 0x3d, 0xa8, 0x53, 0x9f, 0x12, 0x34, 0x40, 0x9b, 0x9d, 0xb1, 0x5a, 0xe2, 0x3e, 0x80, 0xc7, 0x63, - 0x29, 0x78, 0x18, 0x32, 0x41, 0x6a, 0x7a, 0xa3, 0x92, 0xc1, 0x04, 0x5a, 0x49, 0xea, 0x1e, 0x31, - 0x4f, 0x92, 0xba, 0xde, 0x2c, 0x43, 0x7c, 0x1f, 0x60, 0x96, 0xba, 0xa1, 0xef, 0x4d, 0x02, 0x96, - 0x93, 0xc6, 0x00, 0x6d, 0x2e, 0x3f, 0x58, 0x19, 0x16, 0xa4, 0x86, 0x2f, 0x53, 0x77, 0x8f, 0xe5, - 0xe3, 0x4e, 0x81, 0xd8, 0x63, 0xf9, 0xce, 0xdd, 0x9f, 0x9f, 0xbf, 0x7d, 0xac, 0xdf, 0x84, 0xa6, - 0xa6, 0x80, 0x09, 0xe0, 0x79, 0x95, 0x2d, 0x73, 0x66, 0x0f, 0x11, 0x44, 0x90, 0xfd, 0xbd, 0x06, - 0xf0, 0x64, 0x4e, 0xe1, 0x5f, 0xb0, 0xe2, 0x34, 0x72, 0x99, 0xd0, 0xbc, 0x1b, 0x63, 0x13, 0x95, - 0x62, 0x6a, 0x73, 0x31, 0x37, 0xa0, 0x9b, 0xf0, 0x58, 0x4c, 0x1c, 0x4a, 0x05, 0x4b, 0x12, 0xc3, - 0x78, 0x59, 0xe5, 0x76, 0x8b, 0x14, 0xbe, 0x0e, 0xcb, 0x4c, 0x4e, 0x2f, 0x11, 0x8d, 0x42, 0x30, - 0x93, 0xd3, 0x0a, 0xc0, 0x95, 0xde, 0x25, 0xa0, 0x59, 0x00, 0x5c, 0xe9, 0x95, 0x80, 0x45, 0xdd, - 0xd6, 0x15, 0xba, 0xf1, 0x3f, 0x60, 0x05, 0xc9, 0x24, 0x73, 0x42, 0xd2, 0xd2, 0x47, 0x35, 0x83, - 0xe4, 0xc0, 0x09, 0x95, 0xaf, 0x5e, 0xe8, 0xf8, 0x11, 0xa3, 0xa4, 0x3d, 0x40, 0x9b, 0xed, 0x71, - 0x19, 0xee, 0xbc, 0xd1, 0x46, 0xed, 0x03, 0x94, 0xb2, 0x7b, 0x08, 0xe3, 0x45, 0x61, 0xca, 0x27, - 0xbc, 0xba, 0xa0, 0xa4, 0x57, 0x2b, 0x52, 0x15, 0xee, 0xbd, 0x3a, 0x41, 0xb8, 0xa3, 0x4d, 0xea, - 0x35, 0x08, 0x22, 0x35, 0xfb, 0xac, 0x06, 0xdd, 0x03, 0x26, 0xfc, 0x77, 0x7f, 0x3f, 0x0f, 0xd7, - 0x00, 0xa8, 0x4f, 0x27, 0x11, 0x93, 0x53, 0x4e, 0x8d, 0xc1, 0x1d, 0xea, 0xd3, 0x67, 0x3a, 0xa1, - 0x7a, 0xe5, 0x27, 0x49, 0xca, 0x84, 0x71, 0xd6, 0x44, 0xd5, 0x31, 0x6a, 0xfe, 0x69, 0x8c, 0xae, - 0xb4, 0xf3, 0x1e, 0xac, 0x66, 0x15, 0x05, 0x13, 0x99, 0xcf, 0x98, 0x71, 0xb6, 0x57, 0xdd, 0x78, - 0x95, 0xcf, 0xd8, 0xce, 0x7b, 0x6d, 0x65, 0x50, 0xce, 0xdc, 0x1a, 0xac, 0x14, 0x74, 0xaa, 0xf3, - 0x86, 0x6d, 0xd8, 0xa8, 0x4c, 0xe2, 0x5c, 0xdc, 0x56, 0x81, 0xd5, 0xc6, 0xde, 0x86, 0xc1, 0x6f, - 0x55, 0xcb, 0x43, 0x4a, 0x5c, 0x9d, 0x20, 0xd2, 0xb0, 0x3f, 0x20, 0xb0, 0x0a, 0xd6, 0x18, 0x43, - 0x43, 0xf0, 0x90, 0x19, 0x77, 0xf5, 0x1a, 0xff, 0x0f, 0xed, 0x80, 0xe5, 0x05, 0xeb, 0xc2, 0xdc, - 0x56, 0xc0, 0x72, 0x45, 0x16, 0xdf, 0x81, 0x96, 0x70, 0x8e, 0xb5, 0x0b, 0xf5, 0x45, 0x17, 0xc6, - 0xce, 0xb1, 0x72, 0xc1, 0x12, 0xfa, 0x8f, 0x6f, 0x41, 0xfd, 0xe8, 0x38, 0x30, 0x37, 0x0e, 0x97, - 0xa0, 0xa7, 0xfb, 0x2f, 0x9e, 0xbf, 0x66, 0xda, 0x2e, 0xb5, 0x6d, 0x4f, 0x01, 0xe6, 0x29, 0xd5, - 0xe8, 0x40, 0xe6, 0x65, 0xa3, 0x03, 0xa9, 0x33, 0x9e, 0xc8, 0xca, 0xdb, 0xe3, 0x89, 0x0c, 0x77, - 0x01, 0x9d, 0x98, 0x8e, 0xa2, 0x13, 0x15, 0xe5, 0xa6, 0x89, 0x28, 0x57, 0x51, 0x6c, 0x3a, 0x87, - 0x62, 0x15, 0x31, 0xdd, 0xaa, 0xce, 0x18, 0x31, 0xfb, 0x08, 0xac, 0x82, 0x21, 0xde, 0x80, 0x8e, - 0x13, 0x1e, 0x72, 0xe1, 0xcb, 0x69, 0x64, 0x6a, 0xcd, 0x13, 0x78, 0x1d, 0xda, 0x2c, 0xf6, 0x38, - 0xf5, 0xe3, 0x43, 0x53, 0xf6, 0x32, 0xc6, 0x6b, 0xd0, 0xf4, 0x52, 0x91, 0x31, 0x53, 0xbf, 0x08, - 0x34, 0x6b, 0xf3, 0xb6, 0x74, 0xc7, 0x6a, 0xf9, 0xf8, 0xd1, 0xd7, 0xf3, 0x3e, 0x3a, 0x3d, 0xef, - 0xa3, 0xb3, 0xf3, 0x3e, 0xfa, 0x74, 0xd1, 0x5f, 0x3a, 0xbd, 0xe8, 0x2f, 0xfd, 0xb8, 0xe8, 0x2f, - 0xbd, 0xb5, 0x0f, 0x7d, 0x39, 0x4d, 0xdd, 0xa1, 0xc7, 0xa3, 0x11, 0x8f, 0xd5, 0x6d, 0x19, 0xe9, - 0xcf, 0xc9, 0x48, 0xbd, 0x9d, 0xca, 0xf0, 0xc4, 0xb5, 0xf4, 0xc3, 0xf8, 0xf0, 0x57, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xd8, 0x36, 0xf8, 0xc5, 0x4f, 0x05, 0x00, 0x00, + // 890 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x5d, 0x6f, 0xe3, 0x44, + 0x14, 0xed, 0xc4, 0x89, 0x1b, 0xdf, 0xa6, 0x55, 0x76, 0xb4, 0x80, 0xa9, 0x96, 0x10, 0xbc, 0x0b, + 0x04, 0x51, 0x12, 0xed, 0xf2, 0x82, 0x0a, 0x42, 0xec, 0xae, 0x78, 0x80, 0x6a, 0x01, 0x79, 0x61, + 0x11, 0xbc, 0x58, 0x63, 0xcf, 0xd0, 0xb8, 0xfe, 0x98, 0x30, 0x1e, 0xbb, 0xf5, 0x23, 0x12, 0x42, + 0x3c, 0x21, 0x7e, 0x01, 0xbf, 0x87, 0xc7, 0x95, 0x78, 0xe1, 0x11, 0xb5, 0xff, 0x80, 0x5f, 0x80, + 0x66, 0x3c, 0x4e, 0x1c, 0xb1, 0xa2, 0x02, 0xf1, 0xd2, 0xfa, 0x9e, 0x7b, 0xe2, 0xeb, 0x39, 0xe7, + 0x5c, 0x1b, 0x30, 0x8d, 0xe9, 0xa2, 0xba, 0xbb, 0x28, 0x24, 0x91, 0x6c, 0xbe, 0x12, 0x5c, 0x72, + 0x6c, 0xd3, 0x98, 0xce, 0xab, 0xbb, 0x87, 0x2f, 0x44, 0xbc, 0xc8, 0x78, 0xb1, 0xe0, 0x22, 0x53, + 0x14, 0x2e, 0xb2, 0x86, 0xe0, 0x7d, 0x67, 0xc1, 0xc1, 0xfd, 0x52, 0x2e, 0x59, 0x2e, 0xe3, 0x88, + 0xc8, 0x98, 0xe7, 0x78, 0x0c, 0x16, 0x8d, 0xa9, 0x8b, 0xa6, 0x68, 0xe6, 0xf8, 0xea, 0x12, 0x4f, + 0x00, 0x22, 0x9e, 0x4b, 0xc1, 0xd3, 0x94, 0x09, 0xb7, 0xa7, 0x1b, 0x1d, 0x04, 0xbb, 0xb0, 0x5b, + 0x94, 0xe1, 0x19, 0x8b, 0xa4, 0x6b, 0xe9, 0x66, 0x5b, 0xe2, 0xb7, 0x00, 0x56, 0x65, 0x98, 0xc6, + 0x51, 0x90, 0xb0, 0xda, 0xed, 0x4f, 0xd1, 0x6c, 0xef, 0xde, 0xc1, 0xbc, 0x79, 0xa8, 0xf9, 0x67, + 0x65, 0x78, 0xc2, 0x6a, 0xdf, 0x69, 0x18, 0x27, 0xac, 0xc6, 0xb7, 0x61, 0x3f, 0x12, 0x8c, 0xaa, + 0x87, 0x21, 0x69, 0x10, 0x53, 0x77, 0x30, 0x45, 0xb3, 0x91, 0x3f, 0xda, 0x80, 0x1f, 0x51, 0xfc, + 0x01, 0x0c, 0x33, 0x26, 0x09, 0x25, 0x92, 0xb8, 0xf6, 0xd4, 0x9a, 0xed, 0xdd, 0xbb, 0xd3, 0xde, + 0x71, 0xfb, 0x24, 0xf3, 0x47, 0x86, 0xf6, 0x61, 0x2e, 0x45, 0xed, 0xaf, 0x7f, 0x85, 0x5f, 0x85, + 0x83, 0x48, 0x30, 0xcd, 0x09, 0xc2, 0x94, 0x47, 0x89, 0xbb, 0x3b, 0x45, 0x33, 0xcb, 0xdf, 0x6f, + 0xd1, 0x07, 0x0a, 0x3c, 0x7c, 0x17, 0xf6, 0xb7, 0xee, 0xa0, 0x94, 0x51, 0xc7, 0x30, 0xca, 0x24, + 0xac, 0xc6, 0x37, 0x61, 0x50, 0x91, 0xb4, 0x64, 0x46, 0x94, 0xa6, 0x38, 0xee, 0xbd, 0x83, 0x8e, + 0xdf, 0xf8, 0xf3, 0x97, 0xdf, 0x7e, 0xb2, 0x6e, 0xc3, 0x40, 0xab, 0x89, 0x5d, 0xc0, 0x1b, 0xc1, + 0x8e, 0x8c, 0x3c, 0x63, 0xe4, 0x22, 0x17, 0x79, 0x3f, 0x5a, 0x00, 0x0f, 0x37, 0x6a, 0x3e, 0x0f, + 0x76, 0x5e, 0x66, 0x21, 0x13, 0x7a, 0x50, 0xdf, 0x37, 0x55, 0xeb, 0x4b, 0x6f, 0xe3, 0xcb, 0x2b, + 0x30, 0x2a, 0x78, 0x2e, 0x02, 0x42, 0xa9, 0x60, 0x45, 0x61, 0xc4, 0xdf, 0x53, 0xd8, 0xfd, 0x06, + 0xc2, 0x2f, 0xc3, 0x1e, 0x93, 0xcb, 0x35, 0xa3, 0xdf, 0x78, 0xc7, 0xe4, 0xb2, 0x43, 0x08, 0x65, + 0xb4, 0x26, 0x0c, 0x1a, 0x42, 0x28, 0xa3, 0x96, 0xb0, 0x6d, 0xa1, 0x7d, 0x9d, 0x85, 0xcf, 0x81, + 0x9d, 0x14, 0x41, 0x45, 0x52, 0xad, 0xa9, 0xe3, 0x0f, 0x92, 0xe2, 0x09, 0x49, 0xb5, 0xb3, 0x29, + 0x89, 0x33, 0x46, 0x8d, 0xe2, 0x43, 0xad, 0xf8, 0xc8, 0x80, 0x5a, 0xf0, 0x67, 0xf8, 0xe2, 0x3c, + 0xc3, 0x97, 0xe3, 0xaf, 0xb4, 0xb4, 0x8f, 0x01, 0x5a, 0xa1, 0xc6, 0x08, 0xe3, 0x6d, 0x29, 0x94, + 0xb2, 0xf8, 0xc6, 0xd6, 0xd9, 0xc7, 0xbd, 0x06, 0xea, 0x9c, 0x76, 0x6c, 0xb9, 0x08, 0x3b, 0x5a, + 0xd6, 0x71, 0xdf, 0x45, 0x6e, 0xcf, 0xfb, 0xbe, 0x0f, 0xa3, 0x27, 0x4c, 0xc4, 0xdf, 0xfc, 0xf7, + 0x65, 0x78, 0x09, 0x80, 0xc6, 0x34, 0xc8, 0x98, 0x5c, 0x72, 0x6a, 0x2c, 0x71, 0x68, 0x4c, 0x1f, + 0x69, 0x40, 0xb9, 0x1b, 0x17, 0x45, 0xc9, 0x84, 0xf1, 0xc2, 0x54, 0xdd, 0x1d, 0x1a, 0xfc, 0xd3, + 0x0e, 0x5d, 0x6b, 0xc0, 0x9b, 0x70, 0xa3, 0xea, 0x9c, 0x20, 0x90, 0xf5, 0x8a, 0x19, 0x2f, 0xc6, + 0xdd, 0xc6, 0xe7, 0xf5, 0x8a, 0xe1, 0xf7, 0x3b, 0xbb, 0x34, 0xd4, 0xbb, 0xe4, 0xb5, 0x77, 0xee, + 0xca, 0xf0, 0x2f, 0x36, 0xc9, 0xf9, 0xdf, 0x37, 0xe9, 0x5b, 0x6d, 0x77, 0xd2, 0x6e, 0xd2, 0x4d, + 0x38, 0x68, 0x24, 0xeb, 0x6e, 0x11, 0xf6, 0xe0, 0x56, 0x67, 0xbf, 0x36, 0x06, 0x1c, 0x35, 0x5c, + 0x6d, 0xfe, 0x6b, 0x30, 0xfd, 0x9b, 0x32, 0xed, 0x4d, 0x5a, 0x9e, 0xe5, 0x22, 0xb7, 0xef, 0xd5, + 0xe0, 0x9c, 0xb0, 0xba, 0x58, 0x12, 0xc1, 0x0a, 0x15, 0xdd, 0x8a, 0xa4, 0x31, 0x25, 0x92, 0x8b, + 0x20, 0x5a, 0x87, 0x61, 0xb4, 0x06, 0x1f, 0xc6, 0x14, 0xbf, 0x08, 0xc3, 0xb2, 0x60, 0x4d, 0xbf, + 0x39, 0xc1, 0xae, 0xaa, 0x55, 0xeb, 0x08, 0x70, 0x4a, 0x0a, 0x19, 0x94, 0x2b, 0x4a, 0xe4, 0x3a, + 0xff, 0x96, 0xd6, 0x69, 0xac, 0x3a, 0x5f, 0x34, 0x0d, 0x2d, 0x95, 0xf7, 0x03, 0x02, 0xbb, 0x31, + 0x15, 0x63, 0xe8, 0x0b, 0x9e, 0x32, 0x33, 0x4f, 0x5f, 0xab, 0x39, 0x09, 0xab, 0x1b, 0x53, 0xcd, + 0x9c, 0x84, 0xd5, 0xda, 0xcb, 0xd7, 0x61, 0x57, 0x90, 0x73, 0x1d, 0x12, 0x6b, 0x3b, 0x24, 0x3e, + 0x39, 0x57, 0x21, 0xb1, 0x85, 0xfe, 0x8f, 0xef, 0x80, 0x75, 0x76, 0x9e, 0x98, 0xb7, 0x31, 0x6e, + 0x49, 0x1f, 0x3f, 0xfe, 0xf4, 0x93, 0x2f, 0x99, 0x4e, 0x93, 0x6a, 0x7b, 0x4b, 0x80, 0x0d, 0xa4, + 0x0d, 0x93, 0x1b, 0xc3, 0xa4, 0x46, 0x22, 0x51, 0xb5, 0xaf, 0xa3, 0x48, 0x54, 0x78, 0x04, 0xe8, + 0xc2, 0x04, 0x1e, 0x5d, 0xa8, 0xaa, 0x36, 0x19, 0x47, 0xb5, 0xaa, 0x72, 0x13, 0x6c, 0x94, 0xab, + 0x8a, 0xe9, 0x24, 0x3b, 0x3e, 0x62, 0xde, 0x19, 0xd8, 0xcd, 0x13, 0xe2, 0x5b, 0xe0, 0x90, 0xf4, + 0x94, 0x8b, 0x58, 0x2e, 0x33, 0x33, 0x6b, 0x03, 0xe0, 0x43, 0x18, 0xb2, 0x3c, 0xe2, 0x34, 0xce, + 0x4f, 0xcd, 0xd8, 0x75, 0xad, 0xe2, 0x13, 0x95, 0xa2, 0x62, 0x66, 0x7e, 0x53, 0xb4, 0x31, 0xeb, + 0xeb, 0xaf, 0x88, 0xba, 0x7c, 0xf0, 0xde, 0xaf, 0x97, 0x13, 0xf4, 0xf4, 0x72, 0x82, 0xfe, 0xb8, + 0x9c, 0xa0, 0x9f, 0xaf, 0x26, 0x3b, 0x4f, 0xaf, 0x26, 0x3b, 0xbf, 0x5f, 0x4d, 0x76, 0xbe, 0xf6, + 0x4e, 0x63, 0xb9, 0x2c, 0xc3, 0x79, 0xc4, 0xb3, 0x05, 0xcf, 0xd5, 0xcb, 0x64, 0xa1, 0xff, 0x5c, + 0x2c, 0xd4, 0x77, 0x55, 0x09, 0x5e, 0x84, 0xb6, 0xfe, 0x68, 0xbe, 0xfd, 0x57, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x9c, 0xe7, 0xd9, 0xaa, 0x6b, 0x07, 0x00, 0x00, } func (m *Authentication) Marshal() (dAtA []byte, err error) { @@ -606,6 +734,37 @@ func (m *Authentication) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.CreationBlock != 0 { + i = encodeVarintState(dAtA, i, uint64(m.CreationBlock)) + i-- + dAtA[i] = 0x38 + } + if len(m.Metadata) > 0 { + for k := range m.Metadata { + v := m.Metadata[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintState(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintState(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintState(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.CredentialId) > 0 { + i -= len(m.CredentialId) + copy(dAtA[i:], m.CredentialId) + i = encodeVarintState(dAtA, i, uint64(len(m.CredentialId))) + i-- + dAtA[i] = 0x2a + } if m.PublicKey != nil { { size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) @@ -662,13 +821,13 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Claimed { + if m.CreationBlock != 0 { + i = encodeVarintState(dAtA, i, uint64(m.CreationBlock)) i-- - if m.Claimed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + dAtA[i] = 0x48 + } + if m.ClaimedBlock != 0 { + i = encodeVarintState(dAtA, i, uint64(m.ClaimedBlock)) i-- dAtA[i] = 0x40 } @@ -747,6 +906,30 @@ func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.CreationBlock != 0 { + i = encodeVarintState(dAtA, i, uint64(m.CreationBlock)) + i-- + dAtA[i] = 0x48 + } + if len(m.Metadata) > 0 { + for k := range m.Metadata { + v := m.Metadata[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintState(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintState(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintState(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } if len(m.VerificationType) > 0 { i -= len(m.VerificationType) copy(dAtA[i:], m.VerificationType) @@ -804,6 +987,48 @@ func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Keyshares) 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 *Keyshares) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Keyshares) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LastUpdatedBlock != 0 { + i = encodeVarintState(dAtA, i, uint64(m.LastUpdatedBlock)) + i-- + dAtA[i] = 0x18 + } + if len(m.UserCid) > 0 { + i -= len(m.UserCid) + copy(dAtA[i:], m.UserCid) + i = encodeVarintState(dAtA, i, uint64(len(m.UserCid))) + i-- + dAtA[i] = 0x12 + } + if len(m.ValidatorCid) > 0 { + i -= len(m.ValidatorCid) + copy(dAtA[i:], m.ValidatorCid) + i = encodeVarintState(dAtA, i, uint64(len(m.ValidatorCid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *PubKey) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1014,6 +1239,21 @@ func (m *Authentication) Size() (n int) { l = m.PublicKey.Size() n += 1 + l + sovState(uint64(l)) } + l = len(m.CredentialId) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovState(uint64(len(k))) + 1 + len(v) + sovState(uint64(len(v))) + n += mapEntrySize + 1 + sovState(uint64(mapEntrySize)) + } + } + if m.CreationBlock != 0 { + n += 1 + sovState(uint64(m.CreationBlock)) + } return n } @@ -1050,8 +1290,11 @@ func (m *Controller) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.Claimed { - n += 2 + if m.ClaimedBlock != 0 { + n += 1 + sovState(uint64(m.ClaimedBlock)) + } + if m.CreationBlock != 0 { + n += 1 + sovState(uint64(m.CreationBlock)) } return n } @@ -1090,6 +1333,37 @@ func (m *Verification) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovState(uint64(len(k))) + 1 + len(v) + sovState(uint64(len(v))) + n += mapEntrySize + 1 + sovState(uint64(mapEntrySize)) + } + } + if m.CreationBlock != 0 { + n += 1 + sovState(uint64(m.CreationBlock)) + } + return n +} + +func (m *Keyshares) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorCid) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.UserCid) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.LastUpdatedBlock != 0 { + n += 1 + sovState(uint64(m.LastUpdatedBlock)) + } return n } @@ -1343,6 +1617,186 @@ func (m *Authentication) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CredentialId = append(m.CredentialId[:0], dAtA[iNdEx:postIndex]...) + if m.CredentialId == nil { + m.CredentialId = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthState + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthState + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthState + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthState + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) + } + m.CreationBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) @@ -1610,9 +2064,9 @@ func (m *Controller) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 8: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Claimed", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedBlock", wireType) } - var v int + m.ClaimedBlock = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1622,12 +2076,30 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.ClaimedBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) + } + m.CreationBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationBlock |= int64(b&0x7F) << shift if b < 0x80 { break } } - m.Claimed = bool(v != 0) default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) @@ -1906,6 +2378,285 @@ func (m *Verification) Unmarshal(dAtA []byte) error { } m.VerificationType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthState + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthState + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthState + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthState + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) + } + m.CreationBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Keyshares) 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 ErrIntOverflowState + } + 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: Keyshares: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Keyshares: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorCid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorCid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserCid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UserCid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastUpdatedBlock", wireType) + } + m.LastUpdatedBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastUpdatedBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) diff --git a/x/macaroon/keeper/rpc.go b/x/macaroon/keeper/rpc.go index 9a0193773..096eb2458 100644 --- a/x/macaroon/keeper/rpc.go +++ b/x/macaroon/keeper/rpc.go @@ -34,3 +34,10 @@ func (ms msgServer) AuthorizeService(ctx context.Context, msg *types.MsgIssueMac panic("AuthorizeService is unimplemented") return &types.MsgIssueMacaroonResponse{}, nil } + +// IssueMacaroon implements types.MsgServer. +func (ms msgServer) IssueMacaroon(ctx context.Context, msg *types.MsgIssueMacaroon) (*types.MsgIssueMacaroonResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("IssueMacaroon is unimplemented") + return &types.MsgIssueMacaroonResponse{}, nil +} diff --git a/x/macaroon/types/tx.pb.go b/x/macaroon/types/tx.pb.go index 2a7c5c14a..56aff3e6a 100644 --- a/x/macaroon/types/tx.pb.go +++ b/x/macaroon/types/tx.pb.go @@ -129,7 +129,7 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo -// MsgIssueMacaroon is the message type for the AuthorizeService RPC. +// MsgIssueMacaroon is the message type for the IssueMacaroon RPC. type MsgIssueMacaroon struct { // Controller is the address of the controller to authenticate. Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` @@ -202,7 +202,7 @@ func (m *MsgIssueMacaroon) GetToken() string { return "" } -// MsgIssueMacaroonResponse is the response type for the AuthorizeService +// MsgIssueMacaroonResponse is the response type for the IssueMacaroon // RPC. type MsgIssueMacaroonResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` @@ -267,39 +267,39 @@ func init() { func init() { proto.RegisterFile("macaroon/v1/tx.proto", fileDescriptor_68f908349d9da51a) } var fileDescriptor_68f908349d9da51a = []byte{ - // 507 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x4f, 0x6b, 0x13, 0x4f, - 0x18, 0xce, 0x24, 0x6d, 0x7e, 0xbf, 0x4c, 0xc4, 0x86, 0x31, 0xd8, 0xed, 0xa2, 0x6b, 0x08, 0x8a, - 0xa1, 0xe0, 0x2e, 0x89, 0x20, 0x25, 0x07, 0x21, 0x01, 0x0f, 0x0a, 0x81, 0xb0, 0x45, 0x10, 0x2f, - 0xb2, 0xdd, 0x0c, 0xd3, 0xa1, 0xd9, 0x99, 0x65, 0xde, 0xd9, 0xd0, 0x78, 0x12, 0xcf, 0x1e, 0xfc, - 0x02, 0x7e, 0x87, 0x1e, 0x3c, 0xf9, 0x09, 0x7a, 0x2c, 0x9e, 0x3c, 0x89, 0x24, 0x87, 0x7e, 0x0d, - 0xd9, 0x7f, 0xcd, 0x76, 0x0f, 0xf1, 0x12, 0xe6, 0x99, 0xf7, 0x7d, 0x9e, 0xf7, 0x79, 0x9f, 0xec, - 0xe0, 0x76, 0xe0, 0xf9, 0x9e, 0x92, 0x52, 0x38, 0x8b, 0xbe, 0xa3, 0xcf, 0xed, 0x50, 0x49, 0x2d, - 0x49, 0x33, 0xbf, 0xb5, 0x17, 0x7d, 0x73, 0xdf, 0x97, 0x10, 0x48, 0x70, 0x02, 0x60, 0x71, 0x53, - 0x00, 0x2c, 0xed, 0x32, 0x0f, 0xd2, 0xc2, 0x87, 0x04, 0x39, 0x29, 0xc8, 0x4a, 0x6d, 0x26, 0x99, - 0x4c, 0xef, 0xe3, 0x53, 0x4e, 0x28, 0x0e, 0x63, 0x54, 0x50, 0xe0, 0x19, 0xa1, 0xfb, 0x05, 0xe1, - 0xbd, 0x09, 0xb0, 0xb7, 0xe1, 0xcc, 0xd3, 0x74, 0xea, 0x29, 0x2f, 0x00, 0xf2, 0x02, 0x37, 0xbc, - 0x48, 0x9f, 0x4a, 0xc5, 0xf5, 0xd2, 0x40, 0x1d, 0xd4, 0x6b, 0x8c, 0x8d, 0x9f, 0xdf, 0x9f, 0xb5, - 0xb3, 0x49, 0xa3, 0xd9, 0x4c, 0x51, 0x80, 0x63, 0xad, 0xb8, 0x60, 0xee, 0xa6, 0x95, 0xf4, 0x71, - 0x3d, 0x4c, 0x14, 0x8c, 0x6a, 0x07, 0xf5, 0x9a, 0x83, 0x7b, 0x76, 0x61, 0x1d, 0x3b, 0x15, 0x1f, - 0xef, 0x5c, 0xfe, 0x7e, 0x54, 0x71, 0xb3, 0xc6, 0xe1, 0xdd, 0xcf, 0xd7, 0x17, 0x87, 0x1b, 0x89, - 0xee, 0x01, 0xde, 0x2f, 0xb9, 0x71, 0x29, 0x84, 0x52, 0x00, 0xed, 0x7e, 0xab, 0xe2, 0xd6, 0x04, - 0xd8, 0x6b, 0x80, 0x88, 0x4e, 0x32, 0x5d, 0x72, 0x84, 0xb1, 0x2f, 0x85, 0x56, 0x72, 0x3e, 0xa7, - 0xea, 0x9f, 0x5e, 0x0b, 0xbd, 0xe4, 0x3e, 0xae, 0x4b, 0xc5, 0x19, 0x17, 0x89, 0xd9, 0x86, 0x9b, - 0x21, 0x32, 0xc5, 0xcd, 0x90, 0xaa, 0x80, 0x03, 0x70, 0x29, 0xc0, 0xa8, 0x75, 0x6a, 0xbd, 0xe6, - 0xc0, 0xbe, 0xb5, 0x49, 0xd9, 0x85, 0x3d, 0xdd, 0x10, 0x5e, 0x09, 0xad, 0x96, 0x6e, 0x51, 0x82, - 0xb4, 0xf1, 0xae, 0x96, 0x67, 0x54, 0x18, 0x3b, 0xc9, 0xa0, 0x14, 0x98, 0x2f, 0x71, 0xab, 0x4c, - 0x23, 0x2d, 0x5c, 0x3b, 0xa3, 0x59, 0xe4, 0x6e, 0x7c, 0x8c, 0xb9, 0x0b, 0x6f, 0x1e, 0xd1, 0xcc, - 0x64, 0x0a, 0x86, 0xd5, 0x23, 0x34, 0xdc, 0x8b, 0x93, 0x2b, 0x2c, 0xd4, 0x7d, 0x83, 0x8d, 0xb2, - 0xb1, 0x3c, 0x3b, 0x62, 0xe0, 0xff, 0x20, 0xf2, 0x7d, 0x0a, 0x90, 0x88, 0xff, 0xef, 0xe6, 0x70, - 0x63, 0xae, 0x5a, 0x30, 0x37, 0xf8, 0x81, 0x70, 0x6d, 0x02, 0x8c, 0xb8, 0xf8, 0xce, 0xad, 0x2f, - 0xe3, 0x41, 0x39, 0x87, 0x62, 0xd5, 0x7c, 0xbc, 0xad, 0x7a, 0xe3, 0xe5, 0x1d, 0x6e, 0x8d, 0xd2, - 0xff, 0xfb, 0x23, 0x3d, 0xa6, 0x6a, 0xc1, 0x7d, 0x4a, 0x1e, 0x6e, 0xcd, 0xd7, 0x7c, 0xb2, 0xb5, - 0x9c, 0x2b, 0x9b, 0xbb, 0x9f, 0xae, 0x2f, 0x0e, 0xd1, 0x78, 0x74, 0xb9, 0xb2, 0xd0, 0xd5, 0xca, - 0x42, 0x7f, 0x56, 0x16, 0xfa, 0xba, 0xb6, 0x2a, 0x57, 0x6b, 0xab, 0xf2, 0x6b, 0x6d, 0x55, 0xde, - 0x3f, 0x65, 0x5c, 0x9f, 0x46, 0x27, 0xb6, 0x2f, 0x03, 0x47, 0x0a, 0x90, 0x42, 0x39, 0xc9, 0xcf, - 0xb9, 0x73, 0xf3, 0x40, 0xf4, 0x32, 0xa4, 0x70, 0x52, 0x4f, 0x1e, 0xc7, 0xf3, 0xbf, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x0d, 0x7b, 0xef, 0xfd, 0xa6, 0x03, 0x00, 0x00, + // 497 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xcf, 0x6b, 0x13, 0x41, + 0x14, 0xce, 0x24, 0x6d, 0x34, 0x13, 0xb5, 0x61, 0x0c, 0x76, 0xbb, 0xe8, 0x1a, 0x82, 0x62, 0x28, + 0xb8, 0x4b, 0x22, 0x48, 0xc9, 0x41, 0x68, 0xc0, 0x83, 0x42, 0x20, 0xac, 0xf4, 0xe2, 0x45, 0xb6, + 0x9b, 0x61, 0xba, 0x34, 0x3b, 0x6f, 0x99, 0x37, 0x09, 0xcd, 0x4d, 0x3c, 0x7b, 0xf0, 0x1f, 0xf0, + 0x7f, 0xe8, 0x41, 0xf0, 0x5f, 0xe8, 0xb1, 0x78, 0xf2, 0x24, 0x92, 0x1c, 0xfa, 0x6f, 0x48, 0xf6, + 0x47, 0xb3, 0xd9, 0x43, 0xbc, 0x84, 0xf9, 0xe6, 0xbd, 0xef, 0x7b, 0xdf, 0xfb, 0xb2, 0x43, 0x9b, + 0xa1, 0xe7, 0x7b, 0x0a, 0x40, 0x3a, 0xb3, 0xae, 0xa3, 0x2f, 0xec, 0x48, 0x81, 0x06, 0x56, 0xcf, + 0x6e, 0xed, 0x59, 0xd7, 0xdc, 0xf7, 0x01, 0x43, 0x40, 0x27, 0x44, 0xb1, 0x6a, 0x0a, 0x51, 0x24, + 0x5d, 0xe6, 0x41, 0x52, 0xf8, 0x14, 0x23, 0x27, 0x01, 0x69, 0xa9, 0x29, 0x40, 0x40, 0x72, 0xbf, + 0x3a, 0x65, 0x84, 0xfc, 0x30, 0xc1, 0x25, 0xc7, 0x20, 0x25, 0xb4, 0xbf, 0x12, 0xba, 0x37, 0x44, + 0x71, 0x12, 0x8d, 0x3d, 0xcd, 0x47, 0x9e, 0xf2, 0x42, 0x64, 0xaf, 0x69, 0xcd, 0x9b, 0xea, 0x33, + 0x50, 0x81, 0x9e, 0x1b, 0xa4, 0x45, 0x3a, 0xb5, 0x81, 0xf1, 0xeb, 0xc7, 0xcb, 0x66, 0x3a, 0xe9, + 0x78, 0x3c, 0x56, 0x1c, 0xf1, 0x83, 0x56, 0x81, 0x14, 0xee, 0xba, 0x95, 0x75, 0x69, 0x35, 0x8a, + 0x15, 0x8c, 0x72, 0x8b, 0x74, 0xea, 0xbd, 0x87, 0x76, 0x6e, 0x1d, 0x3b, 0x11, 0x1f, 0xec, 0x5c, + 0xfd, 0x79, 0x5a, 0x72, 0xd3, 0xc6, 0xfe, 0x83, 0x2f, 0x37, 0x97, 0x87, 0x6b, 0x89, 0xf6, 0x01, + 0xdd, 0x2f, 0xb8, 0x71, 0x39, 0x46, 0x20, 0x91, 0xb7, 0xbf, 0x97, 0x69, 0x63, 0x88, 0xe2, 0x1d, + 0xe2, 0x94, 0x0f, 0x53, 0x5d, 0x76, 0x44, 0xa9, 0x0f, 0x52, 0x2b, 0x98, 0x4c, 0xb8, 0xfa, 0xaf, + 0xd7, 0x5c, 0x2f, 0x7b, 0x44, 0xab, 0xa0, 0x02, 0x11, 0xc8, 0xd8, 0x6c, 0xcd, 0x4d, 0x11, 0x1b, + 0xd1, 0x7a, 0xc4, 0x55, 0x18, 0x20, 0x06, 0x20, 0xd1, 0xa8, 0xb4, 0x2a, 0x9d, 0x7a, 0xcf, 0xde, + 0xd8, 0xa4, 0xe8, 0xc2, 0x1e, 0xad, 0x09, 0x6f, 0xa5, 0x56, 0x73, 0x37, 0x2f, 0xc1, 0x9a, 0x74, + 0x57, 0xc3, 0x39, 0x97, 0xc6, 0x4e, 0x3c, 0x28, 0x01, 0xe6, 0x1b, 0xda, 0x28, 0xd2, 0x58, 0x83, + 0x56, 0xce, 0x79, 0x1a, 0xb9, 0xbb, 0x3a, 0xae, 0xb8, 0x33, 0x6f, 0x32, 0xe5, 0xa9, 0xc9, 0x04, + 0xf4, 0xcb, 0x47, 0xa4, 0xbf, 0xb7, 0x4a, 0x2e, 0xb7, 0x50, 0xfb, 0x3d, 0x35, 0x8a, 0xc6, 0xb2, + 0xec, 0x98, 0x41, 0xef, 0xe0, 0xd4, 0xf7, 0x39, 0x62, 0x2c, 0x7e, 0xd7, 0xcd, 0xe0, 0xda, 0x5c, + 0x39, 0x67, 0xae, 0xf7, 0x93, 0xd0, 0xca, 0x10, 0x05, 0x73, 0xe9, 0xbd, 0x8d, 0x2f, 0xe3, 0x71, + 0x31, 0x87, 0x7c, 0xd5, 0x7c, 0xb6, 0xad, 0x7a, 0xeb, 0xe5, 0x84, 0xde, 0xdf, 0xfc, 0x0f, 0x9f, + 0x6c, 0x0d, 0xd7, 0x7c, 0xbe, 0xb5, 0x9c, 0xc9, 0x9a, 0xbb, 0x9f, 0x6f, 0x2e, 0x0f, 0xc9, 0xe0, + 0xf8, 0x6a, 0x61, 0x91, 0xeb, 0x85, 0x45, 0xfe, 0x2e, 0x2c, 0xf2, 0x6d, 0x69, 0x95, 0xae, 0x97, + 0x56, 0xe9, 0xf7, 0xd2, 0x2a, 0x7d, 0x7c, 0x21, 0x02, 0x7d, 0x36, 0x3d, 0xb5, 0x7d, 0x08, 0x1d, + 0x90, 0x08, 0x52, 0x39, 0xf1, 0xcf, 0x85, 0x73, 0xfb, 0x3a, 0xf4, 0x3c, 0xe2, 0x78, 0x5a, 0x8d, + 0x5f, 0xc6, 0xab, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x0f, 0x46, 0xf7, 0xa3, 0x03, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -318,9 +318,9 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - // AuthorizeService asserts the given controller is the owner of the given + // IssueMacaroon asserts the given controller is the owner of the given // address. - AuthorizeService(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error) + IssueMacaroon(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error) } type msgClient struct { @@ -340,9 +340,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } -func (c *msgClient) AuthorizeService(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error) { +func (c *msgClient) IssueMacaroon(ctx context.Context, in *MsgIssueMacaroon, opts ...grpc.CallOption) (*MsgIssueMacaroonResponse, error) { out := new(MsgIssueMacaroonResponse) - err := c.cc.Invoke(ctx, "/macaroon.v1.Msg/AuthorizeService", in, out, opts...) + err := c.cc.Invoke(ctx, "/macaroon.v1.Msg/IssueMacaroon", in, out, opts...) if err != nil { return nil, err } @@ -355,9 +355,9 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - // AuthorizeService asserts the given controller is the owner of the given + // IssueMacaroon asserts the given controller is the owner of the given // address. - AuthorizeService(context.Context, *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error) + IssueMacaroon(context.Context, *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -367,8 +367,8 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } -func (*UnimplementedMsgServer) AuthorizeService(ctx context.Context, req *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AuthorizeService not implemented") +func (*UnimplementedMsgServer) IssueMacaroon(ctx context.Context, req *MsgIssueMacaroon) (*MsgIssueMacaroonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IssueMacaroon not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { @@ -393,20 +393,20 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Msg_AuthorizeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_IssueMacaroon_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgIssueMacaroon) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).AuthorizeService(ctx, in) + return srv.(MsgServer).IssueMacaroon(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/macaroon.v1.Msg/AuthorizeService", + FullMethod: "/macaroon.v1.Msg/IssueMacaroon", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).AuthorizeService(ctx, req.(*MsgIssueMacaroon)) + return srv.(MsgServer).IssueMacaroon(ctx, req.(*MsgIssueMacaroon)) } return interceptor(ctx, in, info, handler) } @@ -420,8 +420,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_UpdateParams_Handler, }, { - MethodName: "AuthorizeService", - Handler: _Msg_AuthorizeService_Handler, + MethodName: "IssueMacaroon", + Handler: _Msg_IssueMacaroon_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go index 7bfad844f..2cef31c98 100644 --- a/x/oracle/types/genesis.go +++ b/x/oracle/types/genesis.go @@ -1,7 +1,7 @@ package types import ( - "github.com/onsonr/sonr/x/did/types/orm/assettype" + "github.com/onsonr/sonr/pkg/orm/assettype" ) // this line is used by starport scaffolding # genesis/types/import diff --git a/x/vault/keeper/keeper.go b/x/vault/keeper/keeper.go index d06602ca4..2efd8f0b3 100644 --- a/x/vault/keeper/keeper.go +++ b/x/vault/keeper/keeper.go @@ -4,24 +4,20 @@ import ( "context" "time" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "cosmossdk.io/collections" storetypes "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/orm/model/ormdb" - + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/ipfs/kubo/client/rpc" + apiv1 "github.com/onsonr/sonr/api/vault/v1" - "github.com/onsonr/sonr/app/config/dwn" - - "github.com/onsonr/sonr/x/vault/types" - + "github.com/onsonr/sonr/pkg/dwn" didkeeper "github.com/onsonr/sonr/x/did/keeper" + "github.com/onsonr/sonr/x/vault/types" ) type Keeper struct { diff --git a/x/vault/keeper/orm_test.go b/x/vault/keeper/orm_test.go index 192ef82ac..a76b05bd0 100644 --- a/x/vault/keeper/orm_test.go +++ b/x/vault/keeper/orm_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "testing" - apiv1 "github.com/onsonr/sonr/api/vault/v1" "github.com/stretchr/testify/require" ) @@ -11,21 +10,5 @@ func TestORM(t *testing.T) { f := SetupTest(t) dt := f.k.OrmDB.DWNTable() - acc := []byte("test_acc") - amt := uint64(7) - - err := dt.Insert(f.ctx, &apiv1.DWN{ - Account: acc, - Amount: amt, - }) - require.NoError(t, err) - - d, err := dt.Has(f.ctx, []byte("test_acc")) - require.NoError(t, err) - require.True(t, d) - - res, err := dt.Get(f.ctx, []byte("test_acc")) - require.NoError(t, err) - require.NotNil(t, res) - require.EqualValues(t, amt, res.Amount) + require.NotNil(t, dt) } diff --git a/x/vault/types/internal/app.wasm b/x/vault/types/internal/app.wasm index ed589d153..0b4523eef 100755 Binary files a/x/vault/types/internal/app.wasm and b/x/vault/types/internal/app.wasm differ diff --git a/x/vault/types/internal/embed.go b/x/vault/types/internal/embed.go index 31000d224..b3e4790c1 100644 --- a/x/vault/types/internal/embed.go +++ b/x/vault/types/internal/embed.go @@ -8,7 +8,8 @@ import ( "github.com/a-h/templ" "github.com/ipfs/boxo/files" - "github.com/onsonr/sonr/app/config/dwn" + + "github.com/onsonr/sonr/pkg/dwn" ) //go:embed app.wasm diff --git a/x/vault/types/state.pb.go b/x/vault/types/state.pb.go index 7440654f9..7828ac7f4 100644 --- a/x/vault/types/state.pb.go +++ b/x/vault/types/state.pb.go @@ -24,8 +24,9 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type DWN struct { - Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Alias string `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"` + Cid string `protobuf:"bytes,3,opt,name=cid,proto3" json:"cid,omitempty"` } func (m *DWN) Reset() { *m = DWN{} } @@ -61,20 +62,27 @@ func (m *DWN) XXX_DiscardUnknown() { var xxx_messageInfo_DWN proto.InternalMessageInfo -func (m *DWN) GetAccount() []byte { +func (m *DWN) GetId() uint64 { if m != nil { - return m.Account - } - return nil -} - -func (m *DWN) GetAmount() uint64 { - if m != nil { - return m.Amount + return m.Id } return 0 } +func (m *DWN) GetAlias() string { + if m != nil { + return m.Alias + } + return "" +} + +func (m *DWN) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + func init() { proto.RegisterType((*DWN)(nil), "vault.v1.DWN") } @@ -82,20 +90,21 @@ func init() { func init() { proto.RegisterFile("vault/v1/state.proto", fileDescriptor_2ad3e71ba384142e) } var fileDescriptor_2ad3e71ba384142e = []byte{ - // 198 bytes of a gzipped FileDescriptorProto + // 221 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x29, 0x4b, 0x2c, 0xcd, 0x29, 0xd1, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x00, 0x8b, 0xea, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, - 0xe7, 0x17, 0xe5, 0x82, 0x14, 0xe5, 0x17, 0xe5, 0x42, 0x94, 0x28, 0x45, 0x70, 0x31, 0xbb, 0x84, - 0xfb, 0x09, 0x49, 0x70, 0xb1, 0x27, 0x26, 0x27, 0xe7, 0x97, 0xe6, 0x95, 0x48, 0x30, 0x2a, 0x30, - 0x6a, 0xf0, 0x04, 0xc1, 0xb8, 0x42, 0x62, 0x5c, 0x6c, 0x89, 0xb9, 0x60, 0x09, 0x26, 0x05, 0x46, - 0x0d, 0x96, 0x20, 0x28, 0xcf, 0x4a, 0xfe, 0xd3, 0xbc, 0xcb, 0x7d, 0xcc, 0x92, 0x5c, 0x9c, 0x70, - 0x9d, 0x42, 0x5c, 0x30, 0xa5, 0x02, 0x8c, 0x12, 0x8c, 0x4e, 0x76, 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, 0x92, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, - 0xab, 0x9f, 0x9f, 0x57, 0x9c, 0x9f, 0x57, 0xa4, 0x0f, 0x26, 0x2a, 0xf4, 0x21, 0xbe, 0x28, 0xa9, - 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x3b, 0xd0, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xab, 0xea, - 0x40, 0xd9, 0xdb, 0x00, 0x00, 0x00, + 0xe7, 0x17, 0xe5, 0x82, 0x14, 0xe5, 0x17, 0xe5, 0x42, 0x94, 0x28, 0xa5, 0x73, 0x31, 0xbb, 0x84, + 0xfb, 0x09, 0xf1, 0x71, 0x31, 0x65, 0xa6, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x04, 0x31, 0x65, + 0xa6, 0x08, 0x89, 0x70, 0xb1, 0x26, 0xe6, 0x64, 0x26, 0x16, 0x4b, 0x30, 0x29, 0x30, 0x6a, 0x70, + 0x06, 0x41, 0x38, 0x42, 0x02, 0x5c, 0xcc, 0xc9, 0x99, 0x29, 0x12, 0xcc, 0x60, 0x31, 0x10, 0xd3, + 0x4a, 0xe3, 0xd3, 0xbc, 0xcb, 0x7d, 0xcc, 0x4a, 0x5c, 0x6c, 0x20, 0xfd, 0x02, 0x8c, 0x42, 0xdc, + 0x50, 0x7d, 0x02, 0x8c, 0x12, 0x8c, 0x42, 0x9c, 0x60, 0xe5, 0x02, 0x4c, 0x12, 0x8c, 0x12, 0x8c, + 0x4e, 0x76, 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, 0x92, 0x9e, 0x59, + 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x9f, 0x57, 0x9c, 0x9f, 0x57, 0xa4, 0x0f, + 0x26, 0x2a, 0xf4, 0x21, 0x9e, 0x2a, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xbb, 0xd7, 0x18, + 0x10, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xfb, 0x2a, 0xb2, 0xea, 0x00, 0x00, 0x00, } func (m *DWN) Marshal() (dAtA []byte, err error) { @@ -118,17 +127,24 @@ func (m *DWN) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Amount != 0 { - i = encodeVarintState(dAtA, i, uint64(m.Amount)) + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintState(dAtA, i, uint64(len(m.Cid))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x1a } - if len(m.Account) > 0 { - i -= len(m.Account) - copy(dAtA[i:], m.Account) - i = encodeVarintState(dAtA, i, uint64(len(m.Account))) + if len(m.Alias) > 0 { + i -= len(m.Alias) + copy(dAtA[i:], m.Alias) + i = encodeVarintState(dAtA, i, uint64(len(m.Alias))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -150,12 +166,16 @@ func (m *DWN) Size() (n int) { } var l int _ = l - l = len(m.Account) + if m.Id != 0 { + n += 1 + sovState(uint64(m.Id)) + } + l = len(m.Alias) if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.Amount != 0 { - n += 1 + sovState(uint64(m.Amount)) + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovState(uint64(l)) } return n } @@ -196,10 +216,10 @@ func (m *DWN) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var byteLen int + m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -209,31 +229,48 @@ func (m *DWN) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.Id |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Alias", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - m.Account = append(m.Account[:0], dAtA[iNdEx:postIndex]...) - if m.Account == nil { - m.Account = []byte{} - } + m.Alias = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) } - m.Amount = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -243,11 +280,24 @@ func (m *DWN) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Amount |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) diff --git a/x/vault/types/vault.go b/x/vault/types/vault.go index 6d4b884f6..a41aaf1c8 100644 --- a/x/vault/types/vault.go +++ b/x/vault/types/vault.go @@ -3,7 +3,7 @@ package types import ( "github.com/ipfs/boxo/files" - "github.com/onsonr/sonr/app/config/dwn" + "github.com/onsonr/sonr/pkg/dwn" vault "github.com/onsonr/sonr/x/vault/types/internal" )