diff --git a/.github/workflows/run-goreleaser.yml b/.github/workflows/run-goreleaser.yml index 13b6b07a8..8089f9d48 100644 --- a/.github/workflows/run-goreleaser.yml +++ b/.github/workflows/run-goreleaser.yml @@ -4,6 +4,8 @@ name: "Release Binary" on: push: + branches: + - master tags: - v* diff --git a/.gitignore b/.gitignore index 07c449c9b..888347d22 100644 --- a/.gitignore +++ b/.gitignore @@ -76,3 +76,6 @@ sonr deploy/**/data x/.DS_Store .aider* + + +!motr/build diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 8af7bea23..0211f77bc 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -2,7 +2,7 @@ project_name: core release: github: - owner: di-dao + owner: onsonr name: core name_template: "{{.Tag}}" @@ -13,44 +13,22 @@ builds: goos: - linux - darwin - # - windows goarch: - amd64 - # - arm64 - # - "386" - goarm: - - "6" - gomips: - - hardfloat - goamd64: - - v1 - targets: - - linux_amd64_v1 - # - darwin_amd64_v1 - # - linux_arm64 - # - linux_386 - # - darwin_arm64 - # - windows_amd64_v1 - # - windows_arm64 - # - windows_386 - dir: . main: ./cmd/sonrd binary: sonrd builder: go gobinary: go command: build ldflags: - - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser + - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} archives: - id: default name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}' format: tar.gz files: - - src: license* - src: LICENSE* - - src: readme* - src: README* - - src: changelog* - src: CHANGELOG* snapshot: name_template: "{{ .Version }}-SNAPSHOT-{{ .ShortCommit }}" @@ -76,28 +54,11 @@ announce: reddit: title_template: "{{ .ProjectName }} {{ .Tag }} is out!" url_template: "{{ .ReleaseURL }}" - slack: - message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}" - username: GoReleaser discord: message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}" author: GoReleaser color: "3888754" icon_url: https://goreleaser.com/static/avatar.png - teams: - title_template: "{{ .ProjectName }} {{ .Tag }} is out!" - message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}" - color: "#2D313E" - icon_url: https://goreleaser.com/static/avatar.png - smtp: - subject_template: "{{ .ProjectName }} {{ .Tag }} is out!" - body_template: "You can view details from: {{ .ReleaseURL }}" - mattermost: - message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}" - title_template: "{{ .ProjectName }} {{ .Tag }} is out!" - username: GoReleaser - linkedin: - message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}" telegram: message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}" webhook: diff --git a/Dockerfile b/Dockerfile index a23e314b4..c38bddae5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -86,4 +86,4 @@ WORKDIR /opt # rest server, tendermint p2p, tendermint rpc EXPOSE 1317 26656 26657 -ENTRYPOINT ["/usr/bin/sonrd"] +CMD ["test_node.sh"] diff --git a/Makefile b/Makefile index 028dca694..03fc8475f 100644 --- a/Makefile +++ b/Makefile @@ -307,7 +307,7 @@ dwn: motr: @echo "(motr) Building app.wasm -> Deploy to Cloudflare Workers" - GOOS=js GOARCH=wasm go build -o ./motr/build/app.wasm ./motr + GOOS=js GOARCH=wasm go build -o ./cmd/motr/build/app.wasm ./cmd/motr/main.go ############################################################################### ### help ### diff --git a/api/did/v1/genesis.pulsar.go b/api/did/v1/genesis.pulsar.go index 565535d86..89ab7e5b7 100644 --- a/api/did/v1/genesis.pulsar.go +++ b/api/did/v1/genesis.pulsar.go @@ -13,18 +13,21 @@ import ( io "io" math "math" reflect "reflect" + sort "sort" sync "sync" ) var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_global_integrity protoreflect.FieldDescriptor ) func init() { file_did_v1_genesis_proto_init() md_GenesisState = File_did_v1_genesis_proto.Messages().ByName("GenesisState") fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_global_integrity = md_GenesisState.Fields().ByName("global_integrity") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -98,6 +101,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if x.GlobalIntegrity != nil { + value := protoreflect.ValueOfMessage(x.GlobalIntegrity.ProtoReflect()) + if !f(fd_GenesisState_global_integrity, value) { + return + } + } } // Has reports whether a field is populated. @@ -115,6 +124,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool switch fd.FullName() { case "did.v1.GenesisState.params": return x.Params != nil + case "did.v1.GenesisState.global_integrity": + return x.GlobalIntegrity != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -133,6 +144,8 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.GenesisState.params": x.Params = nil + case "did.v1.GenesisState.global_integrity": + x.GlobalIntegrity = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -152,6 +165,9 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "did.v1.GenesisState.params": value := x.Params return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.GenesisState.global_integrity": + value := x.GlobalIntegrity + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -174,6 +190,8 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value switch fd.FullName() { case "did.v1.GenesisState.params": x.Params = value.Message().Interface().(*Params) + case "did.v1.GenesisState.global_integrity": + x.GlobalIntegrity = value.Message().Interface().(*GlobalIntegrity) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -199,6 +217,11 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p x.Params = new(Params) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "did.v1.GenesisState.global_integrity": + if x.GlobalIntegrity == nil { + x.GlobalIntegrity = new(GlobalIntegrity) + } + return protoreflect.ValueOfMessage(x.GlobalIntegrity.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -215,6 +238,9 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "did.v1.GenesisState.params": m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.GenesisState.global_integrity": + m := new(GlobalIntegrity) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -288,6 +314,10 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } + if x.GlobalIntegrity != nil { + l = options.Size(x.GlobalIntegrity) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -317,6 +347,20 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.GlobalIntegrity != nil { + encoded, err := options.Marshal(x.GlobalIntegrity) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } if x.Params != nil { encoded, err := options.Marshal(x.Params) if err != nil { @@ -416,6 +460,640 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GlobalIntegrity", 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.GlobalIntegrity == nil { + x.GlobalIntegrity = &GlobalIntegrity{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.GlobalIntegrity); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_GlobalIntegrity protoreflect.MessageDescriptor + fd_GlobalIntegrity_controller protoreflect.FieldDescriptor + fd_GlobalIntegrity_seed protoreflect.FieldDescriptor + fd_GlobalIntegrity_accumulator protoreflect.FieldDescriptor + fd_GlobalIntegrity_count protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_GlobalIntegrity = File_did_v1_genesis_proto.Messages().ByName("GlobalIntegrity") + fd_GlobalIntegrity_controller = md_GlobalIntegrity.Fields().ByName("controller") + fd_GlobalIntegrity_seed = md_GlobalIntegrity.Fields().ByName("seed") + fd_GlobalIntegrity_accumulator = md_GlobalIntegrity.Fields().ByName("accumulator") + fd_GlobalIntegrity_count = md_GlobalIntegrity.Fields().ByName("count") +} + +var _ protoreflect.Message = (*fastReflection_GlobalIntegrity)(nil) + +type fastReflection_GlobalIntegrity GlobalIntegrity + +func (x *GlobalIntegrity) ProtoReflect() protoreflect.Message { + return (*fastReflection_GlobalIntegrity)(x) +} + +func (x *GlobalIntegrity) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GlobalIntegrity_messageType fastReflection_GlobalIntegrity_messageType +var _ protoreflect.MessageType = fastReflection_GlobalIntegrity_messageType{} + +type fastReflection_GlobalIntegrity_messageType struct{} + +func (x fastReflection_GlobalIntegrity_messageType) Zero() protoreflect.Message { + return (*fastReflection_GlobalIntegrity)(nil) +} +func (x fastReflection_GlobalIntegrity_messageType) New() protoreflect.Message { + return new(fastReflection_GlobalIntegrity) +} +func (x fastReflection_GlobalIntegrity_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GlobalIntegrity +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GlobalIntegrity) Descriptor() protoreflect.MessageDescriptor { + return md_GlobalIntegrity +} + +// 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_GlobalIntegrity) Type() protoreflect.MessageType { + return _fastReflection_GlobalIntegrity_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GlobalIntegrity) New() protoreflect.Message { + return new(fastReflection_GlobalIntegrity) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GlobalIntegrity) Interface() protoreflect.ProtoMessage { + return (*GlobalIntegrity)(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_GlobalIntegrity) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_GlobalIntegrity_controller, value) { + return + } + } + if x.Seed != "" { + value := protoreflect.ValueOfString(x.Seed) + if !f(fd_GlobalIntegrity_seed, value) { + return + } + } + if len(x.Accumulator) != 0 { + value := protoreflect.ValueOfBytes(x.Accumulator) + if !f(fd_GlobalIntegrity_accumulator, value) { + return + } + } + if x.Count != uint64(0) { + value := protoreflect.ValueOfUint64(x.Count) + if !f(fd_GlobalIntegrity_count, 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_GlobalIntegrity) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.GlobalIntegrity.controller": + return x.Controller != "" + case "did.v1.GlobalIntegrity.seed": + return x.Seed != "" + case "did.v1.GlobalIntegrity.accumulator": + return len(x.Accumulator) != 0 + case "did.v1.GlobalIntegrity.count": + return x.Count != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.GlobalIntegrity.controller": + x.Controller = "" + case "did.v1.GlobalIntegrity.seed": + x.Seed = "" + case "did.v1.GlobalIntegrity.accumulator": + x.Accumulator = nil + case "did.v1.GlobalIntegrity.count": + x.Count = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.GlobalIntegrity.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + case "did.v1.GlobalIntegrity.seed": + value := x.Seed + return protoreflect.ValueOfString(value) + case "did.v1.GlobalIntegrity.accumulator": + value := x.Accumulator + return protoreflect.ValueOfBytes(value) + case "did.v1.GlobalIntegrity.count": + value := x.Count + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.GlobalIntegrity.controller": + x.Controller = value.Interface().(string) + case "did.v1.GlobalIntegrity.seed": + x.Seed = value.Interface().(string) + case "did.v1.GlobalIntegrity.accumulator": + x.Accumulator = value.Bytes() + case "did.v1.GlobalIntegrity.count": + x.Count = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.GlobalIntegrity.controller": + panic(fmt.Errorf("field controller of message did.v1.GlobalIntegrity is not mutable")) + case "did.v1.GlobalIntegrity.seed": + panic(fmt.Errorf("field seed of message did.v1.GlobalIntegrity is not mutable")) + case "did.v1.GlobalIntegrity.accumulator": + panic(fmt.Errorf("field accumulator of message did.v1.GlobalIntegrity is not mutable")) + case "did.v1.GlobalIntegrity.count": + panic(fmt.Errorf("field count of message did.v1.GlobalIntegrity is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.GlobalIntegrity.controller": + return protoreflect.ValueOfString("") + case "did.v1.GlobalIntegrity.seed": + return protoreflect.ValueOfString("") + case "did.v1.GlobalIntegrity.accumulator": + return protoreflect.ValueOfBytes(nil) + case "did.v1.GlobalIntegrity.count": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity 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_GlobalIntegrity) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.GlobalIntegrity", 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_GlobalIntegrity) 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_GlobalIntegrity) 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_GlobalIntegrity) 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_GlobalIntegrity) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GlobalIntegrity) + 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.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Seed) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Accumulator) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Count != 0 { + n += 1 + runtime.Sov(uint64(x.Count)) + } + 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().(*GlobalIntegrity) + 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.Count != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Count)) + i-- + dAtA[i] = 0x20 + } + if len(x.Accumulator) > 0 { + i -= len(x.Accumulator) + copy(dAtA[i:], x.Accumulator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Accumulator))) + i-- + dAtA[i] = 0x1a + } + if len(x.Seed) > 0 { + i -= len(x.Seed) + copy(dAtA[i:], x.Seed) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Seed))) + i-- + dAtA[i] = 0x12 + } + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + 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().(*GlobalIntegrity) + 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: GlobalIntegrity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GlobalIntegrity: 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 Controller", 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.Controller = 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 Seed", 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.Seed = 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 Accumulator", 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.Accumulator = append(x.Accumulator[:0], dAtA[iNdEx:postIndex]...) + if x.Accumulator == nil { + x.Accumulator = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + x.Count = 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.Count |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -502,158 +1180,145 @@ func (x *_Params_1_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_Params_2_list)(nil) +var _ protoreflect.Map = (*_Params_2_map)(nil) -type _Params_2_list struct { - list *[]*ChainInfo +type _Params_2_map struct { + m *map[string]*KeyInfo } -func (x *_Params_2_list) Len() int { - if x.list == nil { +func (x *_Params_2_map) Len() int { + if x.m == nil { return 0 } - return len(*x.list) + return len(*x.m) } -func (x *_Params_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +func (x *_Params_2_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.ValueOfMessage(v.ProtoReflect()) + if !f(mapKey, mapValue) { + break + } + } } -func (x *_Params_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ChainInfo) - (*x.list)[i] = concreteValue +func (x *_Params_2_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 *_Params_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ChainInfo) - *x.list = append(*x.list, concreteValue) +func (x *_Params_2_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) } -func (x *_Params_2_list) AppendMutable() protoreflect.Value { - v := new(ChainInfo) - *x.list = append(*x.list, v) +func (x *_Params_2_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.ValueOfMessage(v.ProtoReflect()) } -func (x *_Params_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil +func (x *_Params_2_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") } - *x.list = (*x.list)[:n] -} - -func (x *_Params_2_list) NewElement() protoreflect.Value { - v := new(ChainInfo) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Params_2_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Params_3_list)(nil) - -type _Params_3_list struct { - list *[]*KeyInfo -} - -func (x *_Params_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Params_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Params_3_list) Set(i int, value protoreflect.Value) { + keyUnwrapped := key.String() + concreteKey := keyUnwrapped valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*KeyInfo) - (*x.list)[i] = concreteValue + (*x.m)[concreteKey] = concreteValue } -func (x *_Params_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*KeyInfo) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Params_3_list) AppendMutable() protoreflect.Value { - v := new(KeyInfo) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Params_3_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil +func (x *_Params_2_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if ok { + return protoreflect.ValueOfMessage(v.ProtoReflect()) } - *x.list = (*x.list)[:n] + newValue := new(KeyInfo) + (*x.m)[concreteKey] = newValue + return protoreflect.ValueOfMessage(newValue.ProtoReflect()) } -func (x *_Params_3_list) NewElement() protoreflect.Value { +func (x *_Params_2_map) NewValue() protoreflect.Value { v := new(KeyInfo) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_Params_3_list) IsValid() bool { - return x.list != nil +func (x *_Params_2_map) IsValid() bool { + return x.m != nil } -var _ protoreflect.List = (*_Params_7_list)(nil) +var _ protoreflect.List = (*_Params_6_list)(nil) -type _Params_7_list struct { +type _Params_6_list struct { list *[]string } -func (x *_Params_7_list) Len() int { +func (x *_Params_6_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Params_7_list) Get(i int) protoreflect.Value { +func (x *_Params_6_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_Params_7_list) Set(i int, value protoreflect.Value) { +func (x *_Params_6_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_Params_7_list) Append(value protoreflect.Value) { +func (x *_Params_6_list) Append(value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_Params_7_list) AppendMutable() protoreflect.Value { +func (x *_Params_6_list) AppendMutable() protoreflect.Value { panic(fmt.Errorf("AppendMutable can not be called on message Params at list field AttestationFormats as it is not of Message kind")) } -func (x *_Params_7_list) Truncate(n int) { +func (x *_Params_6_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_Params_7_list) NewElement() protoreflect.Value { +func (x *_Params_6_list) NewElement() protoreflect.Value { v := "" return protoreflect.ValueOfString(v) } -func (x *_Params_7_list) IsValid() bool { +func (x *_Params_6_list) IsValid() bool { return x.list != nil } var ( md_Params protoreflect.MessageDescriptor fd_Params_whitelisted_assets protoreflect.FieldDescriptor - fd_Params_whitelisted_chains protoreflect.FieldDescriptor fd_Params_allowed_public_keys protoreflect.FieldDescriptor fd_Params_ipfs_active protoreflect.FieldDescriptor fd_Params_localhost_registration_enabled protoreflect.FieldDescriptor @@ -665,7 +1330,6 @@ func init() { file_did_v1_genesis_proto_init() md_Params = File_did_v1_genesis_proto.Messages().ByName("Params") fd_Params_whitelisted_assets = md_Params.Fields().ByName("whitelisted_assets") - fd_Params_whitelisted_chains = md_Params.Fields().ByName("whitelisted_chains") fd_Params_allowed_public_keys = md_Params.Fields().ByName("allowed_public_keys") fd_Params_ipfs_active = md_Params.Fields().ByName("ipfs_active") fd_Params_localhost_registration_enabled = md_Params.Fields().ByName("localhost_registration_enabled") @@ -682,7 +1346,7 @@ func (x *Params) ProtoReflect() protoreflect.Message { } func (x *Params) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[1] + mi := &file_did_v1_genesis_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -744,14 +1408,8 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } - if len(x.WhitelistedChains) != 0 { - value := protoreflect.ValueOfList(&_Params_2_list{list: &x.WhitelistedChains}) - if !f(fd_Params_whitelisted_chains, value) { - return - } - } if len(x.AllowedPublicKeys) != 0 { - value := protoreflect.ValueOfList(&_Params_3_list{list: &x.AllowedPublicKeys}) + value := protoreflect.ValueOfMap(&_Params_2_map{m: &x.AllowedPublicKeys}) if !f(fd_Params_allowed_public_keys, value) { return } @@ -775,7 +1433,7 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto } } if len(x.AttestationFormats) != 0 { - value := protoreflect.ValueOfList(&_Params_7_list{list: &x.AttestationFormats}) + value := protoreflect.ValueOfList(&_Params_6_list{list: &x.AttestationFormats}) if !f(fd_Params_attestation_formats, value) { return } @@ -797,8 +1455,6 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "did.v1.Params.whitelisted_assets": return len(x.WhitelistedAssets) != 0 - case "did.v1.Params.whitelisted_chains": - return len(x.WhitelistedChains) != 0 case "did.v1.Params.allowed_public_keys": return len(x.AllowedPublicKeys) != 0 case "did.v1.Params.ipfs_active": @@ -827,8 +1483,6 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.Params.whitelisted_assets": x.WhitelistedAssets = nil - case "did.v1.Params.whitelisted_chains": - x.WhitelistedChains = nil case "did.v1.Params.allowed_public_keys": x.AllowedPublicKeys = nil case "did.v1.Params.ipfs_active": @@ -861,18 +1515,12 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro } listValue := &_Params_1_list{list: &x.WhitelistedAssets} return protoreflect.ValueOfList(listValue) - case "did.v1.Params.whitelisted_chains": - if len(x.WhitelistedChains) == 0 { - return protoreflect.ValueOfList(&_Params_2_list{}) - } - listValue := &_Params_2_list{list: &x.WhitelistedChains} - return protoreflect.ValueOfList(listValue) case "did.v1.Params.allowed_public_keys": if len(x.AllowedPublicKeys) == 0 { - return protoreflect.ValueOfList(&_Params_3_list{}) + return protoreflect.ValueOfMap(&_Params_2_map{}) } - listValue := &_Params_3_list{list: &x.AllowedPublicKeys} - return protoreflect.ValueOfList(listValue) + mapValue := &_Params_2_map{m: &x.AllowedPublicKeys} + return protoreflect.ValueOfMap(mapValue) case "did.v1.Params.ipfs_active": value := x.IpfsActive return protoreflect.ValueOfBool(value) @@ -884,9 +1532,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro return protoreflect.ValueOfString(value) case "did.v1.Params.attestation_formats": if len(x.AttestationFormats) == 0 { - return protoreflect.ValueOfList(&_Params_7_list{}) + return protoreflect.ValueOfList(&_Params_6_list{}) } - listValue := &_Params_7_list{list: &x.AttestationFormats} + listValue := &_Params_6_list{list: &x.AttestationFormats} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -912,14 +1560,10 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto lv := value.List() clv := lv.(*_Params_1_list) x.WhitelistedAssets = *clv.list - case "did.v1.Params.whitelisted_chains": - lv := value.List() - clv := lv.(*_Params_2_list) - x.WhitelistedChains = *clv.list case "did.v1.Params.allowed_public_keys": - lv := value.List() - clv := lv.(*_Params_3_list) - x.AllowedPublicKeys = *clv.list + mv := value.Map() + cmv := mv.(*_Params_2_map) + x.AllowedPublicKeys = *cmv.m case "did.v1.Params.ipfs_active": x.IpfsActive = value.Bool() case "did.v1.Params.localhost_registration_enabled": @@ -928,7 +1572,7 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.ConveyancePreference = value.Interface().(string) case "did.v1.Params.attestation_formats": lv := value.List() - clv := lv.(*_Params_7_list) + clv := lv.(*_Params_6_list) x.AttestationFormats = *clv.list default: if fd.IsExtension() { @@ -956,23 +1600,17 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore } value := &_Params_1_list{list: &x.WhitelistedAssets} return protoreflect.ValueOfList(value) - case "did.v1.Params.whitelisted_chains": - if x.WhitelistedChains == nil { - x.WhitelistedChains = []*ChainInfo{} - } - value := &_Params_2_list{list: &x.WhitelistedChains} - return protoreflect.ValueOfList(value) case "did.v1.Params.allowed_public_keys": if x.AllowedPublicKeys == nil { - x.AllowedPublicKeys = []*KeyInfo{} + x.AllowedPublicKeys = make(map[string]*KeyInfo) } - value := &_Params_3_list{list: &x.AllowedPublicKeys} - return protoreflect.ValueOfList(value) + value := &_Params_2_map{m: &x.AllowedPublicKeys} + return protoreflect.ValueOfMap(value) case "did.v1.Params.attestation_formats": if x.AttestationFormats == nil { x.AttestationFormats = []string{} } - value := &_Params_7_list{list: &x.AttestationFormats} + value := &_Params_6_list{list: &x.AttestationFormats} return protoreflect.ValueOfList(value) case "did.v1.Params.ipfs_active": panic(fmt.Errorf("field ipfs_active of message did.v1.Params is not mutable")) @@ -996,12 +1634,9 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor case "did.v1.Params.whitelisted_assets": list := []*AssetInfo{} return protoreflect.ValueOfList(&_Params_1_list{list: &list}) - case "did.v1.Params.whitelisted_chains": - list := []*ChainInfo{} - return protoreflect.ValueOfList(&_Params_2_list{list: &list}) case "did.v1.Params.allowed_public_keys": - list := []*KeyInfo{} - return protoreflect.ValueOfList(&_Params_3_list{list: &list}) + m := make(map[string]*KeyInfo) + return protoreflect.ValueOfMap(&_Params_2_map{m: &m}) case "did.v1.Params.ipfs_active": return protoreflect.ValueOfBool(false) case "did.v1.Params.localhost_registration_enabled": @@ -1010,7 +1645,7 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "did.v1.Params.attestation_formats": list := []string{} - return protoreflect.ValueOfList(&_Params_7_list{list: &list}) + return protoreflect.ValueOfList(&_Params_6_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -1086,16 +1721,30 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } - if len(x.WhitelistedChains) > 0 { - for _, e := range x.WhitelistedChains { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } if len(x.AllowedPublicKeys) > 0 { - for _, e := range x.AllowedPublicKeys { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) + SiZeMaP := func(k string, v *KeyInfo) { + l := 0 + if v != nil { + l = options.Size(v) + } + l += 1 + runtime.Sov(uint64(l)) + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.AllowedPublicKeys)) + for k := range x.AllowedPublicKeys { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.AllowedPublicKeys[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.AllowedPublicKeys { + SiZeMaP(k, v) + } } } if x.IpfsActive { @@ -1149,7 +1798,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.AttestationFormats[iNdEx]) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationFormats[iNdEx]))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x32 } } if len(x.ConveyancePreference) > 0 { @@ -1157,7 +1806,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.ConveyancePreference) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ConveyancePreference))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } if x.LocalhostRegistrationEnabled { i-- @@ -1167,7 +1816,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { dAtA[i] = 0 } i-- - dAtA[i] = 0x28 + dAtA[i] = 0x20 } if x.IpfsActive { i-- @@ -1177,27 +1826,12 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { dAtA[i] = 0 } i-- - dAtA[i] = 0x20 + dAtA[i] = 0x18 } if len(x.AllowedPublicKeys) > 0 { - for iNdEx := len(x.AllowedPublicKeys) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.AllowedPublicKeys[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - } - if len(x.WhitelistedChains) > 0 { - for iNdEx := len(x.WhitelistedChains) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.WhitelistedChains[iNdEx]) + MaRsHaLmAp := func(k string, v *KeyInfo) (protoiface.MarshalOutput, error) { + baseI := i + encoded, err := options.Marshal(v) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1209,6 +1843,39 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) 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] = 0x12 + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForAllowedPublicKeys := make([]string, 0, len(x.AllowedPublicKeys)) + for k := range x.AllowedPublicKeys { + keysForAllowedPublicKeys = append(keysForAllowedPublicKeys, string(k)) + } + sort.Slice(keysForAllowedPublicKeys, func(i, j int) bool { + return keysForAllowedPublicKeys[i] < keysForAllowedPublicKeys[j] + }) + for iNdEx := len(keysForAllowedPublicKeys) - 1; iNdEx >= 0; iNdEx-- { + v := x.AllowedPublicKeys[string(keysForAllowedPublicKeys[iNdEx])] + out, err := MaRsHaLmAp(keysForAllowedPublicKeys[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.AllowedPublicKeys { + v := x.AllowedPublicKeys[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } } } if len(x.WhitelistedAssets) > 0 { @@ -1311,40 +1978,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } iNdEx = postIndex case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WhitelistedChains", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.WhitelistedChains = append(x.WhitelistedChains, &ChainInfo{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.WhitelistedChains[len(x.WhitelistedChains)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AllowedPublicKeys", wireType) } @@ -1373,12 +2006,107 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.AllowedPublicKeys = append(x.AllowedPublicKeys, &KeyInfo{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AllowedPublicKeys[len(x.AllowedPublicKeys)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + if x.AllowedPublicKeys == nil { + x.AllowedPublicKeys = make(map[string]*KeyInfo) } + var mapkey string + var mapvalue *KeyInfo + 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 mapmsglen 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++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postmsgIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = &KeyInfo{} + if err := options.Unmarshal(dAtA[iNdEx:postmsgIndex], mapvalue); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postmsgIndex + } 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.AllowedPublicKeys[mapkey] = mapvalue iNdEx = postIndex - case 4: + case 3: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", wireType) } @@ -1398,7 +2126,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } x.IpfsActive = bool(v != 0) - case 5: + case 4: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LocalhostRegistrationEnabled", wireType) } @@ -1418,7 +2146,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } x.LocalhostRegistrationEnabled = bool(v != 0) - case 6: + case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", wireType) } @@ -1450,7 +2178,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.ConveyancePreference = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", wireType) } @@ -1524,7 +2252,6 @@ var ( fd_AssetInfo_symbol protoreflect.FieldDescriptor fd_AssetInfo_asset_type protoreflect.FieldDescriptor fd_AssetInfo_name protoreflect.FieldDescriptor - fd_AssetInfo_method protoreflect.FieldDescriptor fd_AssetInfo_icon_url protoreflect.FieldDescriptor ) @@ -1536,7 +2263,6 @@ func init() { fd_AssetInfo_symbol = md_AssetInfo.Fields().ByName("symbol") fd_AssetInfo_asset_type = md_AssetInfo.Fields().ByName("asset_type") fd_AssetInfo_name = md_AssetInfo.Fields().ByName("name") - fd_AssetInfo_method = md_AssetInfo.Fields().ByName("method") fd_AssetInfo_icon_url = md_AssetInfo.Fields().ByName("icon_url") } @@ -1549,7 +2275,7 @@ func (x *AssetInfo) ProtoReflect() protoreflect.Message { } func (x *AssetInfo) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[2] + mi := &file_did_v1_genesis_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1635,12 +2361,6 @@ func (x *fastReflection_AssetInfo) Range(f func(protoreflect.FieldDescriptor, pr return } } - if x.Method != "" { - value := protoreflect.ValueOfString(x.Method) - if !f(fd_AssetInfo_method, value) { - return - } - } if x.IconUrl != "" { value := protoreflect.ValueOfString(x.IconUrl) if !f(fd_AssetInfo_icon_url, value) { @@ -1672,8 +2392,6 @@ func (x *fastReflection_AssetInfo) Has(fd protoreflect.FieldDescriptor) bool { return x.AssetType != 0 case "did.v1.AssetInfo.name": return x.Name != "" - case "did.v1.AssetInfo.method": - return x.Method != "" case "did.v1.AssetInfo.icon_url": return x.IconUrl != "" default: @@ -1702,8 +2420,6 @@ func (x *fastReflection_AssetInfo) Clear(fd protoreflect.FieldDescriptor) { x.AssetType = 0 case "did.v1.AssetInfo.name": x.Name = "" - case "did.v1.AssetInfo.method": - x.Method = "" case "did.v1.AssetInfo.icon_url": x.IconUrl = "" default: @@ -1737,9 +2453,6 @@ func (x *fastReflection_AssetInfo) Get(descriptor protoreflect.FieldDescriptor) case "did.v1.AssetInfo.name": value := x.Name return protoreflect.ValueOfString(value) - case "did.v1.AssetInfo.method": - value := x.Method - return protoreflect.ValueOfString(value) case "did.v1.AssetInfo.icon_url": value := x.IconUrl return protoreflect.ValueOfString(value) @@ -1773,8 +2486,6 @@ func (x *fastReflection_AssetInfo) Set(fd protoreflect.FieldDescriptor, value pr x.AssetType = (AssetType)(value.Enum()) case "did.v1.AssetInfo.name": x.Name = value.Interface().(string) - case "did.v1.AssetInfo.method": - x.Method = value.Interface().(string) case "did.v1.AssetInfo.icon_url": x.IconUrl = value.Interface().(string) default: @@ -1807,8 +2518,6 @@ func (x *fastReflection_AssetInfo) Mutable(fd protoreflect.FieldDescriptor) prot panic(fmt.Errorf("field asset_type of message did.v1.AssetInfo is not mutable")) case "did.v1.AssetInfo.name": panic(fmt.Errorf("field name of message did.v1.AssetInfo is not mutable")) - case "did.v1.AssetInfo.method": - panic(fmt.Errorf("field method of message did.v1.AssetInfo is not mutable")) case "did.v1.AssetInfo.icon_url": panic(fmt.Errorf("field icon_url of message did.v1.AssetInfo is not mutable")) default: @@ -1834,8 +2543,6 @@ func (x *fastReflection_AssetInfo) NewField(fd protoreflect.FieldDescriptor) pro return protoreflect.ValueOfEnum(0) case "did.v1.AssetInfo.name": return protoreflect.ValueOfString("") - case "did.v1.AssetInfo.method": - return protoreflect.ValueOfString("") case "did.v1.AssetInfo.icon_url": return protoreflect.ValueOfString("") default: @@ -1925,10 +2632,6 @@ func (x *fastReflection_AssetInfo) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Method) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } l = len(x.IconUrl) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -1967,13 +2670,6 @@ func (x *fastReflection_AssetInfo) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.IconUrl) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.IconUrl))) i-- - dAtA[i] = 0x3a - } - if len(x.Method) > 0 { - i -= len(x.Method) - copy(dAtA[i:], x.Method) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Method))) - i-- dAtA[i] = 0x32 } if len(x.Name) > 0 { @@ -2191,38 +2887,6 @@ func (x *fastReflection_AssetInfo) ProtoMethods() *protoiface.Methods { x.Name = 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 Method", 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.Method = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IconUrl", wireType) } @@ -2289,756 +2953,6 @@ func (x *fastReflection_AssetInfo) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_ChainInfo_5_list)(nil) - -type _ChainInfo_5_list struct { - list *[]*ValidatorInfo -} - -func (x *_ChainInfo_5_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_ChainInfo_5_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_ChainInfo_5_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ValidatorInfo) - (*x.list)[i] = concreteValue -} - -func (x *_ChainInfo_5_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ValidatorInfo) - *x.list = append(*x.list, concreteValue) -} - -func (x *_ChainInfo_5_list) AppendMutable() protoreflect.Value { - v := new(ValidatorInfo) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ChainInfo_5_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_ChainInfo_5_list) NewElement() protoreflect.Value { - v := new(ValidatorInfo) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_ChainInfo_5_list) IsValid() bool { - return x.list != nil -} - -var ( - md_ChainInfo protoreflect.MessageDescriptor - fd_ChainInfo_id protoreflect.FieldDescriptor - fd_ChainInfo_chain_id protoreflect.FieldDescriptor - fd_ChainInfo_name protoreflect.FieldDescriptor - fd_ChainInfo_symbol protoreflect.FieldDescriptor - fd_ChainInfo_validators protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_genesis_proto_init() - md_ChainInfo = File_did_v1_genesis_proto.Messages().ByName("ChainInfo") - fd_ChainInfo_id = md_ChainInfo.Fields().ByName("id") - fd_ChainInfo_chain_id = md_ChainInfo.Fields().ByName("chain_id") - fd_ChainInfo_name = md_ChainInfo.Fields().ByName("name") - fd_ChainInfo_symbol = md_ChainInfo.Fields().ByName("symbol") - fd_ChainInfo_validators = md_ChainInfo.Fields().ByName("validators") -} - -var _ protoreflect.Message = (*fastReflection_ChainInfo)(nil) - -type fastReflection_ChainInfo ChainInfo - -func (x *ChainInfo) ProtoReflect() protoreflect.Message { - return (*fastReflection_ChainInfo)(x) -} - -func (x *ChainInfo) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_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_ChainInfo_messageType fastReflection_ChainInfo_messageType -var _ protoreflect.MessageType = fastReflection_ChainInfo_messageType{} - -type fastReflection_ChainInfo_messageType struct{} - -func (x fastReflection_ChainInfo_messageType) Zero() protoreflect.Message { - return (*fastReflection_ChainInfo)(nil) -} -func (x fastReflection_ChainInfo_messageType) New() protoreflect.Message { - return new(fastReflection_ChainInfo) -} -func (x fastReflection_ChainInfo_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ChainInfo -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ChainInfo) Descriptor() protoreflect.MessageDescriptor { - return md_ChainInfo -} - -// 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_ChainInfo) Type() protoreflect.MessageType { - return _fastReflection_ChainInfo_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ChainInfo) New() protoreflect.Message { - return new(fastReflection_ChainInfo) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ChainInfo) Interface() protoreflect.ProtoMessage { - return (*ChainInfo)(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_ChainInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_ChainInfo_id, value) { - return - } - } - if x.ChainId != "" { - value := protoreflect.ValueOfString(x.ChainId) - if !f(fd_ChainInfo_chain_id, value) { - return - } - } - if x.Name != "" { - value := protoreflect.ValueOfString(x.Name) - if !f(fd_ChainInfo_name, value) { - return - } - } - if x.Symbol != "" { - value := protoreflect.ValueOfString(x.Symbol) - if !f(fd_ChainInfo_symbol, value) { - return - } - } - if len(x.Validators) != 0 { - value := protoreflect.ValueOfList(&_ChainInfo_5_list{list: &x.Validators}) - if !f(fd_ChainInfo_validators, 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_ChainInfo) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.ChainInfo.id": - return x.Id != "" - case "did.v1.ChainInfo.chain_id": - return x.ChainId != "" - case "did.v1.ChainInfo.name": - return x.Name != "" - case "did.v1.ChainInfo.symbol": - return x.Symbol != "" - case "did.v1.ChainInfo.validators": - return len(x.Validators) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ChainInfo")) - } - panic(fmt.Errorf("message did.v1.ChainInfo 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_ChainInfo) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.ChainInfo.id": - x.Id = "" - case "did.v1.ChainInfo.chain_id": - x.ChainId = "" - case "did.v1.ChainInfo.name": - x.Name = "" - case "did.v1.ChainInfo.symbol": - x.Symbol = "" - case "did.v1.ChainInfo.validators": - x.Validators = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ChainInfo")) - } - panic(fmt.Errorf("message did.v1.ChainInfo 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_ChainInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.ChainInfo.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "did.v1.ChainInfo.chain_id": - value := x.ChainId - return protoreflect.ValueOfString(value) - case "did.v1.ChainInfo.name": - value := x.Name - return protoreflect.ValueOfString(value) - case "did.v1.ChainInfo.symbol": - value := x.Symbol - return protoreflect.ValueOfString(value) - case "did.v1.ChainInfo.validators": - if len(x.Validators) == 0 { - return protoreflect.ValueOfList(&_ChainInfo_5_list{}) - } - listValue := &_ChainInfo_5_list{list: &x.Validators} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ChainInfo")) - } - panic(fmt.Errorf("message did.v1.ChainInfo 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_ChainInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.ChainInfo.id": - x.Id = value.Interface().(string) - case "did.v1.ChainInfo.chain_id": - x.ChainId = value.Interface().(string) - case "did.v1.ChainInfo.name": - x.Name = value.Interface().(string) - case "did.v1.ChainInfo.symbol": - x.Symbol = value.Interface().(string) - case "did.v1.ChainInfo.validators": - lv := value.List() - clv := lv.(*_ChainInfo_5_list) - x.Validators = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ChainInfo")) - } - panic(fmt.Errorf("message did.v1.ChainInfo 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_ChainInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.ChainInfo.validators": - if x.Validators == nil { - x.Validators = []*ValidatorInfo{} - } - value := &_ChainInfo_5_list{list: &x.Validators} - return protoreflect.ValueOfList(value) - case "did.v1.ChainInfo.id": - panic(fmt.Errorf("field id of message did.v1.ChainInfo is not mutable")) - case "did.v1.ChainInfo.chain_id": - panic(fmt.Errorf("field chain_id of message did.v1.ChainInfo is not mutable")) - case "did.v1.ChainInfo.name": - panic(fmt.Errorf("field name of message did.v1.ChainInfo is not mutable")) - case "did.v1.ChainInfo.symbol": - panic(fmt.Errorf("field symbol of message did.v1.ChainInfo is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ChainInfo")) - } - panic(fmt.Errorf("message did.v1.ChainInfo 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_ChainInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.ChainInfo.id": - return protoreflect.ValueOfString("") - case "did.v1.ChainInfo.chain_id": - return protoreflect.ValueOfString("") - case "did.v1.ChainInfo.name": - return protoreflect.ValueOfString("") - case "did.v1.ChainInfo.symbol": - return protoreflect.ValueOfString("") - case "did.v1.ChainInfo.validators": - list := []*ValidatorInfo{} - return protoreflect.ValueOfList(&_ChainInfo_5_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ChainInfo")) - } - panic(fmt.Errorf("message did.v1.ChainInfo 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_ChainInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.ChainInfo", 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_ChainInfo) 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_ChainInfo) 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_ChainInfo) 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_ChainInfo) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ChainInfo) - 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.Id) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ChainId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Name) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Symbol) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Validators) > 0 { - for _, e := range x.Validators { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ChainInfo) - 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.Validators) > 0 { - for iNdEx := len(x.Validators) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Validators[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x2a - } - } - if len(x.Symbol) > 0 { - i -= len(x.Symbol) - copy(dAtA[i:], x.Symbol) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Symbol))) - i-- - dAtA[i] = 0x22 - } - if len(x.Name) > 0 { - i -= len(x.Name) - copy(dAtA[i:], x.Name) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) - i-- - dAtA[i] = 0x1a - } - if len(x.ChainId) > 0 { - i -= len(x.ChainId) - copy(dAtA[i:], x.ChainId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) - i-- - dAtA[i] = 0x12 - } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) - 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().(*ChainInfo) - 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: ChainInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ChainInfo: 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 Id", 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.Id = 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 ChainId", 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.ChainId = 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 Name", 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.Name = 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 Symbol", 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.Symbol = 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 Validators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Validators = append(x.Validators, &ValidatorInfo{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Validators[len(x.Validators)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - var ( md_KeyInfo protoreflect.MessageDescriptor fd_KeyInfo_role protoreflect.FieldDescriptor @@ -4590,7 +4504,7 @@ func (x *ValidatorInfo_Endpoint) ProtoReflect() protoreflect.Message { } func (x *ValidatorInfo_Endpoint) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[6] + mi := &file_did_v1_genesis_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5064,7 +4978,7 @@ func (x *ValidatorInfo_ExplorerInfo) ProtoReflect() protoreflect.Message { } func (x *ValidatorInfo_ExplorerInfo) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[7] + mi := &file_did_v1_genesis_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5600,7 +5514,7 @@ func (x *ValidatorInfo_FeeInfo) ProtoReflect() protoreflect.Message { } func (x *ValidatorInfo_FeeInfo) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[8] + mi := &file_did_v1_genesis_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6235,7 +6149,7 @@ func (x *ValidatorInfo_IBCChannel) ProtoReflect() protoreflect.Message { } func (x *ValidatorInfo_IBCChannel) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[9] + mi := &file_did_v1_genesis_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7296,6 +7210,8 @@ type GenesisState struct { // Params defines all the parameters of the module. Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // GlobalIntegrity defines a zkp integrity proof for the entire DID namespace + GlobalIntegrity *GlobalIntegrity `protobuf:"bytes,2,opt,name=global_integrity,json=globalIntegrity,proto3" json:"global_integrity,omitempty"` } func (x *GenesisState) Reset() { @@ -7325,6 +7241,73 @@ func (x *GenesisState) GetParams() *Params { return nil } +func (x *GenesisState) GetGlobalIntegrity() *GlobalIntegrity { + if x != nil { + return x.GlobalIntegrity + } + return nil +} + +// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace +type GlobalIntegrity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + Seed string `protobuf:"bytes,2,opt,name=seed,proto3" json:"seed,omitempty"` + Accumulator []byte `protobuf:"bytes,3,opt,name=accumulator,proto3" json:"accumulator,omitempty"` + Count uint64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GlobalIntegrity) Reset() { + *x = GlobalIntegrity{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GlobalIntegrity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GlobalIntegrity) ProtoMessage() {} + +// Deprecated: Use GlobalIntegrity.ProtoReflect.Descriptor instead. +func (*GlobalIntegrity) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{1} +} + +func (x *GlobalIntegrity) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *GlobalIntegrity) GetSeed() string { + if x != nil { + return x.Seed + } + return "" +} + +func (x *GlobalIntegrity) GetAccumulator() []byte { + if x != nil { + return x.Accumulator + } + return nil +} + +func (x *GlobalIntegrity) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + // Params defines the set of module parameters. type Params struct { state protoimpl.MessageState @@ -7333,24 +7316,22 @@ type Params struct { // Whitelisted Assets WhitelistedAssets []*AssetInfo `protobuf:"bytes,1,rep,name=whitelisted_assets,json=whitelistedAssets,proto3" json:"whitelisted_assets,omitempty"` - // Whitelisted Blockchains - WhitelistedChains []*ChainInfo `protobuf:"bytes,2,rep,name=whitelisted_chains,json=whitelistedChains,proto3" json:"whitelisted_chains,omitempty"` // Whitelisted Key Types - AllowedPublicKeys []*KeyInfo `protobuf:"bytes,3,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty"` + AllowedPublicKeys map[string]*KeyInfo `protobuf:"bytes,2,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // IpfsActive is a flag to enable/disable ipfs - IpfsActive bool `protobuf:"varint,4,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + IpfsActive bool `protobuf:"varint,3,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` // Localhost Registration Enabled - LocalhostRegistrationEnabled bool `protobuf:"varint,5,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"` + LocalhostRegistrationEnabled bool `protobuf:"varint,4,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"` // ConveyancePreference defines the conveyance preference - ConveyancePreference string `protobuf:"bytes,6,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` + ConveyancePreference string `protobuf:"bytes,5,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` // AttestationFormats defines the attestation formats - AttestationFormats []string `protobuf:"bytes,7,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` + AttestationFormats []string `protobuf:"bytes,6,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` } func (x *Params) Reset() { *x = Params{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[1] + mi := &file_did_v1_genesis_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7364,7 +7345,7 @@ func (*Params) ProtoMessage() {} // Deprecated: Use Params.ProtoReflect.Descriptor instead. func (*Params) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{1} + return file_did_v1_genesis_proto_rawDescGZIP(), []int{2} } func (x *Params) GetWhitelistedAssets() []*AssetInfo { @@ -7374,14 +7355,7 @@ func (x *Params) GetWhitelistedAssets() []*AssetInfo { return nil } -func (x *Params) GetWhitelistedChains() []*ChainInfo { - if x != nil { - return x.WhitelistedChains - } - return nil -} - -func (x *Params) GetAllowedPublicKeys() []*KeyInfo { +func (x *Params) GetAllowedPublicKeys() map[string]*KeyInfo { if x != nil { return x.AllowedPublicKeys } @@ -7432,16 +7406,14 @@ type AssetInfo struct { AssetType AssetType `protobuf:"varint,4,opt,name=asset_type,json=assetType,proto3,enum=did.v1.AssetType" json:"asset_type,omitempty"` // The name of the asset Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` - // The Method of the did namespace - Method string `protobuf:"bytes,6,opt,name=method,proto3" json:"method,omitempty"` // The icon url - IconUrl string `protobuf:"bytes,7,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` + IconUrl string `protobuf:"bytes,6,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` } func (x *AssetInfo) Reset() { *x = AssetInfo{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[2] + mi := &file_did_v1_genesis_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7455,7 +7427,7 @@ func (*AssetInfo) ProtoMessage() {} // Deprecated: Use AssetInfo.ProtoReflect.Descriptor instead. func (*AssetInfo) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{2} + return file_did_v1_genesis_proto_rawDescGZIP(), []int{3} } func (x *AssetInfo) GetIndex() int64 { @@ -7493,13 +7465,6 @@ func (x *AssetInfo) GetName() string { return "" } -func (x *AssetInfo) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - func (x *AssetInfo) GetIconUrl() string { if x != nil { return x.IconUrl @@ -7507,74 +7472,6 @@ func (x *AssetInfo) GetIconUrl() string { return "" } -// ChainInfo defines the chain info -type ChainInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Symbol string `protobuf:"bytes,4,opt,name=symbol,proto3" json:"symbol,omitempty"` - Validators []*ValidatorInfo `protobuf:"bytes,5,rep,name=validators,proto3" json:"validators,omitempty"` -} - -func (x *ChainInfo) Reset() { - *x = ChainInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChainInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChainInfo) ProtoMessage() {} - -// Deprecated: Use ChainInfo.ProtoReflect.Descriptor instead. -func (*ChainInfo) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{3} -} - -func (x *ChainInfo) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *ChainInfo) GetChainId() string { - if x != nil { - return x.ChainId - } - return "" -} - -func (x *ChainInfo) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ChainInfo) GetSymbol() string { - if x != nil { - return x.Symbol - } - return "" -} - -func (x *ChainInfo) GetValidators() []*ValidatorInfo { - if x != nil { - return x.Validators - } - return nil -} - // KeyInfo defines information for accepted PubKey types type KeyInfo struct { state protoimpl.MessageState @@ -7732,7 +7629,7 @@ type ValidatorInfo_Endpoint struct { func (x *ValidatorInfo_Endpoint) Reset() { *x = ValidatorInfo_Endpoint{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[6] + mi := &file_did_v1_genesis_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7776,7 +7673,7 @@ type ValidatorInfo_ExplorerInfo struct { func (x *ValidatorInfo_ExplorerInfo) Reset() { *x = ValidatorInfo_ExplorerInfo{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[7] + mi := &file_did_v1_genesis_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7823,7 +7720,7 @@ type ValidatorInfo_FeeInfo struct { func (x *ValidatorInfo_FeeInfo) Reset() { *x = ValidatorInfo_FeeInfo{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[8] + mi := &file_did_v1_genesis_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7888,7 +7785,7 @@ type ValidatorInfo_IBCChannel struct { func (x *ValidatorInfo_IBCChannel) Reset() { *x = ValidatorInfo_IBCChannel{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[9] + mi := &file_did_v1_genesis_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7926,254 +7823,258 @@ var file_did_v1_genesis_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, - 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3c, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xb3, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x11, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x41, 0x73, 0x73, 0x65, - 0x74, 0x73, 0x12, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, - 0x64, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x11, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x73, 0x12, 0x3f, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x70, 0x66, 0x73, 0x5f, 0x61, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x70, 0x66, 0x73, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x44, 0x0a, 0x1e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, - 0x6f, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, - 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x15, - 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, - 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, - 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x73, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, - 0x0a, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xc4, 0x01, 0x0a, 0x09, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x10, 0x0a, 0x03, 0x68, 0x72, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x72, - 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x30, 0x0a, 0x0a, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, - 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, - 0x72, 0x6c, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x35, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0xe0, - 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x04, 0x72, 0x6f, - 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, - 0x32, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x41, - 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x12, 0x2f, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, - 0x65, 0x79, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, - 0x43, 0x75, 0x72, 0x76, 0x65, 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x23, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x22, 0xcd, 0x05, 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x45, 0x0a, - 0x0e, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x6e, 0x64, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0d, 0x67, 0x72, 0x70, 0x63, 0x45, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x73, 0x12, 0x45, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6e, 0x64, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, - 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0d, 0x72, 0x65, - 0x73, 0x74, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x65, - 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x08, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x66, - 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x66, 0x65, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x41, 0x0a, 0x0b, 0x69, 0x62, 0x63, 0x5f, 0x63, 0x68, 0x61, - 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, - 0x6f, 0x2e, 0x49, 0x42, 0x43, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x0a, 0x69, 0x62, - 0x63, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x1a, 0x3b, 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x69, - 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, - 0x69, 0x6d, 0x61, 0x72, 0x79, 0x1a, 0x34, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, - 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x1a, 0xb1, 0x01, 0x0a, 0x07, - 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x5f, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x73, - 0x65, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, - 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x66, 0x65, 0x65, 0x52, 0x61, - 0x74, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x69, - 0x74, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, - 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0b, 0x69, 0x73, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x67, 0x61, 0x73, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x0b, 0x67, 0x61, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x1a, - 0x30, 0x0a, 0x0a, 0x49, 0x42, 0x43, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, - 0x74, 0x2a, 0xac, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x1a, 0x0a, 0x16, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x41, - 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x41, 0x54, 0x49, 0x56, 0x45, - 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x57, 0x52, 0x41, 0x50, 0x50, 0x45, 0x44, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x53, - 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4b, 0x49, 0x4e, 0x47, - 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x50, 0x4f, 0x4f, 0x4c, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x53, 0x53, 0x45, 0x54, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, - 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x32, 0x30, 0x10, 0x06, - 0x2a, 0xf9, 0x01, 0x0a, 0x0c, 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, - 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x16, 0x0a, 0x12, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, - 0x45, 0x5f, 0x49, 0x50, 0x46, 0x53, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x49, 0x44, 0x5f, - 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x4f, 0x4e, 0x52, 0x10, 0x02, - 0x12, 0x19, 0x0a, 0x15, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, - 0x45, 0x5f, 0x42, 0x49, 0x54, 0x43, 0x4f, 0x49, 0x4e, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x44, - 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x45, 0x54, 0x48, - 0x45, 0x52, 0x45, 0x55, 0x4d, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44, 0x5f, 0x4e, - 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x1a, - 0x0a, 0x16, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, - 0x57, 0x45, 0x42, 0x41, 0x55, 0x54, 0x48, 0x4e, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, - 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x44, 0x57, 0x4e, 0x10, - 0x07, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, - 0x43, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x08, 0x2a, 0xc4, 0x01, 0x0a, - 0x0c, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1d, 0x0a, - 0x19, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, - 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, - 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, - 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x17, - 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, - 0x45, 0x53, 0x35, 0x31, 0x32, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, - 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x44, 0x44, 0x53, 0x41, 0x10, 0x04, - 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, - 0x4d, 0x5f, 0x45, 0x53, 0x32, 0x35, 0x36, 0x4b, 0x10, 0x05, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, - 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x43, 0x44, 0x53, - 0x41, 0x10, 0x06, 0x2a, 0x81, 0x02, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, - 0x12, 0x19, 0x0a, 0x15, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, - 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, - 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x33, 0x38, - 0x34, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, - 0x5f, 0x50, 0x35, 0x32, 0x31, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x43, - 0x55, 0x52, 0x56, 0x45, 0x5f, 0x58, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x04, 0x12, 0x12, 0x0a, - 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x58, 0x34, 0x34, 0x38, 0x10, - 0x05, 0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x45, - 0x44, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x4b, 0x45, 0x59, 0x5f, - 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x45, 0x44, 0x34, 0x34, 0x38, 0x10, 0x07, 0x12, 0x17, 0x0a, - 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x32, - 0x35, 0x36, 0x4b, 0x31, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, - 0x52, 0x56, 0x45, 0x5f, 0x42, 0x4c, 0x53, 0x31, 0x32, 0x33, 0x38, 0x31, 0x10, 0x09, 0x12, 0x17, - 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x4b, 0x45, 0x43, 0x43, - 0x41, 0x4b, 0x32, 0x35, 0x36, 0x10, 0x0a, 0x2a, 0x73, 0x0a, 0x0b, 0x4b, 0x65, 0x79, 0x45, 0x6e, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x18, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, - 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, - 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x52, 0x41, 0x57, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, - 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x48, 0x45, 0x58, 0x10, 0x02, - 0x12, 0x1a, 0x0a, 0x16, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, - 0x5f, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x42, 0x41, 0x53, 0x45, 0x10, 0x03, 0x2a, 0x8a, 0x01, 0x0a, - 0x07, 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, - 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, - 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, - 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x53, 0x53, 0x45, - 0x52, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x52, - 0x4f, 0x4c, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x03, - 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x56, - 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x2a, 0xd9, 0x01, 0x0a, 0x07, 0x4b, 0x65, - 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x42, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x67, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x22, 0x7d, 0x0a, 0x0f, 0x47, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x65, 0x65, + 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, + 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xde, 0x03, 0x0a, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x55, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1f, 0x0a, + 0x0b, 0x69, 0x70, 0x66, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x69, 0x70, 0x66, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x44, + 0x0a, 0x1e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, + 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, + 0x63, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x50, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x1a, 0x55, 0x0a, 0x16, 0x41, 0x6c, + 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, + 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, + 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xac, 0x01, 0x0a, 0x09, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, + 0x0a, 0x03, 0x68, 0x72, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x72, 0x70, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x30, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x22, 0xe0, 0x01, 0x0a, 0x07, 0x4b, 0x65, + 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, + 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x61, 0x6c, + 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x2f, + 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, + 0x26, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, + 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, + 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xcd, 0x05, 0x0a, + 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, 0x67, 0x72, 0x70, 0x63, + 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x52, 0x0d, 0x67, 0x72, 0x70, 0x63, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, + 0x45, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x45, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x78, + 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x66, 0x65, 0x65, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x66, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x41, 0x0a, 0x0b, 0x69, 0x62, 0x63, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x42, 0x43, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x0a, 0x69, 0x62, 0x63, 0x43, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x1a, 0x3b, 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, + 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, + 0x1a, 0x34, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x1a, 0xb1, 0x01, 0x0a, 0x07, 0x46, 0x65, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, + 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x66, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x73, 0x12, 0x24, + 0x0a, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x47, 0x61, 0x73, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x73, 0x69, 0x6d, 0x75, 0x6c, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x53, 0x69, + 0x6d, 0x75, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x61, 0x73, 0x5f, 0x6d, + 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x67, + 0x61, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x1a, 0x30, 0x0a, 0x0a, 0x49, 0x42, + 0x43, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x2a, 0xac, 0x01, 0x0a, + 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x53, + 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x41, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x16, 0x0a, + 0x12, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x57, 0x52, 0x41, 0x50, + 0x50, 0x45, 0x44, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4b, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x13, 0x0a, + 0x0f, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x4f, 0x4f, 0x4c, + 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x32, 0x30, 0x10, 0x06, 0x2a, 0xf9, 0x01, 0x0a, 0x0c, + 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x19, + 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x44, + 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x46, + 0x53, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, + 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x4f, 0x4e, 0x52, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x44, + 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x42, 0x49, 0x54, + 0x43, 0x4f, 0x49, 0x4e, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, + 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x45, 0x54, 0x48, 0x45, 0x52, 0x45, 0x55, 0x4d, + 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, + 0x41, 0x43, 0x45, 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x49, 0x44, + 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x57, 0x45, 0x42, 0x41, 0x55, + 0x54, 0x48, 0x4e, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, + 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x44, 0x57, 0x4e, 0x10, 0x07, 0x12, 0x19, 0x0a, 0x15, + 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, + 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x08, 0x2a, 0xc4, 0x01, 0x0a, 0x0c, 0x4b, 0x65, 0x79, 0x41, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1d, 0x0a, 0x19, 0x4b, 0x45, 0x59, 0x5f, + 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, + 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x32, 0x35, 0x36, 0x10, 0x01, + 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, + 0x4d, 0x5f, 0x45, 0x53, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, + 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x35, 0x31, 0x32, + 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, + 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x44, 0x44, 0x53, 0x41, 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14, 0x4b, + 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x32, + 0x35, 0x36, 0x4b, 0x10, 0x05, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, + 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x10, 0x06, 0x2a, 0x81, + 0x02, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x4b, + 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, + 0x52, 0x56, 0x45, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, + 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x12, + 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x35, 0x32, 0x31, + 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, + 0x58, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, + 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x58, 0x34, 0x34, 0x38, 0x10, 0x05, 0x12, 0x15, 0x0a, 0x11, + 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x45, 0x44, 0x32, 0x35, 0x35, 0x31, + 0x39, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, + 0x5f, 0x45, 0x44, 0x34, 0x34, 0x38, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, + 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x32, 0x35, 0x36, 0x4b, 0x31, 0x10, + 0x08, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x42, + 0x4c, 0x53, 0x31, 0x32, 0x33, 0x38, 0x31, 0x10, 0x09, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, + 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x4b, 0x45, 0x43, 0x43, 0x41, 0x4b, 0x32, 0x35, 0x36, + 0x10, 0x0a, 0x2a, 0x73, 0x0a, 0x0b, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, + 0x67, 0x12, 0x1c, 0x0a, 0x18, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, + 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, + 0x52, 0x41, 0x57, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, + 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x48, 0x45, 0x58, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4b, + 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4d, 0x55, 0x4c, 0x54, + 0x49, 0x42, 0x41, 0x53, 0x45, 0x10, 0x03, 0x2a, 0x8a, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x52, + 0x6f, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, + 0x17, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, + 0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, + 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x53, 0x53, 0x45, 0x52, 0x54, 0x49, 0x4f, 0x4e, + 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x44, + 0x45, 0x4c, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, + 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x4f, 0x43, 0x41, 0x54, 0x49, + 0x4f, 0x4e, 0x10, 0x04, 0x2a, 0xd9, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, + 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x43, 0x54, 0x45, 0x54, 0x10, 0x01, 0x12, 0x15, + 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4c, 0x4c, 0x49, 0x50, + 0x54, 0x49, 0x43, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x52, 0x53, 0x41, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x04, 0x12, + 0x11, 0x0a, 0x0d, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x4d, 0x41, 0x43, + 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, + 0x50, 0x43, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x5a, 0x4b, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x57, 0x45, 0x42, 0x41, 0x55, 0x54, 0x48, 0x4e, 0x10, 0x08, 0x12, 0x12, 0x0a, 0x0e, + 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x49, 0x50, 0x33, 0x32, 0x10, 0x09, + 0x2a, 0x62, 0x0a, 0x0c, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x52, 0x6f, 0x6c, 0x65, + 0x12, 0x1d, 0x0a, 0x19, 0x4b, 0x45, 0x59, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x43, 0x54, 0x45, - 0x54, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x45, 0x4c, 0x4c, 0x49, 0x50, 0x54, 0x49, 0x43, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4b, 0x45, - 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x53, 0x41, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, - 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, - 0x49, 0x43, 0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x48, 0x4d, 0x41, 0x43, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x4b, 0x45, 0x59, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x50, 0x43, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x4b, 0x45, 0x59, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x5a, 0x4b, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, - 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x57, 0x45, 0x42, 0x41, 0x55, 0x54, 0x48, 0x4e, 0x10, - 0x08, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x49, - 0x50, 0x33, 0x32, 0x10, 0x09, 0x2a, 0x62, 0x0a, 0x0c, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, - 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x4b, 0x45, 0x59, 0x53, 0x48, 0x41, 0x52, - 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x53, 0x48, 0x41, 0x52, 0x45, - 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, - 0x4b, 0x45, 0x59, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x56, 0x41, - 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x02, 0x2a, 0xa7, 0x04, 0x0a, 0x0f, 0x50, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x20, 0x0a, - 0x1c, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, - 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x1f, 0x0a, 0x1b, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, - 0x4f, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, - 0x12, 0x25, 0x0a, 0x21, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, - 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x53, - 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, - 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, - 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x03, 0x12, - 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, - 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, - 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x04, 0x12, 0x27, 0x0a, 0x23, 0x50, 0x45, 0x52, 0x4d, 0x49, - 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, - 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x05, - 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, - 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x41, - 0x44, 0x10, 0x06, 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, + 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, + 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x45, 0x59, 0x53, 0x48, + 0x41, 0x52, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, + 0x4f, 0x52, 0x10, 0x02, 0x2a, 0xa7, 0x04, 0x0a, 0x0f, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x45, 0x52, 0x4d, + 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x45, + 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x42, + 0x41, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, 0x50, + 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, + 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44, + 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, + 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, + 0x4e, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x03, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, + 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, + 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44, + 0x10, 0x04, 0x12, 0x27, 0x0a, 0x23, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, + 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, + 0x4f, 0x4e, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x05, 0x12, 0x21, 0x0a, 0x1d, 0x50, + 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, + 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x06, 0x12, 0x23, + 0x0a, 0x1f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, + 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, + 0x45, 0x10, 0x07, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, - 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x07, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, - 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, - 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x10, 0x08, - 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, - 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x55, 0x50, 0x44, - 0x41, 0x54, 0x45, 0x10, 0x09, 0x12, 0x28, 0x0a, 0x24, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, - 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, - 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x0a, 0x12, - 0x2b, 0x0a, 0x27, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, - 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, - 0x5f, 0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0x0b, 0x12, 0x1f, 0x0a, 0x1b, - 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, - 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x0c, 0x12, 0x24, 0x0a, - 0x20, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, - 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, - 0x52, 0x10, 0x0d, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 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, + 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x10, 0x08, 0x12, 0x23, 0x0a, 0x1f, 0x50, + 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, + 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x09, + 0x12, 0x28, 0x0a, 0x24, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, + 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, + 0x53, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x0a, 0x12, 0x2b, 0x0a, 0x27, 0x50, 0x45, + 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, + 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x42, 0x52, 0x4f, 0x41, + 0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0x0b, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x45, 0x52, 0x4d, 0x49, + 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49, + 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x0c, 0x12, 0x24, 0x0a, 0x20, 0x50, 0x45, 0x52, 0x4d, + 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x41, 0x44, 0x4d, + 0x49, 0x4e, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x0d, 0x42, 0x7c, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 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 ( @@ -8189,7 +8090,7 @@ func file_did_v1_genesis_proto_rawDescGZIP() []byte { } var file_did_v1_genesis_proto_enumTypes = make([]protoimpl.EnumInfo, 9) -var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_did_v1_genesis_proto_goTypes = []interface{}{ (AssetType)(0), // 0: did.v1.AssetType (DIDNamespace)(0), // 1: did.v1.DIDNamespace @@ -8201,33 +8102,34 @@ var file_did_v1_genesis_proto_goTypes = []interface{}{ (KeyshareRole)(0), // 7: did.v1.KeyshareRole (PermissionScope)(0), // 8: did.v1.PermissionScope (*GenesisState)(nil), // 9: did.v1.GenesisState - (*Params)(nil), // 10: did.v1.Params - (*AssetInfo)(nil), // 11: did.v1.AssetInfo - (*ChainInfo)(nil), // 12: did.v1.ChainInfo + (*GlobalIntegrity)(nil), // 10: did.v1.GlobalIntegrity + (*Params)(nil), // 11: did.v1.Params + (*AssetInfo)(nil), // 12: did.v1.AssetInfo (*KeyInfo)(nil), // 13: did.v1.KeyInfo (*ValidatorInfo)(nil), // 14: did.v1.ValidatorInfo - (*ValidatorInfo_Endpoint)(nil), // 15: did.v1.ValidatorInfo.Endpoint - (*ValidatorInfo_ExplorerInfo)(nil), // 16: did.v1.ValidatorInfo.ExplorerInfo - (*ValidatorInfo_FeeInfo)(nil), // 17: did.v1.ValidatorInfo.FeeInfo - (*ValidatorInfo_IBCChannel)(nil), // 18: did.v1.ValidatorInfo.IBCChannel + nil, // 15: did.v1.Params.AllowedPublicKeysEntry + (*ValidatorInfo_Endpoint)(nil), // 16: did.v1.ValidatorInfo.Endpoint + (*ValidatorInfo_ExplorerInfo)(nil), // 17: did.v1.ValidatorInfo.ExplorerInfo + (*ValidatorInfo_FeeInfo)(nil), // 18: did.v1.ValidatorInfo.FeeInfo + (*ValidatorInfo_IBCChannel)(nil), // 19: did.v1.ValidatorInfo.IBCChannel } var file_did_v1_genesis_proto_depIdxs = []int32{ - 10, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params - 11, // 1: did.v1.Params.whitelisted_assets:type_name -> did.v1.AssetInfo - 12, // 2: did.v1.Params.whitelisted_chains:type_name -> did.v1.ChainInfo - 13, // 3: did.v1.Params.allowed_public_keys:type_name -> did.v1.KeyInfo + 11, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params + 10, // 1: did.v1.GenesisState.global_integrity:type_name -> did.v1.GlobalIntegrity + 12, // 2: did.v1.Params.whitelisted_assets:type_name -> did.v1.AssetInfo + 15, // 3: did.v1.Params.allowed_public_keys:type_name -> did.v1.Params.AllowedPublicKeysEntry 0, // 4: did.v1.AssetInfo.asset_type:type_name -> did.v1.AssetType - 14, // 5: did.v1.ChainInfo.validators:type_name -> did.v1.ValidatorInfo - 5, // 6: did.v1.KeyInfo.role:type_name -> did.v1.KeyRole - 2, // 7: did.v1.KeyInfo.algorithm:type_name -> did.v1.KeyAlgorithm - 4, // 8: did.v1.KeyInfo.encoding:type_name -> did.v1.KeyEncoding - 3, // 9: did.v1.KeyInfo.curve:type_name -> did.v1.KeyCurve - 6, // 10: did.v1.KeyInfo.type:type_name -> did.v1.KeyType - 15, // 11: did.v1.ValidatorInfo.grpc_endpoints:type_name -> did.v1.ValidatorInfo.Endpoint - 15, // 12: did.v1.ValidatorInfo.rest_endpoints:type_name -> did.v1.ValidatorInfo.Endpoint - 16, // 13: did.v1.ValidatorInfo.explorer:type_name -> did.v1.ValidatorInfo.ExplorerInfo - 17, // 14: did.v1.ValidatorInfo.fee_info:type_name -> did.v1.ValidatorInfo.FeeInfo - 18, // 15: did.v1.ValidatorInfo.ibc_channel:type_name -> did.v1.ValidatorInfo.IBCChannel + 5, // 5: did.v1.KeyInfo.role:type_name -> did.v1.KeyRole + 2, // 6: did.v1.KeyInfo.algorithm:type_name -> did.v1.KeyAlgorithm + 4, // 7: did.v1.KeyInfo.encoding:type_name -> did.v1.KeyEncoding + 3, // 8: did.v1.KeyInfo.curve:type_name -> did.v1.KeyCurve + 6, // 9: did.v1.KeyInfo.type:type_name -> did.v1.KeyType + 16, // 10: did.v1.ValidatorInfo.grpc_endpoints:type_name -> did.v1.ValidatorInfo.Endpoint + 16, // 11: did.v1.ValidatorInfo.rest_endpoints:type_name -> did.v1.ValidatorInfo.Endpoint + 17, // 12: did.v1.ValidatorInfo.explorer:type_name -> did.v1.ValidatorInfo.ExplorerInfo + 18, // 13: did.v1.ValidatorInfo.fee_info:type_name -> did.v1.ValidatorInfo.FeeInfo + 19, // 14: did.v1.ValidatorInfo.ibc_channel:type_name -> did.v1.ValidatorInfo.IBCChannel + 13, // 15: did.v1.Params.AllowedPublicKeysEntry.value:type_name -> did.v1.KeyInfo 16, // [16:16] is the sub-list for method output_type 16, // [16:16] is the sub-list for method input_type 16, // [16:16] is the sub-list for extension type_name @@ -8254,7 +8156,7 @@ func file_did_v1_genesis_proto_init() { } } file_did_v1_genesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Params); i { + switch v := v.(*GlobalIntegrity); i { case 0: return &v.state case 1: @@ -8266,7 +8168,7 @@ func file_did_v1_genesis_proto_init() { } } file_did_v1_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AssetInfo); i { + switch v := v.(*Params); i { case 0: return &v.state case 1: @@ -8278,7 +8180,7 @@ func file_did_v1_genesis_proto_init() { } } file_did_v1_genesis_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChainInfo); i { + switch v := v.(*AssetInfo); i { case 0: return &v.state case 1: @@ -8313,7 +8215,7 @@ func file_did_v1_genesis_proto_init() { return nil } } - file_did_v1_genesis_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_genesis_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ValidatorInfo_Endpoint); i { case 0: return &v.state @@ -8325,7 +8227,7 @@ func file_did_v1_genesis_proto_init() { return nil } } - file_did_v1_genesis_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_genesis_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ValidatorInfo_ExplorerInfo); i { case 0: return &v.state @@ -8337,7 +8239,7 @@ func file_did_v1_genesis_proto_init() { return nil } } - file_did_v1_genesis_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_genesis_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ValidatorInfo_FeeInfo); i { case 0: return &v.state @@ -8349,7 +8251,7 @@ func file_did_v1_genesis_proto_init() { return nil } } - file_did_v1_genesis_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_genesis_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ValidatorInfo_IBCChannel); i { case 0: return &v.state @@ -8368,7 +8270,7 @@ func file_did_v1_genesis_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_genesis_proto_rawDesc, NumEnums: 9, - NumMessages: 10, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/api/did/v1/models.pulsar.go b/api/did/v1/models.pulsar.go index 8df41f7af..4cea413c9 100644 --- a/api/did/v1/models.pulsar.go +++ b/api/did/v1/models.pulsar.go @@ -5455,7 +5455,7 @@ func (x *PubKey_JWK) ProtoReflect() protoreflect.Message { } func (x *PubKey_JWK) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_models_proto_msgTypes[11] + mi := &file_did_v1_models_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7842,29 +7842,31 @@ func (x *fastReflection_ServiceInfo) ProtoMethods() *protoiface.Methods { } var ( - md_Token protoreflect.MessageDescriptor - fd_Token_id protoreflect.FieldDescriptor - fd_Token_controller protoreflect.FieldDescriptor - fd_Token_macron protoreflect.FieldDescriptor + md_FirstPartyCaveat protoreflect.MessageDescriptor + fd_FirstPartyCaveat_scope protoreflect.FieldDescriptor + fd_FirstPartyCaveat_exp protoreflect.FieldDescriptor + fd_FirstPartyCaveat_cnf protoreflect.FieldDescriptor + fd_FirstPartyCaveat_aud protoreflect.FieldDescriptor ) func init() { file_did_v1_models_proto_init() - md_Token = File_did_v1_models_proto.Messages().ByName("Token") - fd_Token_id = md_Token.Fields().ByName("id") - fd_Token_controller = md_Token.Fields().ByName("controller") - fd_Token_macron = md_Token.Fields().ByName("macron") + md_FirstPartyCaveat = File_did_v1_models_proto.Messages().ByName("FirstPartyCaveat") + fd_FirstPartyCaveat_scope = md_FirstPartyCaveat.Fields().ByName("scope") + fd_FirstPartyCaveat_exp = md_FirstPartyCaveat.Fields().ByName("exp") + fd_FirstPartyCaveat_cnf = md_FirstPartyCaveat.Fields().ByName("cnf") + fd_FirstPartyCaveat_aud = md_FirstPartyCaveat.Fields().ByName("aud") } -var _ protoreflect.Message = (*fastReflection_Token)(nil) +var _ protoreflect.Message = (*fastReflection_FirstPartyCaveat)(nil) -type fastReflection_Token Token +type fastReflection_FirstPartyCaveat FirstPartyCaveat -func (x *Token) ProtoReflect() protoreflect.Message { - return (*fastReflection_Token)(x) +func (x *FirstPartyCaveat) ProtoReflect() protoreflect.Message { + return (*fastReflection_FirstPartyCaveat)(x) } -func (x *Token) slowProtoReflect() protoreflect.Message { +func (x *FirstPartyCaveat) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_models_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -7876,43 +7878,43 @@ func (x *Token) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Token_messageType fastReflection_Token_messageType -var _ protoreflect.MessageType = fastReflection_Token_messageType{} +var _fastReflection_FirstPartyCaveat_messageType fastReflection_FirstPartyCaveat_messageType +var _ protoreflect.MessageType = fastReflection_FirstPartyCaveat_messageType{} -type fastReflection_Token_messageType struct{} +type fastReflection_FirstPartyCaveat_messageType struct{} -func (x fastReflection_Token_messageType) Zero() protoreflect.Message { - return (*fastReflection_Token)(nil) +func (x fastReflection_FirstPartyCaveat_messageType) Zero() protoreflect.Message { + return (*fastReflection_FirstPartyCaveat)(nil) } -func (x fastReflection_Token_messageType) New() protoreflect.Message { - return new(fastReflection_Token) +func (x fastReflection_FirstPartyCaveat_messageType) New() protoreflect.Message { + return new(fastReflection_FirstPartyCaveat) } -func (x fastReflection_Token_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Token +func (x fastReflection_FirstPartyCaveat_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_FirstPartyCaveat } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Token) Descriptor() protoreflect.MessageDescriptor { - return md_Token +func (x *fastReflection_FirstPartyCaveat) Descriptor() protoreflect.MessageDescriptor { + return md_FirstPartyCaveat } // 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_Token) Type() protoreflect.MessageType { - return _fastReflection_Token_messageType +func (x *fastReflection_FirstPartyCaveat) Type() protoreflect.MessageType { + return _fastReflection_FirstPartyCaveat_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Token) New() protoreflect.Message { - return new(fastReflection_Token) +func (x *fastReflection_FirstPartyCaveat) New() protoreflect.Message { + return new(fastReflection_FirstPartyCaveat) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Token) Interface() protoreflect.ProtoMessage { - return (*Token)(x) +func (x *fastReflection_FirstPartyCaveat) Interface() protoreflect.ProtoMessage { + return (*FirstPartyCaveat)(x) } // Range iterates over every populated field in an undefined order, @@ -7920,22 +7922,28 @@ func (x *fastReflection_Token) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_Token) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Token_id, value) { +func (x *fastReflection_FirstPartyCaveat) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Scope != nil { + value := protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) + if !f(fd_FirstPartyCaveat_scope, value) { return } } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Token_controller, value) { + if x.Exp != int64(0) { + value := protoreflect.ValueOfInt64(x.Exp) + if !f(fd_FirstPartyCaveat_exp, value) { return } } - if len(x.Macron) != 0 { - value := protoreflect.ValueOfBytes(x.Macron) - if !f(fd_Token_macron, value) { + if x.Cnf != "" { + value := protoreflect.ValueOfString(x.Cnf) + if !f(fd_FirstPartyCaveat_cnf, value) { + return + } + } + if x.Aud != "" { + value := protoreflect.ValueOfString(x.Aud) + if !f(fd_FirstPartyCaveat_aud, value) { return } } @@ -7952,19 +7960,21 @@ func (x *fastReflection_Token) Range(f func(protoreflect.FieldDescriptor, protor // 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_Token) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_FirstPartyCaveat) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Token.id": - return x.Id != "" - case "did.v1.Token.controller": - return x.Controller != "" - case "did.v1.Token.macron": - return len(x.Macron) != 0 + case "did.v1.FirstPartyCaveat.scope": + return x.Scope != nil + case "did.v1.FirstPartyCaveat.exp": + return x.Exp != int64(0) + case "did.v1.FirstPartyCaveat.cnf": + return x.Cnf != "" + case "did.v1.FirstPartyCaveat.aud": + return x.Aud != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Token")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) } - panic(fmt.Errorf("message did.v1.Token does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.FirstPartyCaveat does not contain field %s", fd.FullName())) } } @@ -7974,19 +7984,21 @@ func (x *fastReflection_Token) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Token) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_FirstPartyCaveat) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Token.id": - x.Id = "" - case "did.v1.Token.controller": - x.Controller = "" - case "did.v1.Token.macron": - x.Macron = nil + case "did.v1.FirstPartyCaveat.scope": + x.Scope = nil + case "did.v1.FirstPartyCaveat.exp": + x.Exp = int64(0) + case "did.v1.FirstPartyCaveat.cnf": + x.Cnf = "" + case "did.v1.FirstPartyCaveat.aud": + x.Aud = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Token")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) } - panic(fmt.Errorf("message did.v1.Token does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.FirstPartyCaveat does not contain field %s", fd.FullName())) } } @@ -7996,22 +8008,25 @@ func (x *fastReflection_Token) Clear(fd protoreflect.FieldDescriptor) { // 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_Token) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_FirstPartyCaveat) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Token.id": - value := x.Id + case "did.v1.FirstPartyCaveat.scope": + value := x.Scope + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.FirstPartyCaveat.exp": + value := x.Exp + return protoreflect.ValueOfInt64(value) + case "did.v1.FirstPartyCaveat.cnf": + value := x.Cnf return protoreflect.ValueOfString(value) - case "did.v1.Token.controller": - value := x.Controller + case "did.v1.FirstPartyCaveat.aud": + value := x.Aud return protoreflect.ValueOfString(value) - case "did.v1.Token.macron": - value := x.Macron - return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Token")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) } - panic(fmt.Errorf("message did.v1.Token does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.FirstPartyCaveat does not contain field %s", descriptor.FullName())) } } @@ -8025,19 +8040,21 @@ func (x *fastReflection_Token) Get(descriptor protoreflect.FieldDescriptor) prot // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Token) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_FirstPartyCaveat) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Token.id": - x.Id = value.Interface().(string) - case "did.v1.Token.controller": - x.Controller = value.Interface().(string) - case "did.v1.Token.macron": - x.Macron = value.Bytes() + case "did.v1.FirstPartyCaveat.scope": + x.Scope = value.Message().Interface().(*Permissions) + case "did.v1.FirstPartyCaveat.exp": + x.Exp = value.Int() + case "did.v1.FirstPartyCaveat.cnf": + x.Cnf = value.Interface().(string) + case "did.v1.FirstPartyCaveat.aud": + x.Aud = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Token")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) } - panic(fmt.Errorf("message did.v1.Token does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.FirstPartyCaveat does not contain field %s", fd.FullName())) } } @@ -8051,48 +8068,56 @@ func (x *fastReflection_Token) Set(fd protoreflect.FieldDescriptor, value protor // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Token) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_FirstPartyCaveat) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Token.id": - panic(fmt.Errorf("field id of message did.v1.Token is not mutable")) - case "did.v1.Token.controller": - panic(fmt.Errorf("field controller of message did.v1.Token is not mutable")) - case "did.v1.Token.macron": - panic(fmt.Errorf("field macron of message did.v1.Token is not mutable")) + case "did.v1.FirstPartyCaveat.scope": + if x.Scope == nil { + x.Scope = new(Permissions) + } + return protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) + case "did.v1.FirstPartyCaveat.exp": + panic(fmt.Errorf("field exp of message did.v1.FirstPartyCaveat is not mutable")) + case "did.v1.FirstPartyCaveat.cnf": + panic(fmt.Errorf("field cnf of message did.v1.FirstPartyCaveat is not mutable")) + case "did.v1.FirstPartyCaveat.aud": + panic(fmt.Errorf("field aud of message did.v1.FirstPartyCaveat is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Token")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) } - panic(fmt.Errorf("message did.v1.Token does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_Token) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_FirstPartyCaveat) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Token.id": + case "did.v1.FirstPartyCaveat.scope": + m := new(Permissions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.FirstPartyCaveat.exp": + return protoreflect.ValueOfInt64(int64(0)) + case "did.v1.FirstPartyCaveat.cnf": return protoreflect.ValueOfString("") - case "did.v1.Token.controller": + case "did.v1.FirstPartyCaveat.aud": return protoreflect.ValueOfString("") - case "did.v1.Token.macron": - return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Token")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) } - panic(fmt.Errorf("message did.v1.Token does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_Token) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_FirstPartyCaveat) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Token", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.FirstPartyCaveat", d.FullName())) } panic("unreachable") } @@ -8100,7 +8125,7 @@ func (x *fastReflection_Token) WhichOneof(d protoreflect.OneofDescriptor) protor // 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_Token) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_FirstPartyCaveat) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -8111,7 +8136,7 @@ func (x *fastReflection_Token) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Token) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_FirstPartyCaveat) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -8123,7 +8148,7 @@ func (x *fastReflection_Token) SetUnknown(fields protoreflect.RawFields) { // 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_Token) IsValid() bool { +func (x *fastReflection_FirstPartyCaveat) IsValid() bool { return x != nil } @@ -8133,9 +8158,9 @@ func (x *fastReflection_Token) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_Token) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_FirstPartyCaveat) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Token) + x := input.Message.Interface().(*FirstPartyCaveat) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -8147,15 +8172,18 @@ func (x *fastReflection_Token) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Id) + if x.Scope != nil { + l = options.Size(x.Scope) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Exp != 0 { + n += 1 + runtime.Sov(uint64(x.Exp)) + } + l = len(x.Cnf) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Controller) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Macron) + l = len(x.Aud) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -8169,7 +8197,7 @@ func (x *fastReflection_Token) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Token) + x := input.Message.Interface().(*FirstPartyCaveat) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -8188,24 +8216,36 @@ func (x *fastReflection_Token) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Macron) > 0 { - i -= len(x.Macron) - copy(dAtA[i:], x.Macron) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Macron))) + if len(x.Aud) > 0 { + i -= len(x.Aud) + copy(dAtA[i:], x.Aud) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Aud))) + i-- + dAtA[i] = 0x22 + } + if len(x.Cnf) > 0 { + i -= len(x.Cnf) + copy(dAtA[i:], x.Cnf) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cnf))) i-- dAtA[i] = 0x1a } - if len(x.Controller) > 0 { - i -= len(x.Controller) - copy(dAtA[i:], x.Controller) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + if x.Exp != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Exp)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + if x.Scope != nil { + encoded, err := options.Marshal(x.Scope) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } @@ -8220,7 +8260,7 @@ func (x *fastReflection_Token) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Token) + x := input.Message.Interface().(*FirstPartyCaveat) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -8252,17 +8292,17 @@ func (x *fastReflection_Token) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Token: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FirstPartyCaveat: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Token: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FirstPartyCaveat: 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 Id", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -8272,27 +8312,50 @@ func (x *fastReflection_Token) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Id = string(dAtA[iNdEx:postIndex]) + if x.Scope == nil { + x.Scope = &Permissions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Scope); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) + } + x.Exp = 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.Exp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Cnf", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8320,13 +8383,13 @@ func (x *fastReflection_Token) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Controller = string(dAtA[iNdEx:postIndex]) + x.Cnf = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Macron", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Aud", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -8336,25 +8399,634 @@ func (x *fastReflection_Token) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + 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.Macron = append(x.Macron[:0], dAtA[iNdEx:postIndex]...) - if x.Macron == nil { - x.Macron = []byte{} + x.Aud = 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_ThirdPartyCaveat protoreflect.MessageDescriptor + fd_ThirdPartyCaveat_scope protoreflect.FieldDescriptor + fd_ThirdPartyCaveat_exp protoreflect.FieldDescriptor + fd_ThirdPartyCaveat_cnf protoreflect.FieldDescriptor + fd_ThirdPartyCaveat_aud protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_ThirdPartyCaveat = File_did_v1_models_proto.Messages().ByName("ThirdPartyCaveat") + fd_ThirdPartyCaveat_scope = md_ThirdPartyCaveat.Fields().ByName("scope") + fd_ThirdPartyCaveat_exp = md_ThirdPartyCaveat.Fields().ByName("exp") + fd_ThirdPartyCaveat_cnf = md_ThirdPartyCaveat.Fields().ByName("cnf") + fd_ThirdPartyCaveat_aud = md_ThirdPartyCaveat.Fields().ByName("aud") +} + +var _ protoreflect.Message = (*fastReflection_ThirdPartyCaveat)(nil) + +type fastReflection_ThirdPartyCaveat ThirdPartyCaveat + +func (x *ThirdPartyCaveat) ProtoReflect() protoreflect.Message { + return (*fastReflection_ThirdPartyCaveat)(x) +} + +func (x *ThirdPartyCaveat) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ThirdPartyCaveat_messageType fastReflection_ThirdPartyCaveat_messageType +var _ protoreflect.MessageType = fastReflection_ThirdPartyCaveat_messageType{} + +type fastReflection_ThirdPartyCaveat_messageType struct{} + +func (x fastReflection_ThirdPartyCaveat_messageType) Zero() protoreflect.Message { + return (*fastReflection_ThirdPartyCaveat)(nil) +} +func (x fastReflection_ThirdPartyCaveat_messageType) New() protoreflect.Message { + return new(fastReflection_ThirdPartyCaveat) +} +func (x fastReflection_ThirdPartyCaveat_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ThirdPartyCaveat +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ThirdPartyCaveat) Descriptor() protoreflect.MessageDescriptor { + return md_ThirdPartyCaveat +} + +// 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_ThirdPartyCaveat) Type() protoreflect.MessageType { + return _fastReflection_ThirdPartyCaveat_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ThirdPartyCaveat) New() protoreflect.Message { + return new(fastReflection_ThirdPartyCaveat) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ThirdPartyCaveat) Interface() protoreflect.ProtoMessage { + return (*ThirdPartyCaveat)(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_ThirdPartyCaveat) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Scope != nil { + value := protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) + if !f(fd_ThirdPartyCaveat_scope, value) { + return + } + } + if x.Exp != int64(0) { + value := protoreflect.ValueOfInt64(x.Exp) + if !f(fd_ThirdPartyCaveat_exp, value) { + return + } + } + if x.Cnf != "" { + value := protoreflect.ValueOfString(x.Cnf) + if !f(fd_ThirdPartyCaveat_cnf, value) { + return + } + } + if x.Aud != "" { + value := protoreflect.ValueOfString(x.Aud) + if !f(fd_ThirdPartyCaveat_aud, 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_ThirdPartyCaveat) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + return x.Scope != nil + case "did.v1.ThirdPartyCaveat.exp": + return x.Exp != int64(0) + case "did.v1.ThirdPartyCaveat.cnf": + return x.Cnf != "" + case "did.v1.ThirdPartyCaveat.aud": + return x.Aud != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + x.Scope = nil + case "did.v1.ThirdPartyCaveat.exp": + x.Exp = int64(0) + case "did.v1.ThirdPartyCaveat.cnf": + x.Cnf = "" + case "did.v1.ThirdPartyCaveat.aud": + x.Aud = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + value := x.Scope + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.ThirdPartyCaveat.exp": + value := x.Exp + return protoreflect.ValueOfInt64(value) + case "did.v1.ThirdPartyCaveat.cnf": + value := x.Cnf + return protoreflect.ValueOfString(value) + case "did.v1.ThirdPartyCaveat.aud": + value := x.Aud + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + x.Scope = value.Message().Interface().(*Permissions) + case "did.v1.ThirdPartyCaveat.exp": + x.Exp = value.Int() + case "did.v1.ThirdPartyCaveat.cnf": + x.Cnf = value.Interface().(string) + case "did.v1.ThirdPartyCaveat.aud": + x.Aud = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + if x.Scope == nil { + x.Scope = new(Permissions) + } + return protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) + case "did.v1.ThirdPartyCaveat.exp": + panic(fmt.Errorf("field exp of message did.v1.ThirdPartyCaveat is not mutable")) + case "did.v1.ThirdPartyCaveat.cnf": + panic(fmt.Errorf("field cnf of message did.v1.ThirdPartyCaveat is not mutable")) + case "did.v1.ThirdPartyCaveat.aud": + panic(fmt.Errorf("field aud of message did.v1.ThirdPartyCaveat is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + m := new(Permissions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.ThirdPartyCaveat.exp": + return protoreflect.ValueOfInt64(int64(0)) + case "did.v1.ThirdPartyCaveat.cnf": + return protoreflect.ValueOfString("") + case "did.v1.ThirdPartyCaveat.aud": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat 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_ThirdPartyCaveat) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.ThirdPartyCaveat", 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_ThirdPartyCaveat) 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_ThirdPartyCaveat) 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_ThirdPartyCaveat) 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_ThirdPartyCaveat) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ThirdPartyCaveat) + 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.Scope != nil { + l = options.Size(x.Scope) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Exp != 0 { + n += 1 + runtime.Sov(uint64(x.Exp)) + } + l = len(x.Cnf) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Aud) + 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().(*ThirdPartyCaveat) + 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.Aud) > 0 { + i -= len(x.Aud) + copy(dAtA[i:], x.Aud) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Aud))) + i-- + dAtA[i] = 0x22 + } + if len(x.Cnf) > 0 { + i -= len(x.Cnf) + copy(dAtA[i:], x.Cnf) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cnf))) + i-- + dAtA[i] = 0x1a + } + if x.Exp != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Exp)) + i-- + dAtA[i] = 0x10 + } + if x.Scope != nil { + encoded, err := options.Marshal(x.Scope) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ThirdPartyCaveat) + 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: ThirdPartyCaveat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ThirdPartyCaveat: 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 Scope", 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.Scope == nil { + x.Scope = &Permissions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Scope); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) + } + x.Exp = 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.Exp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Cnf", 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.Cnf = 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 Aud", 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.Aud = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -9012,19 +9684,20 @@ func (x *ServiceInfo) GetService() *Service { return nil } -// Token defines a macron token -type Token struct { +// FirstPartyCaveat defines a first party caveat +type FirstPartyCaveat struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - Macron []byte `protobuf:"bytes,3,opt,name=macron,proto3" json:"macron,omitempty"` + Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` + Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` + Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` } -func (x *Token) Reset() { - *x = Token{} +func (x *FirstPartyCaveat) Reset() { + *x = FirstPartyCaveat{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_models_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -9032,38 +9705,105 @@ func (x *Token) Reset() { } } -func (x *Token) String() string { +func (x *FirstPartyCaveat) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Token) ProtoMessage() {} +func (*FirstPartyCaveat) ProtoMessage() {} -// Deprecated: Use Token.ProtoReflect.Descriptor instead. -func (*Token) Descriptor() ([]byte, []int) { +// Deprecated: Use FirstPartyCaveat.ProtoReflect.Descriptor instead. +func (*FirstPartyCaveat) Descriptor() ([]byte, []int) { return file_did_v1_models_proto_rawDescGZIP(), []int{8} } -func (x *Token) GetId() string { +func (x *FirstPartyCaveat) GetScope() *Permissions { if x != nil { - return x.Id - } - return "" -} - -func (x *Token) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -func (x *Token) GetMacron() []byte { - if x != nil { - return x.Macron + return x.Scope } return nil } +func (x *FirstPartyCaveat) GetExp() int64 { + if x != nil { + return x.Exp + } + return 0 +} + +func (x *FirstPartyCaveat) GetCnf() string { + if x != nil { + return x.Cnf + } + return "" +} + +func (x *FirstPartyCaveat) GetAud() string { + if x != nil { + return x.Aud + } + return "" +} + +// ThirdPartyCaveat defines a third party caveat +type ThirdPartyCaveat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` + Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` + Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` +} + +func (x *ThirdPartyCaveat) Reset() { + *x = ThirdPartyCaveat{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ThirdPartyCaveat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ThirdPartyCaveat) ProtoMessage() {} + +// Deprecated: Use ThirdPartyCaveat.ProtoReflect.Descriptor instead. +func (*ThirdPartyCaveat) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{9} +} + +func (x *ThirdPartyCaveat) GetScope() *Permissions { + if x != nil { + return x.Scope + } + return nil +} + +func (x *ThirdPartyCaveat) GetExp() int64 { + if x != nil { + return x.Exp + } + return 0 +} + +func (x *ThirdPartyCaveat) GetCnf() string { + if x != nil { + return x.Cnf + } + return "" +} + +func (x *ThirdPartyCaveat) GetAud() string { + if x != nil { + return x.Aud + } + return "" +} + // JWK represents a JSON Web Key type PubKey_JWK struct { state protoimpl.MessageState @@ -9081,7 +9821,7 @@ type PubKey_JWK struct { func (x *PubKey_JWK) Reset() { *x = PubKey_JWK{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_models_proto_msgTypes[11] + mi := &file_did_v1_models_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9281,21 +10021,30 @@ var file_did_v1_models_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x4f, 0x0a, 0x05, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 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, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6d, 0x61, 0x63, 0x72, 0x6f, 0x6e, 0x42, 0x7b, 0x0a, - 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, - 0x65, 0x6c, 0x73, 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, + 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x73, 0x0a, 0x10, + 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, + 0x12, 0x29, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, + 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, + 0x03, 0x63, 0x6e, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6e, 0x66, 0x12, + 0x10, 0x0a, 0x03, 0x61, 0x75, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x75, + 0x64, 0x22, 0x73, 0x0a, 0x10, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x79, 0x43, + 0x61, 0x76, 0x65, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, + 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6e, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x63, 0x6e, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x75, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x61, 0x75, 0x64, 0x42, 0x7b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 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 ( @@ -9310,48 +10059,51 @@ func file_did_v1_models_proto_rawDescGZIP() []byte { return file_did_v1_models_proto_rawDescData } -var file_did_v1_models_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_did_v1_models_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_did_v1_models_proto_goTypes = []interface{}{ - (*Alias)(nil), // 0: did.v1.Alias - (*Credential)(nil), // 1: did.v1.Credential - (*Document)(nil), // 2: did.v1.Document - (*Keyshare)(nil), // 3: did.v1.Keyshare - (*Permissions)(nil), // 4: did.v1.Permissions - (*PubKey)(nil), // 5: did.v1.PubKey - (*Service)(nil), // 6: did.v1.Service - (*ServiceInfo)(nil), // 7: did.v1.ServiceInfo - (*Token)(nil), // 8: did.v1.Token - nil, // 9: did.v1.Keyshare.MetadataEntry - nil, // 10: did.v1.Keyshare.PayloadsEntry - (*PubKey_JWK)(nil), // 11: did.v1.PubKey.JWK - nil, // 12: did.v1.Service.ServiceEndpointsEntry - (DIDNamespace)(0), // 13: did.v1.DIDNamespace - (PermissionScope)(0), // 14: did.v1.PermissionScope - (KeyRole)(0), // 15: did.v1.KeyRole - (KeyAlgorithm)(0), // 16: did.v1.KeyAlgorithm - (KeyEncoding)(0), // 17: did.v1.KeyEncoding - (KeyCurve)(0), // 18: did.v1.KeyCurve - (KeyType)(0), // 19: did.v1.KeyType + (*Alias)(nil), // 0: did.v1.Alias + (*Credential)(nil), // 1: did.v1.Credential + (*Document)(nil), // 2: did.v1.Document + (*Keyshare)(nil), // 3: did.v1.Keyshare + (*Permissions)(nil), // 4: did.v1.Permissions + (*PubKey)(nil), // 5: did.v1.PubKey + (*Service)(nil), // 6: did.v1.Service + (*ServiceInfo)(nil), // 7: did.v1.ServiceInfo + (*FirstPartyCaveat)(nil), // 8: did.v1.FirstPartyCaveat + (*ThirdPartyCaveat)(nil), // 9: did.v1.ThirdPartyCaveat + nil, // 10: did.v1.Keyshare.MetadataEntry + nil, // 11: did.v1.Keyshare.PayloadsEntry + (*PubKey_JWK)(nil), // 12: did.v1.PubKey.JWK + nil, // 13: did.v1.Service.ServiceEndpointsEntry + (DIDNamespace)(0), // 14: did.v1.DIDNamespace + (PermissionScope)(0), // 15: did.v1.PermissionScope + (KeyRole)(0), // 16: did.v1.KeyRole + (KeyAlgorithm)(0), // 17: did.v1.KeyAlgorithm + (KeyEncoding)(0), // 18: did.v1.KeyEncoding + (KeyCurve)(0), // 19: did.v1.KeyCurve + (KeyType)(0), // 20: did.v1.KeyType } var file_did_v1_models_proto_depIdxs = []int32{ - 9, // 0: did.v1.Keyshare.metadata:type_name -> did.v1.Keyshare.MetadataEntry - 10, // 1: did.v1.Keyshare.payloads:type_name -> did.v1.Keyshare.PayloadsEntry - 13, // 2: did.v1.Permissions.grants:type_name -> did.v1.DIDNamespace - 14, // 3: did.v1.Permissions.scopes:type_name -> did.v1.PermissionScope - 15, // 4: did.v1.PubKey.role:type_name -> did.v1.KeyRole - 16, // 5: did.v1.PubKey.algorithm:type_name -> did.v1.KeyAlgorithm - 17, // 6: did.v1.PubKey.encoding:type_name -> did.v1.KeyEncoding - 18, // 7: did.v1.PubKey.curve:type_name -> did.v1.KeyCurve - 19, // 8: did.v1.PubKey.key_type:type_name -> did.v1.KeyType - 11, // 9: did.v1.PubKey.jwk:type_name -> did.v1.PubKey.JWK - 12, // 10: did.v1.Service.service_endpoints:type_name -> did.v1.Service.ServiceEndpointsEntry + 10, // 0: did.v1.Keyshare.metadata:type_name -> did.v1.Keyshare.MetadataEntry + 11, // 1: did.v1.Keyshare.payloads:type_name -> did.v1.Keyshare.PayloadsEntry + 14, // 2: did.v1.Permissions.grants:type_name -> did.v1.DIDNamespace + 15, // 3: did.v1.Permissions.scopes:type_name -> did.v1.PermissionScope + 16, // 4: did.v1.PubKey.role:type_name -> did.v1.KeyRole + 17, // 5: did.v1.PubKey.algorithm:type_name -> did.v1.KeyAlgorithm + 18, // 6: did.v1.PubKey.encoding:type_name -> did.v1.KeyEncoding + 19, // 7: did.v1.PubKey.curve:type_name -> did.v1.KeyCurve + 20, // 8: did.v1.PubKey.key_type:type_name -> did.v1.KeyType + 12, // 9: did.v1.PubKey.jwk:type_name -> did.v1.PubKey.JWK + 13, // 10: did.v1.Service.service_endpoints:type_name -> did.v1.Service.ServiceEndpointsEntry 4, // 11: did.v1.Service.permissions:type_name -> did.v1.Permissions 6, // 12: did.v1.ServiceInfo.service:type_name -> did.v1.Service - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 4, // 13: did.v1.FirstPartyCaveat.scope:type_name -> did.v1.Permissions + 4, // 14: did.v1.ThirdPartyCaveat.scope:type_name -> did.v1.Permissions + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_did_v1_models_proto_init() } @@ -9458,7 +10210,7 @@ func file_did_v1_models_proto_init() { } } file_did_v1_models_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Token); i { + switch v := v.(*FirstPartyCaveat); i { case 0: return &v.state case 1: @@ -9469,7 +10221,19 @@ func file_did_v1_models_proto_init() { return nil } } - file_did_v1_models_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_did_v1_models_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ThirdPartyCaveat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_models_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PubKey_JWK); i { case 0: return &v.state @@ -9488,7 +10252,7 @@ func file_did_v1_models_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_models_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 14, NumExtensions: 0, NumServices: 0, }, diff --git a/api/did/v1/query.pulsar.go b/api/did/v1/query.pulsar.go index 5fec065d9..7d18b2e8d 100644 --- a/api/did/v1/query.pulsar.go +++ b/api/did/v1/query.pulsar.go @@ -10,6 +10,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" reflect "reflect" + sort "sort" sync "sync" ) @@ -17,6 +18,8 @@ var ( md_QueryRequest protoreflect.MessageDescriptor fd_QueryRequest_did protoreflect.FieldDescriptor fd_QueryRequest_origin protoreflect.FieldDescriptor + fd_QueryRequest_key protoreflect.FieldDescriptor + fd_QueryRequest_asset protoreflect.FieldDescriptor ) func init() { @@ -24,6 +27,8 @@ func init() { md_QueryRequest = File_did_v1_query_proto.Messages().ByName("QueryRequest") fd_QueryRequest_did = md_QueryRequest.Fields().ByName("did") fd_QueryRequest_origin = md_QueryRequest.Fields().ByName("origin") + fd_QueryRequest_key = md_QueryRequest.Fields().ByName("key") + fd_QueryRequest_asset = md_QueryRequest.Fields().ByName("asset") } var _ protoreflect.Message = (*fastReflection_QueryRequest)(nil) @@ -103,6 +108,18 @@ func (x *fastReflection_QueryRequest) Range(f func(protoreflect.FieldDescriptor, return } } + if x.Key != "" { + value := protoreflect.ValueOfString(x.Key) + if !f(fd_QueryRequest_key, value) { + return + } + } + if x.Asset != "" { + value := protoreflect.ValueOfString(x.Asset) + if !f(fd_QueryRequest_asset, value) { + return + } + } } // Has reports whether a field is populated. @@ -122,6 +139,10 @@ func (x *fastReflection_QueryRequest) Has(fd protoreflect.FieldDescriptor) bool return x.Did != "" case "did.v1.QueryRequest.origin": return x.Origin != "" + case "did.v1.QueryRequest.key": + return x.Key != "" + case "did.v1.QueryRequest.asset": + return x.Asset != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -142,6 +163,10 @@ func (x *fastReflection_QueryRequest) Clear(fd protoreflect.FieldDescriptor) { x.Did = "" case "did.v1.QueryRequest.origin": x.Origin = "" + case "did.v1.QueryRequest.key": + x.Key = "" + case "did.v1.QueryRequest.asset": + x.Asset = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -164,6 +189,12 @@ func (x *fastReflection_QueryRequest) Get(descriptor protoreflect.FieldDescripto case "did.v1.QueryRequest.origin": value := x.Origin return protoreflect.ValueOfString(value) + case "did.v1.QueryRequest.key": + value := x.Key + return protoreflect.ValueOfString(value) + case "did.v1.QueryRequest.asset": + value := x.Asset + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -188,6 +219,10 @@ func (x *fastReflection_QueryRequest) Set(fd protoreflect.FieldDescriptor, value x.Did = value.Interface().(string) case "did.v1.QueryRequest.origin": x.Origin = value.Interface().(string) + case "did.v1.QueryRequest.key": + x.Key = value.Interface().(string) + case "did.v1.QueryRequest.asset": + x.Asset = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -212,6 +247,10 @@ func (x *fastReflection_QueryRequest) Mutable(fd protoreflect.FieldDescriptor) p panic(fmt.Errorf("field did of message did.v1.QueryRequest is not mutable")) case "did.v1.QueryRequest.origin": panic(fmt.Errorf("field origin of message did.v1.QueryRequest is not mutable")) + case "did.v1.QueryRequest.key": + panic(fmt.Errorf("field key of message did.v1.QueryRequest is not mutable")) + case "did.v1.QueryRequest.asset": + panic(fmt.Errorf("field asset of message did.v1.QueryRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -229,6 +268,10 @@ func (x *fastReflection_QueryRequest) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfString("") case "did.v1.QueryRequest.origin": return protoreflect.ValueOfString("") + case "did.v1.QueryRequest.key": + return protoreflect.ValueOfString("") + case "did.v1.QueryRequest.asset": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) @@ -306,6 +349,14 @@ func (x *fastReflection_QueryRequest) ProtoMethods() *protoiface.Methods { 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)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -335,6 +386,20 @@ func (x *fastReflection_QueryRequest) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + 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) @@ -462,6 +527,70 @@ func (x *fastReflection_QueryRequest) ProtoMethods() *protoiface.Methods { } 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 default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1208,6 +1337,2967 @@ func (x *fastReflection_QueryResponse) ProtoMethods() *protoiface.Methods { } } +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryParamsResponse = File_did_v1_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryParamsAssetsResponse_1_list)(nil) + +type _QueryParamsAssetsResponse_1_list struct { + list *[]*AssetInfo +} + +func (x *_QueryParamsAssetsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryParamsAssetsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryParamsAssetsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AssetInfo) + (*x.list)[i] = concreteValue +} + +func (x *_QueryParamsAssetsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AssetInfo) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryParamsAssetsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(AssetInfo) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryParamsAssetsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryParamsAssetsResponse_1_list) NewElement() protoreflect.Value { + v := new(AssetInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryParamsAssetsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryParamsAssetsResponse protoreflect.MessageDescriptor + fd_QueryParamsAssetsResponse_assets protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryParamsAssetsResponse = File_did_v1_query_proto.Messages().ByName("QueryParamsAssetsResponse") + fd_QueryParamsAssetsResponse_assets = md_QueryParamsAssetsResponse.Fields().ByName("assets") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsAssetsResponse)(nil) + +type fastReflection_QueryParamsAssetsResponse QueryParamsAssetsResponse + +func (x *QueryParamsAssetsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsAssetsResponse)(x) +} + +func (x *QueryParamsAssetsResponse) 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_QueryParamsAssetsResponse_messageType fastReflection_QueryParamsAssetsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsAssetsResponse_messageType{} + +type fastReflection_QueryParamsAssetsResponse_messageType struct{} + +func (x fastReflection_QueryParamsAssetsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsAssetsResponse)(nil) +} +func (x fastReflection_QueryParamsAssetsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsAssetsResponse) +} +func (x fastReflection_QueryParamsAssetsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsAssetsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsAssetsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsAssetsResponse +} + +// 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_QueryParamsAssetsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsAssetsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsAssetsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsAssetsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsAssetsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsAssetsResponse)(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_QueryParamsAssetsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Assets) != 0 { + value := protoreflect.ValueOfList(&_QueryParamsAssetsResponse_1_list{list: &x.Assets}) + if !f(fd_QueryParamsAssetsResponse_assets, 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_QueryParamsAssetsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryParamsAssetsResponse.assets": + return len(x.Assets) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse 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_QueryParamsAssetsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryParamsAssetsResponse.assets": + x.Assets = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse 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_QueryParamsAssetsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryParamsAssetsResponse.assets": + if len(x.Assets) == 0 { + return protoreflect.ValueOfList(&_QueryParamsAssetsResponse_1_list{}) + } + listValue := &_QueryParamsAssetsResponse_1_list{list: &x.Assets} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse 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_QueryParamsAssetsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryParamsAssetsResponse.assets": + lv := value.List() + clv := lv.(*_QueryParamsAssetsResponse_1_list) + x.Assets = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse 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_QueryParamsAssetsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsAssetsResponse.assets": + if x.Assets == nil { + x.Assets = []*AssetInfo{} + } + value := &_QueryParamsAssetsResponse_1_list{list: &x.Assets} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse 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_QueryParamsAssetsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsAssetsResponse.assets": + list := []*AssetInfo{} + return protoreflect.ValueOfList(&_QueryParamsAssetsResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse 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_QueryParamsAssetsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryParamsAssetsResponse", 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_QueryParamsAssetsResponse) 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_QueryParamsAssetsResponse) 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_QueryParamsAssetsResponse) 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_QueryParamsAssetsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsAssetsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Assets) > 0 { + for _, e := range x.Assets { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsAssetsResponse) + 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.Assets) > 0 { + for iNdEx := len(x.Assets) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Assets[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 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().(*QueryParamsAssetsResponse) + 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: QueryParamsAssetsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsAssetsResponse: 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 Assets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Assets = append(x.Assets, &AssetInfo{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Assets[len(x.Assets)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.Map = (*_QueryParamsKeysResponse_1_map)(nil) + +type _QueryParamsKeysResponse_1_map struct { + m *map[string]*KeyInfo +} + +func (x *_QueryParamsKeysResponse_1_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_QueryParamsKeysResponse_1_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.ValueOfMessage(v.ProtoReflect()) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_QueryParamsKeysResponse_1_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 *_QueryParamsKeysResponse_1_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_QueryParamsKeysResponse_1_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.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryParamsKeysResponse_1_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.Message() + concreteValue := valueUnwrapped.Interface().(*KeyInfo) + (*x.m)[concreteKey] = concreteValue +} + +func (x *_QueryParamsKeysResponse_1_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if ok { + return protoreflect.ValueOfMessage(v.ProtoReflect()) + } + newValue := new(KeyInfo) + (*x.m)[concreteKey] = newValue + return protoreflect.ValueOfMessage(newValue.ProtoReflect()) +} + +func (x *_QueryParamsKeysResponse_1_map) NewValue() protoreflect.Value { + v := new(KeyInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryParamsKeysResponse_1_map) IsValid() bool { + return x.m != nil +} + +var ( + md_QueryParamsKeysResponse protoreflect.MessageDescriptor + fd_QueryParamsKeysResponse_keys protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryParamsKeysResponse = File_did_v1_query_proto.Messages().ByName("QueryParamsKeysResponse") + fd_QueryParamsKeysResponse_keys = md_QueryParamsKeysResponse.Fields().ByName("keys") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsKeysResponse)(nil) + +type fastReflection_QueryParamsKeysResponse QueryParamsKeysResponse + +func (x *QueryParamsKeysResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsKeysResponse)(x) +} + +func (x *QueryParamsKeysResponse) 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_QueryParamsKeysResponse_messageType fastReflection_QueryParamsKeysResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsKeysResponse_messageType{} + +type fastReflection_QueryParamsKeysResponse_messageType struct{} + +func (x fastReflection_QueryParamsKeysResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsKeysResponse)(nil) +} +func (x fastReflection_QueryParamsKeysResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsKeysResponse) +} +func (x fastReflection_QueryParamsKeysResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsKeysResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsKeysResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsKeysResponse +} + +// 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_QueryParamsKeysResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsKeysResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsKeysResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsKeysResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsKeysResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsKeysResponse)(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_QueryParamsKeysResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Keys) != 0 { + value := protoreflect.ValueOfMap(&_QueryParamsKeysResponse_1_map{m: &x.Keys}) + if !f(fd_QueryParamsKeysResponse_keys, 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_QueryParamsKeysResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + return len(x.Keys) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse 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_QueryParamsKeysResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + x.Keys = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse 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_QueryParamsKeysResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + if len(x.Keys) == 0 { + return protoreflect.ValueOfMap(&_QueryParamsKeysResponse_1_map{}) + } + mapValue := &_QueryParamsKeysResponse_1_map{m: &x.Keys} + return protoreflect.ValueOfMap(mapValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse 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_QueryParamsKeysResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + mv := value.Map() + cmv := mv.(*_QueryParamsKeysResponse_1_map) + x.Keys = *cmv.m + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse 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_QueryParamsKeysResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + if x.Keys == nil { + x.Keys = make(map[string]*KeyInfo) + } + value := &_QueryParamsKeysResponse_1_map{m: &x.Keys} + return protoreflect.ValueOfMap(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse 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_QueryParamsKeysResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + m := make(map[string]*KeyInfo) + return protoreflect.ValueOfMap(&_QueryParamsKeysResponse_1_map{m: &m}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse 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_QueryParamsKeysResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryParamsKeysResponse", 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_QueryParamsKeysResponse) 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_QueryParamsKeysResponse) 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_QueryParamsKeysResponse) 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_QueryParamsKeysResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsKeysResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Keys) > 0 { + SiZeMaP := func(k string, v *KeyInfo) { + l := 0 + if v != nil { + l = options.Size(v) + } + l += 1 + runtime.Sov(uint64(l)) + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Keys)) + for k := range x.Keys { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Keys[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Keys { + SiZeMaP(k, v) + } + } + } + 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().(*QueryParamsKeysResponse) + 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.Keys) > 0 { + MaRsHaLmAp := func(k string, v *KeyInfo) (protoiface.MarshalOutput, error) { + baseI := i + encoded, err := options.Marshal(v) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + 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] = 0xa + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForKeys := make([]string, 0, len(x.Keys)) + for k := range x.Keys { + keysForKeys = append(keysForKeys, string(k)) + } + sort.Slice(keysForKeys, func(i, j int) bool { + return keysForKeys[i] < keysForKeys[j] + }) + for iNdEx := len(keysForKeys) - 1; iNdEx >= 0; iNdEx-- { + v := x.Keys[string(keysForKeys[iNdEx])] + out, err := MaRsHaLmAp(keysForKeys[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Keys { + v := x.Keys[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + 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().(*QueryParamsKeysResponse) + 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: QueryParamsKeysResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsKeysResponse: 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 Keys", 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.Keys == nil { + x.Keys = make(map[string]*KeyInfo) + } + var mapkey string + var mapvalue *KeyInfo + 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 mapmsglen 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++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postmsgIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = &KeyInfo{} + if err := options.Unmarshal(dAtA[iNdEx:postmsgIndex], mapvalue); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postmsgIndex + } 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.Keys[mapkey] = mapvalue + 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_QueryParamsByKeyResponse protoreflect.MessageDescriptor + fd_QueryParamsByKeyResponse_key protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryParamsByKeyResponse = File_did_v1_query_proto.Messages().ByName("QueryParamsByKeyResponse") + fd_QueryParamsByKeyResponse_key = md_QueryParamsByKeyResponse.Fields().ByName("key") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsByKeyResponse)(nil) + +type fastReflection_QueryParamsByKeyResponse QueryParamsByKeyResponse + +func (x *QueryParamsByKeyResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsByKeyResponse)(x) +} + +func (x *QueryParamsByKeyResponse) 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_QueryParamsByKeyResponse_messageType fastReflection_QueryParamsByKeyResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsByKeyResponse_messageType{} + +type fastReflection_QueryParamsByKeyResponse_messageType struct{} + +func (x fastReflection_QueryParamsByKeyResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsByKeyResponse)(nil) +} +func (x fastReflection_QueryParamsByKeyResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsByKeyResponse) +} +func (x fastReflection_QueryParamsByKeyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsByKeyResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsByKeyResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsByKeyResponse +} + +// 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_QueryParamsByKeyResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsByKeyResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsByKeyResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsByKeyResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsByKeyResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsByKeyResponse)(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_QueryParamsByKeyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Key != nil { + value := protoreflect.ValueOfMessage(x.Key.ProtoReflect()) + if !f(fd_QueryParamsByKeyResponse_key, 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_QueryParamsByKeyResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryParamsByKeyResponse.key": + return x.Key != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse 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_QueryParamsByKeyResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryParamsByKeyResponse.key": + x.Key = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse 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_QueryParamsByKeyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryParamsByKeyResponse.key": + value := x.Key + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse 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_QueryParamsByKeyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryParamsByKeyResponse.key": + x.Key = value.Message().Interface().(*KeyInfo) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse 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_QueryParamsByKeyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsByKeyResponse.key": + if x.Key == nil { + x.Key = new(KeyInfo) + } + return protoreflect.ValueOfMessage(x.Key.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse 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_QueryParamsByKeyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsByKeyResponse.key": + m := new(KeyInfo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse 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_QueryParamsByKeyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryParamsByKeyResponse", 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_QueryParamsByKeyResponse) 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_QueryParamsByKeyResponse) 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_QueryParamsByKeyResponse) 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_QueryParamsByKeyResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsByKeyResponse) + 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.Key != nil { + l = options.Size(x.Key) + 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().(*QueryParamsByKeyResponse) + 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.Key != nil { + encoded, err := options.Marshal(x.Key) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsByKeyResponse) + 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: QueryParamsByKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsByKeyResponse: 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 Key", 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.Key == nil { + x.Key = &KeyInfo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Key); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsByAssetResponse protoreflect.MessageDescriptor + fd_QueryParamsByAssetResponse_asset protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryParamsByAssetResponse = File_did_v1_query_proto.Messages().ByName("QueryParamsByAssetResponse") + fd_QueryParamsByAssetResponse_asset = md_QueryParamsByAssetResponse.Fields().ByName("asset") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsByAssetResponse)(nil) + +type fastReflection_QueryParamsByAssetResponse QueryParamsByAssetResponse + +func (x *QueryParamsByAssetResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsByAssetResponse)(x) +} + +func (x *QueryParamsByAssetResponse) 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_QueryParamsByAssetResponse_messageType fastReflection_QueryParamsByAssetResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsByAssetResponse_messageType{} + +type fastReflection_QueryParamsByAssetResponse_messageType struct{} + +func (x fastReflection_QueryParamsByAssetResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsByAssetResponse)(nil) +} +func (x fastReflection_QueryParamsByAssetResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsByAssetResponse) +} +func (x fastReflection_QueryParamsByAssetResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsByAssetResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsByAssetResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsByAssetResponse +} + +// 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_QueryParamsByAssetResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsByAssetResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsByAssetResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsByAssetResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsByAssetResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsByAssetResponse)(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_QueryParamsByAssetResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Asset != nil { + value := protoreflect.ValueOfMessage(x.Asset.ProtoReflect()) + if !f(fd_QueryParamsByAssetResponse_asset, 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_QueryParamsByAssetResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + return x.Asset != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse 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_QueryParamsByAssetResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + x.Asset = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse 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_QueryParamsByAssetResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + value := x.Asset + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse 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_QueryParamsByAssetResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + x.Asset = value.Message().Interface().(*AssetInfo) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse 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_QueryParamsByAssetResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + if x.Asset == nil { + x.Asset = new(AssetInfo) + } + return protoreflect.ValueOfMessage(x.Asset.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse 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_QueryParamsByAssetResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + m := new(AssetInfo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse 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_QueryParamsByAssetResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryParamsByAssetResponse", 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_QueryParamsByAssetResponse) 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_QueryParamsByAssetResponse) 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_QueryParamsByAssetResponse) 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_QueryParamsByAssetResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsByAssetResponse) + 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.Asset != nil { + l = options.Size(x.Asset) + 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().(*QueryParamsByAssetResponse) + 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.Asset != nil { + encoded, err := options.Marshal(x.Asset) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsByAssetResponse) + 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: QueryParamsByAssetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsByAssetResponse: 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 Asset", 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.Asset == nil { + x.Asset = &AssetInfo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Asset); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryRegistrationOptionsByKeyResponse_1_list)(nil) + +type _QueryRegistrationOptionsByKeyResponse_1_list struct { + list *[]string +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message QueryRegistrationOptionsByKeyResponse at list field RegistrationOptions as it is not of Message kind")) +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryRegistrationOptionsByKeyResponse protoreflect.MessageDescriptor + fd_QueryRegistrationOptionsByKeyResponse_registration_options protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryRegistrationOptionsByKeyResponse = File_did_v1_query_proto.Messages().ByName("QueryRegistrationOptionsByKeyResponse") + fd_QueryRegistrationOptionsByKeyResponse_registration_options = md_QueryRegistrationOptionsByKeyResponse.Fields().ByName("registration_options") +} + +var _ protoreflect.Message = (*fastReflection_QueryRegistrationOptionsByKeyResponse)(nil) + +type fastReflection_QueryRegistrationOptionsByKeyResponse QueryRegistrationOptionsByKeyResponse + +func (x *QueryRegistrationOptionsByKeyResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRegistrationOptionsByKeyResponse)(x) +} + +func (x *QueryRegistrationOptionsByKeyResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryRegistrationOptionsByKeyResponse_messageType fastReflection_QueryRegistrationOptionsByKeyResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryRegistrationOptionsByKeyResponse_messageType{} + +type fastReflection_QueryRegistrationOptionsByKeyResponse_messageType struct{} + +func (x fastReflection_QueryRegistrationOptionsByKeyResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRegistrationOptionsByKeyResponse)(nil) +} +func (x fastReflection_QueryRegistrationOptionsByKeyResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRegistrationOptionsByKeyResponse) +} +func (x fastReflection_QueryRegistrationOptionsByKeyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRegistrationOptionsByKeyResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRegistrationOptionsByKeyResponse +} + +// 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_QueryRegistrationOptionsByKeyResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryRegistrationOptionsByKeyResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) New() protoreflect.Message { + return new(fastReflection_QueryRegistrationOptionsByKeyResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Interface() protoreflect.ProtoMessage { + return (*QueryRegistrationOptionsByKeyResponse)(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_QueryRegistrationOptionsByKeyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.RegistrationOptions) != 0 { + value := protoreflect.ValueOfList(&_QueryRegistrationOptionsByKeyResponse_1_list{list: &x.RegistrationOptions}) + if !f(fd_QueryRegistrationOptionsByKeyResponse_registration_options, 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_QueryRegistrationOptionsByKeyResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + return len(x.RegistrationOptions) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse 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_QueryRegistrationOptionsByKeyResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + x.RegistrationOptions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse 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_QueryRegistrationOptionsByKeyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + if len(x.RegistrationOptions) == 0 { + return protoreflect.ValueOfList(&_QueryRegistrationOptionsByKeyResponse_1_list{}) + } + listValue := &_QueryRegistrationOptionsByKeyResponse_1_list{list: &x.RegistrationOptions} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse 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_QueryRegistrationOptionsByKeyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + lv := value.List() + clv := lv.(*_QueryRegistrationOptionsByKeyResponse_1_list) + x.RegistrationOptions = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse 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_QueryRegistrationOptionsByKeyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + if x.RegistrationOptions == nil { + x.RegistrationOptions = []string{} + } + value := &_QueryRegistrationOptionsByKeyResponse_1_list{list: &x.RegistrationOptions} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse 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_QueryRegistrationOptionsByKeyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + list := []string{} + return protoreflect.ValueOfList(&_QueryRegistrationOptionsByKeyResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse 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_QueryRegistrationOptionsByKeyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryRegistrationOptionsByKeyResponse", 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_QueryRegistrationOptionsByKeyResponse) 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_QueryRegistrationOptionsByKeyResponse) 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_QueryRegistrationOptionsByKeyResponse) 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_QueryRegistrationOptionsByKeyResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRegistrationOptionsByKeyResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.RegistrationOptions) > 0 { + for _, s := range x.RegistrationOptions { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryRegistrationOptionsByKeyResponse) + 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.RegistrationOptions) > 0 { + for iNdEx := len(x.RegistrationOptions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.RegistrationOptions[iNdEx]) + copy(dAtA[i:], x.RegistrationOptions[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RegistrationOptions[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryRegistrationOptionsByKeyResponse) + 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: QueryRegistrationOptionsByKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRegistrationOptionsByKeyResponse: 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 RegistrationOptions", 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.RegistrationOptions = append(x.RegistrationOptions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -1229,6 +4319,8 @@ type QueryRequest 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"` } func (x *QueryRequest) Reset() { @@ -1265,6 +4357,20 @@ func (x *QueryRequest) GetOrigin() string { return "" } +func (x *QueryRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *QueryRequest) GetAsset() string { + if x != nil { + return x.Asset + } + return "" +} + // QueryResolveResponse is the response type for the Query/Resolve RPC method. type QueryResponse struct { state protoimpl.MessageState @@ -1333,6 +4439,217 @@ func (x *QueryResponse) GetParams() *Params { return nil } +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +type QueryParamsAssetsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Assets []*AssetInfo `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` +} + +func (x *QueryParamsAssetsResponse) Reset() { + *x = QueryParamsAssetsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsAssetsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsAssetsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsAssetsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsAssetsResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryParamsAssetsResponse) GetAssets() []*AssetInfo { + if x != nil { + return x.Assets + } + return nil +} + +type QueryParamsKeysResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keys map[string]*KeyInfo `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *QueryParamsKeysResponse) Reset() { + *x = QueryParamsKeysResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsKeysResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsKeysResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsKeysResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsKeysResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryParamsKeysResponse) GetKeys() map[string]*KeyInfo { + if x != nil { + return x.Keys + } + return nil +} + +type QueryParamsByKeyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key *KeyInfo `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *QueryParamsByKeyResponse) Reset() { + *x = QueryParamsByKeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsByKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsByKeyResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsByKeyResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsByKeyResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryParamsByKeyResponse) GetKey() *KeyInfo { + if x != nil { + return x.Key + } + return nil +} + +type QueryParamsByAssetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Asset *AssetInfo `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` +} + +func (x *QueryParamsByAssetResponse) Reset() { + *x = QueryParamsByAssetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsByAssetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsByAssetResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsByAssetResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsByAssetResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryParamsByAssetResponse) GetAsset() *AssetInfo { + if x != nil { + return x.Asset + } + return nil +} + +type QueryRegistrationOptionsByKeyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RegistrationOptions []string `protobuf:"bytes,1,rep,name=registration_options,json=registrationOptions,proto3" json:"registration_options,omitempty"` +} + +func (x *QueryRegistrationOptionsByKeyResponse) Reset() { + *x = QueryRegistrationOptionsByKeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRegistrationOptionsByKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRegistrationOptionsByKeyResponse) ProtoMessage() {} + +// Deprecated: Use QueryRegistrationOptionsByKeyResponse.ProtoReflect.Descriptor instead. +func (*QueryRegistrationOptionsByKeyResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryRegistrationOptionsByKeyResponse) GetRegistrationOptions() []string { + if x != nil { + return x.RegistrationOptions + } + return nil +} + var File_did_v1_query_proto protoreflect.FileDescriptor var file_did_v1_query_proto_rawDesc = []byte{ @@ -1342,46 +4659,111 @@ var file_did_v1_query_proto_rawDesc = []byte{ 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x38, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 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, 0x22, - 0xc4, 0x01, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 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, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 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, 0x12, - 0x2d, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x26, - 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xf2, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x4a, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, + 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, 0x22, 0xc4, 0x01, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, + 0x79, 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, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 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, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x3d, + 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x46, 0x0a, + 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, + 0x1a, 0x48, 0x0a, 0x09, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3d, 0x0a, 0x18, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x79, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x45, 0x0a, 0x1a, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x79, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x22, 0x5a, 0x0a, 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x4b, 0x65, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xc2, 0x05, 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, 0x53, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x5c, 0x0a, 0x0d, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x79, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, - 0x0b, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4a, 0x0a, 0x07, - 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, + 0x16, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, + 0x7b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x7d, 0x12, 0x4f, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x56, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 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, 0x51, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2f, 0x7b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 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, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x7d, + 0x12, 0x70, 0x0a, 0x18, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x21, 0x12, 0x1f, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x2f, + 0x7b, 0x6b, 0x65, 0x79, 0x7d, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x4a, 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, 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 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, 0x51, + 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 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, } var ( @@ -1396,29 +4778,54 @@ 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, 2) +var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_did_v1_query_proto_goTypes = []interface{}{ - (*QueryRequest)(nil), // 0: did.v1.QueryRequest - (*QueryResponse)(nil), // 1: did.v1.QueryResponse - (*Document)(nil), // 2: did.v1.Document - (*ServiceInfo)(nil), // 3: did.v1.ServiceInfo - (*Params)(nil), // 4: did.v1.Params + (*QueryRequest)(nil), // 0: did.v1.QueryRequest + (*QueryResponse)(nil), // 1: did.v1.QueryResponse + (*QueryParamsResponse)(nil), // 2: did.v1.QueryParamsResponse + (*QueryParamsAssetsResponse)(nil), // 3: did.v1.QueryParamsAssetsResponse + (*QueryParamsKeysResponse)(nil), // 4: did.v1.QueryParamsKeysResponse + (*QueryParamsByKeyResponse)(nil), // 5: did.v1.QueryParamsByKeyResponse + (*QueryParamsByAssetResponse)(nil), // 6: did.v1.QueryParamsByAssetResponse + (*QueryRegistrationOptionsByKeyResponse)(nil), // 7: did.v1.QueryRegistrationOptionsByKeyResponse + nil, // 8: did.v1.QueryParamsKeysResponse.KeysEntry + (*Document)(nil), // 9: did.v1.Document + (*ServiceInfo)(nil), // 10: did.v1.ServiceInfo + (*Params)(nil), // 11: did.v1.Params + (*AssetInfo)(nil), // 12: did.v1.AssetInfo + (*KeyInfo)(nil), // 13: did.v1.KeyInfo } var file_did_v1_query_proto_depIdxs = []int32{ - 2, // 0: did.v1.QueryResponse.document:type_name -> did.v1.Document - 3, // 1: did.v1.QueryResponse.service:type_name -> did.v1.ServiceInfo - 4, // 2: did.v1.QueryResponse.params:type_name -> did.v1.Params - 0, // 3: did.v1.Query.Params:input_type -> did.v1.QueryRequest - 0, // 4: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest - 0, // 5: did.v1.Query.Service:input_type -> did.v1.QueryRequest - 1, // 6: did.v1.Query.Params:output_type -> did.v1.QueryResponse - 1, // 7: did.v1.Query.Resolve:output_type -> did.v1.QueryResponse - 1, // 8: did.v1.Query.Service:output_type -> did.v1.QueryResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 9, // 0: did.v1.QueryResponse.document:type_name -> did.v1.Document + 10, // 1: did.v1.QueryResponse.service:type_name -> did.v1.ServiceInfo + 11, // 2: did.v1.QueryResponse.params:type_name -> did.v1.Params + 11, // 3: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params + 12, // 4: did.v1.QueryParamsAssetsResponse.assets:type_name -> did.v1.AssetInfo + 8, // 5: did.v1.QueryParamsKeysResponse.keys:type_name -> did.v1.QueryParamsKeysResponse.KeysEntry + 13, // 6: did.v1.QueryParamsByKeyResponse.key:type_name -> did.v1.KeyInfo + 12, // 7: did.v1.QueryParamsByAssetResponse.asset:type_name -> did.v1.AssetInfo + 13, // 8: did.v1.QueryParamsKeysResponse.KeysEntry.value:type_name -> did.v1.KeyInfo + 0, // 9: did.v1.Query.Params:input_type -> did.v1.QueryRequest + 0, // 10: did.v1.Query.ParamsAssets:input_type -> did.v1.QueryRequest + 0, // 11: did.v1.Query.ParamsByAsset:input_type -> did.v1.QueryRequest + 0, // 12: did.v1.Query.ParamsKeys:input_type -> did.v1.QueryRequest + 0, // 13: did.v1.Query.ParamsByKey:input_type -> did.v1.QueryRequest + 0, // 14: did.v1.Query.RegistrationOptionsByKey:input_type -> did.v1.QueryRequest + 0, // 15: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest + 0, // 16: did.v1.Query.Service:input_type -> did.v1.QueryRequest + 2, // 17: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse + 1, // 18: did.v1.Query.ParamsAssets:output_type -> did.v1.QueryResponse + 1, // 19: did.v1.Query.ParamsByAsset:output_type -> did.v1.QueryResponse + 1, // 20: did.v1.Query.ParamsKeys:output_type -> did.v1.QueryResponse + 1, // 21: did.v1.Query.ParamsByKey:output_type -> did.v1.QueryResponse + 1, // 22: did.v1.Query.RegistrationOptionsByKey:output_type -> did.v1.QueryResponse + 1, // 23: did.v1.Query.Resolve:output_type -> did.v1.QueryResponse + 1, // 24: did.v1.Query.Service:output_type -> did.v1.QueryResponse + 17, // [17:25] is the sub-list for method output_type + 9, // [9:17] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_did_v1_query_proto_init() } @@ -1453,6 +4860,78 @@ func file_did_v1_query_proto_init() { return nil } } + file_did_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsAssetsResponse); 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.(*QueryParamsKeysResponse); 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.(*QueryParamsByKeyResponse); 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.(*QueryParamsByAssetResponse); 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.(*QueryRegistrationOptionsByKeyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1460,7 +4939,7 @@ func file_did_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 9, NumExtensions: 0, NumServices: 1, }, diff --git a/api/did/v1/query_grpc.pb.go b/api/did/v1/query_grpc.pb.go index 139aec38d..553f71c68 100644 --- a/api/did/v1/query_grpc.pb.go +++ b/api/did/v1/query_grpc.pb.go @@ -19,9 +19,14 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_Params_FullMethodName = "/did.v1.Query/Params" - Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" - Query_Service_FullMethodName = "/did.v1.Query/Service" + Query_Params_FullMethodName = "/did.v1.Query/Params" + Query_ParamsAssets_FullMethodName = "/did.v1.Query/ParamsAssets" + Query_ParamsByAsset_FullMethodName = "/did.v1.Query/ParamsByAsset" + Query_ParamsKeys_FullMethodName = "/did.v1.Query/ParamsKeys" + Query_ParamsByKey_FullMethodName = "/did.v1.Query/ParamsByKey" + Query_RegistrationOptionsByKey_FullMethodName = "/did.v1.Query/RegistrationOptionsByKey" + Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" + Query_Service_FullMethodName = "/did.v1.Query/Service" ) // QueryClient is the client API for Query service. @@ -29,7 +34,17 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type QueryClient interface { // Params queries all parameters of the module. - Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // ParamsAssets queries all parameters of the module. + ParamsAssets(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByAsset(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // ParamsKeys queries all parameters of the module. + ParamsKeys(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + RegistrationOptionsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) // Resolve queries the DID document by its id. Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) // Service returns associated ServiceInfo for a given Origin @@ -46,8 +61,8 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { return &queryClient{cc} } -func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { - out := new(QueryResponse) +func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) if err != nil { return nil, err @@ -55,6 +70,51 @@ func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc return out, nil } +func (c *queryClient) ParamsAssets(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Query_ParamsAssets_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ParamsByAsset(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Query_ParamsByAsset_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ParamsKeys(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Query_ParamsKeys_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ParamsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Query_ParamsByKey_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RegistrationOptionsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Query_RegistrationOptionsByKey_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { out := new(QueryResponse) err := c.cc.Invoke(ctx, Query_Resolve_FullMethodName, in, out, opts...) @@ -78,7 +138,17 @@ func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grp // for forward compatibility type QueryServer interface { // Params queries all parameters of the module. - Params(context.Context, *QueryRequest) (*QueryResponse, error) + Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) + // ParamsAssets queries all parameters of the module. + ParamsAssets(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByAsset(context.Context, *QueryRequest) (*QueryResponse, error) + // ParamsKeys queries all parameters of the module. + ParamsKeys(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByKey(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + RegistrationOptionsByKey(context.Context, *QueryRequest) (*QueryResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResponse, error) // Service returns associated ServiceInfo for a given Origin @@ -92,9 +162,24 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryResponse, error) { +func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (UnimplementedQueryServer) ParamsAssets(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsAssets not implemented") +} +func (UnimplementedQueryServer) ParamsByAsset(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsByAsset not implemented") +} +func (UnimplementedQueryServer) ParamsKeys(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsKeys not implemented") +} +func (UnimplementedQueryServer) ParamsByKey(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsByKey not implemented") +} +func (UnimplementedQueryServer) RegistrationOptionsByKey(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegistrationOptionsByKey not implemented") +} func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } @@ -132,6 +217,96 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_ParamsAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsAssets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ParamsAssets_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsAssets(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ParamsByAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsByAsset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ParamsByAsset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsByAsset(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ParamsKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsKeys(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ParamsKeys_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsKeys(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ParamsByKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsByKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ParamsByKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsByKey(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RegistrationOptionsByKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RegistrationOptionsByKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_RegistrationOptionsByKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RegistrationOptionsByKey(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryRequest) if err := dec(in); err != nil { @@ -179,6 +354,26 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "ParamsAssets", + Handler: _Query_ParamsAssets_Handler, + }, + { + MethodName: "ParamsByAsset", + Handler: _Query_ParamsByAsset_Handler, + }, + { + MethodName: "ParamsKeys", + Handler: _Query_ParamsKeys_Handler, + }, + { + MethodName: "ParamsByKey", + Handler: _Query_ParamsByKey_Handler, + }, + { + MethodName: "RegistrationOptionsByKey", + Handler: _Query_RegistrationOptionsByKey_Handler, + }, { MethodName: "Resolve", Handler: _Query_Resolve_Handler, diff --git a/api/did/v1/tx.pulsar.go b/api/did/v1/tx.pulsar.go index bee6ba4bc..062788108 100644 --- a/api/did/v1/tx.pulsar.go +++ b/api/did/v1/tx.pulsar.go @@ -108,8 +108,8 @@ func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescript return } } - if x.Token != nil { - value := protoreflect.ValueOfMessage(x.Token.ProtoReflect()) + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) if !f(fd_MsgUpdateParams_token, value) { return } @@ -134,7 +134,7 @@ func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bo case "did.v1.MsgUpdateParams.params": return x.Params != nil case "did.v1.MsgUpdateParams.token": - return x.Token != nil + return x.Token != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -156,7 +156,7 @@ func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) case "did.v1.MsgUpdateParams.params": x.Params = nil case "did.v1.MsgUpdateParams.token": - x.Token = nil + x.Token = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -181,7 +181,7 @@ func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescri return protoreflect.ValueOfMessage(value.ProtoReflect()) case "did.v1.MsgUpdateParams.token": value := x.Token - return protoreflect.ValueOfMessage(value.ProtoReflect()) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -207,7 +207,7 @@ func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, va case "did.v1.MsgUpdateParams.params": x.Params = value.Message().Interface().(*Params) case "did.v1.MsgUpdateParams.token": - x.Token = value.Message().Interface().(*Token) + x.Token = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -233,13 +233,10 @@ func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor x.Params = new(Params) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "did.v1.MsgUpdateParams.token": - if x.Token == nil { - x.Token = new(Token) - } - return protoreflect.ValueOfMessage(x.Token.ProtoReflect()) case "did.v1.MsgUpdateParams.authority": panic(fmt.Errorf("field authority of message did.v1.MsgUpdateParams is not mutable")) + case "did.v1.MsgUpdateParams.token": + panic(fmt.Errorf("field token of message did.v1.MsgUpdateParams is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -259,8 +256,7 @@ func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescripto m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.MsgUpdateParams.token": - m := new(Token) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -338,8 +334,8 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } - if x.Token != nil { - l = options.Size(x.Token) + l = len(x.Token) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -371,17 +367,10 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Token != nil { - encoded, err := options.Marshal(x.Token) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) i-- dAtA[i] = 0x1a } @@ -527,7 +516,7 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -537,27 +526,23 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + 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 } - if x.Token == nil { - x.Token = &Token{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Token); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2184,8 +2169,8 @@ func (x *fastReflection_MsgProveWitness) Range(f func(protoreflect.FieldDescript return } } - if x.Token != nil { - value := protoreflect.ValueOfMessage(x.Token.ProtoReflect()) + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) if !f(fd_MsgProveWitness_token, value) { return } @@ -2212,7 +2197,7 @@ func (x *fastReflection_MsgProveWitness) Has(fd protoreflect.FieldDescriptor) bo case "did.v1.MsgProveWitness.witness": return len(x.Witness) != 0 case "did.v1.MsgProveWitness.token": - return x.Token != nil + return x.Token != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) @@ -2236,7 +2221,7 @@ func (x *fastReflection_MsgProveWitness) Clear(fd protoreflect.FieldDescriptor) case "did.v1.MsgProveWitness.witness": x.Witness = nil case "did.v1.MsgProveWitness.token": - x.Token = nil + x.Token = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) @@ -2264,7 +2249,7 @@ func (x *fastReflection_MsgProveWitness) Get(descriptor protoreflect.FieldDescri return protoreflect.ValueOfBytes(value) case "did.v1.MsgProveWitness.token": value := x.Token - return protoreflect.ValueOfMessage(value.ProtoReflect()) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) @@ -2292,7 +2277,7 @@ func (x *fastReflection_MsgProveWitness) Set(fd protoreflect.FieldDescriptor, va case "did.v1.MsgProveWitness.witness": x.Witness = value.Bytes() case "did.v1.MsgProveWitness.token": - x.Token = value.Message().Interface().(*Token) + x.Token = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) @@ -2313,17 +2298,14 @@ func (x *fastReflection_MsgProveWitness) Set(fd protoreflect.FieldDescriptor, va // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgProveWitness) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.MsgProveWitness.token": - if x.Token == nil { - x.Token = new(Token) - } - return protoreflect.ValueOfMessage(x.Token.ProtoReflect()) case "did.v1.MsgProveWitness.authority": panic(fmt.Errorf("field authority of message did.v1.MsgProveWitness is not mutable")) case "did.v1.MsgProveWitness.property": panic(fmt.Errorf("field property of message did.v1.MsgProveWitness is not mutable")) case "did.v1.MsgProveWitness.witness": panic(fmt.Errorf("field witness of message did.v1.MsgProveWitness is not mutable")) + case "did.v1.MsgProveWitness.token": + panic(fmt.Errorf("field token of message did.v1.MsgProveWitness is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) @@ -2344,8 +2326,7 @@ func (x *fastReflection_MsgProveWitness) NewField(fd protoreflect.FieldDescripto case "did.v1.MsgProveWitness.witness": return protoreflect.ValueOfBytes(nil) case "did.v1.MsgProveWitness.token": - m := new(Token) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) @@ -2427,8 +2408,8 @@ func (x *fastReflection_MsgProveWitness) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Token != nil { - l = options.Size(x.Token) + l = len(x.Token) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -2460,17 +2441,10 @@ func (x *fastReflection_MsgProveWitness) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Token != nil { - encoded, err := options.Marshal(x.Token) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) i-- dAtA[i] = 0x22 } @@ -2646,7 +2620,7 @@ func (x *fastReflection_MsgProveWitness) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2656,27 +2630,23 @@ func (x *fastReflection_MsgProveWitness) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + 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 } - if x.Token == nil { - x.Token = &Token{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Token); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3271,8 +3241,8 @@ func (x *fastReflection_MsgSyncController) Range(f func(protoreflect.FieldDescri return } } - if x.Token != nil { - value := protoreflect.ValueOfMessage(x.Token.ProtoReflect()) + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) if !f(fd_MsgSyncController_token, value) { return } @@ -3295,7 +3265,7 @@ func (x *fastReflection_MsgSyncController) Has(fd protoreflect.FieldDescriptor) case "did.v1.MsgSyncController.controller": return x.Controller != "" case "did.v1.MsgSyncController.token": - return x.Token != nil + return x.Token != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) @@ -3315,7 +3285,7 @@ func (x *fastReflection_MsgSyncController) Clear(fd protoreflect.FieldDescriptor case "did.v1.MsgSyncController.controller": x.Controller = "" case "did.v1.MsgSyncController.token": - x.Token = nil + x.Token = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) @@ -3337,7 +3307,7 @@ func (x *fastReflection_MsgSyncController) Get(descriptor protoreflect.FieldDesc return protoreflect.ValueOfString(value) case "did.v1.MsgSyncController.token": value := x.Token - return protoreflect.ValueOfMessage(value.ProtoReflect()) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) @@ -3361,7 +3331,7 @@ func (x *fastReflection_MsgSyncController) Set(fd protoreflect.FieldDescriptor, case "did.v1.MsgSyncController.controller": x.Controller = value.Interface().(string) case "did.v1.MsgSyncController.token": - x.Token = value.Message().Interface().(*Token) + x.Token = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) @@ -3382,13 +3352,10 @@ func (x *fastReflection_MsgSyncController) Set(fd protoreflect.FieldDescriptor, // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgSyncController) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.MsgSyncController.token": - if x.Token == nil { - x.Token = new(Token) - } - return protoreflect.ValueOfMessage(x.Token.ProtoReflect()) case "did.v1.MsgSyncController.controller": panic(fmt.Errorf("field controller of message did.v1.MsgSyncController is not mutable")) + case "did.v1.MsgSyncController.token": + panic(fmt.Errorf("field token of message did.v1.MsgSyncController is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) @@ -3405,8 +3372,7 @@ func (x *fastReflection_MsgSyncController) NewField(fd protoreflect.FieldDescrip case "did.v1.MsgSyncController.controller": return protoreflect.ValueOfString("") case "did.v1.MsgSyncController.token": - m := new(Token) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) @@ -3480,8 +3446,8 @@ func (x *fastReflection_MsgSyncController) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Token != nil { - l = options.Size(x.Token) + l = len(x.Token) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -3513,17 +3479,10 @@ func (x *fastReflection_MsgSyncController) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Token != nil { - encoded, err := options.Marshal(x.Token) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) i-- dAtA[i] = 0x1a } @@ -3619,7 +3578,7 @@ func (x *fastReflection_MsgSyncController) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3629,27 +3588,23 @@ func (x *fastReflection_MsgSyncController) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + 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 } - if x.Token == nil { - x.Token = &Token{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Token); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5586,8 +5541,8 @@ func (x *fastReflection_MsgAuthorizeService) Range(f func(protoreflect.FieldDesc return } } - if x.Token != nil { - value := protoreflect.ValueOfMessage(x.Token.ProtoReflect()) + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) if !f(fd_MsgAuthorizeService_token, value) { return } @@ -5614,7 +5569,7 @@ func (x *fastReflection_MsgAuthorizeService) Has(fd protoreflect.FieldDescriptor case "did.v1.MsgAuthorizeService.scopes": return x.Scopes != nil case "did.v1.MsgAuthorizeService.token": - return x.Token != nil + return x.Token != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) @@ -5638,7 +5593,7 @@ func (x *fastReflection_MsgAuthorizeService) Clear(fd protoreflect.FieldDescript case "did.v1.MsgAuthorizeService.scopes": x.Scopes = nil case "did.v1.MsgAuthorizeService.token": - x.Token = nil + x.Token = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) @@ -5666,7 +5621,7 @@ func (x *fastReflection_MsgAuthorizeService) Get(descriptor protoreflect.FieldDe return protoreflect.ValueOfMessage(value.ProtoReflect()) case "did.v1.MsgAuthorizeService.token": value := x.Token - return protoreflect.ValueOfMessage(value.ProtoReflect()) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) @@ -5694,7 +5649,7 @@ func (x *fastReflection_MsgAuthorizeService) Set(fd protoreflect.FieldDescriptor case "did.v1.MsgAuthorizeService.scopes": x.Scopes = value.Message().Interface().(*Permissions) case "did.v1.MsgAuthorizeService.token": - x.Token = value.Message().Interface().(*Token) + x.Token = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) @@ -5720,15 +5675,12 @@ func (x *fastReflection_MsgAuthorizeService) Mutable(fd protoreflect.FieldDescri x.Scopes = new(Permissions) } return protoreflect.ValueOfMessage(x.Scopes.ProtoReflect()) - case "did.v1.MsgAuthorizeService.token": - if x.Token == nil { - x.Token = new(Token) - } - return protoreflect.ValueOfMessage(x.Token.ProtoReflect()) case "did.v1.MsgAuthorizeService.controller": panic(fmt.Errorf("field controller of message did.v1.MsgAuthorizeService is not mutable")) case "did.v1.MsgAuthorizeService.origin": panic(fmt.Errorf("field origin of message did.v1.MsgAuthorizeService is not mutable")) + case "did.v1.MsgAuthorizeService.token": + panic(fmt.Errorf("field token of message did.v1.MsgAuthorizeService is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) @@ -5750,8 +5702,7 @@ func (x *fastReflection_MsgAuthorizeService) NewField(fd protoreflect.FieldDescr m := new(Permissions) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.MsgAuthorizeService.token": - m := new(Token) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) @@ -5833,8 +5784,8 @@ func (x *fastReflection_MsgAuthorizeService) ProtoMethods() *protoiface.Methods l = options.Size(x.Scopes) n += 1 + l + runtime.Sov(uint64(l)) } - if x.Token != nil { - l = options.Size(x.Token) + l = len(x.Token) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -5866,17 +5817,10 @@ func (x *fastReflection_MsgAuthorizeService) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Token != nil { - encoded, err := options.Marshal(x.Token) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) i-- dAtA[i] = 0x22 } @@ -6061,7 +6005,7 @@ func (x *fastReflection_MsgAuthorizeService) ProtoMethods() *protoiface.Methods if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -6071,27 +6015,23 @@ func (x *fastReflection_MsgAuthorizeService) ProtoMethods() *protoiface.Methods } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + 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 } - if x.Token == nil { - x.Token = &Token{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Token); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6212,8 +6152,8 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) Range(f func(protoreflect.F return } } - if x.Token != nil { - value := protoreflect.ValueOfMessage(x.Token.ProtoReflect()) + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) if !f(fd_MsgAuthorizeServiceResponse_token, value) { return } @@ -6236,7 +6176,7 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) Has(fd protoreflect.FieldDe case "did.v1.MsgAuthorizeServiceResponse.success": return x.Success != false case "did.v1.MsgAuthorizeServiceResponse.token": - return x.Token != nil + return x.Token != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) @@ -6256,7 +6196,7 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) Clear(fd protoreflect.Field case "did.v1.MsgAuthorizeServiceResponse.success": x.Success = false case "did.v1.MsgAuthorizeServiceResponse.token": - x.Token = nil + x.Token = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) @@ -6278,7 +6218,7 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) Get(descriptor protoreflect return protoreflect.ValueOfBool(value) case "did.v1.MsgAuthorizeServiceResponse.token": value := x.Token - return protoreflect.ValueOfMessage(value.ProtoReflect()) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) @@ -6302,7 +6242,7 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) Set(fd protoreflect.FieldDe case "did.v1.MsgAuthorizeServiceResponse.success": x.Success = value.Bool() case "did.v1.MsgAuthorizeServiceResponse.token": - x.Token = value.Message().Interface().(*Token) + x.Token = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) @@ -6323,13 +6263,10 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) Set(fd protoreflect.FieldDe // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgAuthorizeServiceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.MsgAuthorizeServiceResponse.token": - if x.Token == nil { - x.Token = new(Token) - } - return protoreflect.ValueOfMessage(x.Token.ProtoReflect()) case "did.v1.MsgAuthorizeServiceResponse.success": panic(fmt.Errorf("field success of message did.v1.MsgAuthorizeServiceResponse is not mutable")) + case "did.v1.MsgAuthorizeServiceResponse.token": + panic(fmt.Errorf("field token of message did.v1.MsgAuthorizeServiceResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) @@ -6346,8 +6283,7 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) NewField(fd protoreflect.Fi case "did.v1.MsgAuthorizeServiceResponse.success": return protoreflect.ValueOfBool(false) case "did.v1.MsgAuthorizeServiceResponse.token": - m := new(Token) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) @@ -6420,8 +6356,8 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) ProtoMethods() *protoiface. if x.Success { n += 2 } - if x.Token != nil { - l = options.Size(x.Token) + l = len(x.Token) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -6453,17 +6389,10 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) ProtoMethods() *protoiface. i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Token != nil { - encoded, err := options.Marshal(x.Token) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) i-- dAtA[i] = 0x12 } @@ -6550,7 +6479,7 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) ProtoMethods() *protoiface. if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -6560,27 +6489,23 @@ func (x *fastReflection_MsgAuthorizeServiceResponse) ProtoMethods() *protoiface. } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + 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 } - if x.Token == nil { - x.Token = &Token{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Token); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6709,8 +6634,8 @@ func (x *fastReflection_MsgRegisterService) Range(f func(protoreflect.FieldDescr return } } - if x.Token != nil { - value := protoreflect.ValueOfMessage(x.Token.ProtoReflect()) + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) if !f(fd_MsgRegisterService_token, value) { return } @@ -6735,7 +6660,7 @@ func (x *fastReflection_MsgRegisterService) Has(fd protoreflect.FieldDescriptor) case "did.v1.MsgRegisterService.service": return x.Service != nil case "did.v1.MsgRegisterService.token": - return x.Token != nil + return x.Token != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) @@ -6757,7 +6682,7 @@ func (x *fastReflection_MsgRegisterService) Clear(fd protoreflect.FieldDescripto case "did.v1.MsgRegisterService.service": x.Service = nil case "did.v1.MsgRegisterService.token": - x.Token = nil + x.Token = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) @@ -6782,7 +6707,7 @@ func (x *fastReflection_MsgRegisterService) Get(descriptor protoreflect.FieldDes return protoreflect.ValueOfMessage(value.ProtoReflect()) case "did.v1.MsgRegisterService.token": value := x.Token - return protoreflect.ValueOfMessage(value.ProtoReflect()) + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) @@ -6808,7 +6733,7 @@ func (x *fastReflection_MsgRegisterService) Set(fd protoreflect.FieldDescriptor, case "did.v1.MsgRegisterService.service": x.Service = value.Message().Interface().(*Service) case "did.v1.MsgRegisterService.token": - x.Token = value.Message().Interface().(*Token) + x.Token = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) @@ -6834,13 +6759,10 @@ func (x *fastReflection_MsgRegisterService) Mutable(fd protoreflect.FieldDescrip x.Service = new(Service) } return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) - case "did.v1.MsgRegisterService.token": - if x.Token == nil { - x.Token = new(Token) - } - return protoreflect.ValueOfMessage(x.Token.ProtoReflect()) case "did.v1.MsgRegisterService.controller": panic(fmt.Errorf("field controller of message did.v1.MsgRegisterService is not mutable")) + case "did.v1.MsgRegisterService.token": + panic(fmt.Errorf("field token of message did.v1.MsgRegisterService is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) @@ -6860,8 +6782,7 @@ func (x *fastReflection_MsgRegisterService) NewField(fd protoreflect.FieldDescri m := new(Service) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.MsgRegisterService.token": - m := new(Token) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) @@ -6939,8 +6860,8 @@ func (x *fastReflection_MsgRegisterService) ProtoMethods() *protoiface.Methods { l = options.Size(x.Service) n += 1 + l + runtime.Sov(uint64(l)) } - if x.Token != nil { - l = options.Size(x.Token) + l = len(x.Token) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -6972,17 +6893,10 @@ func (x *fastReflection_MsgRegisterService) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Token != nil { - encoded, err := options.Marshal(x.Token) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) i-- dAtA[i] = 0x1a } @@ -7128,7 +7042,7 @@ func (x *fastReflection_MsgRegisterService) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -7138,27 +7052,23 @@ func (x *fastReflection_MsgRegisterService) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + 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 } - if x.Token == nil { - x.Token = &Token{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Token); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -7695,7 +7605,7 @@ type MsgUpdateParams struct { // params defines the parameters to update. Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` // token is the macron token to authenticate the operation. - Token *Token `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` } func (x *MsgUpdateParams) Reset() { @@ -7732,11 +7642,11 @@ func (x *MsgUpdateParams) GetParams() *Params { return nil } -func (x *MsgUpdateParams) GetToken() *Token { +func (x *MsgUpdateParams) GetToken() string { if x != nil { return x.Token } - return nil + return "" } // MsgUpdateParamsResponse defines the response structure for executing a @@ -7901,7 +7811,7 @@ type MsgProveWitness struct { // Witness Value is the bytes of the witness. Witness []byte `protobuf:"bytes,3,opt,name=witness,proto3" json:"witness,omitempty"` // token is the macron token to authenticate the operation. - Token *Token `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` } func (x *MsgProveWitness) Reset() { @@ -7945,11 +7855,11 @@ func (x *MsgProveWitness) GetWitness() []byte { return nil } -func (x *MsgProveWitness) GetToken() *Token { +func (x *MsgProveWitness) GetToken() string { if x != nil { return x.Token } - return nil + return "" } // MsgProveWitnessResponse is the response type for the ProveWitness RPC. @@ -8005,7 +7915,7 @@ type MsgSyncController struct { // controller is the address of the controller to sync. Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` // Token is the public token to authenticate the operation. - Token *Token `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` } func (x *MsgSyncController) Reset() { @@ -8035,11 +7945,11 @@ func (x *MsgSyncController) GetController() string { return "" } -func (x *MsgSyncController) GetToken() *Token { +func (x *MsgSyncController) GetToken() string { if x != nil { return x.Token } - return nil + return "" } // MsgSyncControllerResponse is the response type for the SyncController RPC. @@ -8210,7 +8120,7 @@ type MsgAuthorizeService struct { // Permissions is the scope of the service. Scopes *Permissions `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` // token is the macron token to authenticate the operation. - Token *Token `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` } func (x *MsgAuthorizeService) Reset() { @@ -8254,11 +8164,11 @@ func (x *MsgAuthorizeService) GetScopes() *Permissions { return nil } -func (x *MsgAuthorizeService) GetToken() *Token { +func (x *MsgAuthorizeService) GetToken() string { if x != nil { return x.Token } - return nil + return "" } // MsgAuthorizeServiceResponse is the response type for the AuthorizeService RPC. @@ -8268,7 +8178,7 @@ type MsgAuthorizeServiceResponse struct { unknownFields protoimpl.UnknownFields Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Token *Token `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` } func (x *MsgAuthorizeServiceResponse) Reset() { @@ -8298,11 +8208,11 @@ func (x *MsgAuthorizeServiceResponse) GetSuccess() bool { return false } -func (x *MsgAuthorizeServiceResponse) GetToken() *Token { +func (x *MsgAuthorizeServiceResponse) GetToken() string { if x != nil { return x.Token } - return nil + return "" } // MsgRegisterService is the message type for the RegisterService RPC. @@ -8316,7 +8226,7 @@ type MsgRegisterService struct { // origin is the origin of the request in wildcard form. Requires valid TXT record in DNS. Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` // token is the macron token to authenticate the operation. - Token *Token `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` } func (x *MsgRegisterService) Reset() { @@ -8353,11 +8263,11 @@ func (x *MsgRegisterService) GetService() *Service { return nil } -func (x *MsgRegisterService) GetToken() *Token { +func (x *MsgRegisterService) GetToken() string { if x != nil { return x.Token } - return nil + return "" } // MsgRegisterServiceResponse is the response type for the RegisterService RPC. @@ -8415,7 +8325,7 @@ var file_did_v1_tx_proto_rawDesc = []byte{ 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, @@ -8423,163 +8333,157 @@ var file_did_v1_tx_proto_rawDesc = []byte{ 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, - 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, - 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, - 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x36, 0x0a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xa0, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x41, - 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x65, 0x78, - 0x70, 0x69, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, - 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x22, 0xb4, 0x01, 0x0a, 0x0f, 0x4d, - 0x73, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x57, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x36, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0e, + 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, + 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x4d, 0x73, + 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x22, 0x4f, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x57, 0x69, 0x74, - 0x6e, 0x65, 0x73, 0x73, 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, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x22, 0x83, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, - 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x35, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, - 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 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, 0x22, - 0xcb, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, - 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x63, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x40, 0x0a, 0x1c, 0x63, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x1a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3a, 0x0e, 0x82, - 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x81, 0x02, - 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 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, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 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, 0x22, 0xca, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xa0, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, + 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x79, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, + 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x22, 0xa5, 0x01, 0x0a, 0x0f, + 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x57, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x12, + 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x22, 0x4f, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x57, + 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 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, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x22, 0x74, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 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, 0x2b, 0x0a, 0x06, 0x73, - 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0f, 0x82, - 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x5c, - 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 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, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xaf, 0x01, 0x0a, - 0x12, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x29, 0x0a, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0f, 0x82, - 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x48, - 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 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, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x32, 0xf8, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, - 0x12, 0x48, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1f, 0x2e, 0x64, 0x69, 0x64, 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, 0x54, 0x0a, 0x10, 0x41, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1b, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x23, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, + 0x6c, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x35, 0x0a, 0x19, 0x4d, 0x73, + 0x67, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 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, 0x22, 0xcb, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x40, 0x0a, + 0x1c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x1a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3a, + 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, + 0x81, 0x02, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 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, 0x38, 0x0a, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 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, 0x22, 0xbb, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 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, 0x2b, 0x0a, + 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x22, 0x4d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4b, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, - 0x74, 0x12, 0x18, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x6c, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x1a, 0x20, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, - 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, - 0x0e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, - 0x19, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x1a, 0x21, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, - 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, - 0xb0, 0x2a, 0x01, 0x42, 0x77, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x42, 0x07, 0x54, 0x78, 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, + 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, + 0x22, 0xa0, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x22, 0x48, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 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, 0x10, 0x0a, 0x03, 0x64, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x32, 0xf8, 0x03, + 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x48, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1f, + 0x2e, 0x64, 0x69, 0x64, 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, + 0x54, 0x0a, 0x10, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x1a, 0x23, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, + 0x1a, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x1a, + 0x21, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, + 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x22, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x77, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 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 ( @@ -8612,38 +8516,31 @@ var file_did_v1_tx_proto_goTypes = []interface{}{ (*MsgRegisterServiceResponse)(nil), // 13: did.v1.MsgRegisterServiceResponse nil, // 14: did.v1.MsgRegisterControllerResponse.AccountsEntry (*Params)(nil), // 15: did.v1.Params - (*Token)(nil), // 16: did.v1.Token - (*Permissions)(nil), // 17: did.v1.Permissions - (*Service)(nil), // 18: did.v1.Service + (*Permissions)(nil), // 16: did.v1.Permissions + (*Service)(nil), // 17: did.v1.Service } var file_did_v1_tx_proto_depIdxs = []int32{ 15, // 0: did.v1.MsgUpdateParams.params:type_name -> did.v1.Params - 16, // 1: did.v1.MsgUpdateParams.token:type_name -> did.v1.Token - 16, // 2: did.v1.MsgProveWitness.token:type_name -> did.v1.Token - 16, // 3: did.v1.MsgSyncController.token:type_name -> did.v1.Token - 14, // 4: did.v1.MsgRegisterControllerResponse.accounts:type_name -> did.v1.MsgRegisterControllerResponse.AccountsEntry - 17, // 5: did.v1.MsgAuthorizeService.scopes:type_name -> did.v1.Permissions - 16, // 6: did.v1.MsgAuthorizeService.token:type_name -> did.v1.Token - 16, // 7: did.v1.MsgAuthorizeServiceResponse.token:type_name -> did.v1.Token - 18, // 8: did.v1.MsgRegisterService.service:type_name -> did.v1.Service - 16, // 9: did.v1.MsgRegisterService.token:type_name -> did.v1.Token - 0, // 10: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams - 10, // 11: did.v1.Msg.AuthorizeService:input_type -> did.v1.MsgAuthorizeService - 2, // 12: did.v1.Msg.AllocateVault:input_type -> did.v1.MsgAllocateVault - 6, // 13: did.v1.Msg.SyncController:input_type -> did.v1.MsgSyncController - 8, // 14: did.v1.Msg.RegisterController:input_type -> did.v1.MsgRegisterController - 12, // 15: did.v1.Msg.RegisterService:input_type -> did.v1.MsgRegisterService - 1, // 16: did.v1.Msg.UpdateParams:output_type -> did.v1.MsgUpdateParamsResponse - 11, // 17: did.v1.Msg.AuthorizeService:output_type -> did.v1.MsgAuthorizeServiceResponse - 3, // 18: did.v1.Msg.AllocateVault:output_type -> did.v1.MsgAllocateVaultResponse - 7, // 19: did.v1.Msg.SyncController:output_type -> did.v1.MsgSyncControllerResponse - 9, // 20: did.v1.Msg.RegisterController:output_type -> did.v1.MsgRegisterControllerResponse - 13, // 21: did.v1.Msg.RegisterService:output_type -> did.v1.MsgRegisterServiceResponse - 16, // [16:22] is the sub-list for method output_type - 10, // [10:16] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 14, // 1: did.v1.MsgRegisterControllerResponse.accounts:type_name -> did.v1.MsgRegisterControllerResponse.AccountsEntry + 16, // 2: did.v1.MsgAuthorizeService.scopes:type_name -> did.v1.Permissions + 17, // 3: did.v1.MsgRegisterService.service:type_name -> did.v1.Service + 0, // 4: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams + 10, // 5: did.v1.Msg.AuthorizeService:input_type -> did.v1.MsgAuthorizeService + 2, // 6: did.v1.Msg.AllocateVault:input_type -> did.v1.MsgAllocateVault + 6, // 7: did.v1.Msg.SyncController:input_type -> did.v1.MsgSyncController + 8, // 8: did.v1.Msg.RegisterController:input_type -> did.v1.MsgRegisterController + 12, // 9: did.v1.Msg.RegisterService:input_type -> did.v1.MsgRegisterService + 1, // 10: did.v1.Msg.UpdateParams:output_type -> did.v1.MsgUpdateParamsResponse + 11, // 11: did.v1.Msg.AuthorizeService:output_type -> did.v1.MsgAuthorizeServiceResponse + 3, // 12: did.v1.Msg.AllocateVault:output_type -> did.v1.MsgAllocateVaultResponse + 7, // 13: did.v1.Msg.SyncController:output_type -> did.v1.MsgSyncControllerResponse + 9, // 14: did.v1.Msg.RegisterController:output_type -> did.v1.MsgRegisterControllerResponse + 13, // 15: did.v1.Msg.RegisterService:output_type -> did.v1.MsgRegisterServiceResponse + 10, // [10:16] is the sub-list for method output_type + 4, // [4:10] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_did_v1_tx_proto_init() } diff --git a/app/app.go b/app/app.go index 77134f700..45893a3e4 100644 --- a/app/app.go +++ b/app/app.go @@ -611,6 +611,7 @@ func NewChainApp( appCodec, sdkruntime.NewKVStoreService(keys[didtypes.StoreKey]), app.AccountKeeper, + app.NFTKeeper, app.StakingKeeper, logger, authtypes.NewModuleAddress(govtypes.ModuleName).String(), @@ -872,7 +873,7 @@ func NewChainApp( app.GetSubspace(packetforwardtypes.ModuleName), ), - did.NewAppModule(appCodec, app.DidKeeper), + did.NewAppModule(appCodec, app.DidKeeper, app.NFTKeeper), ) // BasicModuleManager defines the module BasicManager is in charge of setting up basic, diff --git a/cmd/dwn/main.go b/cmd/dwn/main.go index a18dc86b4..51a42fc4c 100644 --- a/cmd/dwn/main.go +++ b/cmd/dwn/main.go @@ -4,12 +4,9 @@ package main import ( - "errors" - "github.com/labstack/echo/v4" "github.com/onsonr/sonr/internal/vfs/wasm" - "github.com/donseba/go-htmx" "github.com/onsonr/sonr/internal/db" ) @@ -17,102 +14,27 @@ var dwn *DWN type DWN struct { *echo.Echo - DB *db.DB - Htmx *htmx.HTMX + DB *db.DB } func main() { dwn = initRails() - - dwn.GET("/", htmxHandler) - dwn.POST("/accounts", accountsHandler) - wasm.Serve(dwn.Echo) } // initRails initializes the Rails application func initRails() *DWN { // Open the database - cnfg := db.New() - db, err := cnfg.Open() + e := echo.New() + db, err := db.New() if err != nil { panic(err.Error()) } + db.ServeEcho(e.Group("/dwn")) // Initialize the htmx handler return &DWN{ - Echo: echo.New(), + Echo: e, DB: db, - Htmx: htmx.New(), } } - -func accountsHandler(e echo.Context) error { - switch e.Request().Method { - case "GET": - case "PUT": - // dwn.DB.AddAccount(e.Param("account"), e.Param("address")) - default: - e.Error(errors.New("Method not allowed")) - } - return e.JSON(200, "OK") -} - -func htmxHandler(e echo.Context) error { - // initiate a new htmx handler - h := dwn.Htmx.NewHandler(e.Response(), e.Request()) - - // check if the request is a htmx request - if h.IsHxRequest() { - // do something - } - - // check if the request is boosted - if h.IsHxBoosted() { - // do something - } - - // check if the request is a history restore request - if h.IsHxHistoryRestoreRequest() { - // do something - } - - // check if the request is a prompt request - if h.RenderPartial() { - // do something - } - - // set the headers for the response, see docs for more options - h.PushURL("http://push.url") - h.ReTarget("#ReTarged") - - // write the output like you normally do. - // check the inspector tool in the browser to see that the headers are set. - _, err := h.Write([]byte("OK")) - return err -} - -// -// func credentialsHandler(e echo.Context) error { -// switch e.Request().Method { -// case "GET": -// dwn.DB.GetCredentials(e.Param("account")) -// case "PUT": -// dwn.DB.AddCredentials(e.Param("account"), e.Param("address")) -// default: -// e.Error(errors.New("Method not allowed")) -// } -// return e.JSON(200, "OK") -// } -// -// func keysharesHandler(e echo.Context) error { -// switch e.Request().Method { -// case "GET": -// dwn.DB.GetKeyshares(e.Param("account")) -// case "PUT": -// dwn.DB.AddKeyshares(e.Param("account"), e.Param("address")) -// default: -// e.Error(errors.New("Method not allowed")) -// } -// return e.JSON(200, "OK") -// } diff --git a/motr/main.go b/cmd/motr/main.go similarity index 50% rename from motr/main.go rename to cmd/motr/main.go index 5f53f4c17..8fdf0d6ba 100644 --- a/motr/main.go +++ b/cmd/motr/main.go @@ -6,6 +6,8 @@ import ( "github.com/labstack/echo/v4" "github.com/syumai/workers" + "github.com/onsonr/sonr/internal/db" + "github.com/onsonr/sonr/internal/gui/views" "github.com/onsonr/sonr/internal/mdw" "github.com/onsonr/sonr/internal/svc" @@ -19,13 +21,15 @@ func main() { e.Use(mdw.UseSession) // Setup routes - registerRoutes(e) + registerFrontend(e) + registerOpenID(e.Group("/authorize")) + registerVault(e.Group("/vault")) // Serve Worker workers.Serve(e) } -func registerRoutes(e *echo.Echo) { +func registerFrontend(e *echo.Echo) { // Add Public Pages e.GET("/", views.HomeView) e.GET("/login", views.LoginView) @@ -33,11 +37,25 @@ func registerRoutes(e *echo.Echo) { e.GET("/register", views.RegisterView) e.POST("/register/:subject", svc.HandleCredentialCreation) e.POST("/register/:subject/check", svc.CheckSubjectIsValid) - - // Add Authenticated Pages - e.GET("/authorize", views.AuthorizeView) - e.GET("/authorize/discovery", svc.GetDiscovery) - e.GET("/authorize/jwks", svc.GetJWKS) - e.GET("/authorize/token", svc.GetToken) - e.POST("/authorize/:origin/grant/:subject", svc.GrantAuthorization) + e.GET("/profile", views.ProfileView) +} + +func registerOpenID(g *echo.Group) { + // Add Authenticated Pages + g.Use(mdw.MacaroonMiddleware("test", "test")) + g.GET("/", views.AuthorizeView) + g.GET("/discovery", svc.GetDiscovery) + g.GET("/jwks", svc.GetJWKS) + g.GET("/token", svc.GetToken) + g.POST("/:origin/grant/:subject", svc.GrantAuthorization) +} + +func registerVault(g *echo.Group) { + // Add Authenticated Pages + g.Use(mdw.MacaroonMiddleware("test", "test")) + vault, err := db.New(db.WitDir("vault")) + if err != nil { + // panic(err) + } + vault.ServeEcho(g) } diff --git a/motr/wrangler.toml b/cmd/motr/wrangler.toml similarity index 100% rename from motr/wrangler.toml rename to cmd/motr/wrangler.toml diff --git a/cmd/sonrd/main.go b/cmd/sonrd/main.go index 4f418fe0d..fcca52569 100644 --- a/cmd/sonrd/main.go +++ b/cmd/sonrd/main.go @@ -13,8 +13,7 @@ import ( func main() { rootCmd := NewRootCmd() - rootCmd.AddCommand(tui.NewTUIDashboardCmd()) - // rootCmd.AddCommand(tui.NewExplorerCmd()) + tui.AddTUICmds(rootCmd) if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) diff --git a/devbox.json b/devbox.json index 037e9c12e..01365d83b 100644 --- a/devbox.json +++ b/devbox.json @@ -15,8 +15,7 @@ "CHAIN_ID": "sonr-testnet-1", "DENOM": "usnr", "KEYRING": "test", - "MONIKER": "florence", - "MIN_GAS_PRICES": "0.0001usnr" + "MONIKER": "florence" }, "shell": { "scripts": { @@ -39,6 +38,7 @@ "make proto-gen" ], "gen:pkl": [ + "go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/oidc.pkl", "go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/orm.pkl", "go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/txns.pkl" ], diff --git a/go.mod b/go.mod index 4236e65ee..266cd90bf 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/onsonr/sonr go 1.22.5 -toolchain go1.23.0 - // overrides replace ( cosmossdk.io/core => cosmossdk.io/core v0.11.0 @@ -65,20 +63,20 @@ require ( github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ibc-go/v8 v8.2.0 github.com/donseba/go-htmx v1.10.0 + github.com/ethereum/go-ethereum v1.14.6 github.com/go-webauthn/webauthn v0.10.2 github.com/golang/protobuf v1.5.4 - github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/hack-pad/go-indexeddb v0.3.2 github.com/ipfs/boxo v0.21.0 github.com/ipfs/kubo v0.29.0 github.com/joho/godotenv v1.5.1 - github.com/labstack/echo-jwt/v4 v4.2.0 github.com/labstack/echo/v4 v4.10.2 github.com/mr-tron/base58 v1.2.0 github.com/ncruces/go-sqlite3 v0.18.2 github.com/ncruces/go-sqlite3/gormlite v0.18.0 github.com/nlepage/go-js-promise v1.0.0 - github.com/onsonr/crypto v1.28.0 + github.com/onsonr/crypto v1.29.0 github.com/segmentio/ksuid v1.0.4 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 @@ -97,6 +95,7 @@ require ( gopkg.in/macaroon.v2 v2.1.0 gorm.io/gorm v1.25.11 lukechampine.com/adiantum v1.1.1 + lukechampine.com/blake3 v1.3.0 ) require ( @@ -110,7 +109,6 @@ require ( github.com/99designs/keyring v1.2.1 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect - github.com/Microsoft/go-winio v0.6.2 // indirect github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect github.com/atotto/clipboard v0.1.4 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect @@ -176,7 +174,6 @@ require ( github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/glog v1.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -192,10 +189,12 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/handlers v1.5.2 // indirect + github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect + github.com/hack-pad/safejs v0.1.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect @@ -211,6 +210,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/holiman/uint256 v1.2.4 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect @@ -362,7 +362,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect - lukechampine.com/blake3 v1.3.0 // indirect nhooyr.io/websocket v1.8.10 // indirect pgregory.net/rapid v1.1.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect diff --git a/go.sum b/go.sum index 8a3eabdac..e40ecf31a 100644 --- a/go.sum +++ b/go.sum @@ -1129,6 +1129,8 @@ github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87K github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= +github.com/ethereum/go-ethereum v1.14.6 h1:ZTxnErSopkDyxdvB8zW/KcK+/AVrdil/TzoWXVKaaC8= +github.com/ethereum/go-ethereum v1.14.6/go.mod h1:hglUZo/5pVIYXNyYjWzsAUDpT/zI+WbWo/Nih7ot+G0= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -1228,8 +1230,6 @@ github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= @@ -1403,6 +1403,10 @@ github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8 github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= +github.com/hack-pad/go-indexeddb v0.3.2 h1:DTqeJJYc1usa45Q5r52t01KhvlSN02+Oq+tQbSBI91A= +github.com/hack-pad/go-indexeddb v0.3.2/go.mod h1:QvfTevpDVlkfomY498LhstjwbPW6QC4VC/lxYb0Kom0= +github.com/hack-pad/safejs v0.1.0 h1:qPS6vjreAqh2amUqj4WNG1zIw7qlRQJ9K10eDKMCnE8= +github.com/hack-pad/safejs v0.1.0/go.mod h1:HdS+bKF1NrE72VoXZeWzxFOVQVUSqZJAG0xNCnb+Tio= github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= github.com/hashicorp/consul/sdk v0.14.1/go.mod h1:vFt03juSzocLRFo59NkeQHHmQa6+g7oU0pfzdI1mUhg= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -1459,6 +1463,8 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= @@ -1645,8 +1651,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labstack/echo-jwt/v4 v4.2.0 h1:odSISV9JgcSCuhgQSV/6Io3i7nUmfM/QkBeR5GVJj5c= -github.com/labstack/echo-jwt/v4 v4.2.0/go.mod h1:MA2RqdXdEn4/uEglx0HcUOgQSyBaTh5JcaHIan3biwU= github.com/labstack/echo/v4 v4.10.2 h1:n1jAhnq/elIFTHr1EYpiYtyKgx4RW9ccVgkqByZaN2M= github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k= github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= @@ -1857,8 +1861,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= -github.com/onsonr/crypto v1.28.0 h1:IZnWipcqtehohvau065NJSEgS2a2iMeTv2S0KlQ22ns= -github.com/onsonr/crypto v1.28.0/go.mod h1:2Ew7gRDlysE9+UXN904nUaJ9bqn6OlpKFMtk/LuTYoc= +github.com/onsonr/crypto v1.29.0 h1:ontCN/XNNmpWv23N8VB6vsirLXcjxZaA67lLX9RNj0c= +github.com/onsonr/crypto v1.29.0/go.mod h1:NSfeCO6XoyQeSDEp6Jy42UGG5047GvzG6lW9lRnjrR0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= diff --git a/internal/db/actions.go b/internal/db/actions.go index 1ce969b8b..cf0354acf 100644 --- a/internal/db/actions.go +++ b/internal/db/actions.go @@ -12,11 +12,11 @@ func createInitialTables(db *gorm.DB) (*DB, error) { err := db.AutoMigrate( &orm.Account{}, &orm.Asset{}, - &orm.Keyshare{}, &orm.Credential{}, + &orm.Keyshare{}, + &orm.Permission{}, &orm.Profile{}, &orm.Property{}, - &orm.Permission{}, ) if err != nil { return nil, fmt.Errorf("failed to create table: %w", err) @@ -35,12 +35,75 @@ func (db *DB) AddAccount(account *orm.Account) error { return nil } -// AddKeyshare adds a new keyshare to the database -func (db *DB) AddKeyshare(keyshare *orm.Keyshare) error { - tx := db.Create(keyshare) +// GetAccount gets an account from the database +func (db *DB) GetAccount(account *orm.Account) error { + tx := db.First(account) + if tx.Error != nil { + return fmt.Errorf("failed to get account: %w", tx.Error) + } + + return nil +} + +// UpdateAccount updates an existing account in the database +func (db *DB) UpdateAccount(account *orm.Account) error { + tx := db.Save(account) + if tx.Error != nil { + return fmt.Errorf("failed to update account: %w", tx.Error) + } + + return nil +} + +// DeleteAccount deletes an existing account from the database +func (db *DB) DeleteAccount(account *orm.Account) error { + tx := db.Delete(account) + if tx.Error != nil { + return fmt.Errorf("failed to delete account: %w", tx.Error) + } + + return nil +} + +// AddAsset adds a new asset to the database +func (db *DB) AddAsset(asset *orm.Asset) error { + tx := db.Create(asset) if tx.Error != nil { - return fmt.Errorf("failed to add keyshare: %w", tx.Error) + return fmt.Errorf("failed to add asset: %w", tx.Error) + } + + return nil +} + +// GetAsset gets an asset from the database +func (db *DB) GetAsset(asset *orm.Asset) error { + tx := db.First(asset) + + if tx.Error != nil { + return fmt.Errorf("failed to get asset: %w", tx.Error) + } + + return nil +} + +// UpdateAsset updates an existing asset in the database +func (db *DB) UpdateAsset(asset *orm.Asset) error { + tx := db.Save(asset) + + if tx.Error != nil { + return fmt.Errorf("failed to update asset: %w", tx.Error) + } + + return nil +} + +// DeleteAsset deletes an existing asset from the database +func (db *DB) DeleteAsset(asset *orm.Asset) error { + tx := db.Delete(asset) + + if tx.Error != nil { + return fmt.Errorf("failed to delete asset: %w", tx.Error) } return nil @@ -57,6 +120,127 @@ func (db *DB) AddCredential(credential *orm.Credential) error { return nil } +// GetCredential gets an credential from the database +func (db *DB) GetCredential(credential *orm.Credential) error { + tx := db.First(credential) + + if tx.Error != nil { + return fmt.Errorf("failed to get credential: %w", tx.Error) + } + + return nil +} + +// UpdateCredential updates an existing credential in the database +func (db *DB) UpdateCredential(credential *orm.Credential) error { + tx := db.Save(credential) + + if tx.Error != nil { + return fmt.Errorf("failed to update credential: %w", tx.Error) + } + + return nil +} + +// DeleteCredential deletes an existing credential from the database +func (db *DB) DeleteCredential(credential *orm.Credential) error { + tx := db.Delete(credential) + + if tx.Error != nil { + return fmt.Errorf("failed to delete credential: %w", tx.Error) + } + + return nil +} + +// AddKeyshare adds a new keyshare to the database +func (db *DB) AddKeyshare(keyshare *orm.Keyshare) error { + tx := db.Create(keyshare) + + if tx.Error != nil { + return fmt.Errorf("failed to add keyshare: %w", tx.Error) + } + + return nil +} + +// GetKeyshare gets an keyshare from the database +func (db *DB) GetKeyshare(keyshare *orm.Keyshare) error { + tx := db.First(keyshare) + + if tx.Error != nil { + return fmt.Errorf("failed to get keyshare: %w", tx.Error) + } + + return nil +} + +// UpdateKeyshare updates an existing keyshare in the database +func (db *DB) UpdateKeyshare(keyshare *orm.Keyshare) error { + tx := db.Save(keyshare) + + if tx.Error != nil { + return fmt.Errorf("failed to update keyshare: %w", tx.Error) + } + + return nil +} + +// DeleteKeyshare deletes an existing keyshare from the database +func (db *DB) DeleteKeyshare(keyshare *orm.Keyshare) error { + tx := db.Delete(keyshare) + + if tx.Error != nil { + return fmt.Errorf("failed to delete keyshare: %w", tx.Error) + } + + return nil +} + +// AddPermission adds a new permission to the database +func (db *DB) AddPermission(permission *orm.Permission) error { + tx := db.Create(permission) + + if tx.Error != nil { + return fmt.Errorf("failed to add permission: %w", tx.Error) + } + + return nil +} + +// GetPermission gets an permission from the database +func (db *DB) GetPermission(permission *orm.Permission) error { + tx := db.First(permission) + + if tx.Error != nil { + return fmt.Errorf("failed to get permission: %w", tx.Error) + } + + return nil +} + +// UpdatePermission updates an existing permission in the database +func (db *DB) UpdatePermission(permission *orm.Permission) error { + tx := db.Save(permission) + + if tx.Error != nil { + return fmt.Errorf("failed to update permission: %w", tx.Error) + } + + return nil +} + +// DeletePermission deletes an existing permission from the database +func (db *DB) DeletePermission(permission *orm.Permission) error { + tx := db.Delete(permission) + + if tx.Error != nil { + return fmt.Errorf("failed to delete permission: %w", tx.Error) + } + + return nil +} + // AddProfile adds a new profile to the database func (db *DB) AddProfile(profile *orm.Profile) error { tx := db.Create(profile) @@ -68,6 +252,39 @@ func (db *DB) AddProfile(profile *orm.Profile) error { return nil } +// GetProfile gets an profile from the database +func (db *DB) GetProfile(profile *orm.Profile) error { + tx := db.First(profile) + + if tx.Error != nil { + return fmt.Errorf("failed to get profile: %w", tx.Error) + } + + return nil +} + +// UpdateProfile updates an existing profile in the database +func (db *DB) UpdateProfile(profile *orm.Profile) error { + tx := db.Save(profile) + + if tx.Error != nil { + return fmt.Errorf("failed to update profile: %w", tx.Error) + } + + return nil +} + +// DeleteProfile deletes an existing profile from the database +func (db *DB) DeleteProfile(profile *orm.Profile) error { + tx := db.Delete(profile) + + if tx.Error != nil { + return fmt.Errorf("failed to delete profile: %w", tx.Error) + } + + return nil +} + // AddProperty adds a new property to the database func (db *DB) AddProperty(property *orm.Property) error { tx := db.Create(property) @@ -79,12 +296,34 @@ func (db *DB) AddProperty(property *orm.Property) error { return nil } -// AddPermission adds a new permission to the database -func (db *DB) AddPermission(permission *orm.Permission) error { - tx := db.Create(permission) +// GetProperty gets an property from the database +func (db *DB) GetProperty(property *orm.Property) error { + tx := db.First(property) if tx.Error != nil { - return fmt.Errorf("failed to add permission: %w", tx.Error) + return fmt.Errorf("failed to get property: %w", tx.Error) + } + + return nil +} + +// UpdateProperty updates an existing property in the database +func (db *DB) UpdateProperty(property *orm.Property) error { + tx := db.Save(property) + + if tx.Error != nil { + return fmt.Errorf("failed to update property: %w", tx.Error) + } + + return nil +} + +// DeleteProperty deletes an existing property from the database +func (db *DB) DeleteProperty(property *orm.Property) error { + tx := db.Delete(property) + + if tx.Error != nil { + return fmt.Errorf("failed to delete property: %w", tx.Error) } return nil diff --git a/internal/db/database.go b/internal/db/database.go index 53f87ec65..12bb158ed 100644 --- a/internal/db/database.go +++ b/internal/db/database.go @@ -1,17 +1,54 @@ package db -import "gorm.io/gorm" +import ( + "crypto/rand" + + "github.com/ncruces/go-sqlite3/gormlite" + "golang.org/x/crypto/argon2" + "gorm.io/gorm" + "lukechampine.com/adiantum/hbsh" + "lukechampine.com/adiantum/hpolyc" +) type DB struct { *gorm.DB } -func New(opts ...DBOption) *DBConfig { +func New(opts ...DBOption) (*DB, error) { config := &DBConfig{ fileName: "vault.db", } for _, opt := range opts { opt(config) } - return config + gormdb, err := gorm.Open(gormlite.Open(config.ConnectionString())) + if err != nil { + return nil, err + } + db, err := createInitialTables(gormdb) + if err != nil { + return nil, err + } + return db, nil +} + +// HBSH creates an HBSH cipher given a key. +func (c *DB) HBSH(key []byte) *hbsh.HBSH { + if len(key) != 32 { + // Key is not appropriate, return nil. + return nil + } + return hpolyc.New(key) +} + +// KDF gets a key from a secret. +func (c *DB) KDF(secret string) []byte { + if secret == "" { + // No secret is given, generate a random key. + key := make([]byte, 32) + n, _ := rand.Read(key) + return key[:n] + } + // Hash the secret with a KDF. + return argon2.IDKey([]byte(secret), []byte("hpolyc"), 3, 64*1024, 4, 32) } diff --git a/internal/db/handlers.go b/internal/db/handlers.go new file mode 100644 index 000000000..e4f739c77 --- /dev/null +++ b/internal/db/handlers.go @@ -0,0 +1,195 @@ +package db + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/db/orm" +) + +func (db *DB) ServeEcho(e *echo.Group) { + e.GET("/accounts", db.HandleAccount) + e.GET("/assets", db.HandleAsset) + e.GET("/credentials", db.HandleCredential) + e.GET("/keyshares", db.HandleKeyshare) + e.GET("/permissions", db.HandlePermission) + e.GET("/profiles", db.HandleProfile) + e.GET("/properties", db.HandleProperty) +} + +func (db *DB) HandleAccount(c echo.Context) error { + data := new(orm.Account) + if err := c.Bind(data); err != nil { + return err + } + // Check the method for GET, POST, PUT, DELETE + switch c.Request().Method { + case echo.POST: + + if err := db.AddAccount(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + + if err := db.UpdateAccount(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteAccount(data); err != nil { + return err + } + return c.JSON(200, nil) + } + return c.JSON(200, data) +} + +func (db *DB) HandleAsset(c echo.Context) error { + data := new(orm.Asset) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddAsset(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdateAsset(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteAsset(data); err != nil { + return err + } + return c.JSON(200, "OK") + } + return c.JSON(200, data) +} + +func (db *DB) HandleCredential(c echo.Context) error { + data := new(orm.Credential) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddCredential(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdateCredential(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteCredential(data); err != nil { + return err + } + } + return c.JSON(200, data) +} + +func (db *DB) HandleKeyshare(c echo.Context) error { + data := new(orm.Keyshare) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddKeyshare(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdateKeyshare(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteKeyshare(data); err != nil { + return err + } + } + return c.JSON(200, data) +} + +func (db *DB) HandlePermission(c echo.Context) error { + data := new(orm.Permission) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddPermission(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdatePermission(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeletePermission(data); err != nil { + return err + } + } + return c.JSON(200, data) +} + +func (db *DB) HandleProfile(c echo.Context) error { + data := new(orm.Profile) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddProfile(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdateProfile(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteProfile(data); err != nil { + return err + } + } + return c.JSON(200, data) +} + +func (db *DB) HandleProperty(c echo.Context) error { + data := new(orm.Property) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddProperty(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdateProperty(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteProperty(data); err != nil { + return err + } + } + return c.JSON(200, data) +} diff --git a/internal/db/idb/idb.go b/internal/db/idb/idb.go new file mode 100644 index 000000000..5dab6c074 --- /dev/null +++ b/internal/db/idb/idb.go @@ -0,0 +1,131 @@ +//go:build js && wasm +// +build js,wasm + +package idb + +import ( + "context" + "encoding/json" + "errors" + "syscall/js" + + "github.com/hack-pad/go-indexeddb/idb" +) + +// Model is an interface that must be implemented by types used with Table +type Model interface { + Table() string +} + +// Table is a generic wrapper around IDB for easier database operations on a specific table +type Table[T Model] struct { + db *idb.Database + dbName string + keyPath string +} + +// NewTable creates a new Table instance +func NewTable[T Model](dbName string, version uint, keyPath string) (*Table[T], error) { + ctx := context.Background() + factory := idb.Global() + + var model T + tableName := model.Table() + + openRequest, err := factory.Open(ctx, dbName, version, func(db *idb.Database, oldVersion, newVersion uint) error { + _, err := db.CreateObjectStore(tableName, idb.ObjectStoreOptions{ + KeyPath: js.ValueOf(keyPath), + }) + return err + }) + if err != nil { + return nil, err + } + db, err := openRequest.Await(ctx) + if err != nil { + return nil, err + } + return &Table[T]{ + db: db, + dbName: dbName, + keyPath: keyPath, + }, nil +} + +// Insert adds a new record to the table +func (t *Table[T]) Insert(data T) error { + tx, err := t.db.Transaction(idb.TransactionReadWrite, data.Table()) + if err != nil { + return err + } + defer tx.Commit() + + objectStore, err := tx.ObjectStore(data.Table()) + if err != nil { + return err + } + + jsonData, err := json.Marshal(data) + if err != nil { + return err + } + + _, err = objectStore.Add(js.ValueOf(string(jsonData))) + return err +} + +// Query retrieves a record from the table based on a key +func (t *Table[T]) Query(key interface{}) (T, error) { + var result T + + tx, err := t.db.Transaction(idb.TransactionReadOnly, result.Table()) + if err != nil { + return result, err + } + defer tx.Commit() + + objectStore, err := tx.ObjectStore(result.Table()) + if err != nil { + return result, err + } + + request, err := objectStore.Get(js.ValueOf(key)) + if err != nil { + return result, err + } + + value, err := request.Await(context.Background()) + if err != nil { + return result, err + } + + if value.IsUndefined() || value.IsNull() { + return result, errors.New("record not found") + } + + err = json.Unmarshal([]byte(value.String()), &result) + return result, err +} + +// Delete removes a record from the table based on a key +func (t *Table[T]) Delete(key interface{}) error { + var model T + tx, err := t.db.Transaction(idb.TransactionReadWrite, model.Table()) + if err != nil { + return err + } + defer tx.Commit() + + objectStore, err := tx.ObjectStore(model.Table()) + if err != nil { + return err + } + + _, err = objectStore.Delete(js.ValueOf(key)) + return err +} + +// Close closes the database connection +func (t *Table[T]) Close() error { + return t.db.Close() +} diff --git a/internal/db/options.go b/internal/db/options.go index 15dbe4924..47f2e1f31 100644 --- a/internal/db/options.go +++ b/internal/db/options.go @@ -1,20 +1,13 @@ package db import ( - "crypto/rand" - - "github.com/ncruces/go-sqlite3/gormlite" - "golang.org/x/crypto/argon2" - "gorm.io/gorm" - "lukechampine.com/adiantum/hbsh" - "lukechampine.com/adiantum/hpolyc" - _ "github.com/ncruces/go-sqlite3/embed" + "github.com/onsonr/sonr/internal/db/orm" ) type DBOption func(config *DBConfig) -func WithDir(dir string) DBOption { +func WitDir(dir string) DBOption { return func(config *DBConfig) { config.Dir = dir } @@ -30,41 +23,18 @@ type DBConfig struct { Dir string SecretKey string - fileName string + fileName string + initialAccounts []*orm.Account + initialAssets []*orm.Asset + initialCredentials []*orm.Credential + initialKeyshares []*orm.Keyshare + initialPermissions []*orm.Permission + initialProfiles []*orm.Profile + initialProperties []*orm.Property } func (config *DBConfig) ConnectionString() string { connStr := "file:" - connStr += config.Dir + "/" + config.fileName + connStr += config.fileName return connStr } - -// GormDialector creates a gorm dialector for the database. -func (config *DBConfig) Open() (*DB, error) { - db, err := gorm.Open(gormlite.Open(config.ConnectionString())) - if err != nil { - return nil, err - } - return createInitialTables(db) -} - -// HBSH creates an HBSH cipher given a key. -func (c *DBConfig) HBSH(key []byte) *hbsh.HBSH { - if len(key) != 32 { - // Key is not appropriate, return nil. - return nil - } - return hpolyc.New(key) -} - -// KDF gets a key from a secret. -func (c *DBConfig) KDF(secret string) []byte { - if secret == "" { - // No secret is given, generate a random key. - key := make([]byte, 32) - n, _ := rand.Read(key) - return key[:n] - } - // Hash the secret with a KDF. - return argon2.IDKey([]byte(secret), []byte("hpolyc"), 3, 64*1024, 4, 32) -} diff --git a/internal/db/orm/Keyshare.pkl.go b/internal/db/orm/Keyshare.pkl.go index c5072c7e3..ed51e7a94 100644 --- a/internal/db/orm/Keyshare.pkl.go +++ b/internal/db/orm/Keyshare.pkl.go @@ -4,17 +4,9 @@ package orm type Keyshare struct { Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` - Metadata string `pkl:"metadata" json:"metadata,omitempty" param:"metadata"` - - Payloads string `pkl:"payloads" json:"payloads,omitempty" param:"payloads"` - - Protocol string `pkl:"protocol" json:"protocol,omitempty" param:"protocol"` - - PublicKey string `pkl:"publicKey" json:"publicKey,omitempty" param:"publicKey"` + Data string `pkl:"data" json:"data,omitempty" param:"data"` Role int `pkl:"role" json:"role,omitempty" param:"role"` - Version int `pkl:"version" json:"version,omitempty" param:"version"` - CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` } diff --git a/internal/db/orm/PublicKey.pkl.go b/internal/db/orm/PublicKey.pkl.go deleted file mode 100644 index 7275e0ae5..000000000 --- a/internal/db/orm/PublicKey.pkl.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm - -type PublicKey struct { - Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` - - Role int `pkl:"role" json:"role,omitempty" param:"role"` - - Algorithm int `pkl:"algorithm" json:"algorithm,omitempty" param:"algorithm"` - - Encoding int `pkl:"encoding" json:"encoding,omitempty" param:"encoding"` - - Jwk string `pkl:"jwk" json:"jwk,omitempty" param:"jwk"` - - CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` -} diff --git a/internal/db/orm/init.pkl.go b/internal/db/orm/init.pkl.go index c8660ac41..817be2b7c 100644 --- a/internal/db/orm/init.pkl.go +++ b/internal/db/orm/init.pkl.go @@ -12,7 +12,5 @@ func init() { pkl.RegisterMapping("orm#Profile", Profile{}) pkl.RegisterMapping("orm#Property", Property{}) pkl.RegisterMapping("orm#Keyshare", Keyshare{}) - pkl.RegisterMapping("orm#PublicKey", PublicKey{}) pkl.RegisterMapping("orm#Permission", Permission{}) - pkl.RegisterMapping("orm#DiscoveryDocument", DiscoveryDocument{}) } diff --git a/internal/db/orm/orm.go b/internal/db/orm/orm.go new file mode 100644 index 000000000..1b1266bf1 --- /dev/null +++ b/internal/db/orm/orm.go @@ -0,0 +1,29 @@ +package orm + +func (a *Account) Table() string { + return "accounts" +} + +func (a *Asset) Table() string { + return "assets" +} + +func (a *Credential) Table() string { + return "credentials" +} + +func (a *Keyshare) Table() string { + return "keyshares" +} + +func (a *Permission) Table() string { + return "permissions" +} + +func (a *Profile) Table() string { + return "profiles" +} + +func (a *Property) Table() string { + return "properties" +} diff --git a/internal/gui/elements/badge.templ b/internal/gui/elements/badge.templ new file mode 100644 index 000000000..af512f4ac --- /dev/null +++ b/internal/gui/elements/badge.templ @@ -0,0 +1,59 @@ +package elements + +templ PoweredBySonr() { +
+
+
+ + Powered by + + + + + + +
+
+ sonr image +
+

The creative platform for developers. Community, tools, products, and more

+

+ + + + Joined June 2020 +

+
+
+
+
+
+
+} diff --git a/internal/gui/elements/badge_templ.go b/internal/gui/elements/badge_templ.go new file mode 100644 index 000000000..7d70a6e32 --- /dev/null +++ b/internal/gui/elements/badge_templ.go @@ -0,0 +1,37 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//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 PoweredBySonr() 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 + 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("
Powered by
\"sonr

The creative platform for developers. Community, tools, products, and more

Joined June 2020

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/breadcrumbs.templ b/internal/gui/elements/breadcrumbs.templ new file mode 100644 index 000000000..45eed0d78 --- /dev/null +++ b/internal/gui/elements/breadcrumbs.templ @@ -0,0 +1,35 @@ +package elements + +templ Breadcrumbs() { + +} + +templ breadcrumbItem(title string, active bool) { + if (active) { +
  • { title }
  • + } else { +
  • { title }
  • + } +} + +templ breadcrumbIcon() { + + + + + +} diff --git a/internal/gui/elements/breadcrumbs_templ.go b/internal/gui/elements/breadcrumbs_templ.go new file mode 100644 index 000000000..fd10e29ed --- /dev/null +++ b/internal/gui/elements/breadcrumbs_templ.go @@ -0,0 +1,154 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//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 Breadcrumbs() 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 + 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 + }) +} + +func breadcrumbItem(title string, active 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 + 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_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if active { + _, 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(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/breadcrumbs.templ`, Line: 23, Col: 126} + } + _, 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 + } + } else { + _, 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: `internal/gui/elements/breadcrumbs.templ`, Line: 25, Col: 118} + } + _, 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 + } + } + return templ_7745c5c3_Err + }) +} + +func breadcrumbIcon() 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 + 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_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = 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/internal/gui/elements/button.templ b/internal/gui/elements/button.templ index e7ea64b5c..12b58480b 100644 --- a/internal/gui/elements/button.templ +++ b/internal/gui/elements/button.templ @@ -1,7 +1,79 @@ package elements -func Button(variant Variant) templ.Component { - return renderButton(variant.Attributes()) +type button struct { + variant Variant + hxGet string + hxPost string + hxTarget string + hxTrigger string + hxSwap string +} + +type ButtonOpt func(button *button) + +func PrimaryButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantPrimary + } +} + +func InfoButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantInfo + } +} + +func ErrorButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantError + } +} + +func SuccessButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantSuccess + } +} + +func WarningButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantWarning + } +} + +func GET(action string, target string) ButtonOpt { + return func(button *button) { + button.hxGet = action + button.hxTarget = target + button.hxTrigger = "click" + button.hxSwap = "outerHTML" + } +} + +func POST(action string, target string) ButtonOpt { + return func(button *button) { + button.hxPost = action + button.hxTarget = target + button.hxTrigger = "click" + button.hxSwap = "outerHTML" + } +} + +func Button(opts ...ButtonOpt) templ.Component { + button := button{ + variant: ButtonVariantDefault, + } + for _, opt := range opts { + opt(&button) + } + if button.hxGet != "" { + return renderHxGetButton(&button, button.variant.Attributes()) + } + + if button.hxPost != "" { + return renderHxPostButton(&button, button.variant.Attributes()) + } + return renderButton(button.variant.Attributes()) } templ renderButton(attrs templ.Attributes) { @@ -10,6 +82,18 @@ templ renderButton(attrs templ.Attributes) { } +templ renderHxGetButton(c *button, attrs templ.Attributes) { + +} + +templ renderHxPostButton(c *button, attrs templ.Attributes) { + +} + type ButtonVariant int const ( diff --git a/internal/gui/elements/button_templ.go b/internal/gui/elements/button_templ.go index 43134874b..95f6f7533 100644 --- a/internal/gui/elements/button_templ.go +++ b/internal/gui/elements/button_templ.go @@ -8,8 +8,80 @@ package elements import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -func Button(variant Variant) templ.Component { - return renderButton(variant.Attributes()) +type button struct { + variant Variant + hxGet string + hxPost string + hxTarget string + hxTrigger string + hxSwap string +} + +type ButtonOpt func(button *button) + +func PrimaryButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantPrimary + } +} + +func InfoButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantInfo + } +} + +func ErrorButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantError + } +} + +func SuccessButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantSuccess + } +} + +func WarningButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantWarning + } +} + +func GET(action string, target string) ButtonOpt { + return func(button *button) { + button.hxGet = action + button.hxTarget = target + button.hxTrigger = "click" + button.hxSwap = "outerHTML" + } +} + +func POST(action string, target string) ButtonOpt { + return func(button *button) { + button.hxPost = action + button.hxTarget = target + button.hxTrigger = "click" + button.hxSwap = "outerHTML" + } +} + +func Button(opts ...ButtonOpt) templ.Component { + button := button{ + variant: ButtonVariantDefault, + } + for _, opt := range opts { + opt(&button) + } + if button.hxGet != "" { + return renderHxGetButton(&button, button.variant.Attributes()) + } + + if button.hxPost != "" { + return renderHxPostButton(&button, button.variant.Attributes()) + } + return renderButton(button.variant.Attributes()) } func renderButton(attrs templ.Attributes) templ.Component { @@ -54,6 +126,194 @@ func renderButton(attrs templ.Attributes) templ.Component { }) } +func renderHxGetButton(c *button, attrs templ.Attributes) 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 + 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_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = 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 + }) +} + +func renderHxPostButton(c *button, attrs templ.Attributes) 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 + 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_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = 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 + }) +} + type ButtonVariant int const ( diff --git a/internal/gui/elements/card.templ b/internal/gui/elements/card.templ index 2a9327f39..59113a1a9 100644 --- a/internal/gui/elements/card.templ +++ b/internal/gui/elements/card.templ @@ -1,12 +1,12 @@ package elements -func Card(size Size) templ.Component { - return renderCard(size.CardAttributes()) +func Card(id string, size Size) templ.Component { + return renderCard(id, size.CardAttributes()) } -templ renderCard(attrs templ.Attributes) { -
    -
    +templ renderCard(id string, attrs templ.Attributes) { +
    +
    { children... } @@ -15,3 +15,33 @@ templ renderCard(attrs templ.Attributes) {
    } + +templ ProfileCard() { +
    + +
    +
    + +
    + +
    Adam Wathan
    + adamwathan +
    + +
    +
    +

    Creator of @tailwindcss. Listener of Slayer. Austin 3:16. BTW, Pines UI is super cool!

    + +
    +
    +} diff --git a/internal/gui/elements/card_templ.go b/internal/gui/elements/card_templ.go index 4f155dcda..9636e8d1f 100644 --- a/internal/gui/elements/card_templ.go +++ b/internal/gui/elements/card_templ.go @@ -8,11 +8,11 @@ package elements import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -func Card(size Size) templ.Component { - return renderCard(size.CardAttributes()) +func Card(id string, size Size) templ.Component { + return renderCard(id, size.CardAttributes()) } -func renderCard(attrs templ.Attributes) templ.Component { +func renderCard(id string, attrs templ.Attributes) 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 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) @@ -30,7 +30,20 @@ func renderCard(attrs templ.Attributes) 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 } @@ -54,4 +67,30 @@ func renderCard(attrs templ.Attributes) templ.Component { }) } +func ProfileCard() 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 + 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("

    Creator of @tailwindcss. Listener of Slayer. Austin 3:16. BTW, Pines UI is super cool!

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/utils.go b/internal/gui/elements/elements.go similarity index 78% rename from internal/gui/elements/utils.go rename to internal/gui/elements/elements.go index cec24317e..a923c57c7 100644 --- a/internal/gui/elements/utils.go +++ b/internal/gui/elements/elements.go @@ -35,3 +35,13 @@ func clsxMerge(variants ...Variant) templ.Attributes { } return combinedAttrs } + +func clsxBuilder(classes ...string) templ.Attributes { + if len(classes) == 0 { + return templ.Attributes{} + } + class := strings.Join(classes, " ") + return templ.Attributes{ + "class": class, + } +} diff --git a/internal/gui/elements/fonts.templ b/internal/gui/elements/fonts.templ new file mode 100644 index 000000000..f05d49f83 --- /dev/null +++ b/internal/gui/elements/fonts.templ @@ -0,0 +1,62 @@ +package elements + +func H1(content string) templ.Component { + return renderText(1, content) +} + +func H2(content string) templ.Component { + return renderText(2, content) +} + +func H3(content string) templ.Component { + return renderText(3, content) +} + +func Text(content string) templ.Component { + return renderText(0, content) +} + +templ renderText(level int, text string) { + switch level { + case 1: +

    + { text } +

    + case 2: +

    + { text } +

    + case 3: +

    + { text } +

    + default: +

    + { text } +

    + } +} + +templ renderLink(attrs templ.Attributes, text string) { + + { text } + +} + +templ renderStrong(attrs templ.Attributes, text string) { + + { text } + +} + +templ renderEmphasis(attrs templ.Attributes, text string) { + + { text } + +} + +templ renderCode(attrs templ.Attributes, text string) { + + { text } + +} diff --git a/internal/gui/elements/text_templ.go b/internal/gui/elements/fonts_templ.go similarity index 55% rename from internal/gui/elements/text_templ.go rename to internal/gui/elements/fonts_templ.go index 85585c468..c881cd20a 100644 --- a/internal/gui/elements/text_templ.go +++ b/internal/gui/elements/fonts_templ.go @@ -8,28 +8,23 @@ package elements import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import "fmt" - -func Text(content string, options ...Variant) templ.Component { - if err := ValidTextVariants(options...); err != nil { - return renderParagraph(clsxMerge(TextSizeDefault, TextStyleDefault), content) - } - return renderParagraph(clsxMerge(options...), content) +func H1(content string) templ.Component { + return renderText(1, content) } -func ValidTextVariants(variants ...Variant) error { - for _, v := range variants { - switch v.(type) { - case TextSize: - case TextStyle: - default: - return fmt.Errorf("invalid text variant: %v", v) - } - } - return nil +func H2(content string) templ.Component { + return renderText(2, content) } -func renderHeading(attrs templ.Attributes, text string) templ.Component { +func H3(content string) templ.Component { + return renderText(3, content) +} + +func Text(content string) templ.Component { + return renderText(0, content) +} + +func renderText(level int, text string) 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 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) @@ -47,77 +42,79 @@ func renderHeading(attrs templ.Attributes, text string) templ.Component { 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(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/text.templ`, Line: 26, Col: 8} - } - _, 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 - } - return templ_7745c5c3_Err - }) -} - -func renderParagraph(attrs templ.Attributes, text string) 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 - 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 - } - 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: `internal/gui/elements/text.templ`, Line: 32, Col: 8} - } - _, 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 + switch level { + case 1: + _, 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(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/fonts.templ`, Line: 23, Col: 10} + } + _, 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 + } + case 2: + _, 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(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/fonts.templ`, Line: 27, Col: 10} + } + _, 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 + } + case 3: + _, 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(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/fonts.templ`, Line: 31, Col: 10} + } + _, 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 + } + default: + _, 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(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/fonts.templ`, Line: 35, Col: 10} + } + _, 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("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } return templ_7745c5c3_Err }) @@ -136,9 +133,9 @@ func renderLink(attrs templ.Attributes, text string) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("{ title } - -
    -
    - { children... } -
    + +
    + { children... }
    @@ -31,7 +29,26 @@ templ defaultStyles() { - - + + + + + +} + +templ Rows() { +
    + { children... } +
    +} + +templ Columns() { +
    + { children... } +
    +} + +css main() { + font-family: R-Flex, system-ui, Avenir, Helvetica, Arial, sans-serif; } diff --git a/internal/gui/elements/global_templ.go b/internal/gui/elements/global_templ.go index 8ceb6a81c..46606b039 100644 --- a/internal/gui/elements/global_templ.go +++ b/internal/gui/elements/global_templ.go @@ -47,7 +47,7 @@ func Layout(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -55,7 +55,7 @@ func Layout(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -133,7 +133,7 @@ func defaultStyles() templ.Component { templ_7745c5c3_Var5 = 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 } @@ -141,4 +141,82 @@ func defaultStyles() templ.Component { }) } +func Rows() 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 + 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_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = 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 = templ_7745c5c3_Var6.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 Columns() 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 + 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_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = 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 = templ_7745c5c3_Var7.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 main() templ.CSSClass { + templ_7745c5c3_CSSBuilder := templruntime.GetBuilder() + templ_7745c5c3_CSSBuilder.WriteString(`font-family:R-Flex, system-ui, Avenir, Helvetica, Arial, sans-serif;`) + templ_7745c5c3_CSSID := templ.CSSID(`main`, templ_7745c5c3_CSSBuilder.String()) + return templ.ComponentCSSClass{ + ID: templ_7745c5c3_CSSID, + Class: templ.SafeCSS(`.` + templ_7745c5c3_CSSID + `{` + templ_7745c5c3_CSSBuilder.String() + `}`), + } +} + var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/icons.templ b/internal/gui/elements/icons.templ index 431aa93db..b13e3fd4a 100644 --- a/internal/gui/elements/icons.templ +++ b/internal/gui/elements/icons.templ @@ -26,3 +26,6 @@ templ renderIconVariant(v Icons) { } } + +templ SonrIcon() { +} diff --git a/internal/gui/elements/icons_templ.go b/internal/gui/elements/icons_templ.go index 2557e55d7..9bb3c551a 100644 --- a/internal/gui/elements/icons_templ.go +++ b/internal/gui/elements/icons_templ.go @@ -69,4 +69,26 @@ func renderIconVariant(v Icons) templ.Component { }) } +func SonrIcon() 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 + 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_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + return templ_7745c5c3_Err + }) +} + var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/inputs.templ b/internal/gui/elements/inputs.templ new file mode 100644 index 000000000..73227660a --- /dev/null +++ b/internal/gui/elements/inputs.templ @@ -0,0 +1,29 @@ +package elements + +type InputState int + +const ( + InputStateDefault InputState = iota + InputStateError + InputStateSuccess +) + +templ TextInput(state InputState, label string, placeholder string) { + switch (state) { + case InputStateDefault: +
    + + +
    + case InputStateError: +
    + + +
    + case InputStateSuccess: +
    + + +
    + } +} diff --git a/internal/gui/elements/inputs_templ.go b/internal/gui/elements/inputs_templ.go new file mode 100644 index 000000000..31088115b --- /dev/null +++ b/internal/gui/elements/inputs_templ.go @@ -0,0 +1,97 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//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 InputState int + +const ( + InputStateDefault InputState = iota + InputStateError + InputStateSuccess +) + +func TextInput(state InputState, label string, placeholder string) 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 + 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) + switch state { + case InputStateDefault: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case InputStateError: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case InputStateSuccess: + _, 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/internal/gui/elements/radios.templ b/internal/gui/elements/radios.templ new file mode 100644 index 000000000..0200e04cd --- /dev/null +++ b/internal/gui/elements/radios.templ @@ -0,0 +1,37 @@ +package elements + +templ RadioGroup() { +
    + +
    +} diff --git a/internal/gui/elements/radios_templ.go b/internal/gui/elements/radios_templ.go new file mode 100644 index 000000000..5a91c9f7c --- /dev/null +++ b/internal/gui/elements/radios_templ.go @@ -0,0 +1,37 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//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 RadioGroup() 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 + 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/internal/gui/elements/sizes.templ b/internal/gui/elements/sizes.templ index 0e97fb872..40e70998d 100644 --- a/internal/gui/elements/sizes.templ +++ b/internal/gui/elements/sizes.templ @@ -13,15 +13,15 @@ func (s Size) CardAttributes() templ.Attributes { switch s { case SizeSmall: return templ.Attributes{ - "class": "max-w-md bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + "class": "max-w-lg bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", } case SizeLarge: return templ.Attributes{ - "class": "max-w-xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + "class": "max-w-2xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", } } return templ.Attributes{ - "class": "max-w-lg bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + "class": "max-w-xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", } } diff --git a/internal/gui/elements/sizes_templ.go b/internal/gui/elements/sizes_templ.go index f7a0b98a1..20bc7d8b4 100644 --- a/internal/gui/elements/sizes_templ.go +++ b/internal/gui/elements/sizes_templ.go @@ -21,15 +21,15 @@ func (s Size) CardAttributes() templ.Attributes { switch s { case SizeSmall: return templ.Attributes{ - "class": "max-w-md bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + "class": "max-w-lg bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", } case SizeLarge: return templ.Attributes{ - "class": "max-w-xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + "class": "max-w-2xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", } } return templ.Attributes{ - "class": "max-w-lg bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + "class": "max-w-xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", } } diff --git a/internal/gui/elements/tabs.templ b/internal/gui/elements/tabs.templ new file mode 100644 index 000000000..8b478f482 --- /dev/null +++ b/internal/gui/elements/tabs.templ @@ -0,0 +1,109 @@ +package elements + +templ Tabs() { +
    +
    + + + +
    +
    +
    +
    + @Table() +
    +
    + And, this is the content for Tab2 +
    +
    + Finally, this is the content for Tab3 +
    +
    +
    +} + +templ Table() { +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameAgeAddressAction
    Richard Hendricks30Pied Piper HQ, Palo Alto + Edit +
    Erlich Bachman405230 Penfield Ave, Woodland Hills + Edit +
    Monica Hall352030 Stewart Drive, Sunnyvale + Edit +
    Dinesh Chugtai28Pied Piper HQ, Palo Alto + Edit +
    Gilfoyle32Pied Piper HQ, Palo Alto + Edit +
    +
    +
    +
    +
    +} diff --git a/internal/gui/elements/tabs_templ.go b/internal/gui/elements/tabs_templ.go new file mode 100644 index 000000000..a5ab4fc09 --- /dev/null +++ b/internal/gui/elements/tabs_templ.go @@ -0,0 +1,71 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//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 Tabs() 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 + 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 = Table().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    And, this is the content for Tab2
    Finally, this is the content for Tab3
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func Table() 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 + 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_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    NameAgeAddressAction
    Richard Hendricks30Pied Piper HQ, Palo AltoEdit
    Erlich Bachman405230 Penfield Ave, Woodland HillsEdit
    Monica Hall352030 Stewart Drive, SunnyvaleEdit
    Dinesh Chugtai28Pied Piper HQ, Palo AltoEdit
    Gilfoyle32Pied Piper HQ, Palo AltoEdit
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/text.templ b/internal/gui/elements/text.templ deleted file mode 100644 index f158286ce..000000000 --- a/internal/gui/elements/text.templ +++ /dev/null @@ -1,124 +0,0 @@ -package elements - -import "fmt" - -func Text(content string, options ...Variant) templ.Component { - if err := ValidTextVariants(options...); err != nil { - return renderParagraph(clsxMerge(TextSizeDefault, TextStyleDefault), content) - } - return renderParagraph(clsxMerge(options...), content) -} - -func ValidTextVariants(variants ...Variant) error { - for _, v := range variants { - switch v.(type) { - case TextSize: - case TextStyle: - default: - return fmt.Errorf("invalid text variant: %v", v) - } - } - return nil -} - -templ renderHeading(attrs templ.Attributes, text string) { -

    - { text } -

    -} - -templ renderParagraph(attrs templ.Attributes, text string) { -

    - { text } -

    -} - -templ renderLink(attrs templ.Attributes, text string) { - - { text } - -} - -templ renderStrong(attrs templ.Attributes, text string) { - - { text } - -} - -templ renderEmphasis(attrs templ.Attributes, text string) { - - { text } - -} - -templ renderCode(attrs templ.Attributes, text string) { - - { text } - -} - -type TextSize int - -const ( - TextSizeDefault TextSize = iota - TextSizeSmall - TextSizeMedium - TextSizeLarge -) - -func (s TextSize) Attributes() templ.Attributes { - switch s { - case TextSizeSmall: - return templ.Attributes{ - "class": "text-sm", - } - case TextSizeLarge: - return templ.Attributes{ - "class": "text-xl", - } - } - return templ.Attributes{ - "class": "text-md", - } -} - -type TextStyle int - -const ( - TextStyleDefault TextStyle = iota - TextStyleHeading - TextStyleParagraph - TextStyleLink - TextStyleStrong - TextStyleEmphasis - TextStyleCode -) - -func (s TextStyle) Attributes() templ.Attributes { - switch s { - case TextStyleHeading: - return templ.Attributes{ - "class": "text-xl font-bold text-xl", - } - case TextStyleParagraph: - return templ.Attributes{ - "class": "text-base font-normal", - } - case TextStyleLink: - return templ.Attributes{ - "class": "text-blue-600 font-medium underline", - } - case TextStyleStrong: - return templ.Attributes{ - "class": "font-semibold text-md", - } - case TextStyleCode: - return templ.Attributes{ - "class": "text-stone-800 font-mono", - } - default: - return templ.Attributes{ - "class": "text-base font-normal text-md", - } - } -} diff --git a/internal/gui/forms/forms.go b/internal/gui/forms/forms.go new file mode 100644 index 000000000..0b7e1ad5f --- /dev/null +++ b/internal/gui/forms/forms.go @@ -0,0 +1,41 @@ +package forms + +import ( + "bytes" + + "github.com/a-h/templ" + "github.com/labstack/echo/v4" +) + +func echoFormResponse(c echo.Context, cmp templ.Component, state FormState) error { + // Create a buffer to store the rendered HTML + buf := &bytes.Buffer{} + // Render the component to the buffer + err := cmp.Render(c.Request().Context(), buf) + if err != nil { + return err + } + + // Set the content type + c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML) + c.Response().Header().Set("X-Status", string(state)) + + // Write the buffered content to the response + _, err = c.Response().Write(buf.Bytes()) + return err +} + +type FormState string + +const ( + InitialForm FormState = "initial" + ErrorForm FormState = "error" + SuccessForm FormState = "success" + WarningForm FormState = "warning" +) + +type Form struct { + State FormState + Title string + Description string +} diff --git a/internal/gui/forms/register.templ b/internal/gui/forms/register.templ new file mode 100644 index 000000000..76b0c1d99 --- /dev/null +++ b/internal/gui/forms/register.templ @@ -0,0 +1,25 @@ +package forms + +import "github.com/labstack/echo/v4" + +templ BasicInfo(c echo.Context, state FormState) { + switch (state) { + default: +
    +
    +

    Account

    +

    Make changes to your account here. Click save when you're done.

    +
    +
    +
    +
    +
    +
    + } +} + +templ CreateCredentials(state FormState) { +} + +templ PrivacyTerms(state FormState) { +} diff --git a/internal/gui/forms/register_templ.go b/internal/gui/forms/register_templ.go new file mode 100644 index 000000000..99dbc9976 --- /dev/null +++ b/internal/gui/forms/register_templ.go @@ -0,0 +1,86 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package forms + +//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" + +func BasicInfo(c echo.Context, state FormState) 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 + 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) + switch state { + default: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    Account

    Make changes to your account here. Click save when you're done.

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return templ_7745c5c3_Err + }) +} + +func CreateCredentials(state FormState) 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 + 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_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + return templ_7745c5c3_Err + }) +} + +func PrivacyTerms(state FormState) 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 + 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) + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/views/home.templ b/internal/gui/views/home.templ index a07436fe4..34b505522 100644 --- a/internal/gui/views/home.templ +++ b/internal/gui/views/home.templ @@ -11,13 +11,19 @@ func HomeView(c echo.Context) error { templ renderHomeView() { @elements.Layout("Sonr.ID") { - @elements.Card(elements.SizeMedium) { - @elements.Text("Sonr.ID", elements.TextSizeLarge, elements.TextStyleHeading) - @elements.Text("Neo-tree is a file manager for NeoFS.", elements.TextSizeMedium, elements.TextStyleParagraph) + @elements.Card("home-view", elements.SizeLarge) { + @elements.H1("Sonr.ID") + @elements.Text("A Decentralized Web Node Client for the Sonr Network.") @elements.Spacer() - @elements.Button(elements.ButtonVariantPrimary) { - @elements.Text("Get Started", elements.TextSizeMedium, elements.TextStyleParagraph) - } +
    + @elements.Button(elements.GET("/register", "#home-view"), elements.PrimaryButtonStyle()) { + @elements.Text("Get Started") + } + @elements.Button(elements.GET("/login", "#home-view")) { + @elements.Text("Login") + } +
    + @elements.PoweredBySonr() } } } diff --git a/internal/gui/views/home_templ.go b/internal/gui/views/home_templ.go index be9507cef..8259d8a94 100644 --- a/internal/gui/views/home_templ.go +++ b/internal/gui/views/home_templ.go @@ -59,7 +59,7 @@ func renderHomeView() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = elements.Text("Sonr.ID", elements.TextSizeLarge, elements.TextStyleHeading).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -67,7 +67,7 @@ func renderHomeView() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = elements.Text("Neo-tree is a file manager for NeoFS.", elements.TextSizeMedium, elements.TextStyleParagraph).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Text("A Decentralized Web Node Client for the Sonr Network.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -79,7 +79,7 @@ func renderHomeView() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -95,19 +95,49 @@ func renderHomeView() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = elements.Text("Get Started", elements.TextSizeMedium, elements.TextStyleParagraph).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Text("Get Started").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = elements.Button(elements.ButtonVariantPrimary).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Button(elements.GET("/register", "#home-view"), elements.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 = elements.Text("Login").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Button(elements.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 = elements.PoweredBySonr().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = elements.Card(elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Card("home-view", elements.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/gui/views/login.templ b/internal/gui/views/login.templ index 56ea6f860..601dc0aae 100644 --- a/internal/gui/views/login.templ +++ b/internal/gui/views/login.templ @@ -10,13 +10,15 @@ func LoginView(c echo.Context) error { } templ renderLoginView() { - @elements.Layout("Sonr.ID") { - @elements.Card(elements.SizeMedium) { - @elements.Text("Sonr.ID", elements.TextSizeLarge, elements.TextStyleHeading) - @elements.Text("Neo-tree is a file manager for NeoFS.", elements.TextSizeMedium, elements.TextStyleParagraph) + @elements.Layout("Login | Sonr.ID") { + @elements.Card("login-view", elements.SizeLarge) { + @elements.H1("Sonr.ID") + @elements.Text("Neo-tree is a file manager for NeoFS.") @elements.Spacer() - @elements.Button(elements.ButtonVariantPrimary) { - @elements.Text("Login", elements.TextSizeMedium, elements.TextStyleParagraph) + @elements.RadioGroup() + @elements.Spacer() + @elements.Button(elements.GET("/", "#login-view")) { + @elements.Text("Cancel") } } } diff --git a/internal/gui/views/login_templ.go b/internal/gui/views/login_templ.go index b2b45a1a1..7ec36e580 100644 --- a/internal/gui/views/login_templ.go +++ b/internal/gui/views/login_templ.go @@ -59,7 +59,7 @@ func renderLoginView() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = elements.Text("Sonr.ID", elements.TextSizeLarge, elements.TextStyleHeading).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -67,7 +67,23 @@ func renderLoginView() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = elements.Text("Neo-tree is a file manager for NeoFS.", elements.TextSizeMedium, elements.TextStyleParagraph).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Text("Neo-tree is a file manager for NeoFS.").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 = elements.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_Err = elements.RadioGroup().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -95,25 +111,25 @@ func renderLoginView() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = elements.Text("Login", elements.TextSizeMedium, elements.TextStyleParagraph).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Text("Cancel").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = elements.Button(elements.ButtonVariantPrimary).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Button(elements.GET("/", "#login-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = elements.Card(elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Card("login-view", elements.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = elements.Layout("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Layout("Login | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/gui/views/openid.templ b/internal/gui/views/openid.templ index 3f1a1ae88..f09cdc270 100644 --- a/internal/gui/views/openid.templ +++ b/internal/gui/views/openid.templ @@ -11,9 +11,9 @@ func AuthorizeView(c echo.Context) error { templ renderAuthorizeView() { @elements.Layout("Login | Sonr.ID") { - @elements.Card(elements.SizeMedium) { - @elements.Text("Sonr.ID", elements.TextSizeLarge, elements.TextStyleHeading) - @elements.Text("Neo-tree is a file manager for NeoFS.", elements.TextSizeMedium, elements.TextStyleParagraph) + @elements.Card("authorize-view", elements.SizeMedium) { + @elements.H1("Sonr.ID") + @elements.Text("Neo-tree is a file manager for NeoFS.") } } } diff --git a/internal/gui/views/openid_templ.go b/internal/gui/views/openid_templ.go index e02236ab6..1f62a9b5d 100644 --- a/internal/gui/views/openid_templ.go +++ b/internal/gui/views/openid_templ.go @@ -59,7 +59,7 @@ func renderAuthorizeView() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = elements.Text("Sonr.ID", elements.TextSizeLarge, elements.TextStyleHeading).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -67,13 +67,13 @@ func renderAuthorizeView() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = elements.Text("Neo-tree is a file manager for NeoFS.", elements.TextSizeMedium, elements.TextStyleParagraph).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = elements.Card(elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Card("authorize-view", elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/gui/views/profile.templ b/internal/gui/views/profile.templ new file mode 100644 index 000000000..25c272e99 --- /dev/null +++ b/internal/gui/views/profile.templ @@ -0,0 +1,19 @@ +package views + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" +) + +func ProfileView(c echo.Context) error { + return echoComponentResponse(c, renderProfileView()) +} + +templ renderProfileView() { + @elements.Layout("Profile | Sonr.ID") { + @elements.Card("profile-view", elements.SizeLarge) { + @elements.ProfileCard() + @elements.Tabs() + } + } +} diff --git a/internal/gui/views/profile_templ.go b/internal/gui/views/profile_templ.go new file mode 100644 index 000000000..189837b19 --- /dev/null +++ b/internal/gui/views/profile_templ.go @@ -0,0 +1,90 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package views + +//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/internal/gui/elements" +) + +func ProfileView(c echo.Context) error { + return echoComponentResponse(c, renderProfileView()) +} + +func renderProfileView() 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 + 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_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 = elements.ProfileCard().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 = elements.Tabs().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Card("profile-view", elements.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Layout("Profile | Sonr.ID").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/internal/gui/views/register.templ b/internal/gui/views/register.templ index fb9c1fe68..076d4d992 100644 --- a/internal/gui/views/register.templ +++ b/internal/gui/views/register.templ @@ -3,31 +3,24 @@ package views import ( "github.com/labstack/echo/v4" "github.com/onsonr/sonr/internal/gui/elements" + "github.com/onsonr/sonr/internal/gui/forms" ) func RegisterView(c echo.Context) error { - return echoComponentResponse(c, renderRegisterView()) + return echoComponentResponse(c, renderRegisterView(c)) } -templ renderRegisterView() { +templ renderRegisterView(c echo.Context) { @elements.Layout("Register | Sonr.ID") { - @elements.Card(elements.SizeMedium) { - @elements.Text("Sonr.ID", elements.TextSizeLarge, elements.TextStyleHeading) - @elements.Text("Neo-tree is a file manager for NeoFS.", elements.TextSizeMedium, elements.TextStyleParagraph) - } - @elements.Card(elements.SizeMedium) { -

    Welcome to Neo-tree

    -

    Neo-tree is a file manager for NeoFS.

    - } - @elements.Card(elements.SizeMedium) { -
    -
    -
    -

    Welcome to Neo-tree

    -

    Neo-tree is a file manager for NeoFS.

    -
    -
    -
    + @elements.Card("register-view", elements.SizeMedium) { + @elements.H2("Account Registration") + @elements.Spacer() + @elements.Breadcrumbs() + @forms.BasicInfo(c, forms.InitialForm) + @elements.Spacer() + @elements.Button(elements.GET("/", "#register-view")) { + @elements.Text("Cancel") + } } } } diff --git a/internal/gui/views/register_templ.go b/internal/gui/views/register_templ.go index 19dbc9f03..3a10827f4 100644 --- a/internal/gui/views/register_templ.go +++ b/internal/gui/views/register_templ.go @@ -11,13 +11,14 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" "github.com/onsonr/sonr/internal/gui/elements" + "github.com/onsonr/sonr/internal/gui/forms" ) func RegisterView(c echo.Context) error { - return echoComponentResponse(c, renderRegisterView()) + return echoComponentResponse(c, renderRegisterView(c)) } -func renderRegisterView() templ.Component { +func renderRegisterView(c echo.Context) 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 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) @@ -59,7 +60,7 @@ func renderRegisterView() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = elements.Text("Sonr.ID", elements.TextSizeLarge, elements.TextStyleHeading).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.H2("Account Registration").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -67,65 +68,63 @@ func renderRegisterView() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = elements.Text("Neo-tree is a file manager for NeoFS.", elements.TextSizeMedium, elements.TextStyleParagraph).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.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_Err = elements.Breadcrumbs().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 = forms.BasicInfo(c, forms.InitialForm).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 = elements.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 = elements.Text("Cancel").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Button(elements.GET("/", "#register-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = elements.Card(elements.SizeMedium).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_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 = templ_7745c5c3_Buffer.WriteString("

    Welcome to Neo-tree

    Neo-tree is a file manager for NeoFS.

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Card(elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), 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_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 = templ_7745c5c3_Buffer.WriteString("

    Welcome to Neo-tree

    Neo-tree is a file manager for NeoFS.

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = elements.Card(elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = elements.Card("register-view", elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/internal/mdw/authz.go b/internal/mdw/authz.go index 75fdf9fe5..c9fcc5153 100644 --- a/internal/mdw/authz.go +++ b/internal/mdw/authz.go @@ -1,41 +1,61 @@ package mdw import ( + "fmt" "net/http" + "time" - echojwt "github.com/labstack/echo-jwt/v4" "github.com/labstack/echo/v4" "gopkg.in/macaroon.v2" ) -type Authz struct { - echo.Context - echojwt.Config +const ( + OriginMacroonCaveat MacroonCaveat = "origin" + ScopesMacroonCaveat MacroonCaveat = "scopes" + SubjectMacroonCaveat MacroonCaveat = "subject" + ExpMacroonCaveat MacroonCaveat = "exp" + TokenMacroonCaveat MacroonCaveat = "token" +) - signKey []byte +type MacroonCaveat string + +func (c MacroonCaveat) Equal(other string) bool { + return string(c) == other } -func newAuthz(c echo.Context, signKey []byte) *Authz { - return &Authz{Context: c, signKey: signKey} +func (c MacroonCaveat) String() string { + return string(c) } -func (a *Authz) Accessible(route string, handler echo.HandlerFunc) echo.HandlerFunc { - // Verify the macaroon - // verified := a.Verify(a.signKey, func(caveat string) error { - // Implement your caveat verification logic here - // For example, you might check if the caveat is still valid (e.g., not expired) - // return nil // Return nil if the caveat is valid - // }, nil) - // if !verified { - // return func(c echo.Context) error { - // return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Invalid macaroon"}) - // } - // } - a.SetPath(route) - return handler +func (c MacroonCaveat) Verify(value string) error { + switch c { + case OriginMacroonCaveat: + return nil + case ScopesMacroonCaveat: + return nil + case SubjectMacroonCaveat: + return nil + case ExpMacroonCaveat: + // Check if the expiration time is still valid + exp, err := time.Parse(time.RFC3339, value) + if err != nil { + return err + } + if time.Now().After(exp) { + return fmt.Errorf("expired") + } + return nil + case TokenMacroonCaveat: + return nil + default: + return fmt.Errorf("unknown caveat: %s", c) + } } -func ValidateMacaroonMiddleware(secretKey []byte, location string) echo.MiddlewareFunc { +var MacroonCaveats = []MacroonCaveat{OriginMacroonCaveat, ScopesMacroonCaveat, SubjectMacroonCaveat, ExpMacroonCaveat, TokenMacroonCaveat} + +func MacaroonMiddleware(secretKeyStr string, location string) echo.MiddlewareFunc { + secretKey := []byte(secretKeyStr) return func(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { // Extract the macaroon from the Authorization header @@ -57,8 +77,11 @@ func ValidateMacaroonMiddleware(secretKey []byte, location string) echo.Middlewa // Verify the macaroon err = token.Verify(secretKey, func(caveat string) error { - // Implement your caveat verification logic here - // For example, you might check if the caveat is still valid (e.g., not expired) + for _, c := range MacroonCaveats { + if c.String() == caveat { + return nil + } + } return nil // Return nil if the caveat is valid }, nil) if err != nil { diff --git a/internal/mdw/client.go b/internal/mdw/client.go new file mode 100644 index 000000000..c7be79ac1 --- /dev/null +++ b/internal/mdw/client.go @@ -0,0 +1,3 @@ +package mdw + +type AuthClient struct{} diff --git a/internal/mdw/headers.go b/internal/mdw/headers.go index bc207de46..68fa253ed 100644 --- a/internal/mdw/headers.go +++ b/internal/mdw/headers.go @@ -1,7 +1,5 @@ package mdw -import "github.com/labstack/echo/v4" - type RequestHeaders struct { Authorization *string `header:"Authorization"` CacheControl *string `header:"Cache-Control"` @@ -55,8 +53,3 @@ type ResponseHeaders struct { HXTriggerAfterSettle *string `header:"HX-Trigger-After-Settle"` HXTriggerAfterSwap *string `header:"HX-Trigger-After-Swap"` } - -func bindRequestHeaders(c echo.Context) { - headers := new(RequestHeaders) - c.Bind(headers) -} diff --git a/internal/mdw/session.go b/internal/mdw/session.go index 3c1d921a0..8907bc1e2 100644 --- a/internal/mdw/session.go +++ b/internal/mdw/session.go @@ -10,13 +10,10 @@ import ( "github.com/segmentio/ksuid" ) -// UseSession establishes a Session Cookie. -func UseSession(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - sc := newSession(c) - bindRequestHeaders(sc) - return next(sc) - } +type Session struct { + echo.Context + htmx *htmx.HTMX + dB *db.DB } // GetSession returns the current Session @@ -24,25 +21,29 @@ func GetSession(c echo.Context) *Session { return c.(*Session) } -type Session struct { - echo.Context - htmx *htmx.HTMX - dB *db.DB -} - -func (c *Session) ID() string { - return readCookie(c, "session") -} - -func (c *Session) Htmx() *htmx.HTMX { - return c.htmx +// UseSession establishes a Session Cookie. +func UseSession(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + sc := initSession(c) + headers := new(RequestHeaders) + sc.Bind(headers) + return next(sc) + } } func (c *Session) DB() *db.DB { return c.dB } -func newSession(c echo.Context) *Session { +func (c *Session) Htmx() *htmx.HTMX { + return c.htmx +} + +func (c *Session) ID() string { + return readCookie(c, "session") +} + +func initSession(c echo.Context) *Session { s := &Session{Context: c} if val := readCookie(c, "session"); val == "" { id := ksuid.New().String() diff --git a/internal/mdw/status.go b/internal/mdw/status.go deleted file mode 100644 index 68a712b86..000000000 --- a/internal/mdw/status.go +++ /dev/null @@ -1 +0,0 @@ -package mdw diff --git a/internal/svc/openid.go b/internal/svc/openid.go index 29996fb98..78b97119f 100644 --- a/internal/svc/openid.go +++ b/internal/svc/openid.go @@ -1,8 +1,10 @@ package svc import ( + "fmt" + "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/db/orm" + oidc "github.com/onsonr/sonr/x/did/types/oidc" ) func GrantAuthorization(e echo.Context) error { @@ -25,13 +27,13 @@ func GetToken(e echo.Context) error { func GetDiscovery(e echo.Context) error { baseURL := "https://" + e.Request().Host // Ensure this is the correct base URL for your service - discoveryDoc := &orm.DiscoveryDocument{ - Issuer: "https://sonr.id", - AuthorizationEndpoint: "https://api.sonr.id/auth", - TokenEndpoint: "https://api.sonr.id/token", - UserinfoEndpoint: "https://api.sonr.id/userinfo", - JwksUri: baseURL + "/jwks", // You'll need to implement this endpoint - RegistrationEndpoint: baseURL + "/register", + discoveryDoc := &oidc.DiscoveryDocument{ + Issuer: baseURL, + AuthorizationEndpoint: fmt.Sprintf("%s/auth", baseURL), + TokenEndpoint: fmt.Sprintf("%s/token", baseURL), + UserinfoEndpoint: fmt.Sprintf("%s/userinfo", baseURL), + JwksUri: fmt.Sprintf("%s/jwks", baseURL), + RegistrationEndpoint: fmt.Sprintf("%s/register", baseURL), ScopesSupported: []string{"openid", "profile", "email", "web3", "sonr"}, ResponseTypesSupported: []string{"code"}, ResponseModesSupported: []string{"query", "form_post"}, diff --git a/internal/tui/forms.go b/internal/tui/authmodel/authmodel.go similarity index 91% rename from internal/tui/forms.go rename to internal/tui/authmodel/authmodel.go index c772e7625..2f83c115f 100644 --- a/internal/tui/forms.go +++ b/internal/tui/authmodel/authmodel.go @@ -1,4 +1,4 @@ -package tui +package txmodel import ( "fmt" @@ -12,7 +12,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/spf13/cobra" ) const maxWidth = 100 @@ -321,28 +320,3 @@ func RunTUIForm() (*tx.TxBody, error) { return finalM.message, nil } - -func NewTUIDashboardCmd() *cobra.Command { - return &cobra.Command{ - Use: "dash", - Short: "TUI for managing the local Sonr validator node", - RunE: func(cmd *cobra.Command, args []string) error { - txBody, err := RunTUIForm() - if err != nil { - return err - } - - interfaceRegistry := codectypes.NewInterfaceRegistry() - marshaler := codec.NewProtoCodec(interfaceRegistry) - jsonBytes, err := marshaler.MarshalJSON(txBody) - if err != nil { - return fmt.Errorf("failed to marshal tx body: %w", err) - } - - fmt.Println("Generated Protobuf Message (JSON format):") - fmt.Println(string(jsonBytes)) - - return nil - }, - } -} diff --git a/internal/tui/explorer.go b/internal/tui/dexmodel/dexmodel.go similarity index 94% rename from internal/tui/explorer.go rename to internal/tui/dexmodel/dexmodel.go index e19b0faa5..c6a77a8d8 100644 --- a/internal/tui/explorer.go +++ b/internal/tui/dexmodel/dexmodel.go @@ -1,4 +1,4 @@ -package tui +package dexmodel import ( "fmt" @@ -156,18 +156,10 @@ func tick() tea.Msg { return tickMsg{} } -func runExplorer(cmd *cobra.Command, args []string) error { +func RunExplorerTUI(cmd *cobra.Command, args []string) error { p := tea.NewProgram(initialModel(), tea.WithAltScreen()) if _, err := p.Run(); err != nil { return fmt.Errorf("error running explorer: %v", err) } return nil } - -func NewExplorerCmd() *cobra.Command { - return &cobra.Command{ - Use: "cosmos-explorer", - Short: "A terminal-based Cosmos blockchain explorer", - RunE: runExplorer, - } -} diff --git a/internal/tui/tui.go b/internal/tui/tui.go new file mode 100644 index 000000000..0ac4d76c0 --- /dev/null +++ b/internal/tui/tui.go @@ -0,0 +1,49 @@ +package tui + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/onsonr/sonr/internal/tui/dexmodel" + "github.com/onsonr/sonr/internal/tui/txmodel" + "github.com/spf13/cobra" +) + +func AddTUICmds(rootCmd *cobra.Command) { + rootCmd.AddCommand(newBuildTxnTUICmd()) + rootCmd.AddCommand(newExplorerTUICmd()) +} + +func newBuildTxnTUICmd() *cobra.Command { + return &cobra.Command{ + Use: "dash", + Short: "TUI for managing the local Sonr validator node", + RunE: func(cmd *cobra.Command, args []string) error { + txBody, err := txmodel.RunBuildTxnTUI() + if err != nil { + return err + } + + interfaceRegistry := codectypes.NewInterfaceRegistry() + marshaler := codec.NewProtoCodec(interfaceRegistry) + jsonBytes, err := marshaler.MarshalJSON(txBody) + if err != nil { + return fmt.Errorf("failed to marshal tx body: %w", err) + } + + fmt.Println("Generated Protobuf Message (JSON format):") + fmt.Println(string(jsonBytes)) + + return nil + }, + } +} + +func newExplorerTUICmd() *cobra.Command { + return &cobra.Command{ + Use: "cosmos-explorer", + Short: "A terminal-based Cosmos blockchain explorer", + RunE: dexmodel.RunExplorerTUI, + } +} diff --git a/internal/tui/txmodel/txmodel.go b/internal/tui/txmodel/txmodel.go new file mode 100644 index 000000000..4c493ad24 --- /dev/null +++ b/internal/tui/txmodel/txmodel.go @@ -0,0 +1,322 @@ +package txmodel + +import ( + "fmt" + "strings" + + tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/huh" + "github.com/charmbracelet/lipgloss" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +const maxWidth = 100 + +var ( + red = lipgloss.AdaptiveColor{Light: "#FE5F86", Dark: "#FE5F86"} + indigo = lipgloss.AdaptiveColor{Light: "#5A56E0", Dark: "#7571F9"} + green = lipgloss.AdaptiveColor{Light: "#02BA84", Dark: "#02BF87"} +) + +type Styles struct { + Base, + HeaderText, + Status, + StatusHeader, + Highlight, + ErrorHeaderText, + Help lipgloss.Style +} + +func NewStyles(lg *lipgloss.Renderer) *Styles { + s := Styles{} + s.Base = lg.NewStyle(). + Padding(1, 2, 0, 1) + s.HeaderText = lg.NewStyle(). + Foreground(indigo). + Bold(true). + Padding(0, 1, 0, 1) + s.Status = lg.NewStyle(). + Border(lipgloss.RoundedBorder()). + BorderForeground(indigo). + PaddingLeft(1). + MarginTop(1) + s.StatusHeader = lg.NewStyle(). + Foreground(green). + Bold(true) + s.Highlight = lg.NewStyle(). + Foreground(lipgloss.Color("212")) + s.ErrorHeaderText = s.HeaderText. + Foreground(red) + s.Help = lg.NewStyle(). + Foreground(lipgloss.Color("240")) + return &s +} + +type state int + +const ( + statusNormal state = iota + stateDone +) + +type Model struct { + state state + lg *lipgloss.Renderer + styles *Styles + form *huh.Form + width int + message *tx.TxBody +} + +func NewModel() Model { + m := Model{width: maxWidth} + m.lg = lipgloss.DefaultRenderer() + m.styles = NewStyles(m.lg) + + m.form = huh.NewForm( + huh.NewGroup( + huh.NewInput(). + Key("from"). + Title("From Address"). + Placeholder("cosmos1..."). + Validate(func(s string) error { + if !strings.HasPrefix(s, "cosmos1") { + return fmt.Errorf("invalid address format") + } + return nil + }), + + huh.NewInput(). + Key("to"). + Title("To Address"). + Placeholder("cosmos1..."). + Validate(func(s string) error { + if !strings.HasPrefix(s, "cosmos1") { + return fmt.Errorf("invalid address format") + } + return nil + }), + + huh.NewInput(). + Key("amount"). + Title("Amount"). + Placeholder("100"). + Validate(func(s string) error { + if _, err := sdk.ParseCoinNormalized(s + "atom"); err != nil { + return fmt.Errorf("invalid coin amount") + } + return nil + }), + + huh.NewSelect[string](). + Key("denom"). + Title("Denom"). + Options(huh.NewOptions("atom", "osmo", "usnr", "snr")...), + + huh.NewInput(). + Key("memo"). + Title("Memo"). + Placeholder("Optional"), + + huh.NewConfirm(). + Key("done"). + Title("Ready to convert?"). + Validate(func(v bool) error { + if !v { + return fmt.Errorf("Please confirm when you're ready to convert") + } + return nil + }). + Affirmative("Yes, convert!"). + Negative("Not yet"), + ), + ). + WithWidth(60). + WithShowHelp(false). + WithShowErrors(false) + + return m +} + +func (m Model) Init() tea.Cmd { + return m.form.Init() +} + +func min(x, y int) int { + if x > y { + return y + } + return x +} + +func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + switch msg := msg.(type) { + case tea.WindowSizeMsg: + m.width = min(msg.Width, maxWidth) - m.styles.Base.GetHorizontalFrameSize() + case tea.KeyMsg: + switch msg.String() { + case "esc", "ctrl+c", "q": + return m, tea.Quit + } + } + + var cmds []tea.Cmd + + form, cmd := m.form.Update(msg) + if f, ok := form.(*huh.Form); ok { + m.form = f + cmds = append(cmds, cmd) + } + + if m.form.State == huh.StateCompleted { + m.buildMessage() + cmds = append(cmds, tea.Quit) + } + + return m, tea.Batch(cmds...) +} + +func (m Model) View() string { + s := m.styles + + switch m.form.State { + case huh.StateCompleted: + pklCode := m.generatePkl() + messageView := m.getMessageView() + var b strings.Builder + fmt.Fprintf(&b, "Final Tx:\n\n%s\n\n%s", pklCode, messageView) + return s.Status.Margin(0, 1).Padding(1, 2).Width(80).Render(b.String()) + "\n\n" + default: + var schemaType string + if m.form.GetString("schemaType") != "" { + schemaType = "Schema Type: " + m.form.GetString("schemaType") + } + + v := strings.TrimSuffix(m.form.View(), "\n\n") + form := m.lg.NewStyle().Margin(1, 0).Render(v) + + var status string + { + preview := "(Preview will appear here)" + if m.form.GetString("schema") != "" { + preview = m.generatePkl() + } + + const statusWidth = 40 + statusMarginLeft := m.width - statusWidth - lipgloss.Width(form) - s.Status.GetMarginRight() + status = s.Status. + Height(lipgloss.Height(form)). + Width(statusWidth). + MarginLeft(statusMarginLeft). + Render(s.StatusHeader.Render("Pkl Preview") + "\n" + + schemaType + "\n\n" + + preview) + } + + errors := m.form.Errors() + header := m.appBoundaryView("Sonr TX Builder") + if len(errors) > 0 { + header = m.appErrorBoundaryView(m.errorView()) + } + body := lipgloss.JoinHorizontal(lipgloss.Top, form, status) + + footer := m.appBoundaryView(m.form.Help().ShortHelpView(m.form.KeyBinds())) + if len(errors) > 0 { + footer = m.appErrorBoundaryView("") + } + + return s.Base.Render(header + "\n" + body + "\n\n" + footer) + } +} + +func (m Model) errorView() string { + var s string + for _, err := range m.form.Errors() { + s += err.Error() + } + return s +} + +func (m Model) appBoundaryView(text string) string { + return lipgloss.PlaceHorizontal( + m.width, + lipgloss.Left, + m.styles.HeaderText.Render(text), + lipgloss.WithWhitespaceChars("="), + lipgloss.WithWhitespaceForeground(indigo), + ) +} + +func (m Model) appErrorBoundaryView(text string) string { + return lipgloss.PlaceHorizontal( + m.width, + lipgloss.Left, + m.styles.ErrorHeaderText.Render(text), + lipgloss.WithWhitespaceChars("="), + lipgloss.WithWhitespaceForeground(red), + ) +} + +func (m Model) generatePkl() string { + schemaType := m.form.GetString("schemaType") + schema := m.form.GetString("schema") + + // This is a placeholder for the actual conversion logic + // In a real implementation, you would parse the schema and generate Pkl code + return fmt.Sprintf("// Converted from %s\n\nclass ConvertedSchema {\n // TODO: Implement conversion from %s\n // Original schema:\n /*\n%s\n */\n}", schemaType, schemaType, schema) +} + +func (m *Model) buildMessage() { + from := m.form.GetString("from") + to := m.form.GetString("to") + amount := m.form.GetString("amount") + denom := m.form.GetString("denom") + memo := m.form.GetString("memo") + + coin, _ := sdk.ParseCoinNormalized(fmt.Sprintf("%s%s", amount, denom)) + sendMsg := &banktypes.MsgSend{ + FromAddress: from, + ToAddress: to, + Amount: sdk.NewCoins(coin), + } + + anyMsg, _ := codectypes.NewAnyWithValue(sendMsg) + m.message = &tx.TxBody{ + Messages: []*codectypes.Any{anyMsg}, + Memo: memo, + } +} + +func (m Model) getMessageView() string { + if m.message == nil { + return "Current Message: None" + } + + interfaceRegistry := codectypes.NewInterfaceRegistry() + marshaler := codec.NewProtoCodec(interfaceRegistry) + jsonBytes, _ := marshaler.MarshalJSON(m.message) + + return fmt.Sprintf("Current Message:\n%s", string(jsonBytes)) +} + +func RunBuildTxnTUI() (*tx.TxBody, error) { + m := NewModel() + p := tea.NewProgram(m) + + finalModel, err := p.Run() + if err != nil { + return nil, fmt.Errorf("failed to run program: %w", err) + } + + finalM, ok := finalModel.(Model) + if !ok || finalM.message == nil { + return nil, fmt.Errorf("form not completed") + } + + return finalM.message, nil +} diff --git a/pkl/api.pkl b/pkl/api.pkl new file mode 100644 index 000000000..f18251ac6 --- /dev/null +++ b/pkl/api.pkl @@ -0,0 +1,37 @@ +@go.Package { name = "github.com/onsonr/sonr/motr/api" } + +module api + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + +class JsonField extends go.Field { + structTags { + ["json"] = "%{name},omitempty" + } +} + +abstract class Request { + route: String + method: String + headers: Map + origin: String? + userAgent: String? + body: Dynamic +} + +abstract class Response { + statusCode: Int + headers: Map + body: Dynamic +} + +class GetAccountsRequest extends Request { + route = "/accounts" + method = "GET" + headers = { + "Content-Type" = "application/json" + } + origin = null + userAgent = null + body = null +} diff --git a/pkl/bake.pkl b/pkl/bake.pkl new file mode 100644 index 000000000..927e5ea37 --- /dev/null +++ b/pkl/bake.pkl @@ -0,0 +1,30 @@ +@go.Package { name = "github.com/onsonr/sonr/motr/api/bake" } + +module bake + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + +class JsonField extends go.Field { + structTags { + ["json"] = "%{name},omitempty" + } +} + +abstract class Macroon { + id: String + location: String +} + +abstract class FirstPartyCaveats { + scope: String + exp: Int + cnf: String + aud: String +} + +abstract class ThirdPartyCaveats { + scope: String + exp: Int + cnf: String + aud: String +} diff --git a/pkl/oidc.pkl b/pkl/oidc.pkl new file mode 100644 index 000000000..2437be298 --- /dev/null +++ b/pkl/oidc.pkl @@ -0,0 +1,59 @@ +@go.Package { name = "github.com/onsonr/sonr/x/did/types/oidc" } + +module oidc + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + +class JsonField extends go.Field { + structTags { + ["json"] = "%{name},omitempty" + ["param"] = "%{name}" + } +} + +class DiscoveryDocument { + @JsonField + issuer: String + + @JsonField + authorization_endpoint: String + + @JsonField + token_endpoint: String + + @JsonField + userinfo_endpoint: String + + @JsonField + jwks_uri: String + + @JsonField + registration_endpoint: String + + @JsonField + scopes_supported: List + + @JsonField + response_types_supported: List + + @JsonField + response_modes_supported: List + + @JsonField + subject_types_supported: List + + @JsonField + id_token_signing_alg_values_supported: List + + @JsonField + claims_supported: List + + @JsonField + grant_types_supported: List + + @JsonField + acr_values_supported: List + + @JsonField + token_endpoint_auth_methods_supported: List +} diff --git a/pkl/orm.pkl b/pkl/orm.pkl index a03c4776f..86bc5e06f 100644 --- a/pkl/orm.pkl +++ b/pkl/orm.pkl @@ -196,43 +196,11 @@ class Keyshare { id: UInt @JsonField - metadata: String - - @JsonField - payloads: String - - @JsonField - protocol: String - - @JsonField - publicKey: String + data: String @JsonField role: Int - @JsonField - version: Int - - @JsonField - createdAt: String? -} - -class PublicKey { - @PrimaryKey - id: UInt - - @JsonField - role: Int - - @JsonField - algorithm: Int - - @JsonField - encoding: Int - - @JsonField - jwk: String - @JsonField createdAt: String? } @@ -257,53 +225,3 @@ class Permission { updatedAt: String? } -// -// OpenID Connect -// - -class DiscoveryDocument { - @JsonField - issuer: String - - @JsonField - authorization_endpoint: String - - @JsonField - token_endpoint: String - - @JsonField - userinfo_endpoint: String - - @JsonField - jwks_uri: String - - @JsonField - registration_endpoint: String - - @JsonField - scopes_supported: List - - @JsonField - response_types_supported: List - - @JsonField - response_modes_supported: List - - @JsonField - subject_types_supported: List - - @JsonField - id_token_signing_alg_values_supported: List - - @JsonField - claims_supported: List - - @JsonField - grant_types_supported: List - - @JsonField - acr_values_supported: List - - @JsonField - token_endpoint_auth_methods_supported: List -} diff --git a/pkl/txns.pkl b/pkl/txns.pkl index 4482ab154..beda46381 100644 --- a/pkl/txns.pkl +++ b/pkl/txns.pkl @@ -1,6 +1,6 @@ -@go.Package { name = "github.com/onsonr/sonr/txns" } +@go.Package { name = "github.com/onsonr/sonr/x/did/types/txns" } -module transactions +module txns import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" diff --git a/proto/did/v1/genesis.proto b/proto/did/v1/genesis.proto index 8069f2a9d..558b3088e 100644 --- a/proto/did/v1/genesis.proto +++ b/proto/did/v1/genesis.proto @@ -10,6 +10,17 @@ option go_package = "github.com/onsonr/sonr/x/did/types"; message GenesisState { // Params defines all the parameters of the module. Params params = 1 [(gogoproto.nullable) = false]; + + // GlobalIntegrity defines a zkp integrity proof for the entire DID namespace + GlobalIntegrity global_integrity = 2; +} + +// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace +message GlobalIntegrity { + string controller = 1; + string seed = 2; + bytes accumulator = 3; + uint64 count = 4; } // Params defines the set of module parameters. @@ -21,23 +32,20 @@ message Params { // Whitelisted Assets repeated AssetInfo whitelisted_assets = 1; - // Whitelisted Blockchains - repeated ChainInfo whitelisted_chains = 2; - // Whitelisted Key Types - repeated KeyInfo allowed_public_keys = 3; + map allowed_public_keys = 2; // IpfsActive is a flag to enable/disable ipfs - bool ipfs_active = 4; + bool ipfs_active = 3; // Localhost Registration Enabled - bool localhost_registration_enabled = 5; + bool localhost_registration_enabled = 4; // ConveyancePreference defines the conveyance preference - string conveyance_preference = 6; + string conveyance_preference = 5; // AttestationFormats defines the attestation formats - repeated string attestation_formats = 7; + repeated string attestation_formats = 6; } // AssetInfo defines the asset info @@ -57,20 +65,8 @@ message AssetInfo { // The name of the asset string name = 5; - // The Method of the did namespace - string method = 6; - // The icon url - string icon_url = 7; -} - -// ChainInfo defines the chain info -message ChainInfo { - string id = 1; - string chain_id = 2; - string name = 3; - string symbol = 4; - repeated ValidatorInfo validators = 5; + string icon_url = 6; } // KeyInfo defines information for accepted PubKey types diff --git a/proto/did/v1/models.proto b/proto/did/v1/models.proto index f88876af7..798784e36 100644 --- a/proto/did/v1/models.proto +++ b/proto/did/v1/models.proto @@ -97,9 +97,18 @@ message ServiceInfo { Service service = 4; } -// Token defines a macron token -message Token { - string id = 1; - string controller = 2; - bytes macron = 3; +// FirstPartyCaveat defines a first party caveat +message FirstPartyCaveat { + Permissions scope = 1; + int64 exp = 2; + string cnf = 3; + string aud = 4; +} + +// ThirdPartyCaveat defines a third party caveat +message ThirdPartyCaveat { + Permissions scope = 1; + int64 exp = 2; + string cnf = 3; + string aud = 4; } diff --git a/proto/did/v1/query.proto b/proto/did/v1/query.proto index c80773c92..9f82894b5 100644 --- a/proto/did/v1/query.proto +++ b/proto/did/v1/query.proto @@ -10,8 +10,33 @@ option go_package = "github.com/onsonr/sonr/x/did/types"; // Query provides defines the gRPC querier service. service Query { // Params queries all parameters of the module. - rpc Params(QueryRequest) returns (QueryResponse) { - option (google.api.http).get = "/did/params"; + rpc Params(QueryRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/params"; + } + + // ParamsAssets queries all parameters of the module. + rpc ParamsAssets(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/params/assets"; + } + + // Params queries all parameters of the module. + rpc ParamsByAsset(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/params/assets/{asset}"; + } + + // ParamsKeys queries all parameters of the module. + rpc ParamsKeys(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/params/keys"; + } + + // Params queries all parameters of the module. + rpc ParamsByKey(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/params/keys/{key}"; + } + + // Params queries all parameters of the module. + rpc RegistrationOptionsByKey(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/params/keys/{key}/registration"; } // Resolve queries the DID document by its id. @@ -31,6 +56,8 @@ service Query { message QueryRequest { string did = 1; string origin = 2; + string key = 3; + string asset = 4; } // QueryResolveResponse is the response type for the Query/Resolve RPC method. @@ -41,3 +68,28 @@ message QueryResponse { ServiceInfo service = 4; Params params = 5; } + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + Params params = 1; +} + +message QueryParamsAssetsResponse { + repeated AssetInfo assets = 1; +} + +message QueryParamsKeysResponse { + map keys = 1; +} + +message QueryParamsByKeyResponse { + KeyInfo key = 1; +} + +message QueryParamsByAssetResponse { + AssetInfo asset = 1; +} + +message QueryRegistrationOptionsByKeyResponse { + repeated string registration_options = 1; +} diff --git a/proto/did/v1/tx.proto b/proto/did/v1/tx.proto index b5ff071b6..9cefc62cc 100644 --- a/proto/did/v1/tx.proto +++ b/proto/did/v1/tx.proto @@ -48,7 +48,7 @@ message MsgUpdateParams { Params params = 2 [(gogoproto.nullable) = false]; // token is the macron token to authenticate the operation. - Token token = 3; + string token = 3; } // MsgUpdateParamsResponse defines the response structure for executing a @@ -100,7 +100,7 @@ message MsgProveWitness { bytes witness = 3; // token is the macron token to authenticate the operation. - Token token = 4; + string token = 4; } // MsgProveWitnessResponse is the response type for the ProveWitness RPC. @@ -117,7 +117,7 @@ message MsgSyncController { string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Token is the public token to authenticate the operation. - Token token = 3; + string token = 3; } // MsgSyncControllerResponse is the response type for the SyncController RPC. @@ -168,13 +168,13 @@ message MsgAuthorizeService { Permissions scopes = 3; // token is the macron token to authenticate the operation. - Token token = 4; + string token = 4; } // MsgAuthorizeServiceResponse is the response type for the AuthorizeService RPC. message MsgAuthorizeServiceResponse { bool success = 1; - Token token = 2; + string token = 2; } // MsgRegisterService is the message type for the RegisterService RPC. @@ -188,7 +188,7 @@ message MsgRegisterService { Service service = 2; // token is the macron token to authenticate the operation. - Token token = 3; + string token = 3; } // MsgRegisterServiceResponse is the response type for the RegisterService RPC. diff --git a/txns/Msg.pkl.go b/txns/Msg.pkl.go deleted file mode 100644 index cf0adf0c7..000000000 --- a/txns/Msg.pkl.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package txns - -type Msg interface { - GetTypeUrl() string -} diff --git a/txns/init.pkl.go b/txns/init.pkl.go deleted file mode 100644 index 68ba1e69e..000000000 --- a/txns/init.pkl.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package txns - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("transactions", Transactions{}) - pkl.RegisterMapping("transactions#Proposal", Proposal{}) - pkl.RegisterMapping("transactions#MsgGovSubmitProposal", MsgGovSubmitProposalImpl{}) - pkl.RegisterMapping("transactions#MsgGovVote", MsgGovVoteImpl{}) - pkl.RegisterMapping("transactions#MsgGovDeposit", MsgGovDepositImpl{}) - pkl.RegisterMapping("transactions#MsgGroupCreateGroup", MsgGroupCreateGroupImpl{}) - pkl.RegisterMapping("transactions#MsgGroupSubmitProposal", MsgGroupSubmitProposalImpl{}) - pkl.RegisterMapping("transactions#MsgGroupVote", MsgGroupVoteImpl{}) - pkl.RegisterMapping("transactions#MsgStakingCreateValidator", MsgStakingCreateValidatorImpl{}) - pkl.RegisterMapping("transactions#MsgStakingDelegate", MsgStakingDelegateImpl{}) - pkl.RegisterMapping("transactions#MsgStakingUndelegate", MsgStakingUndelegateImpl{}) - pkl.RegisterMapping("transactions#MsgStakingBeginRedelegate", MsgStakingBeginRedelegateImpl{}) - pkl.RegisterMapping("transactions#MsgDidUpdateParams", MsgDidUpdateParamsImpl{}) - pkl.RegisterMapping("transactions#MsgDidAllocateVault", MsgDidAllocateVaultImpl{}) - pkl.RegisterMapping("transactions#MsgDidProveWitness", MsgDidProveWitnessImpl{}) - pkl.RegisterMapping("transactions#MsgDidSyncVault", MsgDidSyncVaultImpl{}) - pkl.RegisterMapping("transactions#MsgDidRegisterController", MsgDidRegisterControllerImpl{}) - pkl.RegisterMapping("transactions#MsgDidAuthorize", MsgDidAuthorizeImpl{}) - pkl.RegisterMapping("transactions#MsgDidRegisterService", MsgDidRegisterServiceImpl{}) - pkl.RegisterMapping("transactions#TxBody", TxBody{}) -} diff --git a/x/did/autocli.go b/x/did/autocli.go index c5fe6ab80..194a615f9 100644 --- a/x/did/autocli.go +++ b/x/did/autocli.go @@ -24,7 +24,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "UpdateParams", - Skip: false, // set to true if authority gated + Skip: true, // set to true if authority gated }, }, }, diff --git a/x/did/builder/openid.go b/x/did/builder/openid.go new file mode 100644 index 000000000..acd3ba380 --- /dev/null +++ b/x/did/builder/openid.go @@ -0,0 +1,27 @@ +package builder + +import ( + "fmt" + + "github.com/onsonr/sonr/x/did/types/oidc" +) + +func GetDiscovery(origin string) *oidc.DiscoveryDocument { + baseURL := "https://" + origin // Ensure this is the correct base URL for your service + discoveryDoc := &oidc.DiscoveryDocument{ + Issuer: baseURL, + AuthorizationEndpoint: fmt.Sprintf("%s/auth", baseURL), + TokenEndpoint: fmt.Sprintf("%s/token", baseURL), + UserinfoEndpoint: fmt.Sprintf("%s/userinfo", baseURL), + JwksUri: fmt.Sprintf("%s/jwks", baseURL), + RegistrationEndpoint: fmt.Sprintf("%s/register", baseURL), + ScopesSupported: []string{"openid", "profile", "email", "web3", "sonr"}, + ResponseTypesSupported: []string{"code"}, + ResponseModesSupported: []string{"query", "form_post"}, + GrantTypesSupported: []string{"authorization_code", "refresh_token"}, + AcrValuesSupported: []string{"passkey"}, + SubjectTypesSupported: []string{"public"}, + ClaimsSupported: []string{"sub", "iss", "name", "email"}, + } + return discoveryDoc +} diff --git a/x/did/builder/service.go b/x/did/builder/service.go index d7114f727..b5e33a96f 100644 --- a/x/did/builder/service.go +++ b/x/did/builder/service.go @@ -2,6 +2,7 @@ package builder import ( "crypto/rand" + "strings" "github.com/onsonr/sonr/x/did/types" ) @@ -53,8 +54,8 @@ func NewCredentialParameter(ki *types.KeyInfo) CredentialParameter { func ExtractCredentialParameters(p *types.Params) []CredentialParameter { var keys []*types.KeyInfo - for _, v := range p.AllowedPublicKeys { - if v.Role == types.KeyRole_KEY_ROLE_AUTHENTICATION { + for k, v := range p.AllowedPublicKeys { + if strings.Contains(k, "webauthn") { keys = append(keys, v) } } diff --git a/x/did/context/cache.go b/x/did/context/cache.go deleted file mode 100644 index a03e1d1c4..000000000 --- a/x/did/context/cache.go +++ /dev/null @@ -1 +0,0 @@ -package context diff --git a/x/did/context/client.go b/x/did/context/client.go deleted file mode 100644 index 576c12974..000000000 --- a/x/did/context/client.go +++ /dev/null @@ -1,55 +0,0 @@ -package context - -import ( - "context" - "fmt" - "net" - "strings" - - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/peer" -) - -type ClientInfo struct { - Authority string - ContentType string - UserAgent string - Hostname string - IPAddress string -} - -func ExtractClientInfo(ctx context.Context) (*ClientInfo, error) { - md, ok := metadata.FromIncomingContext(ctx) - if !ok { - return nil, fmt.Errorf("failed to get metadata from context") - } - - info := &ClientInfo{} - - // Extract authority, content-type, and user-agent - if authority := md.Get("authority"); len(authority) > 0 { - info.Authority = authority[0] - } - if contentType := md.Get("content-type"); len(contentType) > 0 { - info.ContentType = contentType[0] - } - if userAgent := md.Get("user-agent"); len(userAgent) > 0 { - info.UserAgent = userAgent[0] - } - - // Extract hostname and IP address - p, ok := peer.FromContext(ctx) - if ok { - if tcpAddr, ok := p.Addr.(*net.TCPAddr); ok { - info.IPAddress = tcpAddr.IP.String() - - // Try to get hostname - names, err := net.LookupAddr(info.IPAddress) - if err == nil && len(names) > 0 { - info.Hostname = strings.TrimSuffix(names[0], ".") - } - } - } - - return info, nil -} diff --git a/x/did/depinject.go b/x/did/depinject.go index 13d0b1103..5e523d471 100644 --- a/x/did/depinject.go +++ b/x/did/depinject.go @@ -8,10 +8,12 @@ import ( "cosmossdk.io/core/store" "cosmossdk.io/depinject" "cosmossdk.io/log" + nftkeeper "cosmossdk.io/x/nft/keeper" "github.com/cosmos/cosmos-sdk/codec" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -42,6 +44,7 @@ type ModuleInputs struct { AddressCodec address.Codec AccountKeeper authkeeper.AccountKeeper + NFTKeeper nftkeeper.Keeper StakingKeeper stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper } @@ -56,8 +59,8 @@ type ModuleOutputs struct { func ProvideModule(in ModuleInputs) ModuleOutputs { govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() - k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper, &in.StakingKeeper, log.NewLogger(os.Stderr), govAddr) - m := NewAppModule(in.Cdc, k) + k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper, in.NFTKeeper, &in.StakingKeeper, log.NewLogger(os.Stderr), govAddr) + m := NewAppModule(in.Cdc, k, in.NFTKeeper) return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}} } diff --git a/x/did/keeper/keeper.go b/x/did/keeper/keeper.go index bcfdaf30b..8ca420cb8 100644 --- a/x/did/keeper/keeper.go +++ b/x/did/keeper/keeper.go @@ -5,16 +5,17 @@ import ( storetypes "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/orm/model/ormdb" + nftkeeper "cosmossdk.io/x/nft/keeper" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/ipfs/kubo/client/rpc" apiv1 "github.com/onsonr/sonr/api/did/v1" - middleware "github.com/onsonr/sonr/x/did/context" "github.com/onsonr/sonr/x/did/types" ) @@ -30,6 +31,7 @@ type Keeper struct { Schema collections.Schema AccountKeeper authkeeper.AccountKeeper + NftKeeper nftkeeper.Keeper StakingKeeper *stakkeeper.Keeper authority string @@ -41,6 +43,7 @@ func NewKeeper( cdc codec.BinaryCodec, storeService storetypes.KVStoreService, accKeeper authkeeper.AccountKeeper, + nftKeeper nftkeeper.Keeper, stkKeeper *stakkeeper.Keeper, logger log.Logger, authority string, @@ -77,6 +80,7 @@ func NewKeeper( authority: authority, OrmDB: store, AccountKeeper: accKeeper, + NftKeeper: nftKeeper, StakingKeeper: stkKeeper, } schema, err := sb.Build() @@ -95,10 +99,7 @@ func (k Keeper) IsUnclaimedServiceOrigin(ctx sdk.Context, origin string) bool { } // IsValidServiceOrigin checks if a service origin is valid -func (k Keeper) IsValidServiceOrigin(ctx sdk.Context, origin string, clientInfo *middleware.ClientInfo) bool { - if origin != clientInfo.Hostname { - return false - } +func (k Keeper) IsValidServiceOrigin(ctx sdk.Context, origin string) bool { rec, err := k.OrmDB.ServiceRecordTable().GetByOrigin(ctx, origin) if err != nil { return false diff --git a/x/did/keeper/keeper_test.go b/x/did/keeper/keeper_test.go index a29f9fdbd..79a46262c 100644 --- a/x/did/keeper/keeper_test.go +++ b/x/did/keeper/keeper_test.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/core/store" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" + nftkeeper "cosmossdk.io/x/nft/keeper" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -48,6 +49,7 @@ type testFixture struct { accountkeeper authkeeper.AccountKeeper bankkeeper bankkeeper.BaseKeeper + nftKeeper nftkeeper.Keeper stakingKeeper *stakingkeeper.Keeper mintkeeper mintkeeper.Keeper @@ -77,10 +79,10 @@ func SetupTest(t *testing.T) *testFixture { registerBaseSDKModules(f, encCfg, storeService, logger, require) // Setup POA Keeper. - f.k = keeper.NewKeeper(encCfg.Codec, storeService, f.accountkeeper, f.stakingKeeper, logger, f.govModAddr) + f.k = keeper.NewKeeper(encCfg.Codec, storeService, f.accountkeeper, f.nftKeeper, f.stakingKeeper, logger, f.govModAddr) f.msgServer = keeper.NewMsgServerImpl(f.k) f.queryServer = keeper.NewQuerier(f.k) - f.appModule = module.NewAppModule(encCfg.Codec, f.k) + f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.nftKeeper) return f } diff --git a/x/did/keeper/querier.go b/x/did/keeper/querier.go index 674dac1b5..08c513fb8 100644 --- a/x/did/keeper/querier.go +++ b/x/did/keeper/querier.go @@ -20,9 +20,9 @@ func NewQuerier(keeper Keeper) Querier { func (k Querier) Params( goCtx context.Context, req *types.QueryRequest, -) (*types.QueryResponse, error) { +) (*types.QueryParamsResponse, error) { ctx := k.CurrentCtx(goCtx) - return &types.QueryResponse{Params: k.GetParams(ctx.SDK())}, nil + return &types.QueryParamsResponse{Params: k.GetParams(ctx.SDK())}, nil } // Resolve implements types.QueryServer. @@ -42,3 +42,38 @@ func (k Querier) Service( ctx := k.CurrentCtx(goCtx) return &types.QueryResponse{Service: ctx.GetServiceInfo(req.GetOrigin()), Params: ctx.Params()}, nil } + +// ParamsAssets implements types.QueryServer. +func (k Querier) ParamsAssets(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("ParamsAssets is unimplemented") + return &types.QueryResponse{}, nil +} + +// ParamsByAsset implements types.QueryServer. +func (k Querier) ParamsByAsset(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("ParamsByAsset is unimplemented") + return &types.QueryResponse{}, nil +} + +// ParamsKeys implements types.QueryServer. +func (k Querier) ParamsKeys(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("ParamsKeys is unimplemented") + return &types.QueryResponse{}, nil +} + +// ParamsByKey implements types.QueryServer. +func (k Querier) ParamsByKey(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("ParamsByKey is unimplemented") + return &types.QueryResponse{}, nil +} + +// RegistrationOptionsByKey implements types.QueryServer. +func (k Querier) RegistrationOptionsByKey(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("RegistrationOptionsByKey is unimplemented") + return &types.QueryResponse{}, nil +} diff --git a/x/did/keeper/server.go b/x/did/keeper/server.go index 2b5539b1c..3d0fc3330 100644 --- a/x/did/keeper/server.go +++ b/x/did/keeper/server.go @@ -9,7 +9,6 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/onsonr/sonr/x/did/builder" - snrctx "github.com/onsonr/sonr/x/did/context" "github.com/onsonr/sonr/x/did/types" ) @@ -24,6 +23,8 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{k: keeper} } +// # AuthorizeService +// // AuthorizeService implements types.MsgServer. func (ms msgServer) AuthorizeService(goCtx context.Context, msg *types.MsgAuthorizeService) (*types.MsgAuthorizeServiceResponse, error) { if ms.k.authority != msg.Controller { @@ -37,19 +38,16 @@ func (ms msgServer) AuthorizeService(goCtx context.Context, msg *types.MsgAuthor return &types.MsgAuthorizeServiceResponse{}, nil } +// # AllocateVault +// // AllocateVault implements types.MsgServer. func (ms msgServer) AllocateVault( goCtx context.Context, msg *types.MsgAllocateVault, ) (*types.MsgAllocateVaultResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - clientInfo, err := snrctx.ExtractClientInfo(goCtx) - if err != nil { - return nil, err - } - // 1.Check if the service origin is valid - if ms.k.IsValidServiceOrigin(ctx, msg.Origin, clientInfo) { + if ms.k.IsValidServiceOrigin(ctx, msg.Origin) { return nil, types.ErrInvalidServiceOrigin } @@ -76,6 +74,8 @@ func (ms msgServer) AllocateVault( }, nil } +// # RegisterController +// // RegisterController implements types.MsgServer. func (ms msgServer) RegisterController( goCtx context.Context, @@ -85,6 +85,8 @@ func (ms msgServer) RegisterController( return &types.MsgRegisterControllerResponse{}, nil } +// # RegisterService +// // RegisterService implements types.MsgServer. func (ms msgServer) RegisterService( goCtx context.Context, @@ -92,24 +94,23 @@ func (ms msgServer) RegisterService( ) (*types.MsgRegisterServiceResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - clientInfo, err := snrctx.ExtractClientInfo(goCtx) - if err != nil { - return nil, err - } - // 1.Check if the service origin is valid - if !ms.k.IsValidServiceOrigin(ctx, msg.Service.Origin, clientInfo) { + if !ms.k.IsValidServiceOrigin(ctx, msg.Service.Origin) { return nil, types.ErrInvalidServiceOrigin } return ms.k.insertService(ctx, msg.Service) } +// # SyncController +// // SyncController implements types.MsgServer. func (ms msgServer) SyncController(ctx context.Context, msg *types.MsgSyncController) (*types.MsgSyncControllerResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) return &types.MsgSyncControllerResponse{}, nil } +// # UpdateParams +// // UpdateParams updates the x/did module parameters. func (ms msgServer) UpdateParams( ctx context.Context, diff --git a/x/did/module.go b/x/did/module.go index 9f61da1f2..8592126a1 100644 --- a/x/did/module.go +++ b/x/did/module.go @@ -4,13 +4,14 @@ import ( "context" "encoding/json" - "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" abci "github.com/cometbft/cometbft/abci/types" "cosmossdk.io/client/v2/autocli" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/x/nft" + nftkeeper "cosmossdk.io/x/nft/keeper" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -24,17 +25,15 @@ import ( ) const ( - // ConsensusVersion defines the current x/did module consensus version. ConsensusVersion = 1 // this line is used by starport scaffolding # simapp/module/const ) var ( - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleGenesis = AppModule{} - _ module.AppModule = AppModule{} - + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleGenesis = AppModule{} + _ module.AppModule = AppModule{} _ autocli.HasAutoCLIConfig = AppModule{} ) @@ -46,17 +45,20 @@ type AppModuleBasic struct { type AppModule struct { AppModuleBasic - keeper keeper.Keeper + keeper keeper.Keeper + nftKeeper nftkeeper.Keeper } // NewAppModule constructor func NewAppModule( cdc codec.Codec, keeper keeper.Keeper, + nftKeeper nftkeeper.Keeper, ) *AppModule { return &AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc}, keeper: keeper, + nftKeeper: nftKeeper, } } @@ -66,7 +68,8 @@ func (a AppModuleBasic) Name() string { func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { return cdc.MustMarshalJSON(&types.GenesisState{ - Params: types.DefaultParams(), + GlobalIntegrity: types.DefaultGlobalIntegrity(), + Params: types.DefaultParams(), }) } @@ -82,28 +85,13 @@ func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEn return nil } -func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { -} - func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) if err != nil { - // same behavior as in cosmos-sdk panic(err) } } -// Disable in favor of autocli.go. If you wish to use these, it will override AutoCLI methods. -/* -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() -} - -func (a AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} -*/ - func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) } @@ -113,11 +101,15 @@ func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) { } func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate { - genesisState := types.DefaultGenesis() - if err := a.keeper.Params.Set(ctx, genesisState.Params); err != nil { + didGenesisState := types.DefaultGenesis() + if err := a.keeper.Params.Set(ctx, didGenesisState.Params); err != nil { panic(err) } - + nftGenesisState := nft.DefaultGenesisState() + if err := types.DefaultNFTClasses(nftGenesisState); err != nil { + panic(err) + } + a.nftKeeper.InitGenesis(ctx, nftGenesisState) return nil } diff --git a/x/did/types/codec.go b/x/did/types/codec.go index 987b94d09..b985400f8 100644 --- a/x/did/types/codec.go +++ b/x/did/types/codec.go @@ -1,10 +1,16 @@ package types import ( + "crypto/ecdsa" "crypto/sha256" "encoding/hex" + "strings" + fmt "fmt" + ethcrypto "github.com/ethereum/go-ethereum/crypto" + "golang.org/x/crypto/sha3" + "github.com/cosmos/btcutil/bech32" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" @@ -71,7 +77,11 @@ func (c ChainCode) FormatAddress(pubKey *PubKey) (string, error) { return bech32.Encode("bc", pubKey.Bytes()) case ChainCodeETH: - return bech32.Encode("eth", pubKey.Bytes()) + epk, err := pubKey.ECDSA() + if err != nil { + return "", err + } + return ComputeEthAddress(*epk), nil case ChainCodeSNR: return bech32.Encode("idx", pubKey.Bytes()) @@ -198,3 +208,30 @@ func ComputeOriginTXTRecord(origin string) string { h.Write([]byte(origin)) return fmt.Sprintf("v=sonr,o=%s,p=%x", origin, h.Sum(nil)) } + +func ComputeEthAddress(pk ecdsa.PublicKey) string { + // Generate Ethereum address + address := ethcrypto.PubkeyToAddress(pk) + + // Apply ERC-55 checksum encoding + addr := address.Hex() + addr = strings.ToLower(addr) + addr = strings.TrimPrefix(addr, "0x") + hash := sha3.NewLegacyKeccak256() + hash.Write([]byte(addr)) + hashBytes := hash.Sum(nil) + + result := "0x" + for i, c := range addr { + if c >= '0' && c <= '9' { + result += string(c) + } else { + if hashBytes[i/2]>>(4-i%2*4)&0xf >= 8 { + result += strings.ToUpper(string(c)) + } else { + result += string(c) + } + } + } + return result +} diff --git a/x/did/types/genesis.go b/x/did/types/genesis.go index d92ce632e..826dd9d4d 100644 --- a/x/did/types/genesis.go +++ b/x/did/types/genesis.go @@ -2,10 +2,11 @@ package types import ( "encoding/json" - - "cosmossdk.io/collections" + fmt "fmt" ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" + "cosmossdk.io/collections" + "cosmossdk.io/x/nft" ) // ParamsKey saves the current module params. @@ -35,7 +36,8 @@ const DefaultIndex uint64 = 1 func DefaultGenesis() *GenesisState { return &GenesisState{ // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), + GlobalIntegrity: DefaultGlobalIntegrity(), + Params: DefaultParams(), } } @@ -43,15 +45,24 @@ func DefaultGenesis() *GenesisState { // failure. func (gs GenesisState) Validate() error { // this line is used by starport scaffolding # genesis/types/validate - + if gs.GlobalIntegrity == nil { + return fmt.Errorf("global integrity proof is nil") + } return gs.Params.Validate() } +// DefaultNFTClasses configures the Initial DIDNamespace NFT classes +func DefaultNFTClasses(nftGenesis *nft.GenesisState) error { + for _, n := range DIDNamespace_value { + nftGenesis.Classes = append(nftGenesis.Classes, DIDNamespace(n).GetNFTClass()) + } + return nil +} + // DefaultParams returns default module parameters. func DefaultParams() Params { return Params{ WhitelistedAssets: DefaultAssets(), - WhitelistedChains: DefaultChains(), AllowedPublicKeys: DefaultKeyInfos(), LocalhostRegistrationEnabled: true, ConveyancePreference: "direct", @@ -59,6 +70,25 @@ func DefaultParams() Params { } } +// DefaultGlobalIntegrity returns the default global integrity proof +func DefaultGlobalIntegrity() *GlobalIntegrity { + return &GlobalIntegrity{ + Controller: "did:sonr:0x0", + Seed: DefaultSeedMessage(), + Accumulator: []byte{}, + Count: 0, + } +} + +// DefaultSeedMessage returns the default seed message +func DefaultSeedMessage() string { + l1 := "The Sonr Network shall make no protocol that respects the establishment of centralized authority," + l2 := "or prohibits the free exercise of decentralized identity; or abridges the freedom of data sovereignty," + l3 := "or of encrypted communication; or the right of the users to peaceally interact and transact," + l4 := "and to petition the Network for the redress of vulnerabilities." + return fmt.Sprintf("%s %s %s %s", l1, l2, l3, l4) +} + // DefaultAssets returns the default asset infos: BTC, ETH, SNR, and USDC func DefaultAssets() []*AssetInfo { return []*AssetInfo{ @@ -89,17 +119,12 @@ func DefaultAssets() []*AssetInfo { } } -// DefaultChains returns the default chain infos: Bitcoin, Ethereum, and Sonr. -func DefaultChains() []*ChainInfo { - return []*ChainInfo{} -} - // DefaultKeyInfos returns the default key infos: secp256k1, ed25519, keccak256, and bls12381. -func DefaultKeyInfos() []*KeyInfo { - return []*KeyInfo{ +func DefaultKeyInfos() map[string]*KeyInfo { + return map[string]*KeyInfo{ // Identity Key Info // Sonr Controller Key Info - From MPC - { + "auth.dwn": { Role: KeyRole_KEY_ROLE_INVOCATION, Curve: KeyCurve_KEY_CURVE_P256, Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, @@ -108,7 +133,7 @@ func DefaultKeyInfos() []*KeyInfo { }, // Sonr Vault Shared Key Info - From Registration - { + "auth.zk": { Role: KeyRole_KEY_ROLE_ASSERTION, Curve: KeyCurve_KEY_CURVE_BLS12381, Algorithm: KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED, @@ -118,7 +143,7 @@ func DefaultKeyInfos() []*KeyInfo { // Blockchain Key Info // Ethereum Key Info - { + "auth.ethereum": { Role: KeyRole_KEY_ROLE_DELEGATION, Curve: KeyCurve_KEY_CURVE_KECCAK256, Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, @@ -126,7 +151,7 @@ func DefaultKeyInfos() []*KeyInfo { Type: KeyType_KEY_TYPE_BIP32, }, // Bitcoin/IBC Key Info - { + "auth.bitcoin": { Role: KeyRole_KEY_ROLE_DELEGATION, Curve: KeyCurve_KEY_CURVE_SECP256K1, Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, @@ -136,7 +161,7 @@ func DefaultKeyInfos() []*KeyInfo { // Authentication Key Info // Browser based WebAuthn - { + "webauthn.browser": { Role: KeyRole_KEY_ROLE_AUTHENTICATION, Curve: KeyCurve_KEY_CURVE_P256, Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256, @@ -144,7 +169,7 @@ func DefaultKeyInfos() []*KeyInfo { Type: KeyType_KEY_TYPE_WEBAUTHN, }, // FIDO U2F - { + "webauthn.fido": { Role: KeyRole_KEY_ROLE_AUTHENTICATION, Curve: KeyCurve_KEY_CURVE_P256, Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256, @@ -152,7 +177,7 @@ func DefaultKeyInfos() []*KeyInfo { Type: KeyType_KEY_TYPE_WEBAUTHN, }, // Cross-Platform Passkeys - { + "webauthn.passkey": { Role: KeyRole_KEY_ROLE_AUTHENTICATION, Curve: KeyCurve_KEY_CURVE_ED25519, Algorithm: KeyAlgorithm_KEY_ALGORITHM_EDDSA, @@ -195,14 +220,6 @@ func (a *AssetInfo) Equal(b *AssetInfo) bool { return false } -// Equal returns true if two chain infos are equal -func (c *ChainInfo) Equal(b *ChainInfo) bool { - if c == nil && b == nil { - return true - } - return false -} - // Equal returns true if two key infos are equal func (k *KeyInfo) Equal(b *KeyInfo) bool { if k == nil && b == nil { diff --git a/x/did/types/genesis.pb.go b/x/did/types/genesis.pb.go index d5b6dd68f..814f0882e 100644 --- a/x/did/types/genesis.pb.go +++ b/x/did/types/genesis.pb.go @@ -418,6 +418,8 @@ func (PermissionScope) EnumDescriptor() ([]byte, []int) { type GenesisState struct { // Params defines all the parameters of the module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // GlobalIntegrity defines a zkp integrity proof for the entire DID namespace + GlobalIntegrity *GlobalIntegrity `protobuf:"bytes,2,opt,name=global_integrity,json=globalIntegrity,proto3" json:"global_integrity,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -460,28 +462,102 @@ func (m *GenesisState) GetParams() Params { return Params{} } +func (m *GenesisState) GetGlobalIntegrity() *GlobalIntegrity { + if m != nil { + return m.GlobalIntegrity + } + return nil +} + +// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace +type GlobalIntegrity struct { + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + Seed string `protobuf:"bytes,2,opt,name=seed,proto3" json:"seed,omitempty"` + Accumulator []byte `protobuf:"bytes,3,opt,name=accumulator,proto3" json:"accumulator,omitempty"` + Count uint64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` +} + +func (m *GlobalIntegrity) Reset() { *m = GlobalIntegrity{} } +func (m *GlobalIntegrity) String() string { return proto.CompactTextString(m) } +func (*GlobalIntegrity) ProtoMessage() {} +func (*GlobalIntegrity) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{1} +} +func (m *GlobalIntegrity) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GlobalIntegrity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GlobalIntegrity.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 *GlobalIntegrity) XXX_Merge(src proto.Message) { + xxx_messageInfo_GlobalIntegrity.Merge(m, src) +} +func (m *GlobalIntegrity) XXX_Size() int { + return m.Size() +} +func (m *GlobalIntegrity) XXX_DiscardUnknown() { + xxx_messageInfo_GlobalIntegrity.DiscardUnknown(m) +} + +var xxx_messageInfo_GlobalIntegrity proto.InternalMessageInfo + +func (m *GlobalIntegrity) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *GlobalIntegrity) GetSeed() string { + if m != nil { + return m.Seed + } + return "" +} + +func (m *GlobalIntegrity) GetAccumulator() []byte { + if m != nil { + return m.Accumulator + } + return nil +} + +func (m *GlobalIntegrity) GetCount() uint64 { + if m != nil { + return m.Count + } + return 0 +} + // Params defines the set of module parameters. type Params struct { // Whitelisted Assets WhitelistedAssets []*AssetInfo `protobuf:"bytes,1,rep,name=whitelisted_assets,json=whitelistedAssets,proto3" json:"whitelisted_assets,omitempty"` - // Whitelisted Blockchains - WhitelistedChains []*ChainInfo `protobuf:"bytes,2,rep,name=whitelisted_chains,json=whitelistedChains,proto3" json:"whitelisted_chains,omitempty"` // Whitelisted Key Types - AllowedPublicKeys []*KeyInfo `protobuf:"bytes,3,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty"` + AllowedPublicKeys map[string]*KeyInfo `protobuf:"bytes,2,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // IpfsActive is a flag to enable/disable ipfs - IpfsActive bool `protobuf:"varint,4,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + IpfsActive bool `protobuf:"varint,3,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` // Localhost Registration Enabled - LocalhostRegistrationEnabled bool `protobuf:"varint,5,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"` + LocalhostRegistrationEnabled bool `protobuf:"varint,4,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"` // ConveyancePreference defines the conveyance preference - ConveyancePreference string `protobuf:"bytes,6,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` + ConveyancePreference string `protobuf:"bytes,5,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` // AttestationFormats defines the attestation formats - AttestationFormats []string `protobuf:"bytes,7,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` + AttestationFormats []string `protobuf:"bytes,6,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` } func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{1} + return fileDescriptor_fda181cae44f7c00, []int{2} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -517,14 +593,7 @@ func (m *Params) GetWhitelistedAssets() []*AssetInfo { return nil } -func (m *Params) GetWhitelistedChains() []*ChainInfo { - if m != nil { - return m.WhitelistedChains - } - return nil -} - -func (m *Params) GetAllowedPublicKeys() []*KeyInfo { +func (m *Params) GetAllowedPublicKeys() map[string]*KeyInfo { if m != nil { return m.AllowedPublicKeys } @@ -571,17 +640,15 @@ type AssetInfo struct { AssetType AssetType `protobuf:"varint,4,opt,name=asset_type,json=assetType,proto3,enum=did.v1.AssetType" json:"asset_type,omitempty"` // The name of the asset Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` - // The Method of the did namespace - Method string `protobuf:"bytes,6,opt,name=method,proto3" json:"method,omitempty"` // The icon url - IconUrl string `protobuf:"bytes,7,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` + IconUrl string `protobuf:"bytes,6,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` } func (m *AssetInfo) Reset() { *m = AssetInfo{} } func (m *AssetInfo) String() string { return proto.CompactTextString(m) } func (*AssetInfo) ProtoMessage() {} func (*AssetInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{2} + return fileDescriptor_fda181cae44f7c00, []int{3} } func (m *AssetInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -645,13 +712,6 @@ func (m *AssetInfo) GetName() string { return "" } -func (m *AssetInfo) GetMethod() string { - if m != nil { - return m.Method - } - return "" -} - func (m *AssetInfo) GetIconUrl() string { if m != nil { return m.IconUrl @@ -659,83 +719,6 @@ func (m *AssetInfo) GetIconUrl() string { return "" } -// ChainInfo defines the chain info -type ChainInfo struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Symbol string `protobuf:"bytes,4,opt,name=symbol,proto3" json:"symbol,omitempty"` - Validators []*ValidatorInfo `protobuf:"bytes,5,rep,name=validators,proto3" json:"validators,omitempty"` -} - -func (m *ChainInfo) Reset() { *m = ChainInfo{} } -func (m *ChainInfo) String() string { return proto.CompactTextString(m) } -func (*ChainInfo) ProtoMessage() {} -func (*ChainInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{3} -} -func (m *ChainInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChainInfo.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 *ChainInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainInfo.Merge(m, src) -} -func (m *ChainInfo) XXX_Size() int { - return m.Size() -} -func (m *ChainInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ChainInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ChainInfo proto.InternalMessageInfo - -func (m *ChainInfo) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *ChainInfo) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *ChainInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ChainInfo) GetSymbol() string { - if m != nil { - return m.Symbol - } - return "" -} - -func (m *ChainInfo) GetValidators() []*ValidatorInfo { - if m != nil { - return m.Validators - } - return nil -} - // KeyInfo defines information for accepted PubKey types type KeyInfo struct { Role KeyRole `protobuf:"varint,1,opt,name=role,proto3,enum=did.v1.KeyRole" json:"role,omitempty"` @@ -1145,9 +1128,10 @@ func init() { proto.RegisterEnum("did.v1.KeyshareRole", KeyshareRole_name, KeyshareRole_value) proto.RegisterEnum("did.v1.PermissionScope", PermissionScope_name, PermissionScope_value) proto.RegisterType((*GenesisState)(nil), "did.v1.GenesisState") + proto.RegisterType((*GlobalIntegrity)(nil), "did.v1.GlobalIntegrity") proto.RegisterType((*Params)(nil), "did.v1.Params") + proto.RegisterMapType((map[string]*KeyInfo)(nil), "did.v1.Params.AllowedPublicKeysEntry") proto.RegisterType((*AssetInfo)(nil), "did.v1.AssetInfo") - proto.RegisterType((*ChainInfo)(nil), "did.v1.ChainInfo") proto.RegisterType((*KeyInfo)(nil), "did.v1.KeyInfo") proto.RegisterType((*ValidatorInfo)(nil), "did.v1.ValidatorInfo") proto.RegisterType((*ValidatorInfo_Endpoint)(nil), "did.v1.ValidatorInfo.Endpoint") @@ -1159,121 +1143,124 @@ func init() { func init() { proto.RegisterFile("did/v1/genesis.proto", fileDescriptor_fda181cae44f7c00) } var fileDescriptor_fda181cae44f7c00 = []byte{ - // 1813 bytes of a gzipped FileDescriptorProto + // 1869 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x4d, 0x6f, 0xdb, 0xc8, - 0x19, 0x36, 0xf5, 0xad, 0x57, 0x8e, 0x32, 0x99, 0x38, 0x59, 0xc5, 0x49, 0x6c, 0xc7, 0x49, 0x77, - 0x0d, 0xb5, 0xb0, 0x63, 0x25, 0x2e, 0xd2, 0x76, 0xd1, 0x96, 0xa2, 0xc6, 0x36, 0x61, 0x7d, 0x61, - 0x48, 0xdb, 0x9b, 0xbd, 0x10, 0xb4, 0x34, 0x96, 0x07, 0x4b, 0x91, 0x02, 0x49, 0x7b, 0xe3, 0x63, - 0xaf, 0x7b, 0xea, 0xb1, 0xbd, 0xed, 0xad, 0x97, 0x1e, 0x5a, 0xf4, 0x2f, 0xec, 0x61, 0x2f, 0x05, - 0xf6, 0xd8, 0x5e, 0x8a, 0x45, 0x72, 0x68, 0xff, 0x42, 0x6f, 0xc5, 0x0c, 0x29, 0x89, 0xb2, 0x14, - 0xa3, 0x17, 0x63, 0xe6, 0x79, 0x9e, 0xf7, 0x9d, 0xf7, 0x6b, 0x86, 0x16, 0xac, 0xf4, 0x79, 0x7f, - 0xe7, 0x6a, 0x77, 0x67, 0xc0, 0x5c, 0x16, 0xf0, 0x60, 0x7b, 0xe4, 0x7b, 0xa1, 0x87, 0x73, 0x7d, - 0xde, 0xdf, 0xbe, 0xda, 0x5d, 0xbd, 0x67, 0x0f, 0xb9, 0xeb, 0xed, 0xc8, 0xbf, 0x11, 0xb5, 0xba, - 0x32, 0xf0, 0x06, 0x9e, 0x5c, 0xee, 0x88, 0x55, 0x84, 0x6e, 0x7e, 0x0e, 0xcb, 0x07, 0x91, 0x07, - 0x23, 0xb4, 0x43, 0x86, 0x7f, 0x06, 0xb9, 0x91, 0xed, 0xdb, 0xc3, 0xa0, 0xa2, 0x6c, 0x28, 0x5b, - 0xa5, 0x5a, 0x79, 0x3b, 0xf2, 0xb8, 0xdd, 0x95, 0x68, 0x3d, 0xf3, 0xfd, 0xbf, 0xd6, 0x97, 0x68, - 0xac, 0xd9, 0xfc, 0x5b, 0x1a, 0x72, 0x11, 0x81, 0x7f, 0x0b, 0xf8, 0xeb, 0x0b, 0x1e, 0x32, 0x87, - 0x07, 0x21, 0xeb, 0x5b, 0x76, 0x10, 0xb0, 0x50, 0x38, 0x49, 0x6f, 0x95, 0x6a, 0xf7, 0xc6, 0x4e, - 0x54, 0x81, 0xea, 0xee, 0xb9, 0x47, 0xef, 0x25, 0xc4, 0x12, 0x9d, 0xf3, 0xd0, 0xbb, 0xb0, 0xb9, - 0x1b, 0x54, 0x52, 0xb3, 0x1e, 0x34, 0x81, 0xce, 0x79, 0x90, 0x68, 0x80, 0x7f, 0x03, 0xf7, 0x6d, - 0xc7, 0xf1, 0xbe, 0x66, 0x7d, 0x6b, 0x74, 0x79, 0xe6, 0xf0, 0x9e, 0xf5, 0x15, 0xbb, 0x0e, 0x2a, - 0x69, 0xe9, 0xe2, 0xee, 0xd8, 0xc5, 0x11, 0xbb, 0x8e, 0x1c, 0xc4, 0xda, 0xae, 0x94, 0x1e, 0xb1, - 0xeb, 0x00, 0xaf, 0x43, 0x89, 0x8f, 0xce, 0x03, 0xcb, 0xee, 0x85, 0xfc, 0x8a, 0x55, 0x32, 0x1b, - 0xca, 0x56, 0x81, 0x82, 0x80, 0x54, 0x89, 0xe0, 0x06, 0xac, 0x39, 0x5e, 0xcf, 0x76, 0x2e, 0xbc, - 0x20, 0xb4, 0x7c, 0x36, 0xe0, 0x41, 0xe8, 0xdb, 0x21, 0xf7, 0x5c, 0x8b, 0xb9, 0xf6, 0x99, 0xc3, - 0xfa, 0x95, 0xac, 0xb4, 0x79, 0x32, 0x51, 0xd1, 0x84, 0x88, 0x44, 0x1a, 0xfc, 0x0a, 0x1e, 0xf4, - 0x3c, 0xf7, 0x8a, 0x5d, 0xdb, 0x6e, 0x8f, 0x59, 0x23, 0x9f, 0x9d, 0x33, 0x9f, 0xb9, 0x3d, 0x56, - 0xc9, 0x6d, 0x28, 0x5b, 0x45, 0xba, 0x32, 0x25, 0xbb, 0x13, 0x0e, 0xef, 0xc0, 0x7d, 0x3b, 0x0c, - 0x59, 0x10, 0x46, 0xe7, 0x9d, 0x7b, 0xfe, 0xd0, 0x0e, 0x83, 0x4a, 0x7e, 0x23, 0xbd, 0x55, 0xa4, - 0x38, 0x41, 0xed, 0x47, 0xcc, 0x2f, 0x3f, 0xf9, 0xc3, 0xb7, 0xeb, 0x4b, 0xff, 0xf9, 0x76, 0x5d, - 0xf9, 0xe6, 0xdf, 0x7f, 0xa9, 0x82, 0x18, 0x97, 0xb8, 0x6b, 0xdf, 0x29, 0x50, 0x9c, 0x74, 0x02, - 0xaf, 0x40, 0x96, 0xbb, 0x7d, 0xf6, 0x4e, 0x36, 0x3c, 0x4d, 0xa3, 0x0d, 0x46, 0x90, 0xbe, 0xf0, - 0x47, 0x95, 0x94, 0x0c, 0x48, 0x2c, 0xf1, 0x43, 0xc8, 0x05, 0xd7, 0xc3, 0x33, 0xcf, 0xa9, 0xa4, - 0x25, 0x18, 0xef, 0xf0, 0x4b, 0x00, 0xd9, 0x6c, 0x2b, 0xbc, 0x1e, 0x45, 0x25, 0x2b, 0xdf, 0x68, - 0xb8, 0x79, 0x3d, 0x62, 0xb4, 0x68, 0x8f, 0x97, 0x18, 0x43, 0xc6, 0xb5, 0x87, 0x4c, 0x96, 0xaa, - 0x48, 0xe5, 0x5a, 0x78, 0x1f, 0xb2, 0xf0, 0xc2, 0xeb, 0xc7, 0x35, 0x88, 0x77, 0xf8, 0x11, 0x14, - 0x78, 0xcf, 0x73, 0xad, 0x4b, 0xdf, 0xa9, 0xe4, 0x25, 0x93, 0x17, 0xfb, 0x63, 0xdf, 0xd9, 0xfc, - 0xa3, 0x02, 0xc5, 0xc9, 0x38, 0xe0, 0x32, 0xa4, 0x78, 0x5f, 0xe6, 0x50, 0xa4, 0x29, 0x2e, 0x0d, - 0xe5, 0x04, 0x59, 0xbc, 0x1f, 0x67, 0x91, 0x97, 0x7b, 0xbd, 0x3f, 0x39, 0x3f, 0x3d, 0x7b, 0x7e, - 0x9c, 0x5d, 0x66, 0x26, 0xbb, 0x3d, 0x80, 0x2b, 0xdb, 0xe1, 0x7d, 0x3b, 0xf4, 0xfc, 0xa0, 0x92, - 0x95, 0x93, 0xf4, 0x60, 0x9c, 0xdd, 0xc9, 0x98, 0x91, 0xf3, 0x94, 0x10, 0x6e, 0xfe, 0xa8, 0x40, - 0x3e, 0x9e, 0x33, 0xfc, 0x1c, 0x32, 0xbe, 0xe7, 0x30, 0x19, 0x5b, 0x79, 0x66, 0x0c, 0xa9, 0xe7, - 0x30, 0x2a, 0x49, 0x5c, 0x83, 0xa2, 0xed, 0x0c, 0x3c, 0x9f, 0x87, 0x17, 0x43, 0x19, 0x6f, 0xb9, - 0xb6, 0x92, 0x50, 0xaa, 0x63, 0x8e, 0x4e, 0x65, 0x78, 0x07, 0x0a, 0xcc, 0xed, 0x79, 0x7d, 0xee, - 0x0e, 0x64, 0x2e, 0xe5, 0xda, 0xfd, 0x84, 0x09, 0x89, 0x29, 0x3a, 0x11, 0xe1, 0x4f, 0x21, 0xdb, - 0xbb, 0xf4, 0xaf, 0xc6, 0x5d, 0x42, 0x09, 0xb5, 0x26, 0x70, 0x1a, 0xd1, 0x22, 0x62, 0xd9, 0xcc, - 0xec, 0x5c, 0xc4, 0xb2, 0x95, 0x92, 0xdc, 0xfc, 0x7b, 0x16, 0xee, 0xcc, 0x14, 0x00, 0x57, 0x20, - 0x3f, 0xf4, 0x5c, 0xfe, 0x15, 0xf3, 0xe3, 0x3e, 0x8c, 0xb7, 0x98, 0x40, 0x79, 0xe0, 0x8f, 0x7a, - 0x16, 0x73, 0xfb, 0x23, 0x8f, 0xbb, 0xe1, 0xf8, 0x5a, 0xaf, 0x2d, 0xac, 0xe4, 0x36, 0x89, 0x65, - 0xf4, 0x8e, 0xb0, 0x1a, 0xef, 0x02, 0xe1, 0xc6, 0x67, 0x41, 0x98, 0x70, 0x93, 0xfe, 0xff, 0xdc, - 0x08, 0xab, 0xa9, 0x9b, 0x5f, 0x43, 0x81, 0xbd, 0x1b, 0x39, 0x9e, 0xcf, 0x7c, 0x59, 0x89, 0x52, - 0x6d, 0xf3, 0x23, 0x0e, 0x62, 0x95, 0x6c, 0xef, 0xc4, 0x06, 0xbf, 0x81, 0xc2, 0x39, 0x63, 0x16, - 0x77, 0xcf, 0x3d, 0x59, 0xa2, 0x52, 0xed, 0xe9, 0x62, 0xfb, 0x7d, 0xc6, 0xa4, 0x69, 0xfe, 0x3c, - 0x5a, 0x60, 0x15, 0x4a, 0xfc, 0xac, 0x27, 0x9e, 0x36, 0xd7, 0x65, 0x8e, 0x1c, 0xf5, 0x52, 0x6d, - 0x63, 0xb1, 0xb1, 0x5e, 0xd7, 0xb4, 0x48, 0x47, 0x81, 0x9f, 0xf5, 0xe2, 0xf5, 0xea, 0xaf, 0xa0, - 0x30, 0xce, 0x44, 0x5c, 0x52, 0x71, 0x2f, 0xa2, 0x62, 0x8b, 0x25, 0x7e, 0x0a, 0xc0, 0x03, 0x6b, - 0xe4, 0xf3, 0xa1, 0xed, 0x5f, 0xcb, 0x39, 0x2a, 0xd0, 0x22, 0x0f, 0xba, 0x11, 0xb0, 0xfa, 0x1a, - 0x96, 0x93, 0x39, 0x4d, 0x6e, 0x82, 0x92, 0xb8, 0x09, 0xb1, 0xd3, 0xd4, 0xc4, 0xe9, 0xea, 0x5f, - 0x15, 0xc8, 0xc7, 0xa9, 0x88, 0x03, 0xce, 0xec, 0x80, 0x59, 0x7d, 0xe6, 0x7a, 0xc3, 0xd8, 0xae, - 0x28, 0x90, 0x86, 0x00, 0xf0, 0x63, 0x28, 0x8a, 0xd2, 0xf8, 0x76, 0xc8, 0xa2, 0x1e, 0x17, 0xa9, - 0xa8, 0x15, 0x15, 0x7b, 0xfc, 0x02, 0xca, 0xdc, 0xe5, 0xa1, 0x35, 0xb0, 0x03, 0xcb, 0xe1, 0x43, - 0x1e, 0xca, 0xa9, 0xcd, 0xd2, 0x65, 0x81, 0x1e, 0xd8, 0x41, 0x53, 0x60, 0xf8, 0x19, 0x2c, 0xf3, - 0xc0, 0x0a, 0xf8, 0xf0, 0xd2, 0x11, 0xaf, 0x65, 0xfc, 0x08, 0x97, 0x78, 0x60, 0x8c, 0x21, 0x21, - 0x11, 0x3e, 0x86, 0x97, 0x4e, 0xc8, 0x47, 0xce, 0xb5, 0x6c, 0x82, 0x42, 0x4b, 0x03, 0x3b, 0x68, - 0xc5, 0xd0, 0xea, 0x4b, 0x80, 0x69, 0x01, 0xe7, 0x1e, 0x07, 0x0c, 0x99, 0x91, 0xe7, 0x87, 0x71, - 0x92, 0x72, 0x5d, 0xfd, 0xf3, 0xf8, 0x55, 0x94, 0x6f, 0xd4, 0x2a, 0x3c, 0x54, 0x0d, 0x83, 0x98, - 0x96, 0xf9, 0xb6, 0x4b, 0xac, 0xe3, 0xb6, 0xd1, 0x25, 0x9a, 0xbe, 0xaf, 0x93, 0x06, 0x5a, 0xc2, - 0x0f, 0xe0, 0x5e, 0x82, 0x6b, 0xab, 0xa6, 0x7e, 0x42, 0x90, 0x82, 0x1f, 0x02, 0x4e, 0xc0, 0xa7, - 0x54, 0xed, 0x76, 0x49, 0x03, 0xa5, 0x6e, 0xe0, 0x86, 0xa9, 0x1e, 0xe9, 0xed, 0x03, 0x94, 0xc6, - 0xf7, 0xe1, 0x6e, 0x02, 0xef, 0x76, 0x3a, 0x4d, 0x94, 0xc1, 0x18, 0xca, 0x09, 0x50, 0xaf, 0x6b, - 0x28, 0x7b, 0x43, 0xa8, 0x9d, 0xd6, 0x5e, 0xa2, 0x5c, 0xf5, 0xbf, 0x0a, 0x2c, 0x37, 0xf4, 0x46, - 0xdb, 0x1e, 0xb2, 0x60, 0x64, 0xf7, 0x18, 0x7e, 0x0a, 0x8f, 0x1a, 0x7a, 0xc3, 0x6a, 0xab, 0x2d, - 0x62, 0x74, 0x55, 0xed, 0x66, 0xd0, 0x0f, 0x01, 0xcf, 0xd2, 0x7a, 0x77, 0xdf, 0x88, 0xa2, 0x9e, - 0xc5, 0x8d, 0x4e, 0x9b, 0xa2, 0x14, 0x7e, 0x04, 0x0f, 0x66, 0xf1, 0xba, 0x6e, 0x6a, 0x1d, 0xbd, - 0x8d, 0xd2, 0xa2, 0x36, 0xb3, 0x14, 0x31, 0x0f, 0x09, 0x25, 0xc7, 0x2d, 0x94, 0x11, 0xb5, 0xb9, - 0x71, 0x8c, 0x4c, 0x61, 0xce, 0xe4, 0x94, 0xd4, 0xd5, 0x63, 0xf3, 0xb0, 0x8d, 0x72, 0xf3, 0x26, - 0x8d, 0xd3, 0x36, 0xca, 0xcf, 0x07, 0x60, 0x10, 0x7a, 0xa2, 0x6b, 0x04, 0x15, 0xaa, 0xdf, 0x29, - 0xb0, 0x9c, 0x7c, 0x14, 0x45, 0xee, 0x47, 0xe4, 0xad, 0xa5, 0x36, 0x0f, 0x3a, 0x54, 0x37, 0x0f, - 0x5b, 0x37, 0x72, 0xff, 0x04, 0xee, 0xcf, 0xd2, 0xc4, 0xa8, 0xed, 0xfd, 0x1c, 0x29, 0x8b, 0x88, - 0x57, 0x6f, 0x5e, 0xa3, 0xd4, 0x22, 0x62, 0x6f, 0xb7, 0x86, 0xd2, 0x0b, 0x88, 0x46, 0xc3, 0x50, - 0x51, 0x06, 0x57, 0x60, 0x65, 0xc1, 0x19, 0x47, 0x28, 0xbb, 0xc0, 0x44, 0x13, 0x26, 0xb9, 0xea, - 0xef, 0x52, 0x50, 0x18, 0x3f, 0xbd, 0x22, 0x5d, 0xa1, 0xd2, 0x8e, 0xe9, 0xc9, 0xcd, 0xd6, 0x61, - 0x28, 0x4f, 0xa9, 0x6e, 0x14, 0xf9, 0x2c, 0x16, 0x05, 0x3d, 0x8b, 0xed, 0xd5, 0x76, 0x51, 0x1a, - 0xaf, 0x00, 0x9a, 0x62, 0x5f, 0xd4, 0xf6, 0xf6, 0x76, 0x7f, 0x11, 0x4d, 0x59, 0x02, 0x7d, 0xfd, - 0xfa, 0x0d, 0xca, 0x8a, 0x36, 0x4c, 0x31, 0xd2, 0x88, 0xa4, 0x39, 0x31, 0x7c, 0x49, 0x58, 0x68, - 0xf3, 0xe3, 0x94, 0x22, 0xd0, 0x20, 0x9a, 0x08, 0xea, 0x68, 0x17, 0x15, 0xc4, 0x34, 0x4d, 0x89, - 0x7a, 0xd3, 0xd8, 0xad, 0xbd, 0x7a, 0xb3, 0x8b, 0x8a, 0xb3, 0x06, 0x47, 0x44, 0xd3, 0xd4, 0x23, - 0x91, 0x07, 0x54, 0x03, 0x28, 0x25, 0xbe, 0x55, 0xf8, 0x09, 0x54, 0x84, 0x8e, 0xb4, 0xb5, 0x4e, - 0x43, 0x6f, 0x1f, 0xdc, 0x28, 0x44, 0x9c, 0xcc, 0x84, 0xa5, 0xea, 0x29, 0x52, 0xe6, 0xd0, 0x43, - 0xf2, 0x05, 0x4a, 0x89, 0x89, 0x9b, 0x41, 0x5b, 0xc7, 0x4d, 0x53, 0xaf, 0xab, 0x06, 0x41, 0xe9, - 0xea, 0x37, 0xd1, 0xd7, 0x59, 0x7c, 0x7e, 0xc7, 0x7d, 0xa3, 0x9d, 0xe6, 0xcd, 0xb2, 0x3f, 0x86, - 0x4f, 0x26, 0x8c, 0x98, 0x55, 0xd2, 0x36, 0x75, 0x4d, 0x35, 0xf5, 0x4e, 0x3b, 0xba, 0x36, 0x53, - 0xd2, 0x30, 0x08, 0x95, 0xf8, 0x64, 0x70, 0x24, 0xde, 0x20, 0x4d, 0x72, 0x10, 0x19, 0xa4, 0x67, - 0x08, 0xbd, 0x7d, 0xd2, 0x89, 0x3d, 0x65, 0xaa, 0xff, 0x8c, 0x82, 0x91, 0xaf, 0x4e, 0x1c, 0xcc, - 0x82, 0x37, 0x27, 0xee, 0x98, 0x64, 0x3a, 0x9a, 0x49, 0x4c, 0xa4, 0x8c, 0x3b, 0x26, 0x31, 0xd2, - 0x6c, 0xea, 0x5d, 0x53, 0xd7, 0x50, 0x0a, 0x23, 0x58, 0x9e, 0xc0, 0xd4, 0x50, 0x51, 0x7a, 0x1c, - 0x6c, 0xf4, 0xfe, 0xbc, 0x6d, 0xb5, 0x88, 0x49, 0x75, 0x0d, 0x65, 0xf0, 0x3d, 0xb8, 0x33, 0xc1, - 0x0f, 0x5b, 0xaa, 0xb8, 0xa8, 0x49, 0xe3, 0x56, 0x57, 0x43, 0x39, 0x7c, 0x17, 0x4a, 0x13, 0xe4, - 0xcb, 0x23, 0x94, 0x9f, 0x39, 0x76, 0x72, 0x8d, 0x0b, 0x33, 0x11, 0xd6, 0xf5, 0xee, 0xab, 0x1a, - 0x2a, 0x56, 0xcf, 0xe4, 0x3d, 0x0d, 0x2e, 0x6c, 0x9f, 0xc9, 0x62, 0x47, 0xf7, 0xd4, 0x38, 0x54, - 0x29, 0x59, 0x54, 0xf1, 0x28, 0xce, 0x24, 0x6d, 0x10, 0x8a, 0x94, 0xb8, 0x13, 0x09, 0xfc, 0x44, - 0x6d, 0xea, 0x0d, 0xd5, 0xec, 0x50, 0x94, 0xaa, 0xfe, 0x29, 0x03, 0x77, 0xbb, 0xcc, 0x1f, 0xf2, - 0x20, 0xe0, 0x9e, 0x6b, 0xf4, 0xbc, 0x11, 0xc3, 0x1b, 0xf0, 0xa4, 0x4b, 0x68, 0x4b, 0x37, 0x0c, - 0xbd, 0xd3, 0xb6, 0x0c, 0xad, 0x33, 0x57, 0xcf, 0x75, 0x78, 0x3c, 0xa7, 0xa8, 0xab, 0x86, 0xae, - 0x59, 0x7a, 0x7b, 0xbf, 0x83, 0x14, 0xfc, 0x13, 0x78, 0x36, 0x27, 0x98, 0x02, 0x86, 0x45, 0x89, - 0x2a, 0x1e, 0xf7, 0x4f, 0x61, 0xf3, 0x56, 0xd9, 0x29, 0xd5, 0x4d, 0x82, 0xd2, 0x0b, 0x75, 0x26, - 0x55, 0xdb, 0x86, 0xaa, 0x99, 0x53, 0x7f, 0x19, 0xfc, 0x19, 0x3c, 0xbf, 0x5d, 0x17, 0x39, 0xcc, - 0xe2, 0x67, 0xf0, 0x74, 0x4e, 0x78, 0xaa, 0x36, 0x9b, 0xc4, 0x8c, 0x7d, 0xe5, 0xf0, 0x73, 0x58, - 0xff, 0xa8, 0x44, 0xa3, 0x44, 0x35, 0x09, 0xca, 0x2f, 0x0c, 0x6c, 0x2c, 0x32, 0x8e, 0xeb, 0x86, - 0x46, 0xf5, 0x3a, 0x41, 0x85, 0x5b, 0x9d, 0x1d, 0x77, 0x1b, 0xc2, 0x59, 0x11, 0x6f, 0xc1, 0x8b, - 0xdb, 0xa3, 0x3f, 0x21, 0x54, 0xdf, 0x7f, 0x8b, 0x00, 0xff, 0x14, 0x3e, 0xbb, 0x5d, 0x59, 0xa7, - 0x1d, 0xb5, 0xa1, 0xa9, 0x86, 0x89, 0x4a, 0x0b, 0x9b, 0xa5, 0x36, 0x5a, 0x7a, 0x3b, 0x1a, 0x90, - 0x65, 0xfc, 0x02, 0x36, 0x3e, 0x22, 0x98, 0x4e, 0xca, 0x9d, 0xfa, 0xe7, 0xdf, 0xbf, 0x5f, 0x53, - 0x7e, 0x78, 0xbf, 0xa6, 0xfc, 0xf8, 0x7e, 0x4d, 0xf9, 0xfd, 0x87, 0xb5, 0xa5, 0x1f, 0x3e, 0xac, - 0x2d, 0xfd, 0xe3, 0xc3, 0xda, 0xd2, 0x97, 0x9b, 0x03, 0x1e, 0x5e, 0x5c, 0x9e, 0x6d, 0xf7, 0xbc, - 0xe1, 0x8e, 0xe7, 0x06, 0x9e, 0xeb, 0xef, 0xc8, 0x3f, 0xef, 0x76, 0xc4, 0xcf, 0x26, 0xf1, 0xef, - 0x6e, 0x70, 0x96, 0x93, 0x3f, 0x98, 0x5f, 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xd6, 0x38, - 0x0f, 0x79, 0x0f, 0x00, 0x00, + 0x19, 0x36, 0xf5, 0x65, 0xe9, 0x95, 0x63, 0x8f, 0x27, 0xde, 0x44, 0x71, 0x12, 0xdb, 0x71, 0x92, + 0x5d, 0xc3, 0x2d, 0xec, 0x58, 0x49, 0x8a, 0x74, 0x5b, 0x14, 0xa5, 0xa8, 0xb1, 0x4d, 0x58, 0x5f, + 0x18, 0xd2, 0xf6, 0x66, 0x2f, 0x04, 0x45, 0x8d, 0x65, 0x22, 0x14, 0x29, 0x90, 0xb4, 0x37, 0x3a, + 0x14, 0x68, 0xaf, 0x7b, 0xea, 0xb1, 0xc7, 0xbd, 0xf5, 0xd2, 0x43, 0xfb, 0x1f, 0x7a, 0xd8, 0x4b, + 0x81, 0x3d, 0xb6, 0x97, 0xc5, 0x22, 0x39, 0xb4, 0x7f, 0xa1, 0xb7, 0x62, 0x86, 0xa4, 0x44, 0xc9, + 0x8a, 0xd1, 0x8b, 0x31, 0xf3, 0x3c, 0xcf, 0xfb, 0xce, 0xfb, 0x35, 0x43, 0x0b, 0xd6, 0x7a, 0x76, + 0x6f, 0xff, 0xfa, 0x60, 0xbf, 0xcf, 0x5c, 0x16, 0xd8, 0xc1, 0xde, 0xd0, 0xf7, 0x42, 0x0f, 0x17, + 0x7a, 0x76, 0x6f, 0xef, 0xfa, 0x60, 0x7d, 0xd5, 0x1c, 0xd8, 0xae, 0xb7, 0x2f, 0xfe, 0x46, 0xd4, + 0xfa, 0x5a, 0xdf, 0xeb, 0x7b, 0x62, 0xb9, 0xcf, 0x57, 0x11, 0xba, 0xfd, 0x7b, 0x09, 0x96, 0x8e, + 0x22, 0x17, 0x5a, 0x68, 0x86, 0x0c, 0xff, 0x1c, 0x0a, 0x43, 0xd3, 0x37, 0x07, 0x41, 0x45, 0xda, + 0x92, 0x76, 0xca, 0xd5, 0xe5, 0xbd, 0xc8, 0xe5, 0x5e, 0x47, 0xa0, 0xb5, 0xdc, 0xf7, 0x3f, 0x6e, + 0x2e, 0xd0, 0x58, 0x83, 0x6b, 0x80, 0xfa, 0x8e, 0xd7, 0x35, 0x1d, 0xc3, 0x76, 0x43, 0xd6, 0xf7, + 0xed, 0x70, 0x54, 0xc9, 0x08, 0xbb, 0xfb, 0x89, 0xdd, 0x91, 0xe0, 0xd5, 0x84, 0xa6, 0x2b, 0xfd, + 0x69, 0x60, 0xfb, 0x77, 0xb0, 0x32, 0xa3, 0xc1, 0x1b, 0x00, 0x96, 0xe7, 0x86, 0xbe, 0xe7, 0x38, + 0xcc, 0x17, 0x81, 0x94, 0x68, 0x0a, 0xc1, 0x18, 0x72, 0x01, 0x63, 0x3d, 0x71, 0x54, 0x89, 0x8a, + 0x35, 0xde, 0x82, 0xb2, 0x69, 0x59, 0x57, 0x83, 0x2b, 0xc7, 0x0c, 0x3d, 0xbf, 0x92, 0xdd, 0x92, + 0x76, 0x96, 0x68, 0x1a, 0xc2, 0x6b, 0x90, 0xb7, 0xbc, 0x2b, 0x37, 0xac, 0xe4, 0xb6, 0xa4, 0x9d, + 0x1c, 0x8d, 0x36, 0xdb, 0x3f, 0x66, 0xa1, 0x10, 0xe5, 0x86, 0x7f, 0x0b, 0xf8, 0x9b, 0x4b, 0x3b, + 0x64, 0x8e, 0x1d, 0x84, 0xac, 0x67, 0x98, 0x41, 0xc0, 0x42, 0x5e, 0x87, 0xec, 0x4e, 0xb9, 0xba, + 0x9a, 0xe4, 0x23, 0x73, 0x54, 0x75, 0x2f, 0x3c, 0xba, 0x9a, 0x12, 0x0b, 0x34, 0xc0, 0xa7, 0x70, + 0xd7, 0x74, 0x1c, 0xef, 0x1b, 0xd6, 0x33, 0x86, 0x57, 0x5d, 0xc7, 0xb6, 0x8c, 0x77, 0x6c, 0x14, + 0x54, 0x32, 0xc2, 0xc5, 0xf3, 0xe9, 0x52, 0xee, 0xc9, 0x91, 0xb2, 0x23, 0x84, 0x27, 0x6c, 0x14, + 0x10, 0x37, 0xf4, 0x47, 0x74, 0xd5, 0x9c, 0xc5, 0xf1, 0x26, 0x94, 0xed, 0xe1, 0x45, 0x60, 0x98, + 0x56, 0x68, 0x5f, 0x33, 0x91, 0x5b, 0x91, 0x02, 0x87, 0x64, 0x81, 0xe0, 0x3a, 0x6c, 0x38, 0x9e, + 0x65, 0x3a, 0x97, 0x5e, 0x10, 0x1a, 0x3e, 0xeb, 0xdb, 0x41, 0xe8, 0x9b, 0xa1, 0xed, 0xb9, 0x06, + 0x73, 0xcd, 0xae, 0xc3, 0x7a, 0x22, 0xe7, 0x22, 0x7d, 0x34, 0x56, 0xd1, 0x94, 0x88, 0x44, 0x1a, + 0xfc, 0x12, 0x3e, 0xb3, 0x3c, 0xf7, 0x9a, 0x8d, 0x4c, 0xd7, 0x62, 0xc6, 0xd0, 0x67, 0x17, 0xcc, + 0x67, 0xae, 0xc5, 0x2a, 0x79, 0x51, 0xe7, 0xb5, 0x09, 0xd9, 0x19, 0x73, 0x78, 0x1f, 0xee, 0x9a, + 0x61, 0xc8, 0x82, 0x30, 0x3a, 0xef, 0xc2, 0xf3, 0x07, 0x66, 0x18, 0x54, 0x0a, 0x5b, 0xd9, 0x9d, + 0x12, 0xc5, 0x29, 0xea, 0x30, 0x62, 0xd6, 0x4f, 0xe1, 0xde, 0xfc, 0xcc, 0x31, 0x82, 0xec, 0x3b, + 0x36, 0x8a, 0xfb, 0xcd, 0x97, 0xf8, 0x39, 0xe4, 0xaf, 0x4d, 0xe7, 0x8a, 0xc5, 0x43, 0xb5, 0x92, + 0x54, 0xf0, 0x84, 0x8d, 0x44, 0x0b, 0x22, 0xf6, 0xcb, 0xcc, 0x1b, 0xe9, 0xcb, 0xfb, 0x7f, 0xfa, + 0x6e, 0x73, 0xe1, 0x3f, 0xdf, 0x6d, 0x4a, 0xdf, 0xfe, 0xfb, 0xaf, 0xbb, 0xc0, 0x6f, 0x47, 0x34, + 0xa3, 0xdb, 0x7f, 0x91, 0xa0, 0x34, 0x6e, 0x1a, 0x1f, 0x02, 0xdb, 0xed, 0xb1, 0xf7, 0xe2, 0x94, + 0x2c, 0x8d, 0x36, 0xfc, 0xe4, 0x4b, 0x7f, 0x18, 0xcf, 0x13, 0x5f, 0xe2, 0x7b, 0x50, 0x08, 0x46, + 0x83, 0xae, 0xe7, 0x88, 0x6a, 0x97, 0x68, 0xbc, 0xc3, 0x2f, 0x00, 0xc4, 0x5c, 0x18, 0xe1, 0x68, + 0xc8, 0x44, 0x55, 0x97, 0x67, 0x66, 0x43, 0x1f, 0x0d, 0x19, 0x2d, 0x99, 0xc9, 0x92, 0x0f, 0xab, + 0x6b, 0x0e, 0x92, 0x22, 0x8a, 0x35, 0x7e, 0x00, 0x45, 0xdb, 0xf2, 0x5c, 0xe3, 0xca, 0x77, 0x2a, + 0x05, 0x81, 0x2f, 0xf2, 0xfd, 0xa9, 0xef, 0x6c, 0xff, 0x24, 0xc1, 0x62, 0x9c, 0x1e, 0x7e, 0x0a, + 0x39, 0xdf, 0x73, 0x98, 0x88, 0x75, 0x79, 0x2a, 0x7b, 0xea, 0x39, 0x8c, 0x0a, 0x12, 0x57, 0xa1, + 0x64, 0x3a, 0x7d, 0xcf, 0xb7, 0xc3, 0xcb, 0x81, 0xc8, 0x60, 0xb9, 0xba, 0x96, 0x52, 0xca, 0x09, + 0x47, 0x27, 0x32, 0xbc, 0x0f, 0x45, 0xe6, 0x5a, 0x5e, 0xcf, 0x76, 0xfb, 0x22, 0xbf, 0xe5, 0xea, + 0xdd, 0x94, 0x09, 0x89, 0x29, 0x3a, 0x16, 0xe1, 0xcf, 0x21, 0x6f, 0x5d, 0xf9, 0xd7, 0x49, 0xc6, + 0x28, 0xa5, 0x56, 0x38, 0x4e, 0x23, 0x9a, 0x47, 0x2c, 0x0a, 0x93, 0xbf, 0x11, 0xb1, 0x28, 0x8b, + 0x20, 0xb7, 0xff, 0x91, 0x87, 0x3b, 0x67, 0xa6, 0x63, 0xf7, 0xf8, 0xb5, 0x14, 0x89, 0x56, 0x60, + 0x71, 0xe0, 0xb9, 0xf6, 0xbb, 0xf1, 0x6d, 0x4f, 0xb6, 0x98, 0xc0, 0x72, 0xdf, 0x1f, 0x5a, 0x06, + 0x73, 0x7b, 0x43, 0xcf, 0x76, 0xc3, 0xe4, 0x32, 0x6d, 0x24, 0xae, 0xa7, 0x1c, 0xed, 0x91, 0x58, + 0x46, 0xef, 0x70, 0xab, 0x64, 0x17, 0x70, 0x37, 0x3e, 0x0b, 0xc2, 0x94, 0x9b, 0xec, 0xff, 0xe7, + 0x86, 0x5b, 0x4d, 0xdc, 0xfc, 0x06, 0x8a, 0xec, 0xfd, 0xd0, 0xf1, 0x7c, 0xe6, 0x8b, 0x4a, 0x94, + 0xab, 0xdb, 0x9f, 0x70, 0x10, 0xab, 0xc4, 0x94, 0x8e, 0x6d, 0xf0, 0x1b, 0x28, 0x5e, 0x30, 0x66, + 0xd8, 0xee, 0x85, 0x27, 0x4a, 0x54, 0xae, 0x3e, 0x9e, 0x6f, 0x7f, 0xc8, 0x98, 0x30, 0x5d, 0xbc, + 0x88, 0x16, 0x58, 0x86, 0xb2, 0xdd, 0xb5, 0x0c, 0xeb, 0xd2, 0x74, 0x5d, 0x16, 0x0d, 0x4d, 0xb9, + 0xba, 0x35, 0xdf, 0x58, 0xad, 0x29, 0x4a, 0xa4, 0xa3, 0x60, 0x77, 0xad, 0x78, 0xbd, 0xfe, 0x2b, + 0x28, 0x26, 0x99, 0xf0, 0x81, 0xe7, 0xb3, 0x17, 0x5f, 0xb5, 0x2b, 0xdf, 0xc1, 0x8f, 0x01, 0xec, + 0xc0, 0x18, 0xfa, 0xf6, 0xc0, 0xf4, 0xa3, 0x47, 0xbc, 0x48, 0x4b, 0x76, 0xd0, 0x89, 0x80, 0xf5, + 0x57, 0xb0, 0x94, 0xce, 0x69, 0x3c, 0xd5, 0x52, 0x6a, 0xaa, 0x63, 0xa7, 0x99, 0xb1, 0xd3, 0xf5, + 0xbf, 0x49, 0xb0, 0x18, 0xa7, 0xc2, 0x0f, 0xe8, 0x9a, 0x01, 0x33, 0x7a, 0xcc, 0xf5, 0x06, 0xb1, + 0x5d, 0x89, 0x23, 0x75, 0x0e, 0xe0, 0x87, 0x50, 0xe2, 0xa5, 0xf1, 0xcd, 0x90, 0x45, 0x3d, 0x2e, + 0x51, 0x5e, 0x2b, 0xca, 0xf7, 0xf8, 0x19, 0x2c, 0xdb, 0xae, 0x1d, 0x1a, 0x7d, 0x33, 0x30, 0x1c, + 0x7b, 0x60, 0x87, 0x62, 0x6a, 0xf3, 0x74, 0x89, 0xa3, 0x47, 0x66, 0xd0, 0xe0, 0x18, 0x7e, 0x02, + 0x4b, 0x76, 0x60, 0x04, 0x36, 0x7f, 0xf0, 0xbb, 0x0e, 0x8b, 0xdf, 0xbc, 0xb2, 0x1d, 0x68, 0x09, + 0xc4, 0x25, 0xdc, 0xc7, 0xe0, 0xca, 0x09, 0xed, 0xa1, 0x33, 0x12, 0x4d, 0x90, 0x68, 0xb9, 0x6f, + 0x06, 0xcd, 0x18, 0x5a, 0x7f, 0x01, 0x30, 0x29, 0x20, 0x5e, 0x86, 0x8c, 0xdd, 0x8b, 0xa3, 0xcd, + 0xd8, 0x3d, 0x9e, 0xf7, 0xd0, 0xf3, 0xc3, 0xe4, 0xd3, 0xc3, 0xd7, 0xbb, 0xe3, 0x17, 0x46, 0xdc, + 0xf7, 0x75, 0xb8, 0x27, 0x6b, 0x1a, 0xd1, 0x0d, 0xfd, 0x6d, 0x87, 0x18, 0xa7, 0x2d, 0xad, 0x43, + 0x14, 0xf5, 0x50, 0x25, 0x75, 0xb4, 0x80, 0x3f, 0x83, 0xd5, 0x14, 0xd7, 0x92, 0x75, 0xf5, 0x8c, + 0x20, 0x09, 0xdf, 0x03, 0x9c, 0x82, 0xcf, 0xa9, 0xdc, 0xe9, 0x90, 0x3a, 0xca, 0xcc, 0xe0, 0x9a, + 0x2e, 0x9f, 0xa8, 0xad, 0x23, 0x94, 0xc5, 0x77, 0x61, 0x25, 0x85, 0x77, 0xda, 0xed, 0x06, 0xca, + 0x61, 0x0c, 0xcb, 0x29, 0x50, 0xad, 0x29, 0x28, 0x3f, 0x23, 0x54, 0xce, 0xab, 0x2f, 0x50, 0x61, + 0xf7, 0xbf, 0x12, 0x2c, 0xd5, 0xd5, 0x7a, 0xcb, 0x1c, 0xb0, 0x60, 0x68, 0x5a, 0x0c, 0x3f, 0x86, + 0x07, 0x75, 0xb5, 0x6e, 0xb4, 0xe4, 0x26, 0xd1, 0x3a, 0xb2, 0x32, 0x1b, 0xf4, 0x3d, 0xc0, 0xd3, + 0xb4, 0xda, 0x39, 0xd4, 0xa2, 0xa8, 0xa7, 0x71, 0xad, 0xdd, 0xa2, 0x28, 0x83, 0x1f, 0xc0, 0x67, + 0xd3, 0x78, 0x4d, 0xd5, 0x95, 0xb6, 0xda, 0x42, 0x59, 0x5e, 0x9b, 0x69, 0x8a, 0xe8, 0xc7, 0x84, + 0x92, 0xd3, 0x26, 0xca, 0xf1, 0xda, 0xcc, 0x1c, 0x23, 0x52, 0xb8, 0x61, 0x72, 0x4e, 0x6a, 0xf2, + 0xa9, 0x7e, 0xdc, 0x42, 0x85, 0x9b, 0x26, 0xf5, 0xf3, 0x16, 0x5a, 0xbc, 0x19, 0x80, 0x46, 0xe8, + 0x99, 0xaa, 0x10, 0x54, 0xdc, 0xfd, 0xbb, 0x04, 0x4b, 0xe9, 0x47, 0x91, 0xe7, 0x7e, 0x42, 0xde, + 0x1a, 0x72, 0xe3, 0xa8, 0x4d, 0x55, 0xfd, 0xb8, 0x39, 0x93, 0xfb, 0x7d, 0xb8, 0x3b, 0x4d, 0x13, + 0xad, 0xfa, 0xfa, 0x17, 0x48, 0x9a, 0x47, 0xbc, 0x7c, 0xf3, 0x0a, 0x65, 0xe6, 0x11, 0xaf, 0x0f, + 0xaa, 0x28, 0x3b, 0x87, 0xa8, 0xd7, 0x35, 0x19, 0xe5, 0x70, 0x05, 0xd6, 0xe6, 0x9c, 0x71, 0x82, + 0xf2, 0x73, 0x4c, 0x14, 0x6e, 0x52, 0xd8, 0xfd, 0x43, 0x06, 0x8a, 0xc9, 0xd3, 0xcb, 0xd3, 0xe5, + 0x2a, 0xe5, 0x94, 0x9e, 0xcd, 0xb6, 0x0e, 0xc3, 0xf2, 0x84, 0xea, 0x44, 0x91, 0x4f, 0x63, 0x51, + 0xd0, 0xd3, 0xd8, 0xeb, 0xea, 0x01, 0xca, 0xe2, 0x35, 0x40, 0x13, 0xec, 0xab, 0xea, 0xeb, 0xd7, + 0x07, 0xbf, 0x8c, 0xa6, 0x2c, 0x85, 0xbe, 0x7a, 0xf5, 0x06, 0xe5, 0x79, 0x1b, 0x26, 0x18, 0xa9, + 0x47, 0xd2, 0x02, 0x1f, 0xbe, 0x34, 0xcc, 0xb5, 0x8b, 0x49, 0x4a, 0x11, 0xa8, 0x11, 0x85, 0x07, + 0x75, 0x72, 0x80, 0x8a, 0x7c, 0x9a, 0x26, 0x44, 0xad, 0xa1, 0x1d, 0x54, 0x5f, 0xbe, 0x39, 0x40, + 0xa5, 0x69, 0x83, 0x13, 0xa2, 0x28, 0xf2, 0x09, 0xcf, 0x03, 0x76, 0x03, 0x28, 0xa7, 0xbe, 0x55, + 0xf8, 0x11, 0x54, 0xb8, 0x8e, 0xb4, 0x94, 0x76, 0x5d, 0x6d, 0x1d, 0xcd, 0x14, 0x22, 0x4e, 0x66, + 0xcc, 0x52, 0xf9, 0x1c, 0x49, 0x37, 0xd0, 0x63, 0xf2, 0x15, 0xca, 0xf0, 0x89, 0x9b, 0x42, 0x9b, + 0xa7, 0x0d, 0x5d, 0xad, 0xc9, 0x1a, 0x41, 0xd9, 0xdd, 0x6f, 0xa3, 0xaf, 0x33, 0xff, 0xfc, 0x26, + 0x7d, 0xa3, 0xed, 0xc6, 0x6c, 0xd9, 0x1f, 0xc2, 0xfd, 0x31, 0xc3, 0x67, 0x95, 0xb4, 0x74, 0x55, + 0x91, 0x75, 0xb5, 0xdd, 0x8a, 0xae, 0xcd, 0x84, 0xd4, 0x34, 0x42, 0x05, 0x3e, 0x1e, 0x1c, 0x81, + 0xd7, 0x49, 0x83, 0x1c, 0x45, 0x06, 0xd9, 0x29, 0x42, 0x6d, 0x9d, 0xb5, 0x63, 0x4f, 0xb9, 0xdd, + 0x7f, 0x45, 0xc1, 0x88, 0x57, 0x27, 0x0e, 0x66, 0xce, 0x9b, 0x13, 0x77, 0x4c, 0x30, 0x6d, 0x45, + 0x27, 0x3a, 0x92, 0x92, 0x8e, 0x09, 0x8c, 0x34, 0x1a, 0x6a, 0x47, 0x57, 0x15, 0x94, 0xc1, 0x08, + 0x96, 0xc6, 0x30, 0xd5, 0x64, 0x94, 0x4d, 0x82, 0x8d, 0xde, 0x9f, 0xb7, 0xcd, 0x26, 0xd1, 0xa9, + 0xaa, 0xa0, 0x1c, 0x5e, 0x85, 0x3b, 0x63, 0xfc, 0xb8, 0x29, 0xf3, 0x8b, 0x9a, 0x36, 0x6e, 0x76, + 0x14, 0x54, 0xc0, 0x2b, 0x50, 0x1e, 0x23, 0x5f, 0x9f, 0xa0, 0xc5, 0xa9, 0x63, 0xc7, 0xd7, 0xb8, + 0x38, 0x15, 0x61, 0x4d, 0xed, 0xbc, 0xac, 0xa2, 0xd2, 0x6e, 0x57, 0xdc, 0xd3, 0xe0, 0xd2, 0xf4, + 0x99, 0x28, 0x76, 0x74, 0x4f, 0xb5, 0x63, 0x99, 0x92, 0x79, 0x15, 0x8f, 0xe2, 0x4c, 0xd3, 0x1a, + 0xa1, 0x48, 0x8a, 0x3b, 0x91, 0xc2, 0xcf, 0xe4, 0x86, 0x5a, 0x97, 0xf5, 0x36, 0x45, 0x99, 0xdd, + 0x3f, 0xe7, 0x60, 0xa5, 0xc3, 0xfc, 0x81, 0x1d, 0x04, 0xb6, 0xe7, 0x6a, 0x96, 0x37, 0x64, 0x78, + 0x0b, 0x1e, 0x75, 0x08, 0x6d, 0xaa, 0x9a, 0xa6, 0xb6, 0x5b, 0x86, 0xa6, 0xb4, 0x6f, 0xd4, 0x73, + 0x13, 0x1e, 0xde, 0x50, 0xd4, 0x64, 0x4d, 0x55, 0x0c, 0xb5, 0x75, 0xd8, 0x46, 0x12, 0x7e, 0x0e, + 0x4f, 0x6e, 0x08, 0x26, 0x80, 0x66, 0x50, 0x22, 0xf3, 0xc7, 0xfd, 0x73, 0xd8, 0xbe, 0x55, 0x76, + 0x4e, 0x55, 0x9d, 0xa0, 0xec, 0x5c, 0x9d, 0x4e, 0xe5, 0x96, 0x26, 0x2b, 0xfa, 0xc4, 0x5f, 0x0e, + 0x7f, 0x01, 0x4f, 0x6f, 0xd7, 0x45, 0x0e, 0xf3, 0xf8, 0x09, 0x3c, 0xbe, 0x21, 0x3c, 0x97, 0x1b, + 0x0d, 0xa2, 0xc7, 0xbe, 0x0a, 0xf8, 0x29, 0x6c, 0x7e, 0x52, 0xa2, 0x50, 0x22, 0xeb, 0x04, 0x2d, + 0xce, 0x0d, 0x2c, 0x11, 0x69, 0xa7, 0x35, 0x4d, 0xa1, 0x6a, 0x8d, 0xa0, 0xe2, 0xad, 0xce, 0x4e, + 0x3b, 0x75, 0xee, 0xac, 0x84, 0x77, 0xe0, 0xd9, 0xed, 0xd1, 0x9f, 0x11, 0xaa, 0x1e, 0xbe, 0x45, + 0x80, 0x7f, 0x06, 0x5f, 0xdc, 0xae, 0xac, 0xd1, 0xb6, 0x5c, 0x57, 0x64, 0x4d, 0x47, 0xe5, 0xb9, + 0xcd, 0x92, 0xeb, 0x4d, 0xb5, 0x15, 0x0d, 0xc8, 0x12, 0x7e, 0x06, 0x5b, 0x9f, 0x10, 0x4c, 0x26, + 0xe5, 0x4e, 0xed, 0xd7, 0xdf, 0x7f, 0xd8, 0x90, 0x7e, 0xf8, 0xb0, 0x21, 0xfd, 0xf4, 0x61, 0x43, + 0xfa, 0xe3, 0xc7, 0x8d, 0x85, 0x1f, 0x3e, 0x6e, 0x2c, 0xfc, 0xf3, 0xe3, 0xc6, 0xc2, 0xd7, 0xdb, + 0x7d, 0x3b, 0xbc, 0xbc, 0xea, 0xee, 0x59, 0xde, 0x60, 0xdf, 0x73, 0x03, 0xcf, 0xf5, 0xf7, 0xc5, + 0x9f, 0xf7, 0xfb, 0xfc, 0x27, 0x08, 0xff, 0x77, 0x37, 0xe8, 0x16, 0xc4, 0x6f, 0xed, 0x97, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0xff, 0xaa, 0xef, 0xb3, 0x35, 0xb4, 0x0f, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -1303,14 +1290,6 @@ func (this *Params) Equal(that interface{}) bool { return false } } - if len(this.WhitelistedChains) != len(that1.WhitelistedChains) { - return false - } - for i := range this.WhitelistedChains { - if !this.WhitelistedChains[i].Equal(that1.WhitelistedChains[i]) { - return false - } - } if len(this.AllowedPublicKeys) != len(that1.AllowedPublicKeys) { return false } @@ -1358,6 +1337,18 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.GlobalIntegrity != nil { + { + size, err := m.GlobalIntegrity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1371,6 +1362,55 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GlobalIntegrity) 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 *GlobalIntegrity) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GlobalIntegrity) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Count != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x20 + } + if len(m.Accumulator) > 0 { + i -= len(m.Accumulator) + copy(dAtA[i:], m.Accumulator) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Accumulator))) + i-- + dAtA[i] = 0x1a + } + if len(m.Seed) > 0 { + i -= len(m.Seed) + copy(dAtA[i:], m.Seed) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Seed))) + i-- + dAtA[i] = 0x12 + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1397,7 +1437,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.AttestationFormats[iNdEx]) i = encodeVarintGenesis(dAtA, i, uint64(len(m.AttestationFormats[iNdEx]))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x32 } } if len(m.ConveyancePreference) > 0 { @@ -1405,7 +1445,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.ConveyancePreference) i = encodeVarintGenesis(dAtA, i, uint64(len(m.ConveyancePreference))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } if m.LocalhostRegistrationEnabled { i-- @@ -1415,7 +1455,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x28 + dAtA[i] = 0x20 } if m.IpfsActive { i-- @@ -1425,32 +1465,30 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x20 + dAtA[i] = 0x18 } if len(m.AllowedPublicKeys) > 0 { - for iNdEx := len(m.AllowedPublicKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AllowedPublicKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + for k := range m.AllowedPublicKeys { + v := m.AllowedPublicKeys[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGenesis(dAtA, i, uint64(len(k))) i-- - dAtA[i] = 0x1a - } - } - if len(m.WhitelistedChains) > 0 { - for iNdEx := len(m.WhitelistedChains) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.WhitelistedChains[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } + dAtA[i] = 0xa + i = encodeVarintGenesis(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x12 } @@ -1497,13 +1535,6 @@ func (m *AssetInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.IconUrl) i = encodeVarintGenesis(dAtA, i, uint64(len(m.IconUrl))) i-- - dAtA[i] = 0x3a - } - if len(m.Method) > 0 { - i -= len(m.Method) - copy(dAtA[i:], m.Method) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Method))) - i-- dAtA[i] = 0x32 } if len(m.Name) > 0 { @@ -1540,71 +1571,6 @@ func (m *AssetInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ChainInfo) 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 *ChainInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChainInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Symbol))) - i-- - dAtA[i] = 0x22 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *KeyInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1940,6 +1906,34 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) + if m.GlobalIntegrity != nil { + l = m.GlobalIntegrity.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *GlobalIntegrity) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Seed) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Accumulator) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Count != 0 { + n += 1 + sovGenesis(uint64(m.Count)) + } return n } @@ -1955,16 +1949,17 @@ func (m *Params) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.WhitelistedChains) > 0 { - for _, e := range m.WhitelistedChains { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } if len(m.AllowedPublicKeys) > 0 { - for _, e := range m.AllowedPublicKeys { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) + for k, v := range m.AllowedPublicKeys { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovGenesis(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovGenesis(uint64(len(k))) + l + n += mapEntrySize + 1 + sovGenesis(uint64(mapEntrySize)) } } if m.IpfsActive { @@ -2010,10 +2005,6 @@ func (m *AssetInfo) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - l = len(m.Method) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } l = len(m.IconUrl) if l > 0 { n += 1 + l + sovGenesis(uint64(l)) @@ -2021,37 +2012,6 @@ func (m *AssetInfo) Size() (n int) { return n } -func (m *ChainInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if len(m.Validators) > 0 { - for _, e := range m.Validators { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - func (m *KeyInfo) Size() (n int) { if m == nil { return 0 @@ -2259,6 +2219,209 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GlobalIntegrity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.GlobalIntegrity == nil { + m.GlobalIntegrity = &GlobalIntegrity{} + } + if err := m.GlobalIntegrity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GlobalIntegrity) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GlobalIntegrity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GlobalIntegrity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Seed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Seed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accumulator", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accumulator = append(m.Accumulator[:0], dAtA[iNdEx:postIndex]...) + if m.Accumulator == nil { + m.Accumulator = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) @@ -2344,40 +2507,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedChains", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.WhitelistedChains = append(m.WhitelistedChains, &ChainInfo{}) - if err := m.WhitelistedChains[len(m.WhitelistedChains)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AllowedPublicKeys", wireType) } @@ -2406,12 +2535,107 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AllowedPublicKeys = append(m.AllowedPublicKeys, &KeyInfo{}) - if err := m.AllowedPublicKeys[len(m.AllowedPublicKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.AllowedPublicKeys == nil { + m.AllowedPublicKeys = make(map[string]*KeyInfo) } + var mapkey string + var mapvalue *KeyInfo + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenesis + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenesis + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenesis + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &KeyInfo{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AllowedPublicKeys[mapkey] = mapvalue iNdEx = postIndex - case 4: + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", wireType) } @@ -2431,7 +2655,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } m.IpfsActive = bool(v != 0) - case 5: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field LocalhostRegistrationEnabled", wireType) } @@ -2451,7 +2675,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } m.LocalhostRegistrationEnabled = bool(v != 0) - case 6: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", wireType) } @@ -2483,7 +2707,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.ConveyancePreference = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", wireType) } @@ -2700,38 +2924,6 @@ func (m *AssetInfo) Unmarshal(dAtA []byte) error { m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Method = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IconUrl", wireType) } @@ -2784,218 +2976,6 @@ func (m *AssetInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *ChainInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChainInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChainInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Validators = append(m.Validators, &ValidatorInfo{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *KeyInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/did/types/integrity.go b/x/did/types/integrity.go new file mode 100644 index 000000000..e7eeb1eff --- /dev/null +++ b/x/did/types/integrity.go @@ -0,0 +1,27 @@ +package types + +import "lukechampine.com/blake3" + +func (g *GlobalIntegrity) Update(address string) bool { + return true +} + +func (g *GlobalIntegrity) getProof() (*Proof, error) { + if g.Accumulator == nil { + return NewProof(g.Controller, g.proofProperty(), g.seedKdf()) + } + return &Proof{ + Issuer: g.Controller, + Property: g.proofProperty(), + Accumulator: g.Accumulator, + }, nil +} + +func (g *GlobalIntegrity) proofProperty() string { + return "did:sonr:integrity" +} + +func (g *GlobalIntegrity) seedKdf() []byte { + res := blake3.Sum256([]byte(g.Seed)) + return res[:] +} diff --git a/x/did/types/macroon.go b/x/did/types/macroon.go deleted file mode 100644 index 652ec610d..000000000 --- a/x/did/types/macroon.go +++ /dev/null @@ -1,11 +0,0 @@ -package types - -import sdk "github.com/cosmos/cosmos-sdk/types" - -func (t *Token) Validate(permissions string) error { - return nil -} - -func (t *Token) Verify(msg sdk.Msg) error { - return nil -} diff --git a/x/did/types/models.pb.go b/x/did/types/models.pb.go index 55c905de8..ba75c43a3 100644 --- a/x/did/types/models.pb.go +++ b/x/did/types/models.pb.go @@ -788,25 +788,26 @@ func (m *ServiceInfo) GetService() *Service { return nil } -// Token defines a macron token -type Token struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - Macron []byte `protobuf:"bytes,3,opt,name=macron,proto3" json:"macron,omitempty"` +// FirstPartyCaveat defines a first party caveat +type FirstPartyCaveat struct { + Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` + Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` + Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` } -func (m *Token) Reset() { *m = Token{} } -func (m *Token) String() string { return proto.CompactTextString(m) } -func (*Token) ProtoMessage() {} -func (*Token) Descriptor() ([]byte, []int) { +func (m *FirstPartyCaveat) Reset() { *m = FirstPartyCaveat{} } +func (m *FirstPartyCaveat) String() string { return proto.CompactTextString(m) } +func (*FirstPartyCaveat) ProtoMessage() {} +func (*FirstPartyCaveat) Descriptor() ([]byte, []int) { return fileDescriptor_739bb5ab5cb60751, []int{8} } -func (m *Token) XXX_Unmarshal(b []byte) error { +func (m *FirstPartyCaveat) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *FirstPartyCaveat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Token.Marshal(b, m, deterministic) + return xxx_messageInfo_FirstPartyCaveat.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -816,39 +817,115 @@ func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Token) XXX_Merge(src proto.Message) { - xxx_messageInfo_Token.Merge(m, src) +func (m *FirstPartyCaveat) XXX_Merge(src proto.Message) { + xxx_messageInfo_FirstPartyCaveat.Merge(m, src) } -func (m *Token) XXX_Size() int { +func (m *FirstPartyCaveat) XXX_Size() int { return m.Size() } -func (m *Token) XXX_DiscardUnknown() { - xxx_messageInfo_Token.DiscardUnknown(m) +func (m *FirstPartyCaveat) XXX_DiscardUnknown() { + xxx_messageInfo_FirstPartyCaveat.DiscardUnknown(m) } -var xxx_messageInfo_Token proto.InternalMessageInfo +var xxx_messageInfo_FirstPartyCaveat proto.InternalMessageInfo -func (m *Token) GetId() string { +func (m *FirstPartyCaveat) GetScope() *Permissions { if m != nil { - return m.Id - } - return "" -} - -func (m *Token) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *Token) GetMacron() []byte { - if m != nil { - return m.Macron + return m.Scope } return nil } +func (m *FirstPartyCaveat) GetExp() int64 { + if m != nil { + return m.Exp + } + return 0 +} + +func (m *FirstPartyCaveat) GetCnf() string { + if m != nil { + return m.Cnf + } + return "" +} + +func (m *FirstPartyCaveat) GetAud() string { + if m != nil { + return m.Aud + } + return "" +} + +// ThirdPartyCaveat defines a third party caveat +type ThirdPartyCaveat struct { + Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` + Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` + Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` +} + +func (m *ThirdPartyCaveat) Reset() { *m = ThirdPartyCaveat{} } +func (m *ThirdPartyCaveat) String() string { return proto.CompactTextString(m) } +func (*ThirdPartyCaveat) ProtoMessage() {} +func (*ThirdPartyCaveat) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{9} +} +func (m *ThirdPartyCaveat) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ThirdPartyCaveat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ThirdPartyCaveat.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 *ThirdPartyCaveat) XXX_Merge(src proto.Message) { + xxx_messageInfo_ThirdPartyCaveat.Merge(m, src) +} +func (m *ThirdPartyCaveat) XXX_Size() int { + return m.Size() +} +func (m *ThirdPartyCaveat) XXX_DiscardUnknown() { + xxx_messageInfo_ThirdPartyCaveat.DiscardUnknown(m) +} + +var xxx_messageInfo_ThirdPartyCaveat proto.InternalMessageInfo + +func (m *ThirdPartyCaveat) GetScope() *Permissions { + if m != nil { + return m.Scope + } + return nil +} + +func (m *ThirdPartyCaveat) GetExp() int64 { + if m != nil { + return m.Exp + } + return 0 +} + +func (m *ThirdPartyCaveat) GetCnf() string { + if m != nil { + return m.Cnf + } + return "" +} + +func (m *ThirdPartyCaveat) GetAud() string { + if m != nil { + return m.Aud + } + return "" +} + func init() { proto.RegisterType((*Alias)(nil), "did.v1.Alias") proto.RegisterType((*Credential)(nil), "did.v1.Credential") @@ -862,83 +939,86 @@ func init() { proto.RegisterType((*Service)(nil), "did.v1.Service") proto.RegisterMapType((map[string]string)(nil), "did.v1.Service.ServiceEndpointsEntry") proto.RegisterType((*ServiceInfo)(nil), "did.v1.ServiceInfo") - proto.RegisterType((*Token)(nil), "did.v1.Token") + proto.RegisterType((*FirstPartyCaveat)(nil), "did.v1.FirstPartyCaveat") + proto.RegisterType((*ThirdPartyCaveat)(nil), "did.v1.ThirdPartyCaveat") } func init() { proto.RegisterFile("did/v1/models.proto", fileDescriptor_739bb5ab5cb60751) } var fileDescriptor_739bb5ab5cb60751 = []byte{ - // 1108 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xef, 0x7a, 0x63, 0xc7, 0xfb, 0xec, 0x3a, 0x61, 0x9a, 0x96, 0x95, 0x55, 0x2c, 0xd7, 0x85, - 0xe2, 0x22, 0x64, 0xab, 0xae, 0x90, 0x50, 0xe1, 0x52, 0x92, 0x1c, 0xd2, 0xa8, 0x10, 0x6d, 0x2b, - 0x2a, 0xb8, 0x58, 0xe3, 0xdd, 0xe9, 0x66, 0xea, 0xf5, 0xcc, 0x6a, 0x66, 0xec, 0x66, 0x8f, 0x5c, - 0x39, 0xc1, 0x67, 0xe0, 0xcb, 0x70, 0xec, 0x91, 0x23, 0x6a, 0xe1, 0x7b, 0xa0, 0xf9, 0xb3, 0xf6, - 0xc6, 0xa5, 0xa0, 0x5e, 0x92, 0x79, 0xbf, 0xf7, 0x7b, 0x33, 0x6f, 0x7f, 0xef, 0xbd, 0x19, 0xc3, - 0xb5, 0x84, 0x26, 0xe3, 0xd5, 0xbd, 0xf1, 0x82, 0x27, 0x24, 0x93, 0xa3, 0x5c, 0x70, 0xc5, 0x51, - 0x23, 0xa1, 0xc9, 0x68, 0x75, 0xaf, 0x7b, 0xe0, 0x9c, 0x29, 0x61, 0x44, 0x52, 0xe7, 0xed, 0x1e, - 0xa4, 0x3c, 0xe5, 0x66, 0x39, 0xd6, 0x2b, 0x8b, 0x0e, 0x7e, 0x80, 0xfa, 0xc3, 0x8c, 0x62, 0x89, - 0x42, 0xd8, 0x95, 0xcb, 0xd9, 0x0b, 0x12, 0xab, 0xd0, 0xeb, 0x7b, 0xc3, 0x20, 0x2a, 0x4d, 0x74, - 0x03, 0x1a, 0x5c, 0xd0, 0x94, 0xb2, 0xb0, 0x66, 0x1c, 0xce, 0x42, 0x3d, 0x80, 0x98, 0x33, 0x25, - 0x78, 0x96, 0x11, 0x11, 0xfa, 0xc6, 0x57, 0x41, 0x06, 0xbf, 0xf9, 0x00, 0x87, 0x82, 0x24, 0x84, - 0x29, 0x8a, 0xb3, 0xff, 0x38, 0xe0, 0x2e, 0xec, 0x63, 0xa5, 0x88, 0x54, 0x58, 0x51, 0xce, 0xa6, - 0xaa, 0xc8, 0x89, 0x3b, 0x6a, 0xaf, 0x82, 0x3f, 0x2d, 0x72, 0x52, 0xc9, 0xc5, 0xbf, 0x94, 0xcb, - 0x6d, 0xb8, 0x1a, 0xaf, 0x8f, 0x9a, 0xd2, 0x24, 0xdc, 0xe9, 0x7b, 0xc3, 0x76, 0xd4, 0xde, 0x80, - 0x27, 0x09, 0xfa, 0x08, 0x20, 0x5f, 0xce, 0x32, 0x1a, 0x4f, 0xe7, 0xa4, 0x08, 0xeb, 0x86, 0x11, - 0x58, 0xe4, 0x94, 0x14, 0xe8, 0x26, 0x04, 0x4a, 0x60, 0x26, 0x73, 0x2e, 0x54, 0xd8, 0xe8, 0xfb, - 0xc3, 0x20, 0xda, 0x00, 0x3a, 0x58, 0xd2, 0x94, 0x4d, 0x63, 0xbe, 0x64, 0x2a, 0xdc, 0xed, 0x7b, - 0xc3, 0xab, 0x51, 0xa0, 0x91, 0x43, 0x0d, 0xa0, 0x5b, 0xd0, 0x5e, 0x4a, 0x22, 0xa6, 0xb9, 0x20, - 0x92, 0x30, 0x15, 0x36, 0xfb, 0xde, 0xb0, 0x19, 0xb5, 0x34, 0x76, 0x66, 0x21, 0x9d, 0xa3, 0xa1, - 0xac, 0x88, 0xa0, 0xcf, 0x29, 0x49, 0xc2, 0xc0, 0x70, 0x4c, 0xdc, 0xf7, 0x0e, 0x43, 0x9f, 0xc2, - 0xde, 0x0c, 0xc7, 0xf3, 0x65, 0x3e, 0x25, 0x19, 0x4d, 0xe9, 0x2c, 0x23, 0x21, 0x18, 0x5a, 0xc7, - 0xc2, 0xc7, 0x0e, 0xd5, 0x07, 0x3a, 0xa2, 0xd6, 0x87, 0x84, 0x2d, 0x7b, 0xa0, 0xc5, 0x9e, 0x68, - 0xc8, 0x88, 0x92, 0x71, 0x46, 0xa6, 0x2f, 0xb1, 0x60, 0x94, 0xa5, 0x61, 0xdb, 0x1e, 0x68, 0xc0, - 0x67, 0x16, 0x1b, 0xfc, 0x5a, 0x83, 0xe6, 0x11, 0x8f, 0x97, 0x0b, 0x9d, 0x62, 0x07, 0x6a, 0x34, - 0x71, 0xe5, 0xa9, 0xd1, 0x64, 0xab, 0xc4, 0xb5, 0xed, 0x12, 0xa3, 0x3b, 0xd0, 0xc1, 0x4b, 0x75, - 0xae, 0x15, 0x8e, 0x4d, 0x91, 0x42, 0xdf, 0xe8, 0xb6, 0x85, 0x9a, 0x0a, 0x4b, 0x49, 0x84, 0xa9, - 0xef, 0x82, 0xa8, 0x73, 0xae, 0x2b, 0xe4, 0x9b, 0x0a, 0x97, 0xf8, 0x63, 0x03, 0xa3, 0xfb, 0x70, - 0x3d, 0xc6, 0x39, 0x9e, 0xd1, 0x8c, 0xaa, 0x62, 0x9a, 0x90, 0x8c, 0xa4, 0x76, 0xe7, 0xba, 0xe1, - 0x1f, 0x6c, 0x9c, 0x47, 0x6b, 0xdf, 0x56, 0x10, 0x65, 0x2b, 0xee, 0xd2, 0x69, 0x6c, 0x07, 0x9d, - 0xac, 0x7d, 0xa6, 0x21, 0x89, 0x58, 0xd1, 0x98, 0x84, 0xbb, 0x86, 0x56, 0x9a, 0x83, 0xbf, 0x6b, - 0xd0, 0x3c, 0x25, 0x85, 0x3c, 0xc7, 0x82, 0xa0, 0x07, 0xd0, 0x5c, 0x10, 0x85, 0x13, 0xac, 0x70, - 0xe8, 0xf5, 0xfd, 0x61, 0x6b, 0xd2, 0x1b, 0xd9, 0x41, 0x1b, 0x95, 0x9c, 0xd1, 0x63, 0x47, 0x38, - 0x66, 0x4a, 0x14, 0xd1, 0x9a, 0xaf, 0x63, 0x73, 0x5c, 0x64, 0x1c, 0x27, 0x32, 0xac, 0xbd, 0x23, - 0xf6, 0xcc, 0x11, 0x5c, 0x6c, 0xc9, 0x47, 0x5d, 0x68, 0x9a, 0x11, 0x8d, 0x79, 0xe6, 0x9a, 0x7d, - 0x6d, 0x6f, 0x75, 0xf2, 0xce, 0x76, 0x27, 0x87, 0xb0, 0xbb, 0x22, 0x42, 0x5a, 0xd5, 0x74, 0xa3, - 0x96, 0x26, 0x42, 0xb0, 0x23, 0x78, 0x46, 0xc2, 0x46, 0xdf, 0x1b, 0xd6, 0x23, 0xb3, 0xee, 0x7e, - 0x05, 0x57, 0x2f, 0xe5, 0x8f, 0xf6, 0xc1, 0xd7, 0xdb, 0xda, 0x36, 0xd0, 0x4b, 0x74, 0x00, 0xf5, - 0x15, 0xce, 0x96, 0xe5, 0x58, 0x5a, 0xe3, 0x41, 0xed, 0x4b, 0x4f, 0x07, 0x5f, 0xfa, 0x80, 0xff, - 0x0b, 0x6e, 0x57, 0x82, 0x07, 0x19, 0xb4, 0xce, 0x88, 0x58, 0x50, 0xa9, 0x73, 0x93, 0xe8, 0x73, - 0x68, 0xa4, 0x02, 0x33, 0x25, 0x8d, 0xce, 0x9d, 0xc9, 0x41, 0xa9, 0xd5, 0xd1, 0xc9, 0xd1, 0xb7, - 0x78, 0x41, 0x64, 0x8e, 0x63, 0x12, 0x39, 0x0e, 0x1a, 0x43, 0x43, 0xc6, 0x3c, 0x27, 0x56, 0xd9, - 0xce, 0xe4, 0xc3, 0x92, 0xbd, 0xd9, 0xf2, 0x89, 0xf6, 0x47, 0x8e, 0x36, 0xf8, 0xc9, 0x87, 0xc6, - 0xd9, 0x72, 0xa6, 0x05, 0xba, 0xed, 0x64, 0xd0, 0x59, 0x76, 0x26, 0x7b, 0x95, 0x9a, 0x44, 0x3c, - 0x23, 0x56, 0x17, 0x34, 0x81, 0x00, 0x67, 0x29, 0x17, 0x54, 0x9d, 0x2f, 0x4c, 0xee, 0x95, 0x8c, - 0x4e, 0x49, 0xf1, 0xb0, 0xf4, 0x45, 0x1b, 0x1a, 0x1a, 0x43, 0x93, 0xb0, 0x98, 0x27, 0x7a, 0xda, - 0x7c, 0x13, 0x72, 0xad, 0x12, 0x72, 0xec, 0x5c, 0xd1, 0x9a, 0x84, 0xee, 0x40, 0x3d, 0x5e, 0x8a, - 0x15, 0x31, 0x45, 0xec, 0x4c, 0xf6, 0x2b, 0xec, 0x43, 0x8d, 0x47, 0xd6, 0x8d, 0x3e, 0x83, 0xe6, - 0x9c, 0x14, 0xf6, 0x6e, 0xac, 0xbf, 0x95, 0xb5, 0xbe, 0x1b, 0xa3, 0xdd, 0xb9, 0x5d, 0xe8, 0x12, - 0x08, 0xfc, 0xd2, 0xd4, 0xb8, 0x1d, 0xe9, 0x25, 0xfa, 0x18, 0xfc, 0x17, 0x2f, 0xe7, 0xe6, 0xd6, - 0x6a, 0x4d, 0xd0, 0x5a, 0x28, 0x23, 0xc6, 0xe8, 0xd1, 0xb3, 0xd3, 0x48, 0xbb, 0xbb, 0x18, 0xfc, - 0x47, 0xcf, 0x4e, 0x4d, 0x05, 0xd5, 0xa6, 0x82, 0xca, 0xd4, 0x34, 0x16, 0x2b, 0x57, 0x7c, 0xbd, - 0x44, 0x6d, 0xf0, 0x2e, 0x5c, 0x57, 0x7a, 0x17, 0xda, 0xb2, 0x5d, 0x18, 0x44, 0x5e, 0xa1, 0x2d, - 0xdb, 0x77, 0x41, 0xe4, 0x31, 0x6d, 0xd9, 0x76, 0x0b, 0x22, 0x8f, 0x0c, 0xfe, 0xaa, 0xc1, 0xee, - 0x13, 0x3b, 0x65, 0x6f, 0x5d, 0x36, 0xb7, 0xa0, 0xed, 0x06, 0xb0, 0xfa, 0x04, 0xb4, 0x1c, 0x66, - 0xbe, 0xec, 0x26, 0x04, 0xfa, 0x66, 0xd1, 0x62, 0x17, 0xee, 0xf8, 0x0d, 0x50, 0x79, 0x1c, 0x76, - 0x2e, 0x3d, 0x0e, 0x7d, 0x68, 0x25, 0x44, 0xc6, 0x82, 0xe6, 0xaa, 0x1c, 0x89, 0x20, 0xaa, 0x42, - 0x28, 0x82, 0x0f, 0xca, 0xa3, 0x09, 0x4b, 0x72, 0x4e, 0x75, 0x13, 0x36, 0xcc, 0xc0, 0x7e, 0x52, - 0xaa, 0xe5, 0xd2, 0x2e, 0xff, 0x1f, 0x97, 0x3c, 0x3b, 0xb7, 0xfb, 0x72, 0x0b, 0x46, 0x5f, 0x40, - 0x2b, 0xdf, 0x34, 0xb7, 0xd3, 0xfe, 0xda, 0xdb, 0x4d, 0x2a, 0xa3, 0x2a, 0xaf, 0x7b, 0x08, 0xd7, - 0xff, 0xf5, 0x84, 0xf7, 0x99, 0xca, 0xc1, 0xcf, 0x1e, 0xb4, 0xdc, 0x2e, 0x27, 0xec, 0x39, 0xd7, - 0xca, 0x90, 0x0b, 0x2a, 0xcd, 0x64, 0xe9, 0x27, 0xc0, 0x59, 0xef, 0x7c, 0xda, 0xfb, 0xd0, 0x7a, - 0x4e, 0x59, 0x4a, 0x44, 0x2e, 0x28, 0x53, 0x4e, 0xe9, 0x2a, 0x84, 0xee, 0x6e, 0x2e, 0xcf, 0x1d, - 0xf3, 0x65, 0x7b, 0x5b, 0x3a, 0x6d, 0x6e, 0xd3, 0xef, 0xa0, 0xfe, 0x94, 0xcf, 0x09, 0x7b, 0xef, - 0xd7, 0xe5, 0x06, 0x34, 0x16, 0x38, 0x16, 0xdc, 0x3e, 0xf6, 0xed, 0xc8, 0x59, 0xdf, 0x7c, 0xfd, - 0xfb, 0xeb, 0x9e, 0xf7, 0xea, 0x75, 0xcf, 0xfb, 0xf3, 0x75, 0xcf, 0xfb, 0xe5, 0x4d, 0xef, 0xca, - 0xab, 0x37, 0xbd, 0x2b, 0x7f, 0xbc, 0xe9, 0x5d, 0xf9, 0x71, 0x90, 0x52, 0x75, 0xbe, 0x9c, 0x8d, - 0x62, 0xbe, 0x18, 0x73, 0x26, 0x39, 0x13, 0x63, 0xf3, 0xe7, 0x62, 0xac, 0x7f, 0x12, 0xe9, 0xae, - 0x92, 0xb3, 0x86, 0xb9, 0x45, 0xef, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xd5, 0xfe, 0x6a, 0x5d, - 0x43, 0x09, 0x00, 0x00, + // 1146 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6e, 0xdb, 0xc6, + 0x13, 0x0e, 0x45, 0x4b, 0x96, 0x46, 0x8a, 0xec, 0xdf, 0xc6, 0xf9, 0x95, 0x30, 0x52, 0x41, 0x51, + 0xda, 0x54, 0x29, 0x0a, 0x09, 0x51, 0x50, 0xa0, 0x48, 0x7b, 0x49, 0x6d, 0x17, 0x70, 0x8c, 0x14, + 0x06, 0x13, 0x34, 0x68, 0x2f, 0xc2, 0x8a, 0x1c, 0xcb, 0x1b, 0x53, 0x5c, 0x62, 0x77, 0xa9, 0x98, + 0xc7, 0x5e, 0x7b, 0x6a, 0x9f, 0xa1, 0x2f, 0xd3, 0x63, 0x8e, 0x3d, 0x16, 0x49, 0xfb, 0x1e, 0xc5, + 0xfe, 0xa1, 0x44, 0x2b, 0x4d, 0x8b, 0x5e, 0x7a, 0xb1, 0x77, 0xbe, 0xf9, 0x86, 0x33, 0xfc, 0x66, + 0x66, 0x29, 0xb8, 0x11, 0xb3, 0x78, 0xbc, 0xbc, 0x3f, 0x5e, 0xf0, 0x18, 0x13, 0x39, 0xca, 0x04, + 0x57, 0x9c, 0x34, 0x62, 0x16, 0x8f, 0x96, 0xf7, 0xf7, 0xf7, 0x9c, 0x73, 0x8e, 0x29, 0x4a, 0xe6, + 0xbc, 0xfb, 0x7b, 0x73, 0x3e, 0xe7, 0xe6, 0x38, 0xd6, 0x27, 0x8b, 0x0e, 0xbe, 0x85, 0xfa, 0xa3, + 0x84, 0x51, 0x49, 0x02, 0xd8, 0x96, 0xf9, 0xec, 0x05, 0x46, 0x2a, 0xf0, 0xfa, 0xde, 0xb0, 0x15, + 0x96, 0x26, 0xf9, 0x3f, 0x34, 0xb8, 0x60, 0x73, 0x96, 0x06, 0x35, 0xe3, 0x70, 0x16, 0xe9, 0x01, + 0x44, 0x3c, 0x55, 0x82, 0x27, 0x09, 0x8a, 0xc0, 0x37, 0xbe, 0x0a, 0x32, 0xf8, 0xd9, 0x07, 0x38, + 0x10, 0x18, 0x63, 0xaa, 0x18, 0x4d, 0xfe, 0x26, 0xc1, 0x3d, 0xd8, 0xa5, 0x4a, 0xa1, 0x54, 0x54, + 0x31, 0x9e, 0x4e, 0x55, 0x91, 0xa1, 0x4b, 0xb5, 0x53, 0xc1, 0x9f, 0x15, 0x19, 0x56, 0x6a, 0xf1, + 0xaf, 0xd4, 0x72, 0x07, 0xae, 0x47, 0xab, 0x54, 0x53, 0x16, 0x07, 0x5b, 0x7d, 0x6f, 0xd8, 0x09, + 0x3b, 0x6b, 0xf0, 0x38, 0x26, 0xef, 0x03, 0x64, 0xf9, 0x2c, 0x61, 0xd1, 0xf4, 0x02, 0x8b, 0xa0, + 0x6e, 0x18, 0x2d, 0x8b, 0x9c, 0x60, 0x41, 0x6e, 0x41, 0x4b, 0x09, 0x9a, 0xca, 0x8c, 0x0b, 0x15, + 0x34, 0xfa, 0xfe, 0xb0, 0x15, 0xae, 0x01, 0x1d, 0x2c, 0xd9, 0x3c, 0x9d, 0x46, 0x3c, 0x4f, 0x55, + 0xb0, 0xdd, 0xf7, 0x86, 0xd7, 0xc3, 0x96, 0x46, 0x0e, 0x34, 0x40, 0x6e, 0x43, 0x27, 0x97, 0x28, + 0xa6, 0x99, 0x40, 0x89, 0xa9, 0x0a, 0x9a, 0x7d, 0x6f, 0xd8, 0x0c, 0xdb, 0x1a, 0x3b, 0xb5, 0x90, + 0xae, 0xd1, 0x50, 0x96, 0x28, 0xd8, 0x19, 0xc3, 0x38, 0x68, 0x19, 0x8e, 0x89, 0xfb, 0xc6, 0x61, + 0xe4, 0x23, 0xd8, 0x99, 0xd1, 0xe8, 0x22, 0xcf, 0xa6, 0x98, 0xb0, 0x39, 0x9b, 0x25, 0x18, 0x80, + 0xa1, 0x75, 0x2d, 0x7c, 0xe4, 0x50, 0x9d, 0xd0, 0x11, 0xb5, 0x3e, 0x18, 0xb4, 0x6d, 0x42, 0x8b, + 0x3d, 0xd5, 0x90, 0x11, 0x25, 0xe1, 0x29, 0x4e, 0x5f, 0x52, 0x91, 0xb2, 0x74, 0x1e, 0x74, 0x6c, + 0x42, 0x03, 0x3e, 0xb7, 0xd8, 0xe0, 0xa7, 0x1a, 0x34, 0x0f, 0x79, 0x94, 0x2f, 0x74, 0x89, 0x5d, + 0xa8, 0xb1, 0xd8, 0xb5, 0xa7, 0xc6, 0xe2, 0x8d, 0x16, 0xd7, 0x36, 0x5b, 0x4c, 0xee, 0x42, 0x97, + 0xe6, 0xea, 0x5c, 0x2b, 0x1c, 0x99, 0x26, 0x05, 0xbe, 0xd1, 0x6d, 0x03, 0x35, 0x1d, 0x96, 0x12, + 0x85, 0xe9, 0xef, 0x02, 0xd5, 0x39, 0xd7, 0x1d, 0xf2, 0x4d, 0x87, 0x4b, 0xfc, 0x89, 0x81, 0xc9, + 0x03, 0xb8, 0x19, 0xd1, 0x8c, 0xce, 0x58, 0xc2, 0x54, 0x31, 0x8d, 0x31, 0xc1, 0xb9, 0x7d, 0x72, + 0xdd, 0xf0, 0xf7, 0xd6, 0xce, 0xc3, 0x95, 0x6f, 0x23, 0x88, 0xa5, 0x4b, 0xee, 0xca, 0x69, 0x6c, + 0x06, 0x1d, 0xaf, 0x7c, 0x66, 0x20, 0x51, 0x2c, 0x59, 0x84, 0xc1, 0xb6, 0xa1, 0x95, 0xe6, 0xe0, + 0x8f, 0x1a, 0x34, 0x4f, 0xb0, 0x90, 0xe7, 0x54, 0x20, 0x79, 0x08, 0xcd, 0x05, 0x2a, 0x1a, 0x53, + 0x45, 0x03, 0xaf, 0xef, 0x0f, 0xdb, 0x93, 0xde, 0xc8, 0x2e, 0xda, 0xa8, 0xe4, 0x8c, 0x9e, 0x38, + 0xc2, 0x51, 0xaa, 0x44, 0x11, 0xae, 0xf8, 0x3a, 0x36, 0xa3, 0x45, 0xc2, 0x69, 0x2c, 0x83, 0xda, + 0x3b, 0x62, 0x4f, 0x1d, 0xc1, 0xc5, 0x96, 0x7c, 0xb2, 0x0f, 0x4d, 0xb3, 0xa2, 0x11, 0x4f, 0xdc, + 0xb0, 0xaf, 0xec, 0x8d, 0x49, 0xde, 0xda, 0x9c, 0xe4, 0x00, 0xb6, 0x97, 0x28, 0xa4, 0x55, 0x4d, + 0x0f, 0x6a, 0x69, 0x12, 0x02, 0x5b, 0x82, 0x27, 0x18, 0x34, 0xfa, 0xde, 0xb0, 0x1e, 0x9a, 0xf3, + 0xfe, 0xe7, 0x70, 0xfd, 0x4a, 0xfd, 0x64, 0x17, 0x7c, 0xfd, 0x58, 0x3b, 0x06, 0xfa, 0x48, 0xf6, + 0xa0, 0xbe, 0xa4, 0x49, 0x5e, 0xae, 0xa5, 0x35, 0x1e, 0xd6, 0x3e, 0xf3, 0x74, 0xf0, 0x95, 0x17, + 0xf8, 0xa7, 0xe0, 0x4e, 0x25, 0x78, 0x90, 0x40, 0xfb, 0x14, 0xc5, 0x82, 0x49, 0x5d, 0x9b, 0x24, + 0x9f, 0x40, 0x63, 0x2e, 0x68, 0xaa, 0xa4, 0xd1, 0xb9, 0x3b, 0xd9, 0x2b, 0xb5, 0x3a, 0x3c, 0x3e, + 0xfc, 0x9a, 0x2e, 0x50, 0x66, 0x34, 0xc2, 0xd0, 0x71, 0xc8, 0x18, 0x1a, 0x32, 0xe2, 0x19, 0x5a, + 0x65, 0xbb, 0x93, 0xf7, 0x4a, 0xf6, 0xfa, 0x91, 0x4f, 0xb5, 0x3f, 0x74, 0xb4, 0xc1, 0xf7, 0x3e, + 0x34, 0x4e, 0xf3, 0x99, 0x16, 0xe8, 0x8e, 0x93, 0x41, 0x57, 0xd9, 0x9d, 0xec, 0x54, 0x7a, 0x12, + 0xf2, 0x04, 0xad, 0x2e, 0x64, 0x02, 0x2d, 0x9a, 0xcc, 0xb9, 0x60, 0xea, 0x7c, 0x61, 0x6a, 0xaf, + 0x54, 0x74, 0x82, 0xc5, 0xa3, 0xd2, 0x17, 0xae, 0x69, 0x64, 0x0c, 0x4d, 0x4c, 0x23, 0x1e, 0xeb, + 0x6d, 0xf3, 0x4d, 0xc8, 0x8d, 0x4a, 0xc8, 0x91, 0x73, 0x85, 0x2b, 0x12, 0xb9, 0x0b, 0xf5, 0x28, + 0x17, 0x4b, 0x34, 0x4d, 0xec, 0x4e, 0x76, 0x2b, 0xec, 0x03, 0x8d, 0x87, 0xd6, 0x4d, 0x3e, 0x86, + 0xe6, 0x05, 0x16, 0xf6, 0x6e, 0xac, 0xbf, 0x55, 0xb5, 0xbe, 0x1b, 0xc3, 0xed, 0x0b, 0x7b, 0xd0, + 0x2d, 0x10, 0xf4, 0xa5, 0xe9, 0x71, 0x27, 0xd4, 0x47, 0xf2, 0x01, 0xf8, 0x2f, 0x5e, 0x5e, 0x98, + 0x5b, 0xab, 0x3d, 0x21, 0x2b, 0xa1, 0x8c, 0x18, 0xa3, 0xc7, 0xcf, 0x4f, 0x42, 0xed, 0xde, 0xa7, + 0xe0, 0x3f, 0x7e, 0x7e, 0x62, 0x3a, 0xa8, 0xd6, 0x1d, 0x54, 0xa6, 0xa7, 0x91, 0x58, 0xba, 0xe6, + 0xeb, 0x23, 0xe9, 0x80, 0x77, 0xe9, 0xa6, 0xd2, 0xbb, 0xd4, 0x96, 0x9d, 0xc2, 0x56, 0xe8, 0x15, + 0xda, 0xb2, 0x73, 0xd7, 0x0a, 0xbd, 0x54, 0x5b, 0x76, 0xdc, 0x5a, 0xa1, 0x87, 0x83, 0xdf, 0x6b, + 0xb0, 0xfd, 0xd4, 0x6e, 0xd9, 0x5b, 0x97, 0xcd, 0x6d, 0xe8, 0xb8, 0x05, 0xac, 0x7e, 0x02, 0xda, + 0x0e, 0x33, 0x6f, 0x76, 0x0b, 0x5a, 0xfa, 0x66, 0xd1, 0x62, 0x17, 0x2e, 0xfd, 0x1a, 0xa8, 0x7c, + 0x1c, 0xb6, 0xae, 0x7c, 0x1c, 0xfa, 0xd0, 0x8e, 0x51, 0x46, 0x82, 0x65, 0xaa, 0x5c, 0x89, 0x56, + 0x58, 0x85, 0x48, 0x08, 0xff, 0x2b, 0x53, 0x63, 0x1a, 0x67, 0x9c, 0xe9, 0x21, 0x6c, 0x98, 0x85, + 0xfd, 0xb0, 0x54, 0xcb, 0x95, 0x5d, 0xfe, 0x3f, 0x2a, 0x79, 0x76, 0x6f, 0x77, 0xe5, 0x06, 0x4c, + 0x3e, 0x85, 0x76, 0xb6, 0x1e, 0x6e, 0xa7, 0xfd, 0x8d, 0xb7, 0x87, 0x54, 0x86, 0x55, 0xde, 0xfe, + 0x01, 0xdc, 0xfc, 0xcb, 0x0c, 0xff, 0x66, 0x2b, 0x07, 0x3f, 0x78, 0xd0, 0x76, 0x4f, 0x39, 0x4e, + 0xcf, 0xb8, 0x56, 0x06, 0x2f, 0x99, 0x34, 0x9b, 0xa5, 0x3f, 0x01, 0xce, 0x7a, 0xe7, 0xa7, 0xbd, + 0x0f, 0xed, 0x33, 0x96, 0xce, 0x51, 0x64, 0x82, 0xa5, 0xca, 0x29, 0x5d, 0x85, 0xc8, 0xbd, 0xf5, + 0xe5, 0xb9, 0x65, 0xde, 0x6c, 0x67, 0x43, 0xa7, 0xf5, 0x6d, 0x2a, 0x61, 0xf7, 0x2b, 0x26, 0xa4, + 0x3a, 0xa5, 0x42, 0x15, 0x07, 0x74, 0x89, 0x54, 0x87, 0xd7, 0xcd, 0x56, 0x9a, 0x7a, 0xde, 0x21, + 0x8b, 0x65, 0xe8, 0xf7, 0xc6, 0xcb, 0xcc, 0x14, 0xe8, 0x87, 0xfa, 0x68, 0xc6, 0x31, 0x3d, 0x73, + 0x55, 0xe9, 0xa3, 0x46, 0x68, 0x1e, 0xbb, 0xb6, 0xeb, 0xa3, 0x4e, 0xfa, 0xec, 0x9c, 0x89, 0xf8, + 0xbf, 0x4c, 0xfa, 0xe5, 0x17, 0xbf, 0xbc, 0xee, 0x79, 0xaf, 0x5e, 0xf7, 0xbc, 0xdf, 0x5e, 0xf7, + 0xbc, 0x1f, 0xdf, 0xf4, 0xae, 0xbd, 0x7a, 0xd3, 0xbb, 0xf6, 0xeb, 0x9b, 0xde, 0xb5, 0xef, 0x06, + 0x73, 0xa6, 0xce, 0xf3, 0xd9, 0x28, 0xe2, 0x8b, 0x31, 0x4f, 0x25, 0x4f, 0xc5, 0xd8, 0xfc, 0xb9, + 0x1c, 0xeb, 0xdf, 0x6a, 0x7a, 0xdc, 0xe5, 0xac, 0x61, 0xae, 0xf7, 0x07, 0x7f, 0x06, 0x00, 0x00, + 0xff, 0xff, 0x38, 0x84, 0xad, 0x32, 0xdc, 0x09, 0x00, 0x00, } func (m *Alias) Marshal() (dAtA []byte, err error) { @@ -1615,7 +1695,7 @@ func (m *ServiceInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Token) Marshal() (dAtA []byte, err error) { +func (m *FirstPartyCaveat) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1625,34 +1705,98 @@ func (m *Token) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Token) MarshalTo(dAtA []byte) (int, error) { +func (m *FirstPartyCaveat) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Token) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *FirstPartyCaveat) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Macron) > 0 { - i -= len(m.Macron) - copy(dAtA[i:], m.Macron) - i = encodeVarintModels(dAtA, i, uint64(len(m.Macron))) + if len(m.Aud) > 0 { + i -= len(m.Aud) + copy(dAtA[i:], m.Aud) + i = encodeVarintModels(dAtA, i, uint64(len(m.Aud))) + i-- + dAtA[i] = 0x22 + } + if len(m.Cnf) > 0 { + i -= len(m.Cnf) + copy(dAtA[i:], m.Cnf) + i = encodeVarintModels(dAtA, i, uint64(len(m.Cnf))) i-- dAtA[i] = 0x1a } - if len(m.Controller) > 0 { - i -= len(m.Controller) - copy(dAtA[i:], m.Controller) - i = encodeVarintModels(dAtA, i, uint64(len(m.Controller))) + if m.Exp != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Exp)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintModels(dAtA, i, uint64(len(m.Id))) + if m.Scope != nil { + { + size, err := m.Scope.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ThirdPartyCaveat) 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 *ThirdPartyCaveat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ThirdPartyCaveat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Aud) > 0 { + i -= len(m.Aud) + copy(dAtA[i:], m.Aud) + i = encodeVarintModels(dAtA, i, uint64(len(m.Aud))) + i-- + dAtA[i] = 0x22 + } + if len(m.Cnf) > 0 { + i -= len(m.Cnf) + copy(dAtA[i:], m.Cnf) + i = encodeVarintModels(dAtA, i, uint64(len(m.Cnf))) + i-- + dAtA[i] = 0x1a + } + if m.Exp != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Exp)) + i-- + dAtA[i] = 0x10 + } + if m.Scope != nil { + { + size, err := m.Scope.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } @@ -1987,21 +2131,48 @@ func (m *ServiceInfo) Size() (n int) { return n } -func (m *Token) Size() (n int) { +func (m *FirstPartyCaveat) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Id) + if m.Scope != nil { + l = m.Scope.Size() + n += 1 + l + sovModels(uint64(l)) + } + if m.Exp != 0 { + n += 1 + sovModels(uint64(m.Exp)) + } + l = len(m.Cnf) if l > 0 { n += 1 + l + sovModels(uint64(l)) } - l = len(m.Controller) + l = len(m.Aud) if l > 0 { n += 1 + l + sovModels(uint64(l)) } - l = len(m.Macron) + return n +} + +func (m *ThirdPartyCaveat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Scope != nil { + l = m.Scope.Size() + n += 1 + l + sovModels(uint64(l)) + } + if m.Exp != 0 { + n += 1 + sovModels(uint64(m.Exp)) + } + l = len(m.Cnf) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Aud) if l > 0 { n += 1 + l + sovModels(uint64(l)) } @@ -4396,7 +4567,7 @@ func (m *ServiceInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *Token) Unmarshal(dAtA []byte) error { +func (m *FirstPartyCaveat) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4419,17 +4590,17 @@ func (m *Token) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Token: wiretype end group for non-group") + return fmt.Errorf("proto: FirstPartyCaveat: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Token: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FirstPartyCaveat: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowModels @@ -4439,27 +4610,50 @@ func (m *Token) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthModels } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthModels } if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + if m.Scope == nil { + m.Scope = &Permissions{} + } + if err := m.Scope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) + } + m.Exp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Cnf", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4487,13 +4681,13 @@ func (m *Token) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Controller = string(dAtA[iNdEx:postIndex]) + m.Cnf = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Macron", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aud", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowModels @@ -4503,25 +4697,192 @@ func (m *Token) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthModels } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthModels } if postIndex > l { return io.ErrUnexpectedEOF } - m.Macron = append(m.Macron[:0], dAtA[iNdEx:postIndex]...) - if m.Macron == nil { - m.Macron = []byte{} + m.Aud = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ThirdPartyCaveat) 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 ErrIntOverflowModels + } + 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: ThirdPartyCaveat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ThirdPartyCaveat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scope == nil { + m.Scope = &Permissions{} + } + if err := m.Scope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) + } + m.Exp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cnf", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + 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 ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cnf = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aud", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + 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 ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Aud = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/did/types/namespace.go b/x/did/types/namespace.go new file mode 100644 index 000000000..1e6da75c9 --- /dev/null +++ b/x/did/types/namespace.go @@ -0,0 +1,102 @@ +package types + +import ( + "cosmossdk.io/x/nft" +) + +func (n DIDNamespace) ID() string { + switch n { + case DIDNamespace_DID_NAMESPACE_DWN: + return "did:dwn:0" + case DIDNamespace_DID_NAMESPACE_SONR: + return "did:sonr:0" + case DIDNamespace_DID_NAMESPACE_BITCOIN: + return "did:btc:0" + case DIDNamespace_DID_NAMESPACE_ETHEREUM: + return "did:eth:0" + case DIDNamespace_DID_NAMESPACE_IBC: + return "did:ibc:0" + case DIDNamespace_DID_NAMESPACE_WEBAUTHN: + return "did:authn:0" + case DIDNamespace_DID_NAMESPACE_SERVICE: + return "did:web:0" + case DIDNamespace_DID_NAMESPACE_IPFS: + return "did:ipfs:0" + } + return "" +} + +func (n DIDNamespace) Name() string { + switch n { + case DIDNamespace_DID_NAMESPACE_DWN: + return "DecentralizedWebNode" + case DIDNamespace_DID_NAMESPACE_SONR: + return "SonrNetwork" + case DIDNamespace_DID_NAMESPACE_BITCOIN: + return "BitcoinNetwork" + case DIDNamespace_DID_NAMESPACE_ETHEREUM: + return "EthereumNetwork" + case DIDNamespace_DID_NAMESPACE_IBC: + return "IBCNetwork" + case DIDNamespace_DID_NAMESPACE_WEBAUTHN: + return "WebAuthentication" + case DIDNamespace_DID_NAMESPACE_SERVICE: + return "DecentrlizedService" + case DIDNamespace_DID_NAMESPACE_IPFS: + return "IPFSStorage" + } + return "" +} + +func (n DIDNamespace) Symbol() string { + switch n { + case DIDNamespace_DID_NAMESPACE_DWN: + return "DWN" + case DIDNamespace_DID_NAMESPACE_SONR: + return "SONR" + case DIDNamespace_DID_NAMESPACE_BITCOIN: + return "BTC" + case DIDNamespace_DID_NAMESPACE_ETHEREUM: + return "ETH" + case DIDNamespace_DID_NAMESPACE_IBC: + return "IBC" + case DIDNamespace_DID_NAMESPACE_WEBAUTHN: + return "WEBAUTHN" + case DIDNamespace_DID_NAMESPACE_SERVICE: + return "SERVICE" + case DIDNamespace_DID_NAMESPACE_IPFS: + return "IPFS" + } + return "" +} + +func (n DIDNamespace) Description() string { + switch n { + case DIDNamespace_DID_NAMESPACE_DWN: + return "DWN Service Provider" + case DIDNamespace_DID_NAMESPACE_SONR: + return "Sonr Network Gateway" + case DIDNamespace_DID_NAMESPACE_BITCOIN: + return "Bitcoin Network Gateway" + case DIDNamespace_DID_NAMESPACE_ETHEREUM: + return "Ethereum Network Gateway" + case DIDNamespace_DID_NAMESPACE_IBC: + return "IBC Network Gateway" + case DIDNamespace_DID_NAMESPACE_WEBAUTHN: + return "Web Authentication Key" + case DIDNamespace_DID_NAMESPACE_SERVICE: + return "Decentrlized Service" + case DIDNamespace_DID_NAMESPACE_IPFS: + return "Data Storage on IPFS" + } + return "" +} + +func (n DIDNamespace) GetNFTClass() *nft.Class { + return &nft.Class{ + Id: n.ID(), + Name: n.Name(), + Symbol: n.Symbol(), + Description: n.Description(), + } +} diff --git a/internal/db/orm/DiscoveryDocument.pkl.go b/x/did/types/oidc/DiscoveryDocument.pkl.go similarity index 96% rename from internal/db/orm/DiscoveryDocument.pkl.go rename to x/did/types/oidc/DiscoveryDocument.pkl.go index 036d8f26d..d25cce456 100644 --- a/internal/db/orm/DiscoveryDocument.pkl.go +++ b/x/did/types/oidc/DiscoveryDocument.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `orm`. DO NOT EDIT. -package orm +// Code generated from Pkl module `oidc`. DO NOT EDIT. +package oidc type DiscoveryDocument struct { Issuer string `pkl:"issuer" json:"issuer,omitempty" param:"issuer"` diff --git a/x/did/types/oidc/Oidc.pkl.go b/x/did/types/oidc/Oidc.pkl.go new file mode 100644 index 000000000..3a4e4a67a --- /dev/null +++ b/x/did/types/oidc/Oidc.pkl.go @@ -0,0 +1,36 @@ +// Code generated from Pkl module `oidc`. DO NOT EDIT. +package oidc + +import ( + "context" + + "github.com/apple/pkl-go/pkl" +) + +type Oidc struct { +} + +// LoadFromPath loads the pkl module at the given path and evaluates it into a Oidc +func LoadFromPath(ctx context.Context, path string) (ret *Oidc, err error) { + evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) + if err != nil { + return nil, err + } + defer func() { + cerr := evaluator.Close() + if err == nil { + err = cerr + } + }() + ret, err = Load(ctx, evaluator, pkl.FileSource(path)) + return ret, err +} + +// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Oidc +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Oidc, error) { + var ret Oidc + if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { + return nil, err + } + return &ret, nil +} diff --git a/x/did/types/oidc/init.pkl.go b/x/did/types/oidc/init.pkl.go new file mode 100644 index 000000000..0f351c673 --- /dev/null +++ b/x/did/types/oidc/init.pkl.go @@ -0,0 +1,9 @@ +// Code generated from Pkl module `oidc`. DO NOT EDIT. +package oidc + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("oidc", Oidc{}) + pkl.RegisterMapping("oidc#DiscoveryDocument", DiscoveryDocument{}) +} diff --git a/x/did/types/pubkey.go b/x/did/types/pubkey.go index e1a1ebec5..8d75ac1fb 100644 --- a/x/did/types/pubkey.go +++ b/x/did/types/pubkey.go @@ -1,11 +1,13 @@ package types import ( + "crypto/ecdsa" "encoding/hex" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/mr-tron/base58/base58" "github.com/onsonr/crypto" + "github.com/onsonr/crypto/macaroon" ) var WalletKeyInfo = &KeyInfo{ @@ -79,6 +81,16 @@ func (k *PubKey) Clone() cryptotypes.PubKey { } } +// IssueMacaroon returns a macaroon for the public key with the given id and location +func (pk *PubKey) IssueMacaroon(subject string, origin string) (*macaroon.Macaroon, error) { + return macaroon.New(pk.Bytes(), []byte(subject), origin, macaroon.LatestVersion) +} + +// ECDSA returns the ECDSA public key +func (k *PubKey) ECDSA() (*ecdsa.PublicKey, error) { + return crypto.ComputeEcdsaPublicKey(k.Bytes()) +} + // VerifySignature verifies a signature over the given message func (k *PubKey) VerifySignature(msg []byte, sig []byte) bool { pk, err := crypto.ComputeEcdsaPublicKey(k.Bytes()) diff --git a/x/did/types/query.pb.go b/x/did/types/query.pb.go index 33820131d..b482de53f 100644 --- a/x/did/types/query.pb.go +++ b/x/did/types/query.pb.go @@ -32,6 +32,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type QueryRequest 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"` } func (m *QueryRequest) Reset() { *m = QueryRequest{} } @@ -81,6 +83,20 @@ func (m *QueryRequest) GetOrigin() string { return "" } +func (m *QueryRequest) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *QueryRequest) GetAsset() string { + if m != nil { + return m.Asset + } + return "" +} + // QueryResolveResponse is the response type for the Query/Resolve RPC method. type QueryResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` @@ -158,41 +174,332 @@ func (m *QueryResponse) GetParams() *Params { return nil } +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{2} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +type QueryParamsAssetsResponse struct { + Assets []*AssetInfo `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` +} + +func (m *QueryParamsAssetsResponse) Reset() { *m = QueryParamsAssetsResponse{} } +func (m *QueryParamsAssetsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsAssetsResponse) ProtoMessage() {} +func (*QueryParamsAssetsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{3} +} +func (m *QueryParamsAssetsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsAssetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsAssetsResponse.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 *QueryParamsAssetsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsAssetsResponse.Merge(m, src) +} +func (m *QueryParamsAssetsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsAssetsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsAssetsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsAssetsResponse proto.InternalMessageInfo + +func (m *QueryParamsAssetsResponse) GetAssets() []*AssetInfo { + if m != nil { + return m.Assets + } + return nil +} + +type QueryParamsKeysResponse struct { + Keys map[string]*KeyInfo `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *QueryParamsKeysResponse) Reset() { *m = QueryParamsKeysResponse{} } +func (m *QueryParamsKeysResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsKeysResponse) ProtoMessage() {} +func (*QueryParamsKeysResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{4} +} +func (m *QueryParamsKeysResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsKeysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsKeysResponse.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 *QueryParamsKeysResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsKeysResponse.Merge(m, src) +} +func (m *QueryParamsKeysResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsKeysResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsKeysResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsKeysResponse proto.InternalMessageInfo + +func (m *QueryParamsKeysResponse) GetKeys() map[string]*KeyInfo { + if m != nil { + return m.Keys + } + return nil +} + +type QueryParamsByKeyResponse struct { + Key *KeyInfo `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *QueryParamsByKeyResponse) Reset() { *m = QueryParamsByKeyResponse{} } +func (m *QueryParamsByKeyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsByKeyResponse) ProtoMessage() {} +func (*QueryParamsByKeyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{5} +} +func (m *QueryParamsByKeyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsByKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsByKeyResponse.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 *QueryParamsByKeyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsByKeyResponse.Merge(m, src) +} +func (m *QueryParamsByKeyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsByKeyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsByKeyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsByKeyResponse proto.InternalMessageInfo + +func (m *QueryParamsByKeyResponse) GetKey() *KeyInfo { + if m != nil { + return m.Key + } + return nil +} + +type QueryParamsByAssetResponse struct { + Asset *AssetInfo `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` +} + +func (m *QueryParamsByAssetResponse) Reset() { *m = QueryParamsByAssetResponse{} } +func (m *QueryParamsByAssetResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsByAssetResponse) ProtoMessage() {} +func (*QueryParamsByAssetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{6} +} +func (m *QueryParamsByAssetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsByAssetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsByAssetResponse.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 *QueryParamsByAssetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsByAssetResponse.Merge(m, src) +} +func (m *QueryParamsByAssetResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsByAssetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsByAssetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsByAssetResponse proto.InternalMessageInfo + +func (m *QueryParamsByAssetResponse) GetAsset() *AssetInfo { + if m != nil { + return m.Asset + } + return nil +} + +type QueryRegistrationOptionsByKeyResponse struct { + RegistrationOptions []string `protobuf:"bytes,1,rep,name=registration_options,json=registrationOptions,proto3" json:"registration_options,omitempty"` +} + +func (m *QueryRegistrationOptionsByKeyResponse) Reset() { *m = QueryRegistrationOptionsByKeyResponse{} } +func (m *QueryRegistrationOptionsByKeyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRegistrationOptionsByKeyResponse) ProtoMessage() {} +func (*QueryRegistrationOptionsByKeyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{7} +} +func (m *QueryRegistrationOptionsByKeyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRegistrationOptionsByKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRegistrationOptionsByKeyResponse.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 *QueryRegistrationOptionsByKeyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRegistrationOptionsByKeyResponse.Merge(m, src) +} +func (m *QueryRegistrationOptionsByKeyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRegistrationOptionsByKeyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRegistrationOptionsByKeyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRegistrationOptionsByKeyResponse proto.InternalMessageInfo + +func (m *QueryRegistrationOptionsByKeyResponse) GetRegistrationOptions() []string { + if m != nil { + return m.RegistrationOptions + } + return nil +} + func init() { proto.RegisterType((*QueryRequest)(nil), "did.v1.QueryRequest") proto.RegisterType((*QueryResponse)(nil), "did.v1.QueryResponse") + proto.RegisterType((*QueryParamsResponse)(nil), "did.v1.QueryParamsResponse") + proto.RegisterType((*QueryParamsAssetsResponse)(nil), "did.v1.QueryParamsAssetsResponse") + proto.RegisterType((*QueryParamsKeysResponse)(nil), "did.v1.QueryParamsKeysResponse") + proto.RegisterMapType((map[string]*KeyInfo)(nil), "did.v1.QueryParamsKeysResponse.KeysEntry") + proto.RegisterType((*QueryParamsByKeyResponse)(nil), "did.v1.QueryParamsByKeyResponse") + proto.RegisterType((*QueryParamsByAssetResponse)(nil), "did.v1.QueryParamsByAssetResponse") + proto.RegisterType((*QueryRegistrationOptionsByKeyResponse)(nil), "did.v1.QueryRegistrationOptionsByKeyResponse") } func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) } var fileDescriptor_ae1fa9bb626e2869 = []byte{ - // 404 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0xae, 0xd3, 0x30, - 0x18, 0x85, 0xeb, 0x7b, 0x69, 0x72, 0x71, 0x5b, 0x54, 0xfe, 0x14, 0x14, 0x2a, 0x14, 0x55, 0x19, - 0x50, 0x07, 0x88, 0xd5, 0xb2, 0x30, 0x30, 0x21, 0x16, 0x3a, 0xd1, 0xb0, 0xb1, 0xa5, 0xb1, 0x09, - 0x96, 0x1a, 0x3b, 0x8d, 0x93, 0x88, 0xaa, 0xea, 0xc2, 0x13, 0x20, 0xf1, 0x4a, 0x0c, 0x8c, 0x95, - 0x58, 0x18, 0x51, 0xcb, 0x13, 0xf0, 0x04, 0xa8, 0xb6, 0x83, 0xd0, 0xdd, 0xba, 0x44, 0xf9, 0xcf, - 0x39, 0xfe, 0x94, 0xf3, 0xc7, 0x18, 0x28, 0xa7, 0xa4, 0x99, 0x91, 0x4d, 0xcd, 0xca, 0x6d, 0x54, - 0x94, 0xb2, 0x92, 0xe0, 0x50, 0x4e, 0xa3, 0x66, 0x36, 0x1e, 0x59, 0x2f, 0x63, 0x82, 0x29, 0xae, - 0x8c, 0x3b, 0xf6, 0xac, 0x9a, 0x4b, 0xca, 0xd6, 0xad, 0xf8, 0x38, 0x93, 0x32, 0x5b, 0x33, 0x92, - 0x14, 0x9c, 0x24, 0x42, 0xc8, 0x2a, 0xa9, 0xb8, 0x14, 0xd6, 0x0d, 0x5f, 0xe0, 0xfe, 0xf2, 0xcc, - 0x8f, 0xd9, 0xa6, 0x66, 0xaa, 0x82, 0x21, 0xbe, 0xa6, 0x9c, 0xfa, 0x68, 0x82, 0xa6, 0x77, 0xe3, - 0xf3, 0x2b, 0x3c, 0xc4, 0x8e, 0x2c, 0x79, 0xc6, 0x85, 0x7f, 0xa5, 0x45, 0x3b, 0x85, 0xdf, 0x10, - 0x1e, 0xd8, 0xa3, 0xaa, 0x90, 0x42, 0x31, 0xf0, 0xb1, 0xab, 0xea, 0x34, 0x65, 0x4a, 0xe9, 0xf3, - 0x37, 0x71, 0x3b, 0xc2, 0x08, 0x77, 0x75, 0x0b, 0x8b, 0x30, 0x03, 0x3c, 0xc5, 0x37, 0x54, 0xa6, - 0x75, 0xce, 0x44, 0xe5, 0x5f, 0x4f, 0xd0, 0xb4, 0x37, 0x1f, 0x46, 0xa6, 0x5f, 0xf4, 0xda, 0xea, - 0xf1, 0xbf, 0x04, 0x3c, 0xc3, 0xae, 0x62, 0x65, 0xc3, 0x53, 0xe6, 0xdf, 0xd1, 0x61, 0xaf, 0x0d, - 0xbf, 0x33, 0xf2, 0x1b, 0xf1, 0x41, 0xc6, 0x6d, 0x06, 0x9e, 0x60, 0xa7, 0x48, 0xca, 0x24, 0x57, - 0x7e, 0x57, 0xa7, 0xef, 0xb5, 0xe9, 0xb7, 0x5a, 0x8d, 0xad, 0x3b, 0xff, 0x83, 0x70, 0x57, 0xd7, - 0x80, 0x05, 0x76, 0x8c, 0x07, 0xa3, 0x36, 0xfb, 0xff, 0x6a, 0xc6, 0x0f, 0x6e, 0xa9, 0xa6, 0x75, - 0xe8, 0x7d, 0xfe, 0xf1, 0xfb, 0xeb, 0xd5, 0x00, 0x7a, 0xe4, 0xbc, 0x7d, 0x43, 0x85, 0x05, 0x76, - 0x63, 0xa6, 0xe4, 0xba, 0x61, 0x97, 0xc1, 0x40, 0xc3, 0xfa, 0x80, 0x35, 0x6c, 0x47, 0x39, 0xdd, - 0xc3, 0x12, 0xbb, 0xb6, 0xe1, 0x65, 0xac, 0x47, 0x9a, 0xe5, 0xc1, 0x7d, 0x62, 0x77, 0x42, 0x76, - 0xe6, 0xd7, 0xed, 0x5f, 0xbd, 0xfc, 0x7e, 0x0c, 0xd0, 0xe1, 0x18, 0xa0, 0x5f, 0xc7, 0x00, 0x7d, - 0x39, 0x05, 0x9d, 0xc3, 0x29, 0xe8, 0xfc, 0x3c, 0x05, 0x9d, 0xf7, 0x61, 0xc6, 0xab, 0x8f, 0xf5, - 0x2a, 0x4a, 0x65, 0x4e, 0xa4, 0x50, 0x52, 0x94, 0x44, 0x3f, 0x3e, 0xe9, 0x0f, 0xaa, 0xb6, 0x05, - 0x53, 0x2b, 0x47, 0x5f, 0x9d, 0xe7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xbf, 0x74, 0xaf, - 0xa1, 0x02, 0x00, 0x00, + // 708 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x95, 0xdf, 0x4e, 0x13, 0x41, + 0x14, 0xc6, 0x59, 0xa0, 0x2d, 0x3d, 0x2d, 0xff, 0x4e, 0x2b, 0x2e, 0xd5, 0x54, 0xd9, 0x04, 0x81, + 0x44, 0x3b, 0xa1, 0xde, 0x18, 0x23, 0x17, 0x12, 0x31, 0x2a, 0x26, 0xc8, 0x92, 0x78, 0x41, 0x4c, + 0xb4, 0x74, 0xc7, 0xba, 0x69, 0xbb, 0x53, 0x76, 0xb6, 0x8d, 0x9b, 0xa6, 0x37, 0x3e, 0x81, 0x89, + 0x6f, 0xe0, 0xa3, 0x18, 0x2f, 0xbc, 0x24, 0xf1, 0xc6, 0x4b, 0x03, 0x3e, 0x88, 0xd9, 0xb3, 0x33, + 0x74, 0x2b, 0x60, 0xd2, 0x1b, 0xe8, 0x9c, 0xf9, 0xce, 0xef, 0x9c, 0x39, 0xf3, 0x75, 0x0a, 0xe8, + 0xb8, 0x0e, 0xeb, 0x6d, 0xb2, 0xe3, 0x2e, 0xf7, 0xc3, 0x4a, 0xc7, 0x17, 0x81, 0xc0, 0xb4, 0xe3, + 0x3a, 0x95, 0xde, 0x66, 0xa9, 0xa8, 0xf6, 0x1a, 0xdc, 0xe3, 0xd2, 0x95, 0xf1, 0x6e, 0xa9, 0xa0, + 0xa2, 0x6d, 0xe1, 0xf0, 0x96, 0x0e, 0xde, 0x6c, 0x08, 0xd1, 0x68, 0x71, 0x56, 0xeb, 0xb8, 0xac, + 0xe6, 0x79, 0x22, 0xa8, 0x05, 0xae, 0xf0, 0xd4, 0xae, 0xf5, 0x0e, 0xf2, 0xfb, 0x11, 0xdf, 0xe6, + 0xc7, 0x5d, 0x2e, 0x03, 0x5c, 0x80, 0x29, 0xc7, 0x75, 0x4c, 0xe3, 0xb6, 0xb1, 0x9e, 0xb5, 0xa3, + 0x8f, 0xb8, 0x04, 0x69, 0xe1, 0xbb, 0x0d, 0xd7, 0x33, 0x27, 0x29, 0xa8, 0x56, 0x91, 0xb2, 0xc9, + 0x43, 0x73, 0x2a, 0x56, 0x36, 0x79, 0x88, 0x45, 0x48, 0xd5, 0xa4, 0xe4, 0x81, 0x39, 0x4d, 0xb1, + 0x78, 0x61, 0x7d, 0x37, 0x60, 0x56, 0x95, 0x90, 0x1d, 0xe1, 0x49, 0x8e, 0x26, 0x64, 0x64, 0xb7, + 0x5e, 0xe7, 0x52, 0x52, 0x9d, 0x19, 0x5b, 0x2f, 0x23, 0x02, 0x9d, 0x56, 0x95, 0x8a, 0x17, 0x78, + 0x17, 0x66, 0x1c, 0x51, 0xef, 0xb6, 0xb9, 0x17, 0x50, 0xb9, 0x5c, 0x75, 0xa1, 0x12, 0xcf, 0xa1, + 0xf2, 0x44, 0xc5, 0xed, 0x73, 0x05, 0xde, 0x83, 0x8c, 0xe4, 0x7e, 0xcf, 0xad, 0x73, 0xea, 0x23, + 0x57, 0x2d, 0x68, 0xf1, 0x41, 0x1c, 0x7e, 0xee, 0xbd, 0x17, 0xb6, 0xd6, 0xe0, 0x1d, 0x48, 0x77, + 0x6a, 0x7e, 0xad, 0x2d, 0xcd, 0x14, 0xa9, 0xe7, 0xb4, 0xfa, 0x15, 0x45, 0x6d, 0xb5, 0x6b, 0x6d, + 0x41, 0x81, 0x4e, 0xa1, 0xc2, 0xfa, 0x2c, 0xc3, 0x74, 0xe3, 0xbf, 0xe9, 0x4f, 0x61, 0x39, 0x91, + 0xfe, 0x38, 0x9a, 0xcc, 0x10, 0xb2, 0x01, 0x69, 0x9a, 0x55, 0x04, 0x99, 0x5a, 0xcf, 0x55, 0x17, + 0x35, 0x84, 0x74, 0xd4, 0xaf, 0x12, 0x58, 0x5f, 0x0d, 0xb8, 0x9e, 0x00, 0xed, 0xf2, 0x70, 0x88, + 0xd9, 0x82, 0xe9, 0x26, 0x0f, 0x35, 0x64, 0x43, 0x43, 0xae, 0x90, 0x57, 0xa2, 0xc5, 0x8e, 0x17, + 0xf8, 0xa1, 0x4d, 0x69, 0xa5, 0x67, 0x90, 0x3d, 0x0f, 0xe9, 0xdb, 0x35, 0x86, 0xb7, 0xbb, 0x0a, + 0xa9, 0x5e, 0xad, 0xd5, 0xe5, 0x74, 0x37, 0xb9, 0xea, 0xbc, 0xc6, 0xef, 0xf2, 0x90, 0x3a, 0x8c, + 0x77, 0x1f, 0x4e, 0x3e, 0x30, 0xac, 0x2d, 0x30, 0x13, 0x45, 0xb7, 0xc3, 0x5d, 0x3e, 0xbc, 0xfc, + 0x95, 0x21, 0xf8, 0x12, 0x48, 0xb4, 0x67, 0xed, 0x40, 0x69, 0x24, 0x9d, 0xa6, 0x70, 0x0e, 0x58, + 0xd3, 0x2e, 0x8b, 0x11, 0x97, 0xcc, 0x4a, 0x19, 0xef, 0x10, 0x56, 0x95, 0xef, 0x1a, 0xae, 0x0c, + 0x7c, 0xb2, 0xfd, 0x5e, 0x87, 0xcc, 0x3f, 0xda, 0xd2, 0x26, 0x14, 0xfd, 0x84, 0xe6, 0xad, 0x88, + 0x45, 0x34, 0xc7, 0xac, 0x5d, 0xf0, 0x2f, 0xe6, 0x57, 0xbf, 0xa5, 0x20, 0x45, 0x70, 0x7c, 0x09, + 0xe9, 0xb8, 0x4f, 0x2c, 0x8e, 0x0c, 0x5c, 0x7d, 0xa1, 0x4a, 0x37, 0x2e, 0xb9, 0x06, 0x5d, 0xd9, + 0x9a, 0xff, 0xf4, 0xf3, 0xcf, 0x97, 0xc9, 0x2c, 0x66, 0x58, 0x6c, 0x13, 0x3c, 0x80, 0x7c, 0xd2, + 0x21, 0x57, 0x30, 0xaf, 0xfd, 0x13, 0x55, 0xb4, 0x25, 0xa2, 0x2d, 0xe0, 0x9c, 0xa2, 0xb1, 0xd8, + 0x33, 0xf8, 0x06, 0x66, 0x47, 0x46, 0x39, 0x1e, 0xb5, 0x4c, 0x54, 0x13, 0x97, 0x46, 0xa9, 0xac, + 0x4f, 0xff, 0x07, 0xb8, 0x07, 0x30, 0x34, 0xd7, 0x78, 0xe8, 0x22, 0xa1, 0xe7, 0x30, 0xaf, 0xd1, + 0x91, 0x0f, 0xf1, 0x35, 0xe4, 0x12, 0xc6, 0x19, 0x8f, 0x58, 0x22, 0x62, 0x11, 0x31, 0x49, 0x64, + 0xfd, 0x26, 0x0f, 0x07, 0xd8, 0x01, 0xf3, 0x2a, 0x2b, 0x8c, 0x57, 0x64, 0x8d, 0x8a, 0xac, 0xe0, + 0xad, 0x8b, 0x45, 0x58, 0xd2, 0x2c, 0xf8, 0x02, 0x32, 0x36, 0x97, 0xa2, 0xd5, 0xe3, 0xe3, 0x15, + 0x40, 0x2a, 0x90, 0x47, 0x60, 0xd1, 0x83, 0xde, 0x77, 0x5c, 0x67, 0x80, 0xfb, 0x90, 0x51, 0xef, + 0xd7, 0x78, 0xac, 0x65, 0x62, 0x15, 0x70, 0x91, 0xa9, 0x17, 0x8f, 0xf5, 0xe3, 0x07, 0x7c, 0xb0, + 0xfd, 0xe8, 0xc7, 0x69, 0xd9, 0x38, 0x39, 0x2d, 0x1b, 0xbf, 0x4f, 0xcb, 0xc6, 0xe7, 0xb3, 0xf2, + 0xc4, 0xc9, 0x59, 0x79, 0xe2, 0xd7, 0x59, 0x79, 0xe2, 0xd0, 0x6a, 0xb8, 0xc1, 0x87, 0xee, 0x51, + 0xa5, 0x2e, 0xda, 0x4c, 0x78, 0x52, 0x78, 0x3e, 0xa3, 0x3f, 0x1f, 0xa9, 0xa1, 0x20, 0xec, 0x70, + 0x79, 0x94, 0xa6, 0x1f, 0x90, 0xfb, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x71, 0x4f, 0x30, + 0xa7, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -208,7 +515,17 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { // Params queries all parameters of the module. - Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // ParamsAssets queries all parameters of the module. + ParamsAssets(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByAsset(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // ParamsKeys queries all parameters of the module. + ParamsKeys(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + RegistrationOptionsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) // Resolve queries the DID document by its id. Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) // Service returns associated ServiceInfo for a given Origin @@ -225,8 +542,8 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { - out := new(QueryResponse) +func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Params", in, out, opts...) if err != nil { return nil, err @@ -234,6 +551,51 @@ func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc return out, nil } +func (c *queryClient) ParamsAssets(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/ParamsAssets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ParamsByAsset(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/ParamsByAsset", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ParamsKeys(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/ParamsKeys", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ParamsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/ParamsByKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RegistrationOptionsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/RegistrationOptionsByKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { out := new(QueryResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Resolve", in, out, opts...) @@ -255,7 +617,17 @@ func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grp // QueryServer is the server API for Query service. type QueryServer interface { // Params queries all parameters of the module. - Params(context.Context, *QueryRequest) (*QueryResponse, error) + Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) + // ParamsAssets queries all parameters of the module. + ParamsAssets(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByAsset(context.Context, *QueryRequest) (*QueryResponse, error) + // ParamsKeys queries all parameters of the module. + ParamsKeys(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByKey(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + RegistrationOptionsByKey(context.Context, *QueryRequest) (*QueryResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResponse, error) // Service returns associated ServiceInfo for a given Origin @@ -268,9 +640,24 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (*UnimplementedQueryServer) ParamsAssets(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsAssets not implemented") +} +func (*UnimplementedQueryServer) ParamsByAsset(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsByAsset not implemented") +} +func (*UnimplementedQueryServer) ParamsKeys(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsKeys not implemented") +} +func (*UnimplementedQueryServer) ParamsByKey(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsByKey not implemented") +} +func (*UnimplementedQueryServer) RegistrationOptionsByKey(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegistrationOptionsByKey not implemented") +} func (*UnimplementedQueryServer) Resolve(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } @@ -300,6 +687,96 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_ParamsAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsAssets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/ParamsAssets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsAssets(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ParamsByAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsByAsset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/ParamsByAsset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsByAsset(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ParamsKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsKeys(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/ParamsKeys", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsKeys(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ParamsByKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsByKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/ParamsByKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsByKey(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RegistrationOptionsByKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RegistrationOptionsByKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/RegistrationOptionsByKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RegistrationOptionsByKey(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryRequest) if err := dec(in); err != nil { @@ -344,6 +821,26 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "ParamsAssets", + Handler: _Query_ParamsAssets_Handler, + }, + { + MethodName: "ParamsByAsset", + Handler: _Query_ParamsByAsset_Handler, + }, + { + MethodName: "ParamsKeys", + Handler: _Query_ParamsKeys_Handler, + }, + { + MethodName: "ParamsByKey", + Handler: _Query_ParamsByKey_Handler, + }, + { + MethodName: "RegistrationOptionsByKey", + Handler: _Query_RegistrationOptionsByKey_Handler, + }, { MethodName: "Resolve", Handler: _Query_Resolve_Handler, @@ -377,6 +874,20 @@ func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + 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) @@ -470,6 +981,229 @@ func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsAssetsResponse) 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 *QueryParamsAssetsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsAssetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Assets) > 0 { + for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsKeysResponse) 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 *QueryParamsKeysResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsKeysResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Keys) > 0 { + for k := range m.Keys { + v := m.Keys[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsByKeyResponse) 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 *QueryParamsByKeyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsByKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Key != nil { + { + size, err := m.Key.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsByAssetResponse) 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 *QueryParamsByAssetResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsByAssetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Asset != nil { + { + size, err := m.Asset.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryRegistrationOptionsByKeyResponse) 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 *QueryRegistrationOptionsByKeyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRegistrationOptionsByKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RegistrationOptions) > 0 { + for iNdEx := len(m.RegistrationOptions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RegistrationOptions[iNdEx]) + copy(dAtA[i:], m.RegistrationOptions[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RegistrationOptions[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -495,6 +1229,14 @@ func (m *QueryRequest) Size() (n int) { 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)) + } return n } @@ -526,6 +1268,97 @@ func (m *QueryResponse) Size() (n int) { return n } +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsAssetsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Assets) > 0 { + for _, e := range m.Assets { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryParamsKeysResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Keys) > 0 { + for k, v := range m.Keys { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovQuery(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + +func (m *QueryParamsByKeyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Key != nil { + l = m.Key.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsByAssetResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Asset != nil { + l = m.Asset.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRegistrationOptionsByKeyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RegistrationOptions) > 0 { + for _, s := range m.RegistrationOptions { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -625,6 +1458,70 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { } 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 default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -856,6 +1753,609 @@ func (m *QueryResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsAssetsResponse) 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: QueryParamsAssetsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsAssetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Assets = append(m.Assets, &AssetInfo{}) + if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsKeysResponse) 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: QueryParamsKeysResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsKeysResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Keys == nil { + m.Keys = make(map[string]*KeyInfo) + } + var mapkey string + var mapvalue *KeyInfo + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthQuery + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthQuery + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &KeyInfo{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Keys[mapkey] = mapvalue + 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 *QueryParamsByKeyResponse) 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: QueryParamsByKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsByKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Key == nil { + m.Key = &KeyInfo{} + } + if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsByAssetResponse) 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: QueryParamsByAssetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsByAssetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Asset == nil { + m.Asset = &AssetInfo{} + } + if err := m.Asset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRegistrationOptionsByKeyResponse) 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: QueryRegistrationOptionsByKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRegistrationOptionsByKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegistrationOptions", 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.RegistrationOptions = append(m.RegistrationOptions, 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 skipQuery(dAtA []byte) (n int, err 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 fe7437c9c..b02deb36c 100644 --- a/x/did/types/query.pb.gw.go +++ b/x/did/types/query.pb.gw.go @@ -69,6 +69,294 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +var ( + filter_Query_ParamsAssets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ParamsAssets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ParamsAssets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ParamsAssets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ParamsAssets(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ParamsByAsset_0 = &utilities.DoubleArray{Encoding: map[string]int{"asset": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_ParamsByAsset_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["asset"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "asset") + } + + protoReq.Asset, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "asset", 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_ParamsByAsset_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ParamsByAsset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ParamsByAsset_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["asset"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "asset") + } + + protoReq.Asset, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "asset", 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_ParamsByAsset_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ParamsByAsset(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ParamsKeys_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ParamsKeys_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsKeys_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ParamsKeys(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ParamsKeys_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsKeys_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ParamsKeys(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ParamsByKey_0 = &utilities.DoubleArray{Encoding: map[string]int{"key": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_ParamsByKey_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", 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_ParamsByKey_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ParamsByKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ParamsByKey_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", 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_ParamsByKey_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ParamsByKey(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RegistrationOptionsByKey_0 = &utilities.DoubleArray{Encoding: map[string]int{"key": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_RegistrationOptionsByKey_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", 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_RegistrationOptionsByKey_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RegistrationOptionsByKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RegistrationOptionsByKey_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", 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_RegistrationOptionsByKey_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RegistrationOptionsByKey(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_Resolve_0 = &utilities.DoubleArray{Encoding: map[string]int{"did": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) @@ -242,6 +530,121 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ParamsAssets_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_ParamsAssets_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_ParamsAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsByAsset_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_ParamsByAsset_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_ParamsByAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsKeys_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_ParamsKeys_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_ParamsKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsByKey_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_ParamsByKey_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_ParamsByKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RegistrationOptionsByKey_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_RegistrationOptionsByKey_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_RegistrationOptionsByKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Resolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -349,6 +752,106 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ParamsAssets_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_ParamsAssets_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_ParamsAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsByAsset_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_ParamsByAsset_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_ParamsByAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsKeys_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_ParamsKeys_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_ParamsKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsByKey_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_ParamsByKey_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_ParamsByKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RegistrationOptionsByKey_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_RegistrationOptionsByKey_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_RegistrationOptionsByKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Resolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -393,7 +896,17 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"did", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ParamsAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"params", "assets"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ParamsByAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"params", "assets", "asset"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ParamsKeys_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"params", "keys"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ParamsByKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"params", "keys", "key"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_RegistrationOptionsByKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"params", "keys", "key", "registration"}, "", 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))) @@ -403,6 +916,16 @@ var ( var ( forward_Query_Params_0 = runtime.ForwardResponseMessage + forward_Query_ParamsAssets_0 = runtime.ForwardResponseMessage + + forward_Query_ParamsByAsset_0 = runtime.ForwardResponseMessage + + forward_Query_ParamsKeys_0 = runtime.ForwardResponseMessage + + forward_Query_ParamsByKey_0 = runtime.ForwardResponseMessage + + forward_Query_RegistrationOptionsByKey_0 = runtime.ForwardResponseMessage + forward_Query_Resolve_0 = runtime.ForwardResponseMessage forward_Query_Service_0 = runtime.ForwardResponseMessage diff --git a/x/did/types/tx.pb.go b/x/did/types/tx.pb.go index 6463efcdf..f427305bd 100644 --- a/x/did/types/tx.pb.go +++ b/x/did/types/tx.pb.go @@ -39,7 +39,7 @@ type MsgUpdateParams struct { // params defines the parameters to update. Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` // token is the macron token to authenticate the operation. - Token *Token `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` } func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } @@ -89,11 +89,11 @@ func (m *MsgUpdateParams) GetParams() Params { return Params{} } -func (m *MsgUpdateParams) GetToken() *Token { +func (m *MsgUpdateParams) GetToken() string { if m != nil { return m.Token } - return nil + return "" } // MsgUpdateParamsResponse defines the response structure for executing a @@ -282,7 +282,7 @@ type MsgProveWitness struct { // Witness Value is the bytes of the witness. Witness []byte `protobuf:"bytes,3,opt,name=witness,proto3" json:"witness,omitempty"` // token is the macron token to authenticate the operation. - Token *Token `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` } func (m *MsgProveWitness) Reset() { *m = MsgProveWitness{} } @@ -339,11 +339,11 @@ func (m *MsgProveWitness) GetWitness() []byte { return nil } -func (m *MsgProveWitness) GetToken() *Token { +func (m *MsgProveWitness) GetToken() string { if m != nil { return m.Token } - return nil + return "" } // MsgProveWitnessResponse is the response type for the ProveWitness RPC. @@ -404,7 +404,7 @@ type MsgSyncController struct { // controller is the address of the controller to sync. Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` // Token is the public token to authenticate the operation. - Token *Token `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` } func (m *MsgSyncController) Reset() { *m = MsgSyncController{} } @@ -447,11 +447,11 @@ func (m *MsgSyncController) GetController() string { return "" } -func (m *MsgSyncController) GetToken() *Token { +func (m *MsgSyncController) GetToken() string { if m != nil { return m.Token } - return nil + return "" } // MsgSyncControllerResponse is the response type for the SyncController RPC. @@ -645,7 +645,7 @@ type MsgAuthorizeService struct { // Permissions is the scope of the service. Scopes *Permissions `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` // token is the macron token to authenticate the operation. - Token *Token `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` } func (m *MsgAuthorizeService) Reset() { *m = MsgAuthorizeService{} } @@ -702,17 +702,17 @@ func (m *MsgAuthorizeService) GetScopes() *Permissions { return nil } -func (m *MsgAuthorizeService) GetToken() *Token { +func (m *MsgAuthorizeService) GetToken() string { if m != nil { return m.Token } - return nil + return "" } // MsgAuthorizeServiceResponse is the response type for the AuthorizeService RPC. type MsgAuthorizeServiceResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Token *Token `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` } func (m *MsgAuthorizeServiceResponse) Reset() { *m = MsgAuthorizeServiceResponse{} } @@ -755,11 +755,11 @@ func (m *MsgAuthorizeServiceResponse) GetSuccess() bool { return false } -func (m *MsgAuthorizeServiceResponse) GetToken() *Token { +func (m *MsgAuthorizeServiceResponse) GetToken() string { if m != nil { return m.Token } - return nil + return "" } // MsgRegisterService is the message type for the RegisterService RPC. @@ -769,7 +769,7 @@ type MsgRegisterService struct { // origin is the origin of the request in wildcard form. Requires valid TXT record in DNS. Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` // token is the macron token to authenticate the operation. - Token *Token `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` } func (m *MsgRegisterService) Reset() { *m = MsgRegisterService{} } @@ -819,11 +819,11 @@ func (m *MsgRegisterService) GetService() *Service { return nil } -func (m *MsgRegisterService) GetToken() *Token { +func (m *MsgRegisterService) GetToken() string { if m != nil { return m.Token } - return nil + return "" } // MsgRegisterServiceResponse is the response type for the RegisterService RPC. @@ -900,65 +900,64 @@ func init() { func init() { proto.RegisterFile("did/v1/tx.proto", fileDescriptor_d73284df019ff211) } var fileDescriptor_d73284df019ff211 = []byte{ - // 922 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xce, 0xd8, 0x89, 0x1b, 0xbf, 0xf9, 0x70, 0x98, 0x04, 0xe2, 0x6c, 0x5b, 0x37, 0xdd, 0x0a, - 0x29, 0x14, 0xb0, 0x95, 0x54, 0xa0, 0xaa, 0x70, 0x20, 0xa9, 0x90, 0x2a, 0x21, 0x93, 0xb2, 0x29, - 0x20, 0x55, 0x48, 0xd1, 0x66, 0x76, 0xb4, 0x19, 0xb2, 0xde, 0x59, 0xcd, 0x8c, 0x4d, 0xcc, 0x89, - 0x8f, 0x2b, 0x07, 0x7e, 0x02, 0x3f, 0x00, 0x89, 0x1e, 0xfa, 0x23, 0x2a, 0xb8, 0x54, 0x9c, 0x38, - 0x21, 0x94, 0x1c, 0xfa, 0x17, 0x38, 0x56, 0xbb, 0x33, 0xfb, 0x61, 0x3b, 0x4e, 0xdd, 0xe4, 0x62, - 0xef, 0x3b, 0xcf, 0x3b, 0xef, 0xd7, 0xf3, 0xcc, 0xec, 0x42, 0xcd, 0x63, 0x5e, 0xab, 0xb7, 0xd9, - 0x52, 0xc7, 0xcd, 0x48, 0x70, 0xc5, 0x71, 0xc5, 0x63, 0x5e, 0xb3, 0xb7, 0x69, 0xad, 0x12, 0x2e, - 0x3b, 0x5c, 0xb6, 0x3a, 0xd2, 0x8f, 0xf1, 0x8e, 0xf4, 0xb5, 0x83, 0xb5, 0xa6, 0x81, 0xfd, 0xc4, - 0x6a, 0x69, 0xc3, 0x40, 0x2b, 0x26, 0x98, 0x4f, 0x43, 0x2a, 0x59, 0xba, 0xba, 0x6c, 0x56, 0x3b, - 0xdc, 0xa3, 0x41, 0xe6, 0xea, 0x73, 0x9f, 0xeb, 0x10, 0xf1, 0x93, 0x5e, 0xb5, 0x7f, 0x47, 0x50, - 0x6b, 0x4b, 0xff, 0xcb, 0xc8, 0x73, 0x15, 0x7d, 0xe8, 0x0a, 0xb7, 0x23, 0xf1, 0x87, 0x50, 0x75, - 0xbb, 0xea, 0x90, 0x0b, 0xa6, 0xfa, 0x75, 0xb4, 0x8e, 0x36, 0xaa, 0x3b, 0xf5, 0xbf, 0x9f, 0xbe, - 0xbf, 0x62, 0x32, 0x6f, 0x7b, 0x9e, 0xa0, 0x52, 0xee, 0x29, 0xc1, 0x42, 0xdf, 0xc9, 0x5d, 0xf1, - 0x7b, 0x50, 0x89, 0x92, 0x08, 0xf5, 0xd2, 0x3a, 0xda, 0x98, 0xdb, 0x5a, 0x6c, 0xea, 0xce, 0x9a, - 0x3a, 0xee, 0xce, 0xf4, 0xb3, 0x7f, 0x6f, 0x4c, 0x39, 0xc6, 0x07, 0xdf, 0x82, 0x19, 0xc5, 0x8f, - 0x68, 0x58, 0x2f, 0x27, 0xce, 0x0b, 0xa9, 0xf3, 0xa3, 0x78, 0xd1, 0xd1, 0xd8, 0xbd, 0xc5, 0x9f, - 0x5e, 0x3c, 0xb9, 0x9d, 0xa7, 0xb0, 0xd7, 0x60, 0x75, 0xa8, 0x5a, 0x87, 0xca, 0x88, 0x87, 0x92, - 0xda, 0xbf, 0x20, 0x58, 0x6a, 0x4b, 0x7f, 0x3b, 0x08, 0x38, 0x71, 0x15, 0xfd, 0xca, 0xed, 0x06, - 0xea, 0xc2, 0xad, 0xd4, 0xe1, 0x8a, 0xec, 0x1e, 0x7c, 0x4b, 0x89, 0x4a, 0x7a, 0xa9, 0x3a, 0xa9, - 0x89, 0xdf, 0x82, 0x0a, 0x17, 0xcc, 0x67, 0xba, 0xee, 0xaa, 0x63, 0xac, 0x91, 0x4a, 0x7f, 0x43, - 0x50, 0x1f, 0x2e, 0x27, 0xad, 0x15, 0x2f, 0x41, 0x99, 0x30, 0x4f, 0x17, 0xe4, 0xc4, 0x8f, 0xf8, - 0x26, 0xcc, 0xd3, 0xe3, 0x88, 0x89, 0xfe, 0xfe, 0x41, 0xc0, 0xc9, 0x51, 0x92, 0xb5, 0xec, 0xcc, - 0xe9, 0xb5, 0x9d, 0x78, 0x09, 0x6f, 0xc2, 0x8a, 0xa0, 0x3e, 0x93, 0x4a, 0xb8, 0x8a, 0xf1, 0x70, - 0x9f, 0x47, 0xf1, 0x9f, 0x34, 0x75, 0x2c, 0x17, 0xb1, 0x5d, 0x0d, 0xe1, 0x6b, 0x50, 0x8d, 0xd3, - 0x07, 0x87, 0x5c, 0xaa, 0xfa, 0xf4, 0x3a, 0xda, 0x98, 0x75, 0xf2, 0x05, 0xfb, 0xa9, 0xe6, 0xfe, - 0xa1, 0xe0, 0x3d, 0xfa, 0x35, 0x53, 0x21, 0x95, 0x17, 0xe7, 0xde, 0x82, 0xd9, 0x48, 0xf0, 0x88, - 0x0a, 0xd5, 0x37, 0x13, 0xcb, 0xec, 0x78, 0x98, 0xdf, 0xe9, 0xf0, 0x49, 0xad, 0xf3, 0x4e, 0x6a, - 0xe6, 0x1a, 0x98, 0x7e, 0x0d, 0x0d, 0xec, 0x26, 0x1a, 0x28, 0x56, 0x9d, 0xcd, 0x35, 0xa1, 0x8d, - 0x90, 0x38, 0x13, 0x4a, 0xba, 0x4d, 0xcd, 0xf3, 0xea, 0xb3, 0x7f, 0x46, 0xf0, 0x46, 0x5b, 0xfa, - 0x7b, 0xfd, 0x90, 0xdc, 0xe7, 0xa1, 0x12, 0x3c, 0x08, 0xa8, 0xc0, 0x77, 0x01, 0x48, 0x66, 0xbd, - 0x72, 0x14, 0x05, 0xdf, 0xc9, 0x94, 0x5d, 0x8b, 0xbb, 0x2a, 0xec, 0xb2, 0x3f, 0x80, 0xb5, 0x91, - 0x22, 0x5e, 0xdd, 0x98, 0xfd, 0x17, 0x82, 0x37, 0xdb, 0xd2, 0x77, 0x12, 0xf6, 0xa9, 0x28, 0x34, - 0x70, 0x51, 0x2a, 0x8d, 0x38, 0x4b, 0xb9, 0x38, 0xc7, 0x68, 0x1e, 0x7f, 0x02, 0xd7, 0x88, 0xa0, - 0x1e, 0x0d, 0x15, 0x73, 0x83, 0x7d, 0x22, 0xa8, 0x16, 0xa6, 0x30, 0x55, 0x27, 0xac, 0x56, 0x1d, - 0x2b, 0xf7, 0xb9, 0x6f, 0x5c, 0xd2, 0xbe, 0x46, 0xb8, 0xfd, 0xb1, 0x04, 0xd7, 0xcf, 0xec, 0x66, - 0x02, 0x8a, 0x07, 0x09, 0x2b, 0xbd, 0x06, 0x61, 0xbb, 0x30, 0xeb, 0x12, 0xc2, 0xbb, 0xa1, 0x8a, - 0x15, 0x5a, 0xde, 0x98, 0xdb, 0xba, 0x93, 0x72, 0x76, 0x6e, 0x31, 0xcd, 0x6d, 0xb3, 0xeb, 0xd3, - 0x50, 0x89, 0xbe, 0x93, 0x05, 0xb1, 0x3e, 0x82, 0x85, 0x01, 0x28, 0x9e, 0xe9, 0x11, 0xed, 0xa7, - 0x07, 0xfe, 0x88, 0xf6, 0xf1, 0x0a, 0xcc, 0xf4, 0xdc, 0xa0, 0x4b, 0xcd, 0x9c, 0xb5, 0x71, 0xaf, - 0x74, 0x17, 0xd9, 0x7f, 0x22, 0x58, 0x8e, 0x6f, 0x0e, 0x3d, 0x94, 0xef, 0xe9, 0x1e, 0x15, 0x3d, - 0x46, 0xe8, 0x25, 0x04, 0x99, 0xf3, 0x57, 0x1a, 0xe0, 0xef, 0x5d, 0xa8, 0x48, 0xc2, 0x23, 0x2a, - 0x8d, 0x52, 0x97, 0xb3, 0x0b, 0x9b, 0x8a, 0x0e, 0x93, 0x32, 0xbe, 0x43, 0x1c, 0xe3, 0x32, 0xd9, - 0x59, 0x1d, 0x51, 0xf5, 0x37, 0x70, 0xf5, 0x8c, 0x5e, 0x26, 0x60, 0x33, 0x4b, 0x57, 0x1a, 0x9f, - 0xce, 0xfe, 0x03, 0x01, 0x2e, 0x30, 0x74, 0xf9, 0x49, 0xbd, 0x03, 0x57, 0xa4, 0x0e, 0x62, 0xf2, - 0xd6, 0xd2, 0xbc, 0x69, 0xe5, 0x29, 0x7e, 0xc1, 0x53, 0xfe, 0x00, 0xac, 0xd1, 0x82, 0x27, 0x18, - 0xc7, 0x12, 0x94, 0xbd, 0xfc, 0x50, 0x7a, 0xcc, 0xdb, 0xfa, 0xbf, 0x0c, 0xe5, 0xb6, 0xf4, 0xf1, - 0x03, 0x98, 0x1f, 0x78, 0x7b, 0xaf, 0x16, 0xa4, 0x5b, 0x04, 0xac, 0x1b, 0x63, 0x80, 0x2c, 0xfb, - 0x23, 0x58, 0x1a, 0x11, 0xdd, 0xd5, 0xc2, 0xa6, 0x61, 0xd0, 0xba, 0x75, 0x0e, 0x98, 0x45, 0xfd, - 0x0c, 0x16, 0x06, 0xdf, 0xc9, 0xf5, 0xe2, 0xae, 0x22, 0x62, 0xad, 0x8f, 0x43, 0xb2, 0x60, 0x9f, - 0xc3, 0xe2, 0xd0, 0x35, 0xbd, 0x56, 0xd8, 0x33, 0x08, 0x59, 0x37, 0xc7, 0x42, 0x59, 0xbc, 0xc7, - 0x80, 0xcf, 0xb8, 0x39, 0xaf, 0x9f, 0x7b, 0xfa, 0xad, 0xb7, 0x27, 0xba, 0x1c, 0xf0, 0x17, 0x50, - 0x1b, 0x16, 0xa6, 0x75, 0xc6, 0xce, 0x74, 0x98, 0xf6, 0x78, 0x2c, 0x0d, 0x69, 0xcd, 0xfc, 0xf0, - 0xe2, 0xc9, 0x6d, 0xb4, 0xf3, 0xf1, 0xb3, 0x93, 0x06, 0x7a, 0x7e, 0xd2, 0x40, 0xff, 0x9d, 0x34, - 0xd0, 0xaf, 0xa7, 0x8d, 0xa9, 0xe7, 0xa7, 0x8d, 0xa9, 0x7f, 0x4e, 0x1b, 0x53, 0x8f, 0x6d, 0x9f, - 0xa9, 0xc3, 0xee, 0x41, 0x93, 0xf0, 0x4e, 0x8b, 0x87, 0x92, 0x87, 0xa2, 0x95, 0xfc, 0x1c, 0xb7, - 0xe2, 0x4f, 0x42, 0xd5, 0x8f, 0xa8, 0x3c, 0xa8, 0x24, 0x5f, 0x7e, 0x77, 0x5e, 0x06, 0x00, 0x00, - 0xff, 0xff, 0x14, 0xb5, 0x39, 0x32, 0x89, 0x0a, 0x00, 0x00, + // 911 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0xdc, 0x44, + 0x18, 0x8e, 0x77, 0xd3, 0x6d, 0xf2, 0x26, 0xcd, 0x06, 0x27, 0x10, 0xc7, 0x6d, 0xb7, 0xa9, 0x11, + 0x52, 0x28, 0xb0, 0xab, 0xa4, 0x02, 0x55, 0x85, 0x03, 0x49, 0x85, 0x54, 0x09, 0x2d, 0x29, 0x0e, + 0x1f, 0x52, 0x2f, 0x91, 0x77, 0x3c, 0x72, 0x86, 0xf5, 0x7a, 0xac, 0x99, 0xd9, 0x25, 0xe6, 0x04, + 0x9c, 0x39, 0xf0, 0x07, 0x90, 0xb8, 0x70, 0xef, 0x81, 0x1b, 0x7f, 0xa0, 0x12, 0x97, 0x8a, 0x13, + 0x27, 0x84, 0x92, 0x43, 0xff, 0x02, 0x47, 0x34, 0x9e, 0xf1, 0xc7, 0x7e, 0x76, 0x9b, 0x5e, 0x76, + 0xfd, 0xce, 0xf3, 0xce, 0x33, 0xcf, 0x3b, 0xcf, 0x3b, 0x63, 0x43, 0xdd, 0x27, 0x7e, 0x6b, 0xb0, + 0xd7, 0x12, 0x67, 0xcd, 0x98, 0x51, 0x41, 0xcd, 0x9a, 0x4f, 0xfc, 0xe6, 0x60, 0xcf, 0xde, 0x42, + 0x94, 0xf7, 0x28, 0x6f, 0xf5, 0x78, 0x20, 0xf1, 0x1e, 0x0f, 0x54, 0x82, 0xbd, 0xad, 0x80, 0x93, + 0x34, 0x6a, 0xa9, 0x40, 0x43, 0x9b, 0x9a, 0x2c, 0xc0, 0x11, 0xe6, 0x24, 0x1b, 0xdd, 0xd0, 0xa3, + 0x3d, 0xea, 0xe3, 0x30, 0x4f, 0x0d, 0x68, 0x40, 0x15, 0x85, 0x7c, 0x52, 0xa3, 0xce, 0x2f, 0x06, + 0xd4, 0xdb, 0x3c, 0xf8, 0x32, 0xf6, 0x3d, 0x81, 0x1f, 0x79, 0xcc, 0xeb, 0x71, 0xf3, 0x03, 0x58, + 0xf6, 0xfa, 0xe2, 0x94, 0x32, 0x22, 0x12, 0xcb, 0xd8, 0x31, 0x76, 0x97, 0x0f, 0xad, 0xbf, 0x7e, + 0x7f, 0x6f, 0x53, 0xaf, 0x7c, 0xe0, 0xfb, 0x0c, 0x73, 0x7e, 0x2c, 0x18, 0x89, 0x02, 0xb7, 0x48, + 0x35, 0xdf, 0x85, 0x5a, 0x9c, 0x32, 0x58, 0x95, 0x1d, 0x63, 0x77, 0x65, 0x7f, 0xad, 0xa9, 0x2a, + 0x6b, 0x2a, 0xde, 0xc3, 0xc5, 0xa7, 0xff, 0xdc, 0x5a, 0x70, 0x75, 0x8e, 0xb9, 0x09, 0x57, 0x04, + 0xed, 0xe2, 0xc8, 0xaa, 0xca, 0x15, 0x5c, 0x15, 0xdc, 0x5f, 0xfb, 0xf1, 0xf9, 0x93, 0x3b, 0x05, + 0xa7, 0xb3, 0x0d, 0x5b, 0x23, 0xf2, 0x5c, 0xcc, 0x63, 0x1a, 0x71, 0xec, 0xfc, 0x64, 0xc0, 0x7a, + 0x9b, 0x07, 0x07, 0x61, 0x48, 0x91, 0x27, 0xf0, 0x57, 0x5e, 0x3f, 0x14, 0x97, 0xd6, 0x6e, 0xc1, + 0x55, 0xde, 0xef, 0x7c, 0x83, 0x91, 0x48, 0xc5, 0x2f, 0xbb, 0x59, 0x68, 0xbe, 0x01, 0x35, 0xca, + 0x48, 0x40, 0x32, 0xa1, 0x3a, 0x1a, 0x53, 0xfa, 0xab, 0x01, 0xd6, 0xa8, 0x9c, 0x4c, 0xab, 0xb9, + 0x0e, 0x55, 0x44, 0x7c, 0x25, 0xc8, 0x95, 0x8f, 0xe6, 0x6d, 0x58, 0xc5, 0x67, 0x31, 0x61, 0xc9, + 0x49, 0x27, 0xa4, 0xa8, 0x9b, 0xae, 0x5a, 0x75, 0x57, 0xd4, 0xd8, 0xa1, 0x1c, 0x32, 0xf7, 0x60, + 0x93, 0xe1, 0x80, 0x70, 0xc1, 0x3c, 0x41, 0x68, 0x74, 0x42, 0x63, 0xf9, 0xc7, 0xb5, 0x8e, 0x8d, + 0x32, 0x76, 0xa4, 0x20, 0xf3, 0x06, 0x2c, 0xcb, 0xe5, 0xc3, 0x53, 0xca, 0x85, 0xb5, 0xb8, 0x63, + 0xec, 0x2e, 0xb9, 0xc5, 0x80, 0xf3, 0x9b, 0x32, 0xfb, 0x11, 0xa3, 0x03, 0xfc, 0x35, 0x11, 0x11, + 0xe6, 0x97, 0x37, 0xdb, 0x86, 0xa5, 0x98, 0xd1, 0x18, 0x33, 0x91, 0xe8, 0x1d, 0xcb, 0x63, 0xb9, + 0x99, 0xdf, 0x2a, 0xfa, 0x54, 0xeb, 0xaa, 0x9b, 0x85, 0x85, 0xe9, 0x8b, 0xb3, 0x4c, 0x3f, 0x4a, + 0x4d, 0x2f, 0xcb, 0xcc, 0x37, 0x32, 0xf5, 0x09, 0x21, 0x49, 0x6d, 0xa4, 0xe5, 0x65, 0xe1, 0x2c, + 0x41, 0x8e, 0x80, 0xd7, 0xda, 0x3c, 0x38, 0x4e, 0x22, 0xf4, 0x80, 0x46, 0x82, 0xd1, 0x30, 0xc4, + 0xcc, 0xbc, 0x07, 0x80, 0xf2, 0xe8, 0x85, 0xa5, 0x97, 0x72, 0xa7, 0xb4, 0x6e, 0x5d, 0x56, 0x51, + 0x4a, 0x73, 0xde, 0x87, 0xed, 0xb1, 0x55, 0x5f, 0x5c, 0x88, 0xf3, 0xa7, 0x01, 0xaf, 0xb7, 0x79, + 0xe0, 0xa6, 0xf6, 0x62, 0x56, 0x52, 0x7c, 0x59, 0xaf, 0x74, 0xf7, 0x55, 0x8a, 0xee, 0x9b, 0xd2, + 0xd4, 0xe6, 0xc7, 0x70, 0x03, 0x31, 0xec, 0xe3, 0x48, 0x10, 0x2f, 0x3c, 0x41, 0x0c, 0xab, 0xce, + 0x63, 0x5a, 0xb5, 0xb6, 0xcd, 0x2e, 0x72, 0x1e, 0xe8, 0x94, 0xac, 0xae, 0x31, 0x2f, 0x7f, 0xa8, + 0xc0, 0xcd, 0x89, 0xd5, 0xcc, 0x61, 0xe9, 0xb0, 0x43, 0x95, 0x97, 0x70, 0xe8, 0x08, 0x96, 0x3c, + 0x84, 0x68, 0x3f, 0x12, 0xb2, 0x05, 0xab, 0xbb, 0x2b, 0xfb, 0x77, 0xb3, 0xcb, 0x68, 0xa6, 0x98, + 0xe6, 0x81, 0x9e, 0xf5, 0x49, 0x24, 0x58, 0xe2, 0xe6, 0x24, 0xf6, 0x87, 0x70, 0x6d, 0x08, 0x92, + 0x7b, 0xda, 0xc5, 0x49, 0x76, 0xa2, 0xbb, 0x38, 0x91, 0x5d, 0x31, 0xf0, 0xc2, 0x3e, 0xd6, 0xfb, + 0xac, 0x82, 0xfb, 0x95, 0x7b, 0x86, 0xf3, 0x87, 0x01, 0x1b, 0xf2, 0x6a, 0x50, 0x9b, 0xf2, 0x1d, + 0x3e, 0xc6, 0x6c, 0x40, 0x10, 0x7e, 0x85, 0x0e, 0x2c, 0xfc, 0xab, 0x0c, 0xf9, 0xf7, 0x0e, 0xd4, + 0x38, 0xa2, 0x31, 0x56, 0x07, 0x6f, 0x65, 0x7f, 0x23, 0xbf, 0x82, 0x31, 0xeb, 0x11, 0xce, 0xe5, + 0x25, 0xe1, 0xea, 0x94, 0x29, 0x87, 0x71, 0xac, 0x8d, 0xdb, 0x70, 0x7d, 0x82, 0xf8, 0x39, 0xec, + 0xcb, 0xf9, 0x2b, 0x25, 0x7e, 0x79, 0x4f, 0x9a, 0x25, 0x0f, 0x5e, 0x7d, 0x2f, 0xde, 0x86, 0xab, + 0x5c, 0x91, 0xe8, 0xf7, 0x4e, 0x3d, 0x2b, 0x3a, 0x93, 0x9a, 0xe1, 0xf3, 0x1e, 0xdc, 0x87, 0x60, + 0x8f, 0x2b, 0x9c, 0xa3, 0xe0, 0x75, 0xa8, 0xfa, 0xc5, 0x39, 0xf3, 0x89, 0xbf, 0xff, 0x5f, 0x15, + 0xaa, 0x6d, 0x1e, 0x98, 0x0f, 0x61, 0x75, 0xe8, 0x15, 0xbb, 0x55, 0xea, 0xc6, 0x32, 0x60, 0xdf, + 0x9a, 0x02, 0xe4, 0xab, 0x7f, 0x01, 0xeb, 0x63, 0x7d, 0x74, 0xbd, 0x34, 0x69, 0x14, 0xb4, 0xdf, + 0x9c, 0x01, 0xe6, 0xac, 0x9f, 0xc2, 0xb5, 0xe1, 0xf7, 0xa8, 0x55, 0x9e, 0x55, 0x46, 0xec, 0x9d, + 0x69, 0x48, 0x4e, 0xf6, 0x19, 0xac, 0x8d, 0x5c, 0xb5, 0xdb, 0xa5, 0x39, 0xc3, 0x90, 0x7d, 0x7b, + 0x2a, 0x94, 0xf3, 0x3d, 0x06, 0x73, 0xc2, 0x65, 0x78, 0x73, 0xe6, 0x81, 0xb6, 0xdf, 0x9a, 0xeb, + 0xbc, 0x9b, 0x9f, 0x43, 0x7d, 0xb4, 0x13, 0xed, 0x09, 0x33, 0xb3, 0xcd, 0x74, 0xa6, 0x63, 0x19, + 0xa5, 0x7d, 0xe5, 0xfb, 0xe7, 0x4f, 0xee, 0x18, 0x87, 0x1f, 0x3d, 0x3d, 0x6f, 0x18, 0xcf, 0xce, + 0x1b, 0xc6, 0xbf, 0xe7, 0x0d, 0xe3, 0xe7, 0x8b, 0xc6, 0xc2, 0xb3, 0x8b, 0xc6, 0xc2, 0xdf, 0x17, + 0x8d, 0x85, 0xc7, 0x4e, 0x40, 0xc4, 0x69, 0xbf, 0xd3, 0x44, 0xb4, 0xd7, 0xa2, 0x11, 0xa7, 0x11, + 0x6b, 0xa5, 0x3f, 0x67, 0x2d, 0xf9, 0xdd, 0x26, 0x92, 0x18, 0xf3, 0x4e, 0x2d, 0xfd, 0x3c, 0xbb, + 0xfb, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x48, 0x8a, 0xd6, 0x2e, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1259,15 +1258,10 @@ func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Token != nil { - { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) i-- dAtA[i] = 0x1a } @@ -1430,15 +1424,10 @@ func (m *MsgProveWitness) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Token != nil { - { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) i-- dAtA[i] = 0x22 } @@ -1526,15 +1515,10 @@ func (m *MsgSyncController) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Token != nil { - { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) i-- dAtA[i] = 0x1a } @@ -1711,15 +1695,10 @@ func (m *MsgAuthorizeService) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Token != nil { - { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) i-- dAtA[i] = 0x22 } @@ -1772,15 +1751,10 @@ func (m *MsgAuthorizeServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l - if m.Token != nil { - { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) i-- dAtA[i] = 0x12 } @@ -1817,15 +1791,10 @@ func (m *MsgRegisterService) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Token != nil { - { - size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) i-- dAtA[i] = 0x1a } @@ -1914,8 +1883,8 @@ func (m *MsgUpdateParams) Size() (n int) { } l = m.Params.Size() n += 1 + l + sovTx(uint64(l)) - if m.Token != nil { - l = m.Token.Size() + l = len(m.Token) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n @@ -1992,8 +1961,8 @@ func (m *MsgProveWitness) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.Token != nil { - l = m.Token.Size() + l = len(m.Token) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n @@ -2025,8 +1994,8 @@ func (m *MsgSyncController) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.Token != nil { - l = m.Token.Size() + l = len(m.Token) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n @@ -2111,8 +2080,8 @@ func (m *MsgAuthorizeService) Size() (n int) { l = m.Scopes.Size() n += 1 + l + sovTx(uint64(l)) } - if m.Token != nil { - l = m.Token.Size() + l = len(m.Token) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n @@ -2127,8 +2096,8 @@ func (m *MsgAuthorizeServiceResponse) Size() (n int) { if m.Success { n += 2 } - if m.Token != nil { - l = m.Token.Size() + l = len(m.Token) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n @@ -2148,8 +2117,8 @@ func (m *MsgRegisterService) Size() (n int) { l = m.Service.Size() n += 1 + l + sovTx(uint64(l)) } - if m.Token != nil { - l = m.Token.Size() + l = len(m.Token) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n @@ -2275,7 +2244,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2285,27 +2254,23 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Token == nil { - m.Token = &Token{} - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2808,7 +2773,7 @@ func (m *MsgProveWitness) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2818,27 +2783,23 @@ func (m *MsgProveWitness) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Token == nil { - m.Token = &Token{} - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3028,7 +2989,7 @@ func (m *MsgSyncController) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3038,27 +2999,23 @@ func (m *MsgSyncController) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Token == nil { - m.Token = &Token{} - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3691,7 +3648,7 @@ func (m *MsgAuthorizeService) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3701,27 +3658,23 @@ func (m *MsgAuthorizeService) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Token == nil { - m.Token = &Token{} - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3797,7 +3750,7 @@ func (m *MsgAuthorizeServiceResponse) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3807,27 +3760,23 @@ func (m *MsgAuthorizeServiceResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Token == nil { - m.Token = &Token{} - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3951,7 +3900,7 @@ func (m *MsgRegisterService) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3961,27 +3910,23 @@ func (m *MsgRegisterService) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Token == nil { - m.Token = &Token{} - } - if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/did/types/txns/Msg.pkl.go b/x/did/types/txns/Msg.pkl.go new file mode 100644 index 000000000..316adf06d --- /dev/null +++ b/x/did/types/txns/Msg.pkl.go @@ -0,0 +1,6 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +type Msg interface { + GetTypeUrl() string +} diff --git a/txns/MsgDidAllocateVault.pkl.go b/x/did/types/txns/MsgDidAllocateVault.pkl.go similarity index 92% rename from txns/MsgDidAllocateVault.pkl.go rename to x/did/types/txns/MsgDidAllocateVault.pkl.go index 508f5cb23..dcb4a04e4 100644 --- a/txns/MsgDidAllocateVault.pkl.go +++ b/x/did/types/txns/MsgDidAllocateVault.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgDidAuthorize.pkl.go b/x/did/types/txns/MsgDidAuthorize.pkl.go similarity index 94% rename from txns/MsgDidAuthorize.pkl.go rename to x/did/types/txns/MsgDidAuthorize.pkl.go index 127ffefe7..344bbe81a 100644 --- a/txns/MsgDidAuthorize.pkl.go +++ b/x/did/types/txns/MsgDidAuthorize.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgDidProveWitness.pkl.go b/x/did/types/txns/MsgDidProveWitness.pkl.go similarity index 93% rename from txns/MsgDidProveWitness.pkl.go rename to x/did/types/txns/MsgDidProveWitness.pkl.go index 41f2a3fdc..6ea127769 100644 --- a/txns/MsgDidProveWitness.pkl.go +++ b/x/did/types/txns/MsgDidProveWitness.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgDidRegisterController.pkl.go b/x/did/types/txns/MsgDidRegisterController.pkl.go similarity index 94% rename from txns/MsgDidRegisterController.pkl.go rename to x/did/types/txns/MsgDidRegisterController.pkl.go index 901a85595..dc6d3651b 100644 --- a/txns/MsgDidRegisterController.pkl.go +++ b/x/did/types/txns/MsgDidRegisterController.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgDidRegisterService.pkl.go b/x/did/types/txns/MsgDidRegisterService.pkl.go similarity index 95% rename from txns/MsgDidRegisterService.pkl.go rename to x/did/types/txns/MsgDidRegisterService.pkl.go index 2cf0c86a2..3d2f849a5 100644 --- a/txns/MsgDidRegisterService.pkl.go +++ b/x/did/types/txns/MsgDidRegisterService.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgDidSyncVault.pkl.go b/x/did/types/txns/MsgDidSyncVault.pkl.go similarity index 91% rename from txns/MsgDidSyncVault.pkl.go rename to x/did/types/txns/MsgDidSyncVault.pkl.go index 61db8f7b2..c7f38de0a 100644 --- a/txns/MsgDidSyncVault.pkl.go +++ b/x/did/types/txns/MsgDidSyncVault.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgDidUpdateParams.pkl.go b/x/did/types/txns/MsgDidUpdateParams.pkl.go similarity index 92% rename from txns/MsgDidUpdateParams.pkl.go rename to x/did/types/txns/MsgDidUpdateParams.pkl.go index 2d9db3e5c..566383b4f 100644 --- a/txns/MsgDidUpdateParams.pkl.go +++ b/x/did/types/txns/MsgDidUpdateParams.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgGovDeposit.pkl.go b/x/did/types/txns/MsgGovDeposit.pkl.go similarity index 92% rename from txns/MsgGovDeposit.pkl.go rename to x/did/types/txns/MsgGovDeposit.pkl.go index 7f8b133be..237e1ff46 100644 --- a/txns/MsgGovDeposit.pkl.go +++ b/x/did/types/txns/MsgGovDeposit.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgGovSubmitProposal.pkl.go b/x/did/types/txns/MsgGovSubmitProposal.pkl.go similarity index 93% rename from txns/MsgGovSubmitProposal.pkl.go rename to x/did/types/txns/MsgGovSubmitProposal.pkl.go index 665e7059d..8c7f744fb 100644 --- a/txns/MsgGovSubmitProposal.pkl.go +++ b/x/did/types/txns/MsgGovSubmitProposal.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgGovVote.pkl.go b/x/did/types/txns/MsgGovVote.pkl.go similarity index 91% rename from txns/MsgGovVote.pkl.go rename to x/did/types/txns/MsgGovVote.pkl.go index d760dca68..73ff547b2 100644 --- a/txns/MsgGovVote.pkl.go +++ b/x/did/types/txns/MsgGovVote.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns type MsgGovVote interface { diff --git a/txns/MsgGroupCreateGroup.pkl.go b/x/did/types/txns/MsgGroupCreateGroup.pkl.go similarity index 92% rename from txns/MsgGroupCreateGroup.pkl.go rename to x/did/types/txns/MsgGroupCreateGroup.pkl.go index f7a9448bf..19fd7173e 100644 --- a/txns/MsgGroupCreateGroup.pkl.go +++ b/x/did/types/txns/MsgGroupCreateGroup.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgGroupSubmitProposal.pkl.go b/x/did/types/txns/MsgGroupSubmitProposal.pkl.go similarity index 94% rename from txns/MsgGroupSubmitProposal.pkl.go rename to x/did/types/txns/MsgGroupSubmitProposal.pkl.go index f4807a2b2..2cb9f0729 100644 --- a/txns/MsgGroupSubmitProposal.pkl.go +++ b/x/did/types/txns/MsgGroupSubmitProposal.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgGroupVote.pkl.go b/x/did/types/txns/MsgGroupVote.pkl.go similarity index 93% rename from txns/MsgGroupVote.pkl.go rename to x/did/types/txns/MsgGroupVote.pkl.go index f5c80ca9a..79ae04244 100644 --- a/txns/MsgGroupVote.pkl.go +++ b/x/did/types/txns/MsgGroupVote.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns type MsgGroupVote interface { diff --git a/txns/MsgStakingBeginRedelegate.pkl.go b/x/did/types/txns/MsgStakingBeginRedelegate.pkl.go similarity index 94% rename from txns/MsgStakingBeginRedelegate.pkl.go rename to x/did/types/txns/MsgStakingBeginRedelegate.pkl.go index e22288c7f..fe803db38 100644 --- a/txns/MsgStakingBeginRedelegate.pkl.go +++ b/x/did/types/txns/MsgStakingBeginRedelegate.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgStakingCreateValidator.pkl.go b/x/did/types/txns/MsgStakingCreateValidator.pkl.go similarity index 96% rename from txns/MsgStakingCreateValidator.pkl.go rename to x/did/types/txns/MsgStakingCreateValidator.pkl.go index 12763546f..d3c11015c 100644 --- a/txns/MsgStakingCreateValidator.pkl.go +++ b/x/did/types/txns/MsgStakingCreateValidator.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgStakingDelegate.pkl.go b/x/did/types/txns/MsgStakingDelegate.pkl.go similarity index 93% rename from txns/MsgStakingDelegate.pkl.go rename to x/did/types/txns/MsgStakingDelegate.pkl.go index d0709ef6e..b6fb170ec 100644 --- a/txns/MsgStakingDelegate.pkl.go +++ b/x/did/types/txns/MsgStakingDelegate.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/MsgStakingUndelegate.pkl.go b/x/did/types/txns/MsgStakingUndelegate.pkl.go similarity index 93% rename from txns/MsgStakingUndelegate.pkl.go rename to x/did/types/txns/MsgStakingUndelegate.pkl.go index 9b7f609bc..c1732c2c2 100644 --- a/txns/MsgStakingUndelegate.pkl.go +++ b/x/did/types/txns/MsgStakingUndelegate.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/Proposal.pkl.go b/x/did/types/txns/Proposal.pkl.go similarity index 76% rename from txns/Proposal.pkl.go rename to x/did/types/txns/Proposal.pkl.go index ab363f202..70463d42f 100644 --- a/txns/Proposal.pkl.go +++ b/x/did/types/txns/Proposal.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns // Base class for all proposals diff --git a/txns/TxBody.pkl.go b/x/did/types/txns/TxBody.pkl.go similarity index 84% rename from txns/TxBody.pkl.go rename to x/did/types/txns/TxBody.pkl.go index c1912f774..407ba4179 100644 --- a/txns/TxBody.pkl.go +++ b/x/did/types/txns/TxBody.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import "github.com/apple/pkl-go/pkl" diff --git a/txns/Transactions.pkl.go b/x/did/types/txns/Txns.pkl.go similarity index 66% rename from txns/Transactions.pkl.go rename to x/did/types/txns/Txns.pkl.go index a471a756d..288c5c5bc 100644 --- a/txns/Transactions.pkl.go +++ b/x/did/types/txns/Txns.pkl.go @@ -1,4 +1,4 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. +// Code generated from Pkl module `txns`. DO NOT EDIT. package txns import ( @@ -7,11 +7,11 @@ import ( "github.com/apple/pkl-go/pkl" ) -type Transactions struct { +type Txns struct { } -// LoadFromPath loads the pkl module at the given path and evaluates it into a Transactions -func LoadFromPath(ctx context.Context, path string) (ret *Transactions, err error) { +// LoadFromPath loads the pkl module at the given path and evaluates it into a Txns +func LoadFromPath(ctx context.Context, path string) (ret *Txns, err error) { evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) if err != nil { return nil, err @@ -26,9 +26,9 @@ func LoadFromPath(ctx context.Context, path string) (ret *Transactions, err erro return ret, err } -// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Transactions -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Transactions, error) { - var ret Transactions +// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Txns +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Txns, error) { + var ret Txns if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { return nil, err } diff --git a/x/did/types/txns/init.pkl.go b/x/did/types/txns/init.pkl.go new file mode 100644 index 000000000..d92d7649e --- /dev/null +++ b/x/did/types/txns/init.pkl.go @@ -0,0 +1,27 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("txns", Txns{}) + pkl.RegisterMapping("txns#Proposal", Proposal{}) + pkl.RegisterMapping("txns#MsgGovSubmitProposal", MsgGovSubmitProposalImpl{}) + pkl.RegisterMapping("txns#MsgGovVote", MsgGovVoteImpl{}) + pkl.RegisterMapping("txns#MsgGovDeposit", MsgGovDepositImpl{}) + pkl.RegisterMapping("txns#MsgGroupCreateGroup", MsgGroupCreateGroupImpl{}) + pkl.RegisterMapping("txns#MsgGroupSubmitProposal", MsgGroupSubmitProposalImpl{}) + pkl.RegisterMapping("txns#MsgGroupVote", MsgGroupVoteImpl{}) + pkl.RegisterMapping("txns#MsgStakingCreateValidator", MsgStakingCreateValidatorImpl{}) + pkl.RegisterMapping("txns#MsgStakingDelegate", MsgStakingDelegateImpl{}) + pkl.RegisterMapping("txns#MsgStakingUndelegate", MsgStakingUndelegateImpl{}) + pkl.RegisterMapping("txns#MsgStakingBeginRedelegate", MsgStakingBeginRedelegateImpl{}) + pkl.RegisterMapping("txns#MsgDidUpdateParams", MsgDidUpdateParamsImpl{}) + pkl.RegisterMapping("txns#MsgDidAllocateVault", MsgDidAllocateVaultImpl{}) + pkl.RegisterMapping("txns#MsgDidProveWitness", MsgDidProveWitnessImpl{}) + pkl.RegisterMapping("txns#MsgDidSyncVault", MsgDidSyncVaultImpl{}) + pkl.RegisterMapping("txns#MsgDidRegisterController", MsgDidRegisterControllerImpl{}) + pkl.RegisterMapping("txns#MsgDidAuthorize", MsgDidAuthorizeImpl{}) + pkl.RegisterMapping("txns#MsgDidRegisterService", MsgDidRegisterServiceImpl{}) + pkl.RegisterMapping("txns#TxBody", TxBody{}) +} diff --git a/x/did/types/zkprop.go b/x/did/types/zkprop.go index 27bf81ecf..2674cd60b 100644 --- a/x/did/types/zkprop.go +++ b/x/did/types/zkprop.go @@ -17,7 +17,7 @@ type Element = accumulator.Element type Witness []byte // NewProof creates a new Proof which is used for ZKP -func NewProof(id, controller, issuer, property string, pubKey []byte) (*Proof, error) { +func NewProof(issuer, property string, pubKey []byte) (*Proof, error) { input := append(pubKey, []byte(property)...) hash := []byte(input) @@ -33,8 +33,6 @@ func NewProof(id, controller, issuer, property string, pubKey []byte) (*Proof, e } return &Proof{ - Id: id, - Controller: controller, Issuer: issuer, Property: property, Accumulator: keyBytes, @@ -117,7 +115,6 @@ func VerifyWitness(proof *Proof, acc Accumulator, witness Witness) error { if err := witnessObj.UnmarshalBinary(witness); err != nil { return fmt.Errorf("failed to unmarshal witness: %w", err) } - return witnessObj.Verify(publicKey, accObj) }