diff --git a/.github/workflows/publish-assets.yml b/.github/workflows/publish-assets.yml index 7a50f5ba5..57e6fce9b 100644 --- a/.github/workflows/publish-assets.yml +++ b/.github/workflows/publish-assets.yml @@ -9,7 +9,7 @@ permissions: issues: write jobs: - buf_push: + buf_push_core: name: Publish to buf.build/onsonr/sonr runs-on: ubuntu-latest steps: @@ -24,40 +24,60 @@ jobs: input: proto buf_token: ${{ secrets.BUF_TOKEN }} - # - # upload_configs: - # runs-on: ubuntu-latest - # name: Publish to configs.sonr.id - # steps: - # - name: checkout - # uses: actions/checkout@v4 - # - name: Upload to R2 - # continue-on-error: true - # uses: ryand56/r2-upload-action@latest - # with: - # r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} - # r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} - # r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} - # r2-bucket: configs - # source-dir: config - # destination-dir: ./pkl - # + buf_push_thirdparty: + name: Publish to buf.build/onsonr/thirdparty + runs-on: ubuntu-latest + steps: + # Run `git checkout` + - uses: actions/checkout@v3 + # Install the `buf` CLI + - uses: bufbuild/buf-setup-action@v1 + # Push only the Input in `proto` to the BSR + - uses: bufbuild/buf-push-action@v1 + continue-on-error: true + with: + input: third_party/proto + buf_token: ${{ secrets.BUF_TOKEN }} - upload_pkl: + upload_motr_dwn: runs-on: ubuntu-latest - name: Publish to pkl.sh + name: Publish to configs.sonr.id steps: - name: checkout uses: actions/checkout@v4 - - name: Upload to R2 + + - uses: actions/setup-go@v5 + with: + go-version: "1.23" + check-latest: true + + - name: Setup go-task / task / taskfile + uses: rnorton5432/setup-task@v1 + + - name: Build DWN WASM + run: task dwn:build + + - name: Upload WASM to R2 + continue-on-error: true uses: ryand56/r2-upload-action@latest with: r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} - r2-bucket: pkljar - source-dir: pkl - destination-dir: . + r2-bucket: nebula + source-dir: ./build/app.wasm + destination-dir: wasm + + - name: Upload SW JS to R2 + continue-on-error: true + uses: ryand56/r2-upload-action@latest + with: + r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} + r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} + r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} + r2-bucket: nebula + source-dir: ./pkg/motr/static/sw.js + destination-dir: js upload_nebula_cdn: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 1bf639ce3..7dd9471b5 100644 --- a/.gitignore +++ b/.gitignore @@ -71,7 +71,9 @@ deploy/**/data x/.DS_Store .aider* buildenv* -nebula/node_modules +node_modules +cmd/gateway/node_modules +pkg/nebula/node_modules mprocs.yaml build diff --git a/Makefile b/Makefile index f05600097..b12a05119 100644 --- a/Makefile +++ b/Makefile @@ -296,19 +296,14 @@ sh-testnet: mod-tidy .PHONY: templ-gen pkl-gen -assets-gen: - @echo "(assets) Generating gateway cloudflare workers assets" - go run github.com/syumai/workers/cmd/workers-assets-gen -mode=go -o ./cmd/hway/build - templ-gen: @echo "(templ) Generating templ files" templ generate pkl-gen: @echo "(pkl) Building PKL" - go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/DWN.pkl - go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/ORM.pkl - go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/Txns.pkl + go run github.com/apple/pkl-go/cmd/pkl-gen-go ./third_party/pkl/src/sonr.configs.v1/DWN.pkl + go run github.com/apple/pkl-go/cmd/pkl-gen-go ./third_party/pkl/src/sonr.models.v1/ORM.pkl ############################################################################### ### help ### diff --git a/Taskfile.yml b/Taskfile.yml index b46e78fd6..7c472ea43 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,37 +1,41 @@ version: "3" - vars: ROOT_DIR: sh: pwd tasks: + hway:assets: + internal: true + cmds: + - go run github.com/syumai/workers/cmd/workers-assets-gen -mode=go -o ./cmd/gateway/build + hway:build: - dir: cmd/hway + dir: cmd/gateway env: GOOS: js GOARCH: wasm cmds: + - task: hway:assets - go build -o build/app.wasm main.go hway:dev: - dir: cmd/hway + dir: cmd/gateway cmds: - task: nebula:build - bunx wrangler dev hway:deploy: - dir: cmd/hway + dir: cmd/gateway cmds: - task: nebula:build - bunx wrangler deploy - motr:build: - dir: internal/dwn + dwn:build: env: GOOS: js GOARCH: wasm cmds: - - go build -o app.wasm wasm/main.go + - go build -o build/app.wasm ./cmd/dwn/main.go nebula:build: dir: pkg/nebula @@ -40,3 +44,43 @@ tasks: - bun run deps.mjs - bunx tailwindcss -i ./global/styles/globals.css -o ./assets/css/styles.css - templ generate + + # ╭───────────────────────────────────────────────────────────╮ + # │ Registration Components │ + # ╰───────────────────────────────────────────────────────────╯ + + buf:push: + cmds: + - task: buf:push:sonr + - task: buf:push:thirdparty + + buf:deps: + cmds: + - task: buf:deps:sonr + - task: buf:deps:thirdparty + + buf:deps:sonr: + internal: true + dir: proto + cmds: + - buf dep update + + buf:deps:thirdparty: + internal: true + dir: third_party/proto + cmds: + - buf dep update + + buf:push:sonr: + internal: true + dir: proto + cmds: + - buf build + - buf push + + buf:push:thirdparty: + internal: true + dir: third_party/proto + cmds: + - buf build + - buf push diff --git a/api/did/module/v1/module.pulsar.go b/api/did/module/v1/module.pulsar.go index 460d51bc5..56d217580 100644 --- a/api/did/module/v1/module.pulsar.go +++ b/api/did/module/v1/module.pulsar.go @@ -104,9 +104,9 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -120,9 +120,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -136,9 +136,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", descriptor.FullName())) } } @@ -156,9 +156,9 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -176,9 +176,9 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -189,9 +189,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -201,7 +201,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in onsonr.sonr.did.module.v1.Module", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.module.v1.Module", d.FullName())) } panic("unreachable") } @@ -414,29 +414,24 @@ var File_did_module_v1_module_proto protoreflect.FileDescriptor var file_did_module_v1_module_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x6e, - 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2e, 0x0a, 0x06, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x3a, 0x24, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x1e, 0x0a, 0x1c, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, - 0x6f, 0x6e, 0x72, 0x2f, 0x78, 0x2f, 0x64, 0x69, 0x64, 0x42, 0xe8, 0x01, 0x0a, 0x1d, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, - 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, - 0x4f, 0x53, 0x44, 0x4d, 0xaa, 0x02, 0x19, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x53, 0x6f, - 0x6e, 0x72, 0x2e, 0x44, 0x69, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x19, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x44, - 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x25, 0x4f, - 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x53, - 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x69, + 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, + 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, + 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, + 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xa9, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x44, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x44, 0x69, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0f, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -453,7 +448,7 @@ func file_did_module_v1_module_proto_rawDescGZIP() []byte { var file_did_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_did_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: onsonr.sonr.did.module.v1.Module + (*Module)(nil), // 0: did.module.v1.Module } var file_did_module_v1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type diff --git a/api/did/v1/genesis.pulsar.go b/api/did/v1/genesis.pulsar.go index 5195e993a..ac24273bc 100644 --- a/api/did/v1/genesis.pulsar.go +++ b/api/did/v1/genesis.pulsar.go @@ -11,7 +11,6 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" reflect "reflect" - sort "sort" sync "sync" ) @@ -450,166 +449,268 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.Map = (*_Params_2_map)(nil) +var _ protoreflect.List = (*_Document_3_list)(nil) -type _Params_2_map struct { - m *map[string]*KeyInfo +type _Document_3_list struct { + list *[]string } -func (x *_Params_2_map) Len() int { - if x.m == nil { +func (x *_Document_3_list) Len() int { + if x.list == nil { return 0 } - return len(*x.m) + return len(*x.list) } -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 *_Document_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) } -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 *_Document_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = 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 *_Document_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) } -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{} +func (x *_Document_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Authentication as it is not of Message kind")) +} + +func (x *_Document_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_4_list)(nil) + +type _Document_4_list struct { + list *[]string +} + +func (x *_Document_4_list) Len() int { + if x.list == nil { + return 0 } - return protoreflect.ValueOfMessage(v.ProtoReflect()) + return len(*x.list) +} + +func (x *_Document_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field AssertionMethod as it is not of Message kind")) +} + +func (x *_Document_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_4_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_5_list)(nil) + +type _Document_5_list struct { + list *[]string } -func (x *_Params_2_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") +func (x *_Document_5_list) Len() int { + if x.list == nil { + return 0 } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*KeyInfo) - (*x.m)[concreteKey] = concreteValue + return len(*x.list) +} + +func (x *_Document_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_5_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityDelegation as it is not of Message kind")) +} + +func (x *_Document_5_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_5_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_5_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_6_list)(nil) + +type _Document_6_list struct { + list *[]string } -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()) +func (x *_Document_6_list) Len() int { + if x.list == nil { + return 0 } - newValue := new(KeyInfo) - (*x.m)[concreteKey] = newValue - return protoreflect.ValueOfMessage(newValue.ProtoReflect()) + return len(*x.list) +} + +func (x *_Document_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_6_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityInvocation as it is not of Message kind")) } -func (x *_Params_2_map) NewValue() protoreflect.Value { - v := new(KeyInfo) - return protoreflect.ValueOfMessage(v.ProtoReflect()) +func (x *_Document_6_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_6_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) } -func (x *_Params_2_map) IsValid() bool { - return x.m != nil +func (x *_Document_6_list) IsValid() bool { + return x.list != nil } -var _ protoreflect.List = (*_Params_4_list)(nil) +var _ protoreflect.List = (*_Document_7_list)(nil) -type _Params_4_list struct { +type _Document_7_list struct { list *[]string } -func (x *_Params_4_list) Len() int { +func (x *_Document_7_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Params_4_list) Get(i int) protoreflect.Value { +func (x *_Document_7_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_Params_4_list) Set(i int, value protoreflect.Value) { +func (x *_Document_7_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_Params_4_list) Append(value protoreflect.Value) { +func (x *_Document_7_list) Append(value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_Params_4_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 *_Document_7_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Service as it is not of Message kind")) } -func (x *_Params_4_list) Truncate(n int) { +func (x *_Document_7_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_Params_4_list) NewElement() protoreflect.Value { +func (x *_Document_7_list) NewElement() protoreflect.Value { v := "" return protoreflect.ValueOfString(v) } -func (x *_Params_4_list) IsValid() bool { +func (x *_Document_7_list) IsValid() bool { return x.list != nil } var ( - md_Params protoreflect.MessageDescriptor - fd_Params_allowed_public_keys protoreflect.FieldDescriptor - fd_Params_conveyance_preference protoreflect.FieldDescriptor - fd_Params_attestation_formats protoreflect.FieldDescriptor + md_Document protoreflect.MessageDescriptor + fd_Document_id protoreflect.FieldDescriptor + fd_Document_controller protoreflect.FieldDescriptor + fd_Document_authentication protoreflect.FieldDescriptor + fd_Document_assertion_method protoreflect.FieldDescriptor + fd_Document_capability_delegation protoreflect.FieldDescriptor + fd_Document_capability_invocation protoreflect.FieldDescriptor + fd_Document_service protoreflect.FieldDescriptor ) func init() { file_did_v1_genesis_proto_init() - md_Params = File_did_v1_genesis_proto.Messages().ByName("Params") - fd_Params_allowed_public_keys = md_Params.Fields().ByName("allowed_public_keys") - fd_Params_conveyance_preference = md_Params.Fields().ByName("conveyance_preference") - fd_Params_attestation_formats = md_Params.Fields().ByName("attestation_formats") + md_Document = File_did_v1_genesis_proto.Messages().ByName("Document") + fd_Document_id = md_Document.Fields().ByName("id") + fd_Document_controller = md_Document.Fields().ByName("controller") + fd_Document_authentication = md_Document.Fields().ByName("authentication") + fd_Document_assertion_method = md_Document.Fields().ByName("assertion_method") + fd_Document_capability_delegation = md_Document.Fields().ByName("capability_delegation") + fd_Document_capability_invocation = md_Document.Fields().ByName("capability_invocation") + fd_Document_service = md_Document.Fields().ByName("service") } -var _ protoreflect.Message = (*fastReflection_Params)(nil) +var _ protoreflect.Message = (*fastReflection_Document)(nil) -type fastReflection_Params Params +type fastReflection_Document Document -func (x *Params) ProtoReflect() protoreflect.Message { - return (*fastReflection_Params)(x) +func (x *Document) ProtoReflect() protoreflect.Message { + return (*fastReflection_Document)(x) } -func (x *Params) slowProtoReflect() protoreflect.Message { +func (x *Document) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_genesis_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -621,43 +722,43 @@ func (x *Params) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Params_messageType fastReflection_Params_messageType -var _ protoreflect.MessageType = fastReflection_Params_messageType{} +var _fastReflection_Document_messageType fastReflection_Document_messageType +var _ protoreflect.MessageType = fastReflection_Document_messageType{} -type fastReflection_Params_messageType struct{} +type fastReflection_Document_messageType struct{} -func (x fastReflection_Params_messageType) Zero() protoreflect.Message { - return (*fastReflection_Params)(nil) +func (x fastReflection_Document_messageType) Zero() protoreflect.Message { + return (*fastReflection_Document)(nil) } -func (x fastReflection_Params_messageType) New() protoreflect.Message { - return new(fastReflection_Params) +func (x fastReflection_Document_messageType) New() protoreflect.Message { + return new(fastReflection_Document) } -func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Params +func (x fastReflection_Document_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Document } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { - return md_Params +func (x *fastReflection_Document) Descriptor() protoreflect.MessageDescriptor { + return md_Document } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_Params) Type() protoreflect.MessageType { - return _fastReflection_Params_messageType +func (x *fastReflection_Document) Type() protoreflect.MessageType { + return _fastReflection_Document_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Params) New() protoreflect.Message { - return new(fastReflection_Params) +func (x *fastReflection_Document) New() protoreflect.Message { + return new(fastReflection_Document) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { - return (*Params)(x) +func (x *fastReflection_Document) Interface() protoreflect.ProtoMessage { + return (*Document)(x) } // Range iterates over every populated field in an undefined order, @@ -665,22 +766,46 @@ func (x *fastReflection_Params) 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_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.AllowedPublicKeys) != 0 { - value := protoreflect.ValueOfMap(&_Params_2_map{m: &x.AllowedPublicKeys}) - if !f(fd_Params_allowed_public_keys, value) { +func (x *fastReflection_Document) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Document_id, value) { + return + } + } + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_Document_controller, value) { + return + } + } + if len(x.Authentication) != 0 { + value := protoreflect.ValueOfList(&_Document_3_list{list: &x.Authentication}) + if !f(fd_Document_authentication, value) { return } } - if x.ConveyancePreference != "" { - value := protoreflect.ValueOfString(x.ConveyancePreference) - if !f(fd_Params_conveyance_preference, value) { + if len(x.AssertionMethod) != 0 { + value := protoreflect.ValueOfList(&_Document_4_list{list: &x.AssertionMethod}) + if !f(fd_Document_assertion_method, value) { return } } - if len(x.AttestationFormats) != 0 { - value := protoreflect.ValueOfList(&_Params_4_list{list: &x.AttestationFormats}) - if !f(fd_Params_attestation_formats, value) { + if len(x.CapabilityDelegation) != 0 { + value := protoreflect.ValueOfList(&_Document_5_list{list: &x.CapabilityDelegation}) + if !f(fd_Document_capability_delegation, value) { + return + } + } + if len(x.CapabilityInvocation) != 0 { + value := protoreflect.ValueOfList(&_Document_6_list{list: &x.CapabilityInvocation}) + if !f(fd_Document_capability_invocation, value) { + return + } + } + if len(x.Service) != 0 { + value := protoreflect.ValueOfList(&_Document_7_list{list: &x.Service}) + if !f(fd_Document_service, value) { return } } @@ -697,19 +822,27 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Document) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Params.allowed_public_keys": - return len(x.AllowedPublicKeys) != 0 - case "did.v1.Params.conveyance_preference": - return x.ConveyancePreference != "" - case "did.v1.Params.attestation_formats": - return len(x.AttestationFormats) != 0 + case "did.v1.Document.id": + return x.Id != "" + case "did.v1.Document.controller": + return x.Controller != "" + case "did.v1.Document.authentication": + return len(x.Authentication) != 0 + case "did.v1.Document.assertion_method": + return len(x.AssertionMethod) != 0 + case "did.v1.Document.capability_delegation": + return len(x.CapabilityDelegation) != 0 + case "did.v1.Document.capability_invocation": + return len(x.CapabilityInvocation) != 0 + case "did.v1.Document.service": + return len(x.Service) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) } - panic(fmt.Errorf("message did.v1.Params does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) } } @@ -719,19 +852,27 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Document) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Params.allowed_public_keys": - x.AllowedPublicKeys = nil - case "did.v1.Params.conveyance_preference": - x.ConveyancePreference = "" - case "did.v1.Params.attestation_formats": - x.AttestationFormats = nil + case "did.v1.Document.id": + x.Id = "" + case "did.v1.Document.controller": + x.Controller = "" + case "did.v1.Document.authentication": + x.Authentication = nil + case "did.v1.Document.assertion_method": + x.AssertionMethod = nil + case "did.v1.Document.capability_delegation": + x.CapabilityDelegation = nil + case "did.v1.Document.capability_invocation": + x.CapabilityInvocation = nil + case "did.v1.Document.service": + x.Service = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) } - panic(fmt.Errorf("message did.v1.Params does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) } } @@ -741,28 +882,49 @@ func (x *fastReflection_Params) 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_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Document) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Params.allowed_public_keys": - if len(x.AllowedPublicKeys) == 0 { - return protoreflect.ValueOfMap(&_Params_2_map{}) - } - mapValue := &_Params_2_map{m: &x.AllowedPublicKeys} - return protoreflect.ValueOfMap(mapValue) - case "did.v1.Params.conveyance_preference": - value := x.ConveyancePreference + case "did.v1.Document.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.Document.controller": + value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.Params.attestation_formats": - if len(x.AttestationFormats) == 0 { - return protoreflect.ValueOfList(&_Params_4_list{}) + case "did.v1.Document.authentication": + if len(x.Authentication) == 0 { + return protoreflect.ValueOfList(&_Document_3_list{}) + } + listValue := &_Document_3_list{list: &x.Authentication} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.assertion_method": + if len(x.AssertionMethod) == 0 { + return protoreflect.ValueOfList(&_Document_4_list{}) + } + listValue := &_Document_4_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.capability_delegation": + if len(x.CapabilityDelegation) == 0 { + return protoreflect.ValueOfList(&_Document_5_list{}) + } + listValue := &_Document_5_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.capability_invocation": + if len(x.CapabilityInvocation) == 0 { + return protoreflect.ValueOfList(&_Document_6_list{}) + } + listValue := &_Document_6_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.service": + if len(x.Service) == 0 { + return protoreflect.ValueOfList(&_Document_7_list{}) } - listValue := &_Params_4_list{list: &x.AttestationFormats} + listValue := &_Document_7_list{list: &x.Service} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) } - panic(fmt.Errorf("message did.v1.Params does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.Document does not contain field %s", descriptor.FullName())) } } @@ -776,23 +938,37 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Document) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Params.allowed_public_keys": - mv := value.Map() - cmv := mv.(*_Params_2_map) - x.AllowedPublicKeys = *cmv.m - case "did.v1.Params.conveyance_preference": - x.ConveyancePreference = value.Interface().(string) - case "did.v1.Params.attestation_formats": + case "did.v1.Document.id": + x.Id = value.Interface().(string) + case "did.v1.Document.controller": + x.Controller = value.Interface().(string) + case "did.v1.Document.authentication": lv := value.List() - clv := lv.(*_Params_4_list) - x.AttestationFormats = *clv.list + clv := lv.(*_Document_3_list) + x.Authentication = *clv.list + case "did.v1.Document.assertion_method": + lv := value.List() + clv := lv.(*_Document_4_list) + x.AssertionMethod = *clv.list + case "did.v1.Document.capability_delegation": + lv := value.List() + clv := lv.(*_Document_5_list) + x.CapabilityDelegation = *clv.list + case "did.v1.Document.capability_invocation": + lv := value.List() + clv := lv.(*_Document_6_list) + x.CapabilityInvocation = *clv.list + case "did.v1.Document.service": + lv := value.List() + clv := lv.(*_Document_7_list) + x.Service = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) } - panic(fmt.Errorf("message did.v1.Params does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) } } @@ -806,58 +982,89 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Document) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Params.allowed_public_keys": - if x.AllowedPublicKeys == nil { - x.AllowedPublicKeys = make(map[string]*KeyInfo) + case "did.v1.Document.authentication": + if x.Authentication == nil { + x.Authentication = []string{} + } + value := &_Document_3_list{list: &x.Authentication} + return protoreflect.ValueOfList(value) + case "did.v1.Document.assertion_method": + if x.AssertionMethod == nil { + x.AssertionMethod = []string{} + } + value := &_Document_4_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(value) + case "did.v1.Document.capability_delegation": + if x.CapabilityDelegation == nil { + x.CapabilityDelegation = []string{} } - 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 := &_Document_5_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(value) + case "did.v1.Document.capability_invocation": + if x.CapabilityInvocation == nil { + x.CapabilityInvocation = []string{} + } + value := &_Document_6_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(value) + case "did.v1.Document.service": + if x.Service == nil { + x.Service = []string{} } - value := &_Params_4_list{list: &x.AttestationFormats} + value := &_Document_7_list{list: &x.Service} return protoreflect.ValueOfList(value) - case "did.v1.Params.conveyance_preference": - panic(fmt.Errorf("field conveyance_preference of message did.v1.Params is not mutable")) + case "did.v1.Document.id": + panic(fmt.Errorf("field id of message did.v1.Document is not mutable")) + case "did.v1.Document.controller": + panic(fmt.Errorf("field controller of message did.v1.Document is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) } - panic(fmt.Errorf("message did.v1.Params does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Document) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Params.allowed_public_keys": - m := make(map[string]*KeyInfo) - return protoreflect.ValueOfMap(&_Params_2_map{m: &m}) - case "did.v1.Params.conveyance_preference": + case "did.v1.Document.id": + return protoreflect.ValueOfString("") + case "did.v1.Document.controller": return protoreflect.ValueOfString("") - case "did.v1.Params.attestation_formats": + case "did.v1.Document.authentication": + list := []string{} + return protoreflect.ValueOfList(&_Document_3_list{list: &list}) + case "did.v1.Document.assertion_method": + list := []string{} + return protoreflect.ValueOfList(&_Document_4_list{list: &list}) + case "did.v1.Document.capability_delegation": + list := []string{} + return protoreflect.ValueOfList(&_Document_5_list{list: &list}) + case "did.v1.Document.capability_invocation": + list := []string{} + return protoreflect.ValueOfList(&_Document_6_list{list: &list}) + case "did.v1.Document.service": list := []string{} - return protoreflect.ValueOfList(&_Params_4_list{list: &list}) + return protoreflect.ValueOfList(&_Document_7_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) } - panic(fmt.Errorf("message did.v1.Params does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Document) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Params", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.Document", d.FullName())) } panic("unreachable") } @@ -865,7 +1072,7 @@ func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) proto // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Document) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -876,7 +1083,7 @@ func (x *fastReflection_Params) 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_Params) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Document) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -888,7 +1095,7 @@ func (x *fastReflection_Params) 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_Params) IsValid() bool { +func (x *fastReflection_Document) IsValid() bool { return x != nil } @@ -898,9 +1105,9 @@ func (x *fastReflection_Params) 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_Params) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Document) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Params) + x := input.Message.Interface().(*Document) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -912,38 +1119,40 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if len(x.AllowedPublicKeys) > 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.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) - } - } + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.ConveyancePreference) + l = len(x.Controller) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.AttestationFormats) > 0 { - for _, s := range x.AttestationFormats { + if len(x.Authentication) > 0 { + for _, s := range x.Authentication { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.AssertionMethod) > 0 { + for _, s := range x.AssertionMethod { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityDelegation) > 0 { + for _, s := range x.CapabilityDelegation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityInvocation) > 0 { + for _, s := range x.CapabilityInvocation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.Service) > 0 { + for _, s := range x.Service { l = len(s) n += 1 + l + runtime.Sov(uint64(l)) } @@ -958,7 +1167,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Params) + x := input.Message.Interface().(*Document) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -977,72 +1186,65 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.AttestationFormats) > 0 { - for iNdEx := len(x.AttestationFormats) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.AttestationFormats[iNdEx]) - copy(dAtA[i:], x.AttestationFormats[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationFormats[iNdEx]))) + if len(x.Service) > 0 { + for iNdEx := len(x.Service) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Service[iNdEx]) + copy(dAtA[i:], x.Service[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Service[iNdEx]))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x3a } } - if len(x.ConveyancePreference) > 0 { - i -= len(x.ConveyancePreference) - copy(dAtA[i:], x.ConveyancePreference) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ConveyancePreference))) - i-- - dAtA[i] = 0x1a - } - if len(x.AllowedPublicKeys) > 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))) + if len(x.CapabilityInvocation) > 0 { + for iNdEx := len(x.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityInvocation[iNdEx]) + copy(dAtA[i:], x.CapabilityInvocation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityInvocation[iNdEx]))) i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + dAtA[i] = 0x32 + } + } + if len(x.CapabilityDelegation) > 0 { + for iNdEx := len(x.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityDelegation[iNdEx]) + copy(dAtA[i:], x.CapabilityDelegation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityDelegation[iNdEx]))) i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + dAtA[i] = 0x2a + } + } + if len(x.AssertionMethod) > 0 { + for iNdEx := len(x.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AssertionMethod[iNdEx]) + copy(dAtA[i:], x.AssertionMethod[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AssertionMethod[iNdEx]))) i-- - dAtA[i] = 0x12 - return protoiface.MarshalOutput{}, nil + dAtA[i] = 0x22 } - 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.Authentication) > 0 { + for iNdEx := len(x.Authentication) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Authentication[iNdEx]) + copy(dAtA[i:], x.Authentication[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authentication[iNdEx]))) + 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))) + 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 { @@ -1054,7 +1256,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Params) + x := input.Message.Interface().(*Document) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1086,17 +1288,17 @@ func (x *fastReflection_Params) 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: Params: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Document: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 2: + case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AllowedPublicKeys", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", 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 @@ -1106,124 +1308,59 @@ func (x *fastReflection_Params) 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.AllowedPublicKeys == nil { - x.AllowedPublicKeys = make(map[string]*KeyInfo) + 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 Controller", wireType) } - 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 - } + 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 } - 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 + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break } } - x.AllowedPublicKeys[mapkey] = mapvalue + 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 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1251,11 +1388,11 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.ConveyancePreference = string(dAtA[iNdEx:postIndex]) + x.Authentication = append(x.Authentication, 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 AttestationFormats", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AssertionMethod", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1283,3053 +1420,11 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.AttestationFormats = append(x.AttestationFormats, string(dAtA[iNdEx:postIndex])) + x.AssertionMethod = append(x.AssertionMethod, 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_KeyInfo protoreflect.MessageDescriptor - fd_KeyInfo_role protoreflect.FieldDescriptor - fd_KeyInfo_algorithm protoreflect.FieldDescriptor - fd_KeyInfo_encoding protoreflect.FieldDescriptor - fd_KeyInfo_curve protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_genesis_proto_init() - md_KeyInfo = File_did_v1_genesis_proto.Messages().ByName("KeyInfo") - fd_KeyInfo_role = md_KeyInfo.Fields().ByName("role") - fd_KeyInfo_algorithm = md_KeyInfo.Fields().ByName("algorithm") - fd_KeyInfo_encoding = md_KeyInfo.Fields().ByName("encoding") - fd_KeyInfo_curve = md_KeyInfo.Fields().ByName("curve") -} - -var _ protoreflect.Message = (*fastReflection_KeyInfo)(nil) - -type fastReflection_KeyInfo KeyInfo - -func (x *KeyInfo) ProtoReflect() protoreflect.Message { - return (*fastReflection_KeyInfo)(x) -} - -func (x *KeyInfo) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_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_KeyInfo_messageType fastReflection_KeyInfo_messageType -var _ protoreflect.MessageType = fastReflection_KeyInfo_messageType{} - -type fastReflection_KeyInfo_messageType struct{} - -func (x fastReflection_KeyInfo_messageType) Zero() protoreflect.Message { - return (*fastReflection_KeyInfo)(nil) -} -func (x fastReflection_KeyInfo_messageType) New() protoreflect.Message { - return new(fastReflection_KeyInfo) -} -func (x fastReflection_KeyInfo_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_KeyInfo -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_KeyInfo) Descriptor() protoreflect.MessageDescriptor { - return md_KeyInfo -} - -// 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_KeyInfo) Type() protoreflect.MessageType { - return _fastReflection_KeyInfo_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_KeyInfo) New() protoreflect.Message { - return new(fastReflection_KeyInfo) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_KeyInfo) Interface() protoreflect.ProtoMessage { - return (*KeyInfo)(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_KeyInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Role != "" { - value := protoreflect.ValueOfString(x.Role) - if !f(fd_KeyInfo_role, value) { - return - } - } - if x.Algorithm != "" { - value := protoreflect.ValueOfString(x.Algorithm) - if !f(fd_KeyInfo_algorithm, value) { - return - } - } - if x.Encoding != "" { - value := protoreflect.ValueOfString(x.Encoding) - if !f(fd_KeyInfo_encoding, value) { - return - } - } - if x.Curve != "" { - value := protoreflect.ValueOfString(x.Curve) - if !f(fd_KeyInfo_curve, 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_KeyInfo) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.KeyInfo.role": - return x.Role != "" - case "did.v1.KeyInfo.algorithm": - return x.Algorithm != "" - case "did.v1.KeyInfo.encoding": - return x.Encoding != "" - case "did.v1.KeyInfo.curve": - return x.Curve != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) - } - panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.KeyInfo.role": - x.Role = "" - case "did.v1.KeyInfo.algorithm": - x.Algorithm = "" - case "did.v1.KeyInfo.encoding": - x.Encoding = "" - case "did.v1.KeyInfo.curve": - x.Curve = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) - } - panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.KeyInfo.role": - value := x.Role - return protoreflect.ValueOfString(value) - case "did.v1.KeyInfo.algorithm": - value := x.Algorithm - return protoreflect.ValueOfString(value) - case "did.v1.KeyInfo.encoding": - value := x.Encoding - return protoreflect.ValueOfString(value) - case "did.v1.KeyInfo.curve": - value := x.Curve - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) - } - panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.KeyInfo.role": - x.Role = value.Interface().(string) - case "did.v1.KeyInfo.algorithm": - x.Algorithm = value.Interface().(string) - case "did.v1.KeyInfo.encoding": - x.Encoding = value.Interface().(string) - case "did.v1.KeyInfo.curve": - x.Curve = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) - } - panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.KeyInfo.role": - panic(fmt.Errorf("field role of message did.v1.KeyInfo is not mutable")) - case "did.v1.KeyInfo.algorithm": - panic(fmt.Errorf("field algorithm of message did.v1.KeyInfo is not mutable")) - case "did.v1.KeyInfo.encoding": - panic(fmt.Errorf("field encoding of message did.v1.KeyInfo is not mutable")) - case "did.v1.KeyInfo.curve": - panic(fmt.Errorf("field curve of message did.v1.KeyInfo is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) - } - panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.KeyInfo.role": - return protoreflect.ValueOfString("") - case "did.v1.KeyInfo.algorithm": - return protoreflect.ValueOfString("") - case "did.v1.KeyInfo.encoding": - return protoreflect.ValueOfString("") - case "did.v1.KeyInfo.curve": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) - } - panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.KeyInfo", 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_KeyInfo) 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_KeyInfo) 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_KeyInfo) 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_KeyInfo) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*KeyInfo) - 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.Role) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Algorithm) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Encoding) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Curve) - 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().(*KeyInfo) - 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.Curve) > 0 { - i -= len(x.Curve) - copy(dAtA[i:], x.Curve) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Curve))) - i-- - dAtA[i] = 0x22 - } - if len(x.Encoding) > 0 { - i -= len(x.Encoding) - copy(dAtA[i:], x.Encoding) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Encoding))) - i-- - dAtA[i] = 0x1a - } - if len(x.Algorithm) > 0 { - i -= len(x.Algorithm) - copy(dAtA[i:], x.Algorithm) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Algorithm))) - i-- - dAtA[i] = 0x12 - } - if len(x.Role) > 0 { - i -= len(x.Role) - copy(dAtA[i:], x.Role) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Role))) - 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().(*KeyInfo) - 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: KeyInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: KeyInfo: 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 Role", 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.Role = 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 Algorithm", 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.Algorithm = 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 Encoding", 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.Encoding = 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 Curve", 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.Curve = 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_Keyshares protoreflect.MessageDescriptor - fd_Keyshares_validator_cid protoreflect.FieldDescriptor - fd_Keyshares_user_cid protoreflect.FieldDescriptor - fd_Keyshares_last_updated_block protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_genesis_proto_init() - md_Keyshares = File_did_v1_genesis_proto.Messages().ByName("Keyshares") - fd_Keyshares_validator_cid = md_Keyshares.Fields().ByName("validator_cid") - fd_Keyshares_user_cid = md_Keyshares.Fields().ByName("user_cid") - fd_Keyshares_last_updated_block = md_Keyshares.Fields().ByName("last_updated_block") -} - -var _ protoreflect.Message = (*fastReflection_Keyshares)(nil) - -type fastReflection_Keyshares Keyshares - -func (x *Keyshares) ProtoReflect() protoreflect.Message { - return (*fastReflection_Keyshares)(x) -} - -func (x *Keyshares) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_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_Keyshares_messageType fastReflection_Keyshares_messageType -var _ protoreflect.MessageType = fastReflection_Keyshares_messageType{} - -type fastReflection_Keyshares_messageType struct{} - -func (x fastReflection_Keyshares_messageType) Zero() protoreflect.Message { - return (*fastReflection_Keyshares)(nil) -} -func (x fastReflection_Keyshares_messageType) New() protoreflect.Message { - return new(fastReflection_Keyshares) -} -func (x fastReflection_Keyshares_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Keyshares -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Keyshares) Descriptor() protoreflect.MessageDescriptor { - return md_Keyshares -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_Keyshares) Type() protoreflect.MessageType { - return _fastReflection_Keyshares_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Keyshares) New() protoreflect.Message { - return new(fastReflection_Keyshares) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Keyshares) Interface() protoreflect.ProtoMessage { - return (*Keyshares)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_Keyshares) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.ValidatorCid != "" { - value := protoreflect.ValueOfString(x.ValidatorCid) - if !f(fd_Keyshares_validator_cid, value) { - return - } - } - if x.UserCid != "" { - value := protoreflect.ValueOfString(x.UserCid) - if !f(fd_Keyshares_user_cid, value) { - return - } - } - if x.LastUpdatedBlock != int64(0) { - value := protoreflect.ValueOfInt64(x.LastUpdatedBlock) - if !f(fd_Keyshares_last_updated_block, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Keyshares) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Keyshares.validator_cid": - return x.ValidatorCid != "" - case "did.v1.Keyshares.user_cid": - return x.UserCid != "" - case "did.v1.Keyshares.last_updated_block": - return x.LastUpdatedBlock != int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Keyshares) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Keyshares.validator_cid": - x.ValidatorCid = "" - case "did.v1.Keyshares.user_cid": - x.UserCid = "" - case "did.v1.Keyshares.last_updated_block": - x.LastUpdatedBlock = int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_Keyshares) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Keyshares.validator_cid": - value := x.ValidatorCid - return protoreflect.ValueOfString(value) - case "did.v1.Keyshares.user_cid": - value := x.UserCid - return protoreflect.ValueOfString(value) - case "did.v1.Keyshares.last_updated_block": - value := x.LastUpdatedBlock - return protoreflect.ValueOfInt64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Keyshares) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Keyshares.validator_cid": - x.ValidatorCid = value.Interface().(string) - case "did.v1.Keyshares.user_cid": - x.UserCid = value.Interface().(string) - case "did.v1.Keyshares.last_updated_block": - x.LastUpdatedBlock = value.Int() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Keyshares) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Keyshares.validator_cid": - panic(fmt.Errorf("field validator_cid of message did.v1.Keyshares is not mutable")) - case "did.v1.Keyshares.user_cid": - panic(fmt.Errorf("field user_cid of message did.v1.Keyshares is not mutable")) - case "did.v1.Keyshares.last_updated_block": - panic(fmt.Errorf("field last_updated_block of message did.v1.Keyshares is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Keyshares) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Keyshares.validator_cid": - return protoreflect.ValueOfString("") - case "did.v1.Keyshares.user_cid": - return protoreflect.ValueOfString("") - case "did.v1.Keyshares.last_updated_block": - return protoreflect.ValueOfInt64(int64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Keyshares) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Keyshares", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Keyshares) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Keyshares) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_Keyshares) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_Keyshares) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Keyshares) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.ValidatorCid) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.UserCid) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.LastUpdatedBlock != 0 { - n += 1 + runtime.Sov(uint64(x.LastUpdatedBlock)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Keyshares) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.LastUpdatedBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.LastUpdatedBlock)) - i-- - dAtA[i] = 0x18 - } - if len(x.UserCid) > 0 { - i -= len(x.UserCid) - copy(dAtA[i:], x.UserCid) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.UserCid))) - i-- - dAtA[i] = 0x12 - } - if len(x.ValidatorCid) > 0 { - i -= len(x.ValidatorCid) - copy(dAtA[i:], x.ValidatorCid) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorCid))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Keyshares) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Keyshares: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Keyshares: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.ValidatorCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UserCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.UserCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastUpdatedBlock", wireType) - } - x.LastUpdatedBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.LastUpdatedBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - 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_PubKey protoreflect.MessageDescriptor - fd_PubKey_role protoreflect.FieldDescriptor - fd_PubKey_key_type protoreflect.FieldDescriptor - fd_PubKey_raw_key protoreflect.FieldDescriptor - fd_PubKey_jwk protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_genesis_proto_init() - md_PubKey = File_did_v1_genesis_proto.Messages().ByName("PubKey") - fd_PubKey_role = md_PubKey.Fields().ByName("role") - fd_PubKey_key_type = md_PubKey.Fields().ByName("key_type") - fd_PubKey_raw_key = md_PubKey.Fields().ByName("raw_key") - fd_PubKey_jwk = md_PubKey.Fields().ByName("jwk") -} - -var _ protoreflect.Message = (*fastReflection_PubKey)(nil) - -type fastReflection_PubKey PubKey - -func (x *PubKey) ProtoReflect() protoreflect.Message { - return (*fastReflection_PubKey)(x) -} - -func (x *PubKey) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_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_PubKey_messageType fastReflection_PubKey_messageType -var _ protoreflect.MessageType = fastReflection_PubKey_messageType{} - -type fastReflection_PubKey_messageType struct{} - -func (x fastReflection_PubKey_messageType) Zero() protoreflect.Message { - return (*fastReflection_PubKey)(nil) -} -func (x fastReflection_PubKey_messageType) New() protoreflect.Message { - return new(fastReflection_PubKey) -} -func (x fastReflection_PubKey_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_PubKey -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_PubKey) Descriptor() protoreflect.MessageDescriptor { - return md_PubKey -} - -// 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_PubKey) Type() protoreflect.MessageType { - return _fastReflection_PubKey_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_PubKey) New() protoreflect.Message { - return new(fastReflection_PubKey) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_PubKey) Interface() protoreflect.ProtoMessage { - return (*PubKey)(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_PubKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Role != "" { - value := protoreflect.ValueOfString(x.Role) - if !f(fd_PubKey_role, value) { - return - } - } - if x.KeyType != "" { - value := protoreflect.ValueOfString(x.KeyType) - if !f(fd_PubKey_key_type, value) { - return - } - } - if x.RawKey != nil { - value := protoreflect.ValueOfMessage(x.RawKey.ProtoReflect()) - if !f(fd_PubKey_raw_key, value) { - return - } - } - if x.Jwk != nil { - value := protoreflect.ValueOfMessage(x.Jwk.ProtoReflect()) - if !f(fd_PubKey_jwk, 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_PubKey) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.PubKey.role": - return x.Role != "" - case "did.v1.PubKey.key_type": - return x.KeyType != "" - case "did.v1.PubKey.raw_key": - return x.RawKey != nil - case "did.v1.PubKey.jwk": - return x.Jwk != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey 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_PubKey) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.PubKey.role": - x.Role = "" - case "did.v1.PubKey.key_type": - x.KeyType = "" - case "did.v1.PubKey.raw_key": - x.RawKey = nil - case "did.v1.PubKey.jwk": - x.Jwk = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey 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_PubKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.PubKey.role": - value := x.Role - return protoreflect.ValueOfString(value) - case "did.v1.PubKey.key_type": - value := x.KeyType - return protoreflect.ValueOfString(value) - case "did.v1.PubKey.raw_key": - value := x.RawKey - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.PubKey.jwk": - value := x.Jwk - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey 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_PubKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.PubKey.role": - x.Role = value.Interface().(string) - case "did.v1.PubKey.key_type": - x.KeyType = value.Interface().(string) - case "did.v1.PubKey.raw_key": - x.RawKey = value.Message().Interface().(*RawKey) - case "did.v1.PubKey.jwk": - x.Jwk = value.Message().Interface().(*JSONWebKey) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey 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_PubKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.PubKey.raw_key": - if x.RawKey == nil { - x.RawKey = new(RawKey) - } - return protoreflect.ValueOfMessage(x.RawKey.ProtoReflect()) - case "did.v1.PubKey.jwk": - if x.Jwk == nil { - x.Jwk = new(JSONWebKey) - } - return protoreflect.ValueOfMessage(x.Jwk.ProtoReflect()) - case "did.v1.PubKey.role": - panic(fmt.Errorf("field role of message did.v1.PubKey is not mutable")) - case "did.v1.PubKey.key_type": - panic(fmt.Errorf("field key_type of message did.v1.PubKey is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey 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_PubKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.PubKey.role": - return protoreflect.ValueOfString("") - case "did.v1.PubKey.key_type": - return protoreflect.ValueOfString("") - case "did.v1.PubKey.raw_key": - m := new(RawKey) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.PubKey.jwk": - m := new(JSONWebKey) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey")) - } - panic(fmt.Errorf("message did.v1.PubKey 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_PubKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.PubKey", 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_PubKey) 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_PubKey) 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_PubKey) 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_PubKey) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*PubKey) - 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.Role) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.KeyType) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.RawKey != nil { - l = options.Size(x.RawKey) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Jwk != nil { - l = options.Size(x.Jwk) - 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().(*PubKey) - 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.Jwk != nil { - encoded, err := options.Marshal(x.Jwk) - 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] = 0x22 - } - if x.RawKey != nil { - encoded, err := options.Marshal(x.RawKey) - 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.KeyType) > 0 { - i -= len(x.KeyType) - copy(dAtA[i:], x.KeyType) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KeyType))) - i-- - dAtA[i] = 0x12 - } - if len(x.Role) > 0 { - i -= len(x.Role) - copy(dAtA[i:], x.Role) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Role))) - 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().(*PubKey) - 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: PubKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey: 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 Role", 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.Role = 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 KeyType", 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.KeyType = 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 RawKey", 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.RawKey == nil { - x.RawKey = &RawKey{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RawKey); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jwk", 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.Jwk == nil { - x.Jwk = &JSONWebKey{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Jwk); 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_JSONWebKey protoreflect.MessageDescriptor - fd_JSONWebKey_kty protoreflect.FieldDescriptor - fd_JSONWebKey_crv protoreflect.FieldDescriptor - fd_JSONWebKey_x protoreflect.FieldDescriptor - fd_JSONWebKey_y protoreflect.FieldDescriptor - fd_JSONWebKey_n protoreflect.FieldDescriptor - fd_JSONWebKey_e protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_genesis_proto_init() - md_JSONWebKey = File_did_v1_genesis_proto.Messages().ByName("JSONWebKey") - fd_JSONWebKey_kty = md_JSONWebKey.Fields().ByName("kty") - fd_JSONWebKey_crv = md_JSONWebKey.Fields().ByName("crv") - fd_JSONWebKey_x = md_JSONWebKey.Fields().ByName("x") - fd_JSONWebKey_y = md_JSONWebKey.Fields().ByName("y") - fd_JSONWebKey_n = md_JSONWebKey.Fields().ByName("n") - fd_JSONWebKey_e = md_JSONWebKey.Fields().ByName("e") -} - -var _ protoreflect.Message = (*fastReflection_JSONWebKey)(nil) - -type fastReflection_JSONWebKey JSONWebKey - -func (x *JSONWebKey) ProtoReflect() protoreflect.Message { - return (*fastReflection_JSONWebKey)(x) -} - -func (x *JSONWebKey) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_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_JSONWebKey_messageType fastReflection_JSONWebKey_messageType -var _ protoreflect.MessageType = fastReflection_JSONWebKey_messageType{} - -type fastReflection_JSONWebKey_messageType struct{} - -func (x fastReflection_JSONWebKey_messageType) Zero() protoreflect.Message { - return (*fastReflection_JSONWebKey)(nil) -} -func (x fastReflection_JSONWebKey_messageType) New() protoreflect.Message { - return new(fastReflection_JSONWebKey) -} -func (x fastReflection_JSONWebKey_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_JSONWebKey -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_JSONWebKey) Descriptor() protoreflect.MessageDescriptor { - return md_JSONWebKey -} - -// 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_JSONWebKey) Type() protoreflect.MessageType { - return _fastReflection_JSONWebKey_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_JSONWebKey) New() protoreflect.Message { - return new(fastReflection_JSONWebKey) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_JSONWebKey) Interface() protoreflect.ProtoMessage { - return (*JSONWebKey)(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_JSONWebKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Kty != "" { - value := protoreflect.ValueOfString(x.Kty) - if !f(fd_JSONWebKey_kty, value) { - return - } - } - if x.Crv != "" { - value := protoreflect.ValueOfString(x.Crv) - if !f(fd_JSONWebKey_crv, value) { - return - } - } - if x.X != "" { - value := protoreflect.ValueOfString(x.X) - if !f(fd_JSONWebKey_x, value) { - return - } - } - if x.Y != "" { - value := protoreflect.ValueOfString(x.Y) - if !f(fd_JSONWebKey_y, value) { - return - } - } - if x.N != "" { - value := protoreflect.ValueOfString(x.N) - if !f(fd_JSONWebKey_n, value) { - return - } - } - if x.E != "" { - value := protoreflect.ValueOfString(x.E) - if !f(fd_JSONWebKey_e, 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_JSONWebKey) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.JSONWebKey.kty": - return x.Kty != "" - case "did.v1.JSONWebKey.crv": - return x.Crv != "" - case "did.v1.JSONWebKey.x": - return x.X != "" - case "did.v1.JSONWebKey.y": - return x.Y != "" - case "did.v1.JSONWebKey.n": - return x.N != "" - case "did.v1.JSONWebKey.e": - return x.E != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JSONWebKey")) - } - panic(fmt.Errorf("message did.v1.JSONWebKey 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_JSONWebKey) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.JSONWebKey.kty": - x.Kty = "" - case "did.v1.JSONWebKey.crv": - x.Crv = "" - case "did.v1.JSONWebKey.x": - x.X = "" - case "did.v1.JSONWebKey.y": - x.Y = "" - case "did.v1.JSONWebKey.n": - x.N = "" - case "did.v1.JSONWebKey.e": - x.E = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JSONWebKey")) - } - panic(fmt.Errorf("message did.v1.JSONWebKey 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_JSONWebKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.JSONWebKey.kty": - value := x.Kty - return protoreflect.ValueOfString(value) - case "did.v1.JSONWebKey.crv": - value := x.Crv - return protoreflect.ValueOfString(value) - case "did.v1.JSONWebKey.x": - value := x.X - return protoreflect.ValueOfString(value) - case "did.v1.JSONWebKey.y": - value := x.Y - return protoreflect.ValueOfString(value) - case "did.v1.JSONWebKey.n": - value := x.N - return protoreflect.ValueOfString(value) - case "did.v1.JSONWebKey.e": - value := x.E - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JSONWebKey")) - } - panic(fmt.Errorf("message did.v1.JSONWebKey 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_JSONWebKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.JSONWebKey.kty": - x.Kty = value.Interface().(string) - case "did.v1.JSONWebKey.crv": - x.Crv = value.Interface().(string) - case "did.v1.JSONWebKey.x": - x.X = value.Interface().(string) - case "did.v1.JSONWebKey.y": - x.Y = value.Interface().(string) - case "did.v1.JSONWebKey.n": - x.N = value.Interface().(string) - case "did.v1.JSONWebKey.e": - x.E = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JSONWebKey")) - } - panic(fmt.Errorf("message did.v1.JSONWebKey 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_JSONWebKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.JSONWebKey.kty": - panic(fmt.Errorf("field kty of message did.v1.JSONWebKey is not mutable")) - case "did.v1.JSONWebKey.crv": - panic(fmt.Errorf("field crv of message did.v1.JSONWebKey is not mutable")) - case "did.v1.JSONWebKey.x": - panic(fmt.Errorf("field x of message did.v1.JSONWebKey is not mutable")) - case "did.v1.JSONWebKey.y": - panic(fmt.Errorf("field y of message did.v1.JSONWebKey is not mutable")) - case "did.v1.JSONWebKey.n": - panic(fmt.Errorf("field n of message did.v1.JSONWebKey is not mutable")) - case "did.v1.JSONWebKey.e": - panic(fmt.Errorf("field e of message did.v1.JSONWebKey is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JSONWebKey")) - } - panic(fmt.Errorf("message did.v1.JSONWebKey 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_JSONWebKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.JSONWebKey.kty": - return protoreflect.ValueOfString("") - case "did.v1.JSONWebKey.crv": - return protoreflect.ValueOfString("") - case "did.v1.JSONWebKey.x": - return protoreflect.ValueOfString("") - case "did.v1.JSONWebKey.y": - return protoreflect.ValueOfString("") - case "did.v1.JSONWebKey.n": - return protoreflect.ValueOfString("") - case "did.v1.JSONWebKey.e": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.JSONWebKey")) - } - panic(fmt.Errorf("message did.v1.JSONWebKey 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_JSONWebKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.JSONWebKey", 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_JSONWebKey) 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_JSONWebKey) 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_JSONWebKey) 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_JSONWebKey) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*JSONWebKey) - 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.Kty) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Crv) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.X) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Y) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.N) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.E) - 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().(*JSONWebKey) - 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.E) > 0 { - i -= len(x.E) - copy(dAtA[i:], x.E) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.E))) - i-- - dAtA[i] = 0x32 - } - if len(x.N) > 0 { - i -= len(x.N) - copy(dAtA[i:], x.N) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.N))) - i-- - dAtA[i] = 0x2a - } - if len(x.Y) > 0 { - i -= len(x.Y) - copy(dAtA[i:], x.Y) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Y))) - i-- - dAtA[i] = 0x22 - } - if len(x.X) > 0 { - i -= len(x.X) - copy(dAtA[i:], x.X) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.X))) - i-- - dAtA[i] = 0x1a - } - if len(x.Crv) > 0 { - i -= len(x.Crv) - copy(dAtA[i:], x.Crv) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Crv))) - i-- - dAtA[i] = 0x12 - } - if len(x.Kty) > 0 { - i -= len(x.Kty) - copy(dAtA[i:], x.Kty) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kty))) - 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().(*JSONWebKey) - 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: JSONWebKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: JSONWebKey: 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 Kty", 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.Kty = 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 Crv", 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.Crv = 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 X", 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.X = 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 Y", 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.Y = 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 N", 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.N = 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 E", 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.E = 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_RawKey protoreflect.MessageDescriptor - fd_RawKey_algorithm protoreflect.FieldDescriptor - fd_RawKey_encoding protoreflect.FieldDescriptor - fd_RawKey_curve protoreflect.FieldDescriptor - fd_RawKey_key protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_genesis_proto_init() - md_RawKey = File_did_v1_genesis_proto.Messages().ByName("RawKey") - fd_RawKey_algorithm = md_RawKey.Fields().ByName("algorithm") - fd_RawKey_encoding = md_RawKey.Fields().ByName("encoding") - fd_RawKey_curve = md_RawKey.Fields().ByName("curve") - fd_RawKey_key = md_RawKey.Fields().ByName("key") -} - -var _ protoreflect.Message = (*fastReflection_RawKey)(nil) - -type fastReflection_RawKey RawKey - -func (x *RawKey) ProtoReflect() protoreflect.Message { - return (*fastReflection_RawKey)(x) -} - -func (x *RawKey) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_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_RawKey_messageType fastReflection_RawKey_messageType -var _ protoreflect.MessageType = fastReflection_RawKey_messageType{} - -type fastReflection_RawKey_messageType struct{} - -func (x fastReflection_RawKey_messageType) Zero() protoreflect.Message { - return (*fastReflection_RawKey)(nil) -} -func (x fastReflection_RawKey_messageType) New() protoreflect.Message { - return new(fastReflection_RawKey) -} -func (x fastReflection_RawKey_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_RawKey -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_RawKey) Descriptor() protoreflect.MessageDescriptor { - return md_RawKey -} - -// 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_RawKey) Type() protoreflect.MessageType { - return _fastReflection_RawKey_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_RawKey) New() protoreflect.Message { - return new(fastReflection_RawKey) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_RawKey) Interface() protoreflect.ProtoMessage { - return (*RawKey)(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_RawKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Algorithm != "" { - value := protoreflect.ValueOfString(x.Algorithm) - if !f(fd_RawKey_algorithm, value) { - return - } - } - if x.Encoding != "" { - value := protoreflect.ValueOfString(x.Encoding) - if !f(fd_RawKey_encoding, value) { - return - } - } - if x.Curve != "" { - value := protoreflect.ValueOfString(x.Curve) - if !f(fd_RawKey_curve, value) { - return - } - } - if len(x.Key) != 0 { - value := protoreflect.ValueOfBytes(x.Key) - if !f(fd_RawKey_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_RawKey) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.RawKey.algorithm": - return x.Algorithm != "" - case "did.v1.RawKey.encoding": - return x.Encoding != "" - case "did.v1.RawKey.curve": - return x.Curve != "" - case "did.v1.RawKey.key": - return len(x.Key) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.RawKey")) - } - panic(fmt.Errorf("message did.v1.RawKey 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_RawKey) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.RawKey.algorithm": - x.Algorithm = "" - case "did.v1.RawKey.encoding": - x.Encoding = "" - case "did.v1.RawKey.curve": - x.Curve = "" - case "did.v1.RawKey.key": - x.Key = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.RawKey")) - } - panic(fmt.Errorf("message did.v1.RawKey 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_RawKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.RawKey.algorithm": - value := x.Algorithm - return protoreflect.ValueOfString(value) - case "did.v1.RawKey.encoding": - value := x.Encoding - return protoreflect.ValueOfString(value) - case "did.v1.RawKey.curve": - value := x.Curve - return protoreflect.ValueOfString(value) - case "did.v1.RawKey.key": - value := x.Key - return protoreflect.ValueOfBytes(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.RawKey")) - } - panic(fmt.Errorf("message did.v1.RawKey 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_RawKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.RawKey.algorithm": - x.Algorithm = value.Interface().(string) - case "did.v1.RawKey.encoding": - x.Encoding = value.Interface().(string) - case "did.v1.RawKey.curve": - x.Curve = value.Interface().(string) - case "did.v1.RawKey.key": - x.Key = value.Bytes() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.RawKey")) - } - panic(fmt.Errorf("message did.v1.RawKey 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_RawKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.RawKey.algorithm": - panic(fmt.Errorf("field algorithm of message did.v1.RawKey is not mutable")) - case "did.v1.RawKey.encoding": - panic(fmt.Errorf("field encoding of message did.v1.RawKey is not mutable")) - case "did.v1.RawKey.curve": - panic(fmt.Errorf("field curve of message did.v1.RawKey is not mutable")) - case "did.v1.RawKey.key": - panic(fmt.Errorf("field key of message did.v1.RawKey is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.RawKey")) - } - panic(fmt.Errorf("message did.v1.RawKey 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_RawKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.RawKey.algorithm": - return protoreflect.ValueOfString("") - case "did.v1.RawKey.encoding": - return protoreflect.ValueOfString("") - case "did.v1.RawKey.curve": - return protoreflect.ValueOfString("") - case "did.v1.RawKey.key": - return protoreflect.ValueOfBytes(nil) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.RawKey")) - } - panic(fmt.Errorf("message did.v1.RawKey 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_RawKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.RawKey", 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_RawKey) 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_RawKey) 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_RawKey) 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_RawKey) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*RawKey) - 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.Algorithm) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Encoding) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Curve) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Key) - 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().(*RawKey) - 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.Key) > 0 { - i -= len(x.Key) - copy(dAtA[i:], x.Key) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key))) - i-- - dAtA[i] = 0x22 - } - if len(x.Curve) > 0 { - i -= len(x.Curve) - copy(dAtA[i:], x.Curve) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Curve))) - i-- - dAtA[i] = 0x1a - } - if len(x.Encoding) > 0 { - i -= len(x.Encoding) - copy(dAtA[i:], x.Encoding) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Encoding))) - i-- - dAtA[i] = 0x12 - } - if len(x.Algorithm) > 0 { - i -= len(x.Algorithm) - copy(dAtA[i:], x.Algorithm) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Algorithm))) - 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().(*RawKey) - 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: RawKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RawKey: 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 Algorithm", 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.Algorithm = 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 Encoding", wireType) + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CapabilityDelegation", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4357,11 +1452,11 @@ func (x *fastReflection_RawKey) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Encoding = string(dAtA[iNdEx:postIndex]) + x.CapabilityDelegation = append(x.CapabilityDelegation, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 3: + case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CapabilityInvocation", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4389,13 +1484,13 @@ func (x *fastReflection_RawKey) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Curve = string(dAtA[iNdEx:postIndex]) + x.CapabilityInvocation = append(x.CapabilityInvocation, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 4: + case 7: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Service", 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 @@ -4405,25 +1500,23 @@ func (x *fastReflection_RawKey) 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.Key = append(x.Key[:0], dAtA[iNdEx:postIndex]...) - if x.Key == nil { - x.Key = []byte{} - } + x.Service = append(x.Service, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -4510,22 +1603,23 @@ func (x *GenesisState) GetParams() *Params { return nil } -// Params defines the set of module parameters. -type Params struct { +// Document defines a DID document +type Document struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Whitelisted Key Types - 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"` - // ConveyancePreference defines the conveyance preference - ConveyancePreference string `protobuf:"bytes,3,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` - // AttestationFormats defines the attestation formats - AttestationFormats []string `protobuf:"bytes,4,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // The DID of the controller + Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"` + AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"` } -func (x *Params) Reset() { - *x = Params{} +func (x *Document) Reset() { + *x = Document{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_genesis_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4533,340 +1627,62 @@ func (x *Params) Reset() { } } -func (x *Params) String() string { +func (x *Document) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Params) ProtoMessage() {} +func (*Document) ProtoMessage() {} -// Deprecated: Use Params.ProtoReflect.Descriptor instead. -func (*Params) Descriptor() ([]byte, []int) { +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { return file_did_v1_genesis_proto_rawDescGZIP(), []int{1} } -func (x *Params) GetAllowedPublicKeys() map[string]*KeyInfo { - if x != nil { - return x.AllowedPublicKeys - } - return nil -} - -func (x *Params) GetConveyancePreference() string { - if x != nil { - return x.ConveyancePreference - } - return "" -} - -func (x *Params) GetAttestationFormats() []string { - if x != nil { - return x.AttestationFormats - } - return nil -} - -// KeyInfo defines information for accepted PubKey types -type KeyInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` // e.g., "ES256", "EdDSA", "ES256K" - Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` // e.g., "hex", "base64", "multibase" - Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` // e.g., "P256", "P384", "P521", "X25519", "X448", -} - -func (x *KeyInfo) Reset() { - *x = KeyInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KeyInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KeyInfo) ProtoMessage() {} - -// Deprecated: Use KeyInfo.ProtoReflect.Descriptor instead. -func (*KeyInfo) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{2} -} - -func (x *KeyInfo) GetRole() string { - if x != nil { - return x.Role - } - return "" -} - -func (x *KeyInfo) GetAlgorithm() string { - if x != nil { - return x.Algorithm - } - return "" -} - -func (x *KeyInfo) GetEncoding() string { - if x != nil { - return x.Encoding - } - return "" -} - -func (x *KeyInfo) GetCurve() string { - if x != nil { - return x.Curve - } - return "" -} - -type Keyshares struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ValidatorCid string `protobuf:"bytes,1,opt,name=validator_cid,json=validatorCid,proto3" json:"validator_cid,omitempty"` - UserCid string `protobuf:"bytes,2,opt,name=user_cid,json=userCid,proto3" json:"user_cid,omitempty"` - LastUpdatedBlock int64 `protobuf:"varint,3,opt,name=last_updated_block,json=lastUpdatedBlock,proto3" json:"last_updated_block,omitempty"` -} - -func (x *Keyshares) Reset() { - *x = Keyshares{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Keyshares) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Keyshares) ProtoMessage() {} - -// Deprecated: Use Keyshares.ProtoReflect.Descriptor instead. -func (*Keyshares) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{3} -} - -func (x *Keyshares) GetValidatorCid() string { - if x != nil { - return x.ValidatorCid - } - return "" -} - -func (x *Keyshares) GetUserCid() string { - if x != nil { - return x.UserCid - } - return "" -} - -func (x *Keyshares) GetLastUpdatedBlock() int64 { - if x != nil { - return x.LastUpdatedBlock - } - return 0 -} - -// PubKey defines a public key for a did -type PubKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` - RawKey *RawKey `protobuf:"bytes,3,opt,name=raw_key,json=rawKey,proto3" json:"raw_key,omitempty"` - Jwk *JSONWebKey `protobuf:"bytes,4,opt,name=jwk,proto3" json:"jwk,omitempty"` -} - -func (x *PubKey) Reset() { - *x = PubKey{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PubKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PubKey) ProtoMessage() {} - -// Deprecated: Use PubKey.ProtoReflect.Descriptor instead. -func (*PubKey) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{4} -} - -func (x *PubKey) GetRole() string { +func (x *Document) GetId() string { if x != nil { - return x.Role + return x.Id } return "" } -func (x *PubKey) GetKeyType() string { +func (x *Document) GetController() string { if x != nil { - return x.KeyType + return x.Controller } return "" } -func (x *PubKey) GetRawKey() *RawKey { +func (x *Document) GetAuthentication() []string { if x != nil { - return x.RawKey + return x.Authentication } return nil } -func (x *PubKey) GetJwk() *JSONWebKey { +func (x *Document) GetAssertionMethod() []string { if x != nil { - return x.Jwk + return x.AssertionMethod } return nil } -// JWK represents a JSON Web Key -type JSONWebKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"` // Key Type - Crv string `protobuf:"bytes,2,opt,name=crv,proto3" json:"crv,omitempty"` // Curve (for EC and OKP keys) - X string `protobuf:"bytes,3,opt,name=x,proto3" json:"x,omitempty"` // X coordinate (for EC and OKP keys) - Y string `protobuf:"bytes,4,opt,name=y,proto3" json:"y,omitempty"` // Y coordinate (for EC keys) - N string `protobuf:"bytes,5,opt,name=n,proto3" json:"n,omitempty"` // Modulus (for RSA keys) - E string `protobuf:"bytes,6,opt,name=e,proto3" json:"e,omitempty"` // Exponent (for RSA keys) -} - -func (x *JSONWebKey) Reset() { - *x = JSONWebKey{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JSONWebKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JSONWebKey) ProtoMessage() {} - -// Deprecated: Use JSONWebKey.ProtoReflect.Descriptor instead. -func (*JSONWebKey) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{5} -} - -func (x *JSONWebKey) GetKty() string { - if x != nil { - return x.Kty - } - return "" -} - -func (x *JSONWebKey) GetCrv() string { - if x != nil { - return x.Crv - } - return "" -} - -func (x *JSONWebKey) GetX() string { - if x != nil { - return x.X - } - return "" -} - -func (x *JSONWebKey) GetY() string { - if x != nil { - return x.Y - } - return "" -} - -func (x *JSONWebKey) GetN() string { - if x != nil { - return x.N - } - return "" -} - -func (x *JSONWebKey) GetE() string { - if x != nil { - return x.E - } - return "" -} - -type RawKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Algorithm string `protobuf:"bytes,1,opt,name=algorithm,proto3" json:"algorithm,omitempty"` - Encoding string `protobuf:"bytes,2,opt,name=encoding,proto3" json:"encoding,omitempty"` - Curve string `protobuf:"bytes,3,opt,name=curve,proto3" json:"curve,omitempty"` - Key []byte `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *RawKey) Reset() { - *x = RawKey{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RawKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RawKey) ProtoMessage() {} - -// Deprecated: Use RawKey.ProtoReflect.Descriptor instead. -func (*RawKey) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{6} -} - -func (x *RawKey) GetAlgorithm() string { - if x != nil { - return x.Algorithm - } - return "" -} - -func (x *RawKey) GetEncoding() string { +func (x *Document) GetCapabilityDelegation() []string { if x != nil { - return x.Encoding + return x.CapabilityDelegation } - return "" + return nil } -func (x *RawKey) GetCurve() string { +func (x *Document) GetCapabilityInvocation() []string { if x != nil { - return x.Curve + return x.CapabilityInvocation } - return "" + return nil } -func (x *RawKey) GetKey() []byte { +func (x *Document) GetService() []string { if x != nil { - return x.Key + return x.Service } return nil } @@ -4877,76 +1693,39 @@ var file_did_v1_genesis_proto_rawDesc = []byte{ 0x0a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 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, 0xb5, 0x02, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 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, 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, 0x03, 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, 0x04, 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, 0x6d, 0x0a, - 0x07, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x22, 0x79, 0x0a, 0x09, - 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x69, 0x64, 0x12, 0x19, - 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x43, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x61, 0x73, - 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x86, 0x01, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x4b, - 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x27, 0x0a, 0x07, 0x72, 0x61, 0x77, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x4b, - 0x65, 0x79, 0x52, 0x06, 0x72, 0x61, 0x77, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x03, 0x6a, 0x77, - 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x57, 0x65, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6a, 0x77, 0x6b, - 0x22, 0x68, 0x0a, 0x0a, 0x4a, 0x53, 0x4f, 0x4e, 0x57, 0x65, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x74, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, - 0x72, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, - 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x79, 0x12, 0x0c, - 0x0a, 0x01, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6e, 0x12, 0x0c, 0x0a, 0x01, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, 0x6a, 0x0a, 0x06, 0x52, 0x61, - 0x77, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, - 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, - 0x75, 0x72, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 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, + 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 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, 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, 0x91, 0x02, 0x0a, 0x08, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x29, 0x0a, 0x10, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65, 0x72, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, + 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, + 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, + 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 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 ( @@ -4961,28 +1740,19 @@ func file_did_v1_genesis_proto_rawDescGZIP() []byte { return file_did_v1_genesis_proto_rawDescData } -var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_did_v1_genesis_proto_goTypes = []interface{}{ (*GenesisState)(nil), // 0: did.v1.GenesisState - (*Params)(nil), // 1: did.v1.Params - (*KeyInfo)(nil), // 2: did.v1.KeyInfo - (*Keyshares)(nil), // 3: did.v1.Keyshares - (*PubKey)(nil), // 4: did.v1.PubKey - (*JSONWebKey)(nil), // 5: did.v1.JSONWebKey - (*RawKey)(nil), // 6: did.v1.RawKey - nil, // 7: did.v1.Params.AllowedPublicKeysEntry + (*Document)(nil), // 1: did.v1.Document + (*Params)(nil), // 2: did.v1.Params } var file_did_v1_genesis_proto_depIdxs = []int32{ - 1, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params - 7, // 1: did.v1.Params.allowed_public_keys:type_name -> did.v1.Params.AllowedPublicKeysEntry - 6, // 2: did.v1.PubKey.raw_key:type_name -> did.v1.RawKey - 5, // 3: did.v1.PubKey.jwk:type_name -> did.v1.JSONWebKey - 2, // 4: did.v1.Params.AllowedPublicKeysEntry.value:type_name -> did.v1.KeyInfo - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 2, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_did_v1_genesis_proto_init() } @@ -4990,6 +1760,7 @@ func file_did_v1_genesis_proto_init() { if File_did_v1_genesis_proto != nil { return } + file_did_v1_params_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenesisState); i { @@ -5004,67 +1775,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 { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_genesis_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Keyshares); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_genesis_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PubKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_genesis_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JSONWebKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_genesis_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RawKey); i { + switch v := v.(*Document); i { case 0: return &v.state case 1: @@ -5082,7 +1793,7 @@ func file_did_v1_genesis_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_genesis_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/api/did/v1/params.pulsar.go b/api/did/v1/params.pulsar.go new file mode 100644 index 000000000..e3667ff35 --- /dev/null +++ b/api/did/v1/params.pulsar.go @@ -0,0 +1,1750 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package didv1 + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sort "sort" + sync "sync" +) + +var _ protoreflect.Map = (*_Params_2_map)(nil) + +type _Params_2_map struct { + m *map[string]*KeyInfo +} + +func (x *_Params_2_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +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_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_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +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_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 *_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()) + } + newValue := new(KeyInfo) + (*x.m)[concreteKey] = newValue + return protoreflect.ValueOfMessage(newValue.ProtoReflect()) +} + +func (x *_Params_2_map) NewValue() protoreflect.Value { + v := new(KeyInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_2_map) IsValid() bool { + return x.m != nil +} + +var _ protoreflect.List = (*_Params_4_list)(nil) + +type _Params_4_list struct { + list *[]string +} + +func (x *_Params_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_4_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_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_4_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_4_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Params protoreflect.MessageDescriptor + fd_Params_allowed_public_keys protoreflect.FieldDescriptor + fd_Params_conveyance_preference protoreflect.FieldDescriptor + fd_Params_attestation_formats protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_params_proto_init() + md_Params = File_did_v1_params_proto.Messages().ByName("Params") + fd_Params_allowed_public_keys = md_Params.Fields().ByName("allowed_public_keys") + fd_Params_conveyance_preference = md_Params.Fields().ByName("conveyance_preference") + fd_Params_attestation_formats = md_Params.Fields().ByName("attestation_formats") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_params_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.AllowedPublicKeys) != 0 { + value := protoreflect.ValueOfMap(&_Params_2_map{m: &x.AllowedPublicKeys}) + if !f(fd_Params_allowed_public_keys, value) { + return + } + } + if x.ConveyancePreference != "" { + value := protoreflect.ValueOfString(x.ConveyancePreference) + if !f(fd_Params_conveyance_preference, value) { + return + } + } + if len(x.AttestationFormats) != 0 { + value := protoreflect.ValueOfList(&_Params_4_list{list: &x.AttestationFormats}) + if !f(fd_Params_attestation_formats, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Params.allowed_public_keys": + return len(x.AllowedPublicKeys) != 0 + case "did.v1.Params.conveyance_preference": + return x.ConveyancePreference != "" + case "did.v1.Params.attestation_formats": + return len(x.AttestationFormats) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + } + panic(fmt.Errorf("message did.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Params.allowed_public_keys": + x.AllowedPublicKeys = nil + case "did.v1.Params.conveyance_preference": + x.ConveyancePreference = "" + case "did.v1.Params.attestation_formats": + x.AttestationFormats = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + } + panic(fmt.Errorf("message did.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Params.allowed_public_keys": + if len(x.AllowedPublicKeys) == 0 { + return protoreflect.ValueOfMap(&_Params_2_map{}) + } + mapValue := &_Params_2_map{m: &x.AllowedPublicKeys} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.Params.conveyance_preference": + value := x.ConveyancePreference + return protoreflect.ValueOfString(value) + case "did.v1.Params.attestation_formats": + if len(x.AttestationFormats) == 0 { + return protoreflect.ValueOfList(&_Params_4_list{}) + } + listValue := &_Params_4_list{list: &x.AttestationFormats} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + } + panic(fmt.Errorf("message did.v1.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Params.allowed_public_keys": + mv := value.Map() + cmv := mv.(*_Params_2_map) + x.AllowedPublicKeys = *cmv.m + case "did.v1.Params.conveyance_preference": + x.ConveyancePreference = value.Interface().(string) + case "did.v1.Params.attestation_formats": + lv := value.List() + clv := lv.(*_Params_4_list) + x.AttestationFormats = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + } + panic(fmt.Errorf("message did.v1.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Params.allowed_public_keys": + if x.AllowedPublicKeys == nil { + x.AllowedPublicKeys = make(map[string]*KeyInfo) + } + 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_4_list{list: &x.AttestationFormats} + return protoreflect.ValueOfList(value) + case "did.v1.Params.conveyance_preference": + panic(fmt.Errorf("field conveyance_preference of message did.v1.Params is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + } + panic(fmt.Errorf("message did.v1.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Params.allowed_public_keys": + m := make(map[string]*KeyInfo) + return protoreflect.ValueOfMap(&_Params_2_map{m: &m}) + case "did.v1.Params.conveyance_preference": + return protoreflect.ValueOfString("") + case "did.v1.Params.attestation_formats": + list := []string{} + return protoreflect.ValueOfList(&_Params_4_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) + } + panic(fmt.Errorf("message did.v1.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.AllowedPublicKeys) > 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.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) + } + } + } + l = len(x.ConveyancePreference) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.AttestationFormats) > 0 { + for _, s := range x.AttestationFormats { + 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().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.AttestationFormats) > 0 { + for iNdEx := len(x.AttestationFormats) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AttestationFormats[iNdEx]) + copy(dAtA[i:], x.AttestationFormats[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationFormats[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(x.ConveyancePreference) > 0 { + i -= len(x.ConveyancePreference) + copy(dAtA[i:], x.ConveyancePreference) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ConveyancePreference))) + i-- + dAtA[i] = 0x1a + } + if len(x.AllowedPublicKeys) > 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] = 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 input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AllowedPublicKeys", 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.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 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", 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.ConveyancePreference = 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 AttestationFormats", 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.AttestationFormats = append(x.AttestationFormats, 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_KeyInfo protoreflect.MessageDescriptor + fd_KeyInfo_role protoreflect.FieldDescriptor + fd_KeyInfo_algorithm protoreflect.FieldDescriptor + fd_KeyInfo_encoding protoreflect.FieldDescriptor + fd_KeyInfo_curve protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_params_proto_init() + md_KeyInfo = File_did_v1_params_proto.Messages().ByName("KeyInfo") + fd_KeyInfo_role = md_KeyInfo.Fields().ByName("role") + fd_KeyInfo_algorithm = md_KeyInfo.Fields().ByName("algorithm") + fd_KeyInfo_encoding = md_KeyInfo.Fields().ByName("encoding") + fd_KeyInfo_curve = md_KeyInfo.Fields().ByName("curve") +} + +var _ protoreflect.Message = (*fastReflection_KeyInfo)(nil) + +type fastReflection_KeyInfo KeyInfo + +func (x *KeyInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_KeyInfo)(x) +} + +func (x *KeyInfo) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_params_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_KeyInfo_messageType fastReflection_KeyInfo_messageType +var _ protoreflect.MessageType = fastReflection_KeyInfo_messageType{} + +type fastReflection_KeyInfo_messageType struct{} + +func (x fastReflection_KeyInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_KeyInfo)(nil) +} +func (x fastReflection_KeyInfo_messageType) New() protoreflect.Message { + return new(fastReflection_KeyInfo) +} +func (x fastReflection_KeyInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_KeyInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_KeyInfo) Descriptor() protoreflect.MessageDescriptor { + return md_KeyInfo +} + +// 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_KeyInfo) Type() protoreflect.MessageType { + return _fastReflection_KeyInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_KeyInfo) New() protoreflect.Message { + return new(fastReflection_KeyInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_KeyInfo) Interface() protoreflect.ProtoMessage { + return (*KeyInfo)(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_KeyInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Role != "" { + value := protoreflect.ValueOfString(x.Role) + if !f(fd_KeyInfo_role, value) { + return + } + } + if x.Algorithm != "" { + value := protoreflect.ValueOfString(x.Algorithm) + if !f(fd_KeyInfo_algorithm, value) { + return + } + } + if x.Encoding != "" { + value := protoreflect.ValueOfString(x.Encoding) + if !f(fd_KeyInfo_encoding, value) { + return + } + } + if x.Curve != "" { + value := protoreflect.ValueOfString(x.Curve) + if !f(fd_KeyInfo_curve, 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_KeyInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.KeyInfo.role": + return x.Role != "" + case "did.v1.KeyInfo.algorithm": + return x.Algorithm != "" + case "did.v1.KeyInfo.encoding": + return x.Encoding != "" + case "did.v1.KeyInfo.curve": + return x.Curve != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.KeyInfo.role": + x.Role = "" + case "did.v1.KeyInfo.algorithm": + x.Algorithm = "" + case "did.v1.KeyInfo.encoding": + x.Encoding = "" + case "did.v1.KeyInfo.curve": + x.Curve = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.KeyInfo.role": + value := x.Role + return protoreflect.ValueOfString(value) + case "did.v1.KeyInfo.algorithm": + value := x.Algorithm + return protoreflect.ValueOfString(value) + case "did.v1.KeyInfo.encoding": + value := x.Encoding + return protoreflect.ValueOfString(value) + case "did.v1.KeyInfo.curve": + value := x.Curve + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.KeyInfo.role": + x.Role = value.Interface().(string) + case "did.v1.KeyInfo.algorithm": + x.Algorithm = value.Interface().(string) + case "did.v1.KeyInfo.encoding": + x.Encoding = value.Interface().(string) + case "did.v1.KeyInfo.curve": + x.Curve = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.KeyInfo.role": + panic(fmt.Errorf("field role of message did.v1.KeyInfo is not mutable")) + case "did.v1.KeyInfo.algorithm": + panic(fmt.Errorf("field algorithm of message did.v1.KeyInfo is not mutable")) + case "did.v1.KeyInfo.encoding": + panic(fmt.Errorf("field encoding of message did.v1.KeyInfo is not mutable")) + case "did.v1.KeyInfo.curve": + panic(fmt.Errorf("field curve of message did.v1.KeyInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.KeyInfo.role": + return protoreflect.ValueOfString("") + case "did.v1.KeyInfo.algorithm": + return protoreflect.ValueOfString("") + case "did.v1.KeyInfo.encoding": + return protoreflect.ValueOfString("") + case "did.v1.KeyInfo.curve": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo 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_KeyInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.KeyInfo", 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_KeyInfo) 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_KeyInfo) 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_KeyInfo) 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_KeyInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*KeyInfo) + 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.Role) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Algorithm) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Encoding) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Curve) + 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().(*KeyInfo) + 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.Curve) > 0 { + i -= len(x.Curve) + copy(dAtA[i:], x.Curve) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Curve))) + i-- + dAtA[i] = 0x22 + } + if len(x.Encoding) > 0 { + i -= len(x.Encoding) + copy(dAtA[i:], x.Encoding) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Encoding))) + i-- + dAtA[i] = 0x1a + } + if len(x.Algorithm) > 0 { + i -= len(x.Algorithm) + copy(dAtA[i:], x.Algorithm) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Algorithm))) + i-- + dAtA[i] = 0x12 + } + if len(x.Role) > 0 { + i -= len(x.Role) + copy(dAtA[i:], x.Role) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Role))) + 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().(*KeyInfo) + 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: KeyInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: KeyInfo: 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 Role", 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.Role = 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 Algorithm", 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.Algorithm = 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 Encoding", 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.Encoding = 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 Curve", 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.Curve = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: did/v1/params.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Params defines the set of module parameters. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Whitelisted Key Types + 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"` + // ConveyancePreference defines the conveyance preference + ConveyancePreference string `protobuf:"bytes,3,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` + // AttestationFormats defines the attestation formats + AttestationFormats []string `protobuf:"bytes,4,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_params_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_did_v1_params_proto_rawDescGZIP(), []int{0} +} + +func (x *Params) GetAllowedPublicKeys() map[string]*KeyInfo { + if x != nil { + return x.AllowedPublicKeys + } + return nil +} + +func (x *Params) GetConveyancePreference() string { + if x != nil { + return x.ConveyancePreference + } + return "" +} + +func (x *Params) GetAttestationFormats() []string { + if x != nil { + return x.AttestationFormats + } + return nil +} + +// KeyInfo defines information for accepted PubKey types +type KeyInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` // e.g., "ES256", "EdDSA", "ES256K" + Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` // e.g., "hex", "base64", "multibase" + Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` // e.g., "P256", "P384", "P521", "X25519", "X448", +} + +func (x *KeyInfo) Reset() { + *x = KeyInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_params_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyInfo) ProtoMessage() {} + +// Deprecated: Use KeyInfo.ProtoReflect.Descriptor instead. +func (*KeyInfo) Descriptor() ([]byte, []int) { + return file_did_v1_params_proto_rawDescGZIP(), []int{1} +} + +func (x *KeyInfo) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *KeyInfo) GetAlgorithm() string { + if x != nil { + return x.Algorithm + } + return "" +} + +func (x *KeyInfo) GetEncoding() string { + if x != nil { + return x.Encoding + } + return "" +} + +func (x *KeyInfo) GetCurve() string { + if x != nil { + return x.Curve + } + return "" +} + +var File_did_v1_params_proto protoreflect.FileDescriptor + +var file_did_v1_params_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 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, 0xb5, 0x02, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, + 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, 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, 0x03, 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, 0x04, 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, 0x6d, + 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x42, 0x7b, 0x0a, + 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, + 0x61, 0x6d, 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 ( + file_did_v1_params_proto_rawDescOnce sync.Once + file_did_v1_params_proto_rawDescData = file_did_v1_params_proto_rawDesc +) + +func file_did_v1_params_proto_rawDescGZIP() []byte { + file_did_v1_params_proto_rawDescOnce.Do(func() { + file_did_v1_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_did_v1_params_proto_rawDescData) + }) + return file_did_v1_params_proto_rawDescData +} + +var file_did_v1_params_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_did_v1_params_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: did.v1.Params + (*KeyInfo)(nil), // 1: did.v1.KeyInfo + nil, // 2: did.v1.Params.AllowedPublicKeysEntry +} +var file_did_v1_params_proto_depIdxs = []int32{ + 2, // 0: did.v1.Params.allowed_public_keys:type_name -> did.v1.Params.AllowedPublicKeysEntry + 1, // 1: did.v1.Params.AllowedPublicKeysEntry.value:type_name -> did.v1.KeyInfo + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_did_v1_params_proto_init() } +func file_did_v1_params_proto_init() { + if File_did_v1_params_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_did_v1_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_params_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_did_v1_params_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_did_v1_params_proto_goTypes, + DependencyIndexes: file_did_v1_params_proto_depIdxs, + MessageInfos: file_did_v1_params_proto_msgTypes, + }.Build() + File_did_v1_params_proto = out.File + file_did_v1_params_proto_rawDesc = nil + file_did_v1_params_proto_goTypes = nil + file_did_v1_params_proto_depIdxs = nil +} diff --git a/api/did/v1/query.pulsar.go b/api/did/v1/query.pulsar.go index 6aff4e648..fea2ff863 100644 --- a/api/did/v1/query.pulsar.go +++ b/api/did/v1/query.pulsar.go @@ -3741,1110 +3741,6 @@ func (x *fastReflection_QueryVerifyResponse) ProtoMethods() *protoiface.Methods } } -var _ protoreflect.List = (*_Document_3_list)(nil) - -type _Document_3_list struct { - list *[]string -} - -func (x *_Document_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Document_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Document_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Document_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Document_3_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Authentication as it is not of Message kind")) -} - -func (x *_Document_3_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Document_3_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Document_3_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Document_4_list)(nil) - -type _Document_4_list struct { - list *[]string -} - -func (x *_Document_4_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Document_4_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Document_4_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Document_4_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Document_4_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Document at list field AssertionMethod as it is not of Message kind")) -} - -func (x *_Document_4_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Document_4_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Document_4_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Document_5_list)(nil) - -type _Document_5_list struct { - list *[]string -} - -func (x *_Document_5_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Document_5_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Document_5_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Document_5_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Document_5_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityDelegation as it is not of Message kind")) -} - -func (x *_Document_5_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Document_5_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Document_5_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Document_6_list)(nil) - -type _Document_6_list struct { - list *[]string -} - -func (x *_Document_6_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Document_6_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Document_6_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Document_6_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Document_6_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityInvocation as it is not of Message kind")) -} - -func (x *_Document_6_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Document_6_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Document_6_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_Document_7_list)(nil) - -type _Document_7_list struct { - list *[]string -} - -func (x *_Document_7_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Document_7_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Document_7_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Document_7_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Document_7_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Service as it is not of Message kind")) -} - -func (x *_Document_7_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Document_7_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Document_7_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Document protoreflect.MessageDescriptor - fd_Document_id protoreflect.FieldDescriptor - fd_Document_controller protoreflect.FieldDescriptor - fd_Document_authentication protoreflect.FieldDescriptor - fd_Document_assertion_method protoreflect.FieldDescriptor - fd_Document_capability_delegation protoreflect.FieldDescriptor - fd_Document_capability_invocation protoreflect.FieldDescriptor - fd_Document_service protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_Document = File_did_v1_query_proto.Messages().ByName("Document") - fd_Document_id = md_Document.Fields().ByName("id") - fd_Document_controller = md_Document.Fields().ByName("controller") - fd_Document_authentication = md_Document.Fields().ByName("authentication") - fd_Document_assertion_method = md_Document.Fields().ByName("assertion_method") - fd_Document_capability_delegation = md_Document.Fields().ByName("capability_delegation") - fd_Document_capability_invocation = md_Document.Fields().ByName("capability_invocation") - fd_Document_service = md_Document.Fields().ByName("service") -} - -var _ protoreflect.Message = (*fastReflection_Document)(nil) - -type fastReflection_Document Document - -func (x *Document) ProtoReflect() protoreflect.Message { - return (*fastReflection_Document)(x) -} - -func (x *Document) 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_Document_messageType fastReflection_Document_messageType -var _ protoreflect.MessageType = fastReflection_Document_messageType{} - -type fastReflection_Document_messageType struct{} - -func (x fastReflection_Document_messageType) Zero() protoreflect.Message { - return (*fastReflection_Document)(nil) -} -func (x fastReflection_Document_messageType) New() protoreflect.Message { - return new(fastReflection_Document) -} -func (x fastReflection_Document_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Document -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Document) Descriptor() protoreflect.MessageDescriptor { - return md_Document -} - -// 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_Document) Type() protoreflect.MessageType { - return _fastReflection_Document_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Document) New() protoreflect.Message { - return new(fastReflection_Document) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Document) Interface() protoreflect.ProtoMessage { - return (*Document)(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_Document) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Document_id, value) { - return - } - } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Document_controller, value) { - return - } - } - if len(x.Authentication) != 0 { - value := protoreflect.ValueOfList(&_Document_3_list{list: &x.Authentication}) - if !f(fd_Document_authentication, value) { - return - } - } - if len(x.AssertionMethod) != 0 { - value := protoreflect.ValueOfList(&_Document_4_list{list: &x.AssertionMethod}) - if !f(fd_Document_assertion_method, value) { - return - } - } - if len(x.CapabilityDelegation) != 0 { - value := protoreflect.ValueOfList(&_Document_5_list{list: &x.CapabilityDelegation}) - if !f(fd_Document_capability_delegation, value) { - return - } - } - if len(x.CapabilityInvocation) != 0 { - value := protoreflect.ValueOfList(&_Document_6_list{list: &x.CapabilityInvocation}) - if !f(fd_Document_capability_invocation, value) { - return - } - } - if len(x.Service) != 0 { - value := protoreflect.ValueOfList(&_Document_7_list{list: &x.Service}) - if !f(fd_Document_service, 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_Document) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Document.id": - return x.Id != "" - case "did.v1.Document.controller": - return x.Controller != "" - case "did.v1.Document.authentication": - return len(x.Authentication) != 0 - case "did.v1.Document.assertion_method": - return len(x.AssertionMethod) != 0 - case "did.v1.Document.capability_delegation": - return len(x.CapabilityDelegation) != 0 - case "did.v1.Document.capability_invocation": - return len(x.CapabilityInvocation) != 0 - case "did.v1.Document.service": - return len(x.Service) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document 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_Document) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Document.id": - x.Id = "" - case "did.v1.Document.controller": - x.Controller = "" - case "did.v1.Document.authentication": - x.Authentication = nil - case "did.v1.Document.assertion_method": - x.AssertionMethod = nil - case "did.v1.Document.capability_delegation": - x.CapabilityDelegation = nil - case "did.v1.Document.capability_invocation": - x.CapabilityInvocation = nil - case "did.v1.Document.service": - x.Service = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document 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_Document) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Document.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "did.v1.Document.controller": - value := x.Controller - return protoreflect.ValueOfString(value) - case "did.v1.Document.authentication": - if len(x.Authentication) == 0 { - return protoreflect.ValueOfList(&_Document_3_list{}) - } - listValue := &_Document_3_list{list: &x.Authentication} - return protoreflect.ValueOfList(listValue) - case "did.v1.Document.assertion_method": - if len(x.AssertionMethod) == 0 { - return protoreflect.ValueOfList(&_Document_4_list{}) - } - listValue := &_Document_4_list{list: &x.AssertionMethod} - return protoreflect.ValueOfList(listValue) - case "did.v1.Document.capability_delegation": - if len(x.CapabilityDelegation) == 0 { - return protoreflect.ValueOfList(&_Document_5_list{}) - } - listValue := &_Document_5_list{list: &x.CapabilityDelegation} - return protoreflect.ValueOfList(listValue) - case "did.v1.Document.capability_invocation": - if len(x.CapabilityInvocation) == 0 { - return protoreflect.ValueOfList(&_Document_6_list{}) - } - listValue := &_Document_6_list{list: &x.CapabilityInvocation} - return protoreflect.ValueOfList(listValue) - case "did.v1.Document.service": - if len(x.Service) == 0 { - return protoreflect.ValueOfList(&_Document_7_list{}) - } - listValue := &_Document_7_list{list: &x.Service} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document 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_Document) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Document.id": - x.Id = value.Interface().(string) - case "did.v1.Document.controller": - x.Controller = value.Interface().(string) - case "did.v1.Document.authentication": - lv := value.List() - clv := lv.(*_Document_3_list) - x.Authentication = *clv.list - case "did.v1.Document.assertion_method": - lv := value.List() - clv := lv.(*_Document_4_list) - x.AssertionMethod = *clv.list - case "did.v1.Document.capability_delegation": - lv := value.List() - clv := lv.(*_Document_5_list) - x.CapabilityDelegation = *clv.list - case "did.v1.Document.capability_invocation": - lv := value.List() - clv := lv.(*_Document_6_list) - x.CapabilityInvocation = *clv.list - case "did.v1.Document.service": - lv := value.List() - clv := lv.(*_Document_7_list) - x.Service = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document 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_Document) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Document.authentication": - if x.Authentication == nil { - x.Authentication = []string{} - } - value := &_Document_3_list{list: &x.Authentication} - return protoreflect.ValueOfList(value) - case "did.v1.Document.assertion_method": - if x.AssertionMethod == nil { - x.AssertionMethod = []string{} - } - value := &_Document_4_list{list: &x.AssertionMethod} - return protoreflect.ValueOfList(value) - case "did.v1.Document.capability_delegation": - if x.CapabilityDelegation == nil { - x.CapabilityDelegation = []string{} - } - value := &_Document_5_list{list: &x.CapabilityDelegation} - return protoreflect.ValueOfList(value) - case "did.v1.Document.capability_invocation": - if x.CapabilityInvocation == nil { - x.CapabilityInvocation = []string{} - } - value := &_Document_6_list{list: &x.CapabilityInvocation} - return protoreflect.ValueOfList(value) - case "did.v1.Document.service": - if x.Service == nil { - x.Service = []string{} - } - value := &_Document_7_list{list: &x.Service} - return protoreflect.ValueOfList(value) - case "did.v1.Document.id": - panic(fmt.Errorf("field id of message did.v1.Document is not mutable")) - case "did.v1.Document.controller": - panic(fmt.Errorf("field controller of message did.v1.Document is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document 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_Document) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Document.id": - return protoreflect.ValueOfString("") - case "did.v1.Document.controller": - return protoreflect.ValueOfString("") - case "did.v1.Document.authentication": - list := []string{} - return protoreflect.ValueOfList(&_Document_3_list{list: &list}) - case "did.v1.Document.assertion_method": - list := []string{} - return protoreflect.ValueOfList(&_Document_4_list{list: &list}) - case "did.v1.Document.capability_delegation": - list := []string{} - return protoreflect.ValueOfList(&_Document_5_list{list: &list}) - case "did.v1.Document.capability_invocation": - list := []string{} - return protoreflect.ValueOfList(&_Document_6_list{list: &list}) - case "did.v1.Document.service": - list := []string{} - return protoreflect.ValueOfList(&_Document_7_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) - } - panic(fmt.Errorf("message did.v1.Document 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_Document) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Document", 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_Document) 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_Document) 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_Document) 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_Document) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Document) - 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.Controller) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Authentication) > 0 { - for _, s := range x.Authentication { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.AssertionMethod) > 0 { - for _, s := range x.AssertionMethod { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.CapabilityDelegation) > 0 { - for _, s := range x.CapabilityDelegation { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.CapabilityInvocation) > 0 { - for _, s := range x.CapabilityInvocation { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.Service) > 0 { - for _, s := range x.Service { - 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().(*Document) - 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.Service) > 0 { - for iNdEx := len(x.Service) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Service[iNdEx]) - copy(dAtA[i:], x.Service[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Service[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if len(x.CapabilityInvocation) > 0 { - for iNdEx := len(x.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.CapabilityInvocation[iNdEx]) - copy(dAtA[i:], x.CapabilityInvocation[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityInvocation[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(x.CapabilityDelegation) > 0 { - for iNdEx := len(x.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.CapabilityDelegation[iNdEx]) - copy(dAtA[i:], x.CapabilityDelegation[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityDelegation[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(x.AssertionMethod) > 0 { - for iNdEx := len(x.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.AssertionMethod[iNdEx]) - copy(dAtA[i:], x.AssertionMethod[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AssertionMethod[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(x.Authentication) > 0 { - for iNdEx := len(x.Authentication) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Authentication[iNdEx]) - copy(dAtA[i:], x.Authentication[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authentication[iNdEx]))) - 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))) - 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().(*Document) - 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: Document: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Document: 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 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 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authentication", 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.Authentication = append(x.Authentication, 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 AssertionMethod", 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.AssertionMethod = append(x.AssertionMethod, 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 CapabilityDelegation", 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.CapabilityDelegation = append(x.CapabilityDelegation, 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 CapabilityInvocation", 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.CapabilityInvocation = append(x.CapabilityInvocation, 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 Service", 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.Service = append(x.Service, 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 @@ -5210,185 +4106,80 @@ func (x *QueryVerifyResponse) GetValid() bool { return false } -// Document defines a DID document -type Document 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"` // The DID of the controller - Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"` - AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` - CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` - CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` - Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"` -} - -func (x *Document) Reset() { - *x = Document{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_query_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Document) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Document) ProtoMessage() {} - -// Deprecated: Use Document.ProtoReflect.Descriptor instead. -func (*Document) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{7} -} - -func (x *Document) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Document) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -func (x *Document) GetAuthentication() []string { - if x != nil { - return x.Authentication - } - return nil -} - -func (x *Document) GetAssertionMethod() []string { - if x != nil { - return x.AssertionMethod - } - return nil -} - -func (x *Document) GetCapabilityDelegation() []string { - if x != nil { - return x.CapabilityDelegation - } - return nil -} - -func (x *Document) GetCapabilityInvocation() []string { - if x != nil { - return x.CapabilityInvocation - } - return nil -} - -func (x *Document) GetService() []string { - if x != nil { - return x.Service - } - return nil -} - var File_did_v1_query_proto protoreflect.FileDescriptor var file_did_v1_query_proto_rawDesc = []byte{ 0x0a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 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, 0x60, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 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, 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, 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, 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, 0x44, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, + 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x7e, 0x0a, 0x10, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, - 0x65, 0x74, 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, 0x44, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x7e, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, 0x18, 0x0a, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x31, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x12, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, - 0x73, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x2b, 0x0a, 0x13, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x22, 0x91, 0x02, 0x0a, 0x08, 0x44, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, - 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, - 0x10, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, - 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, - 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x32, 0xec, 0x02, 0x0a, - 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x53, 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, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x64, 0x69, - 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x54, 0x0a, 0x07, 0x52, - 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64, 0x69, 0x64, - 0x7d, 0x12, 0x57, 0x0a, 0x04, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x18, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x22, 0x12, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, - 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x5f, 0x0a, 0x06, 0x56, 0x65, - 0x72, 0x69, 0x66, 0x79, 0x12, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, - 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x14, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x7b, - 0x64, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x42, 0x7a, 0x0a, 0x0a, 0x63, - 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, - 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x31, 0x0a, 0x11, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, + 0x9e, 0x01, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x22, 0x2b, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x32, 0x93, 0x02, + 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x53, 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, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x64, + 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x54, 0x0a, 0x07, + 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, + 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64, 0x69, + 0x64, 0x7d, 0x12, 0x5f, 0x0a, 0x06, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x1a, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x14, 0x2f, + 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, + 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, + 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, + 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5403,7 +4194,7 @@ 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, 8) +var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_did_v1_query_proto_goTypes = []interface{}{ (*QueryRequest)(nil), // 0: did.v1.QueryRequest (*QueryParamsResponse)(nil), // 1: did.v1.QueryParamsResponse @@ -5412,22 +4203,20 @@ var file_did_v1_query_proto_goTypes = []interface{}{ (*QuerySignResponse)(nil), // 4: did.v1.QuerySignResponse (*QueryVerifyRequest)(nil), // 5: did.v1.QueryVerifyRequest (*QueryVerifyResponse)(nil), // 6: did.v1.QueryVerifyResponse - (*Document)(nil), // 7: did.v1.Document - (*Params)(nil), // 8: did.v1.Params + (*Params)(nil), // 7: did.v1.Params + (*Document)(nil), // 8: did.v1.Document } var file_did_v1_query_proto_depIdxs = []int32{ - 8, // 0: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params - 7, // 1: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document + 7, // 0: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params + 8, // 1: did.v1.QueryResolveResponse.document:type_name -> did.v1.Document 0, // 2: did.v1.Query.Params:input_type -> did.v1.QueryRequest 0, // 3: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest - 3, // 4: did.v1.Query.Sign:input_type -> did.v1.QuerySignRequest - 5, // 5: did.v1.Query.Verify:input_type -> did.v1.QueryVerifyRequest - 1, // 6: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse - 2, // 7: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse - 4, // 8: did.v1.Query.Sign:output_type -> did.v1.QuerySignResponse - 6, // 9: did.v1.Query.Verify:output_type -> did.v1.QueryVerifyResponse - 6, // [6:10] is the sub-list for method output_type - 2, // [2:6] is the sub-list for method input_type + 5, // 4: did.v1.Query.Verify:input_type -> did.v1.QueryVerifyRequest + 1, // 5: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse + 2, // 6: did.v1.Query.Resolve:output_type -> did.v1.QueryResolveResponse + 6, // 7: did.v1.Query.Verify:output_type -> did.v1.QueryVerifyResponse + 5, // [5:8] is the sub-list for method output_type + 2, // [2:5] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name @@ -5439,6 +4228,7 @@ func file_did_v1_query_proto_init() { return } file_did_v1_genesis_proto_init() + file_did_v1_params_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryRequest); i { @@ -5524,18 +4314,6 @@ func file_did_v1_query_proto_init() { return nil } } - file_did_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Document); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -5543,7 +4321,7 @@ func file_did_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, diff --git a/api/did/v1/query_grpc.pb.go b/api/did/v1/query_grpc.pb.go index 3aaa5ebbb..1d4d55b41 100644 --- a/api/did/v1/query_grpc.pb.go +++ b/api/did/v1/query_grpc.pb.go @@ -21,7 +21,6 @@ const _ = grpc.SupportPackageIsVersion9 const ( Query_Params_FullMethodName = "/did.v1.Query/Params" Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" - Query_Sign_FullMethodName = "/did.v1.Query/Sign" Query_Verify_FullMethodName = "/did.v1.Query/Verify" ) @@ -35,8 +34,6 @@ type QueryClient interface { Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) - // Sign signs a message with the DID document - Sign(ctx context.Context, in *QuerySignRequest, opts ...grpc.CallOption) (*QuerySignResponse, error) // Verify verifies a message with the DID document Verify(ctx context.Context, in *QueryVerifyRequest, opts ...grpc.CallOption) (*QueryVerifyResponse, error) } @@ -69,16 +66,6 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grp return out, nil } -func (c *queryClient) Sign(ctx context.Context, in *QuerySignRequest, opts ...grpc.CallOption) (*QuerySignResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QuerySignResponse) - err := c.cc.Invoke(ctx, Query_Sign_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) Verify(ctx context.Context, in *QueryVerifyRequest, opts ...grpc.CallOption) (*QueryVerifyResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVerifyResponse) @@ -99,8 +86,6 @@ type QueryServer interface { Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) - // Sign signs a message with the DID document - Sign(context.Context, *QuerySignRequest) (*QuerySignResponse, error) // Verify verifies a message with the DID document Verify(context.Context, *QueryVerifyRequest) (*QueryVerifyResponse, error) mustEmbedUnimplementedQueryServer() @@ -119,9 +104,6 @@ func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryPa func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } -func (UnimplementedQueryServer) Sign(context.Context, *QuerySignRequest) (*QuerySignResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Sign not implemented") -} func (UnimplementedQueryServer) Verify(context.Context, *QueryVerifyRequest) (*QueryVerifyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Verify not implemented") } @@ -182,24 +164,6 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_Sign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySignRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Sign(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Sign_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Sign(ctx, req.(*QuerySignRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_Verify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryVerifyRequest) if err := dec(in); err != nil { @@ -233,10 +197,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Resolve", Handler: _Query_Resolve_Handler, }, - { - MethodName: "Sign", - Handler: _Query_Sign_Handler, - }, { MethodName: "Verify", Handler: _Query_Verify_Handler, diff --git a/api/did/v1/state.cosmos_orm.go b/api/did/v1/state.cosmos_orm.go index 96239bc31..39ed930dc 100644 --- a/api/did/v1/state.cosmos_orm.go +++ b/api/did/v1/state.cosmos_orm.go @@ -323,6 +323,173 @@ func NewAuthenticationTable(db ormtable.Schema) (AuthenticationTable, error) { return authenticationTable{table}, nil } +type BiscuitTable interface { + Insert(ctx context.Context, biscuit *Biscuit) error + InsertReturningId(ctx context.Context, biscuit *Biscuit) (uint64, error) + LastInsertedSequence(ctx context.Context) (uint64, error) + Update(ctx context.Context, biscuit *Biscuit) error + Save(ctx context.Context, biscuit *Biscuit) error + Delete(ctx context.Context, biscuit *Biscuit) error + Has(ctx context.Context, id uint64) (found bool, err error) + // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + Get(ctx context.Context, id uint64) (*Biscuit, error) + HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) + // GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Biscuit, error) + List(ctx context.Context, prefixKey BiscuitIndexKey, opts ...ormlist.Option) (BiscuitIterator, error) + ListRange(ctx context.Context, from, to BiscuitIndexKey, opts ...ormlist.Option) (BiscuitIterator, error) + DeleteBy(ctx context.Context, prefixKey BiscuitIndexKey) error + DeleteRange(ctx context.Context, from, to BiscuitIndexKey) error + + doNotImplement() +} + +type BiscuitIterator struct { + ormtable.Iterator +} + +func (i BiscuitIterator) Value() (*Biscuit, error) { + var biscuit Biscuit + err := i.UnmarshalMessage(&biscuit) + return &biscuit, err +} + +type BiscuitIndexKey interface { + id() uint32 + values() []interface{} + biscuitIndexKey() +} + +// primary key starting index.. +type BiscuitPrimaryKey = BiscuitIdIndexKey + +type BiscuitIdIndexKey struct { + vs []interface{} +} + +func (x BiscuitIdIndexKey) id() uint32 { return 0 } +func (x BiscuitIdIndexKey) values() []interface{} { return x.vs } +func (x BiscuitIdIndexKey) biscuitIndexKey() {} + +func (this BiscuitIdIndexKey) WithId(id uint64) BiscuitIdIndexKey { + this.vs = []interface{}{id} + return this +} + +type BiscuitSubjectOriginIndexKey struct { + vs []interface{} +} + +func (x BiscuitSubjectOriginIndexKey) id() uint32 { return 1 } +func (x BiscuitSubjectOriginIndexKey) values() []interface{} { return x.vs } +func (x BiscuitSubjectOriginIndexKey) biscuitIndexKey() {} + +func (this BiscuitSubjectOriginIndexKey) WithSubject(subject string) BiscuitSubjectOriginIndexKey { + this.vs = []interface{}{subject} + return this +} + +func (this BiscuitSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) BiscuitSubjectOriginIndexKey { + this.vs = []interface{}{subject, origin} + return this +} + +type biscuitTable struct { + table ormtable.AutoIncrementTable +} + +func (this biscuitTable) Insert(ctx context.Context, biscuit *Biscuit) error { + return this.table.Insert(ctx, biscuit) +} + +func (this biscuitTable) Update(ctx context.Context, biscuit *Biscuit) error { + return this.table.Update(ctx, biscuit) +} + +func (this biscuitTable) Save(ctx context.Context, biscuit *Biscuit) error { + return this.table.Save(ctx, biscuit) +} + +func (this biscuitTable) Delete(ctx context.Context, biscuit *Biscuit) error { + return this.table.Delete(ctx, biscuit) +} + +func (this biscuitTable) InsertReturningId(ctx context.Context, biscuit *Biscuit) (uint64, error) { + return this.table.InsertReturningPKey(ctx, biscuit) +} + +func (this biscuitTable) LastInsertedSequence(ctx context.Context) (uint64, error) { + return this.table.LastInsertedSequence(ctx) +} + +func (this biscuitTable) Has(ctx context.Context, id uint64) (found bool, err error) { + return this.table.PrimaryKey().Has(ctx, id) +} + +func (this biscuitTable) Get(ctx context.Context, id uint64) (*Biscuit, error) { + var biscuit Biscuit + found, err := this.table.PrimaryKey().Get(ctx, &biscuit, id) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &biscuit, nil +} + +func (this biscuitTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) { + return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, + subject, + origin, + ) +} + +func (this biscuitTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Biscuit, error) { + var biscuit Biscuit + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &biscuit, + subject, + origin, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &biscuit, nil +} + +func (this biscuitTable) List(ctx context.Context, prefixKey BiscuitIndexKey, opts ...ormlist.Option) (BiscuitIterator, error) { + it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) + return BiscuitIterator{it}, err +} + +func (this biscuitTable) ListRange(ctx context.Context, from, to BiscuitIndexKey, opts ...ormlist.Option) (BiscuitIterator, error) { + it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) + return BiscuitIterator{it}, err +} + +func (this biscuitTable) DeleteBy(ctx context.Context, prefixKey BiscuitIndexKey) error { + return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) +} + +func (this biscuitTable) DeleteRange(ctx context.Context, from, to BiscuitIndexKey) error { + return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) +} + +func (this biscuitTable) doNotImplement() {} + +var _ BiscuitTable = biscuitTable{} + +func NewBiscuitTable(db ormtable.Schema) (BiscuitTable, error) { + table := db.GetTable(&Biscuit{}) + if table == nil { + return nil, ormerrors.TableNotFound.Wrap(string((&Biscuit{}).ProtoReflect().Descriptor().FullName())) + } + return biscuitTable{table.(ormtable.AutoIncrementTable)}, nil +} + type ControllerTable interface { Insert(ctx context.Context, controller *Controller) error InsertReturningNumber(ctx context.Context, controller *Controller) (uint64, error) @@ -591,340 +758,6 @@ func NewControllerTable(db ormtable.Schema) (ControllerTable, error) { return controllerTable{table.(ormtable.AutoIncrementTable)}, nil } -type GrantTable interface { - Insert(ctx context.Context, grant *Grant) error - InsertReturningId(ctx context.Context, grant *Grant) (uint64, error) - LastInsertedSequence(ctx context.Context) (uint64, error) - Update(ctx context.Context, grant *Grant) error - Save(ctx context.Context, grant *Grant) error - Delete(ctx context.Context, grant *Grant) error - Has(ctx context.Context, id uint64) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id uint64) (*Grant, error) - HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) - // GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Grant, error) - List(ctx context.Context, prefixKey GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) - ListRange(ctx context.Context, from, to GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) - DeleteBy(ctx context.Context, prefixKey GrantIndexKey) error - DeleteRange(ctx context.Context, from, to GrantIndexKey) error - - doNotImplement() -} - -type GrantIterator struct { - ormtable.Iterator -} - -func (i GrantIterator) Value() (*Grant, error) { - var grant Grant - err := i.UnmarshalMessage(&grant) - return &grant, err -} - -type GrantIndexKey interface { - id() uint32 - values() []interface{} - grantIndexKey() -} - -// primary key starting index.. -type GrantPrimaryKey = GrantIdIndexKey - -type GrantIdIndexKey struct { - vs []interface{} -} - -func (x GrantIdIndexKey) id() uint32 { return 0 } -func (x GrantIdIndexKey) values() []interface{} { return x.vs } -func (x GrantIdIndexKey) grantIndexKey() {} - -func (this GrantIdIndexKey) WithId(id uint64) GrantIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type GrantSubjectOriginIndexKey struct { - vs []interface{} -} - -func (x GrantSubjectOriginIndexKey) id() uint32 { return 1 } -func (x GrantSubjectOriginIndexKey) values() []interface{} { return x.vs } -func (x GrantSubjectOriginIndexKey) grantIndexKey() {} - -func (this GrantSubjectOriginIndexKey) WithSubject(subject string) GrantSubjectOriginIndexKey { - this.vs = []interface{}{subject} - return this -} - -func (this GrantSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) GrantSubjectOriginIndexKey { - this.vs = []interface{}{subject, origin} - return this -} - -type grantTable struct { - table ormtable.AutoIncrementTable -} - -func (this grantTable) Insert(ctx context.Context, grant *Grant) error { - return this.table.Insert(ctx, grant) -} - -func (this grantTable) Update(ctx context.Context, grant *Grant) error { - return this.table.Update(ctx, grant) -} - -func (this grantTable) Save(ctx context.Context, grant *Grant) error { - return this.table.Save(ctx, grant) -} - -func (this grantTable) Delete(ctx context.Context, grant *Grant) error { - return this.table.Delete(ctx, grant) -} - -func (this grantTable) InsertReturningId(ctx context.Context, grant *Grant) (uint64, error) { - return this.table.InsertReturningPKey(ctx, grant) -} - -func (this grantTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - return this.table.LastInsertedSequence(ctx) -} - -func (this grantTable) Has(ctx context.Context, id uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this grantTable) Get(ctx context.Context, id uint64) (*Grant, error) { - var grant Grant - found, err := this.table.PrimaryKey().Get(ctx, &grant, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &grant, nil -} - -func (this grantTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - subject, - origin, - ) -} - -func (this grantTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Grant, error) { - var grant Grant - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &grant, - subject, - origin, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &grant, nil -} - -func (this grantTable) List(ctx context.Context, prefixKey GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return GrantIterator{it}, err -} - -func (this grantTable) ListRange(ctx context.Context, from, to GrantIndexKey, opts ...ormlist.Option) (GrantIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return GrantIterator{it}, err -} - -func (this grantTable) DeleteBy(ctx context.Context, prefixKey GrantIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this grantTable) DeleteRange(ctx context.Context, from, to GrantIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this grantTable) doNotImplement() {} - -var _ GrantTable = grantTable{} - -func NewGrantTable(db ormtable.Schema) (GrantTable, error) { - table := db.GetTable(&Grant{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Grant{}).ProtoReflect().Descriptor().FullName())) - } - return grantTable{table.(ormtable.AutoIncrementTable)}, nil -} - -type MacaroonTable interface { - Insert(ctx context.Context, macaroon *Macaroon) error - InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error) - LastInsertedSequence(ctx context.Context) (uint64, error) - Update(ctx context.Context, macaroon *Macaroon) error - Save(ctx context.Context, macaroon *Macaroon) error - Delete(ctx context.Context, macaroon *Macaroon) error - Has(ctx context.Context, id uint64) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id uint64) (*Macaroon, error) - HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) - // GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error) - List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) - ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) - DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error - DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error - - doNotImplement() -} - -type MacaroonIterator struct { - ormtable.Iterator -} - -func (i MacaroonIterator) Value() (*Macaroon, error) { - var macaroon Macaroon - err := i.UnmarshalMessage(&macaroon) - return &macaroon, err -} - -type MacaroonIndexKey interface { - id() uint32 - values() []interface{} - macaroonIndexKey() -} - -// primary key starting index.. -type MacaroonPrimaryKey = MacaroonIdIndexKey - -type MacaroonIdIndexKey struct { - vs []interface{} -} - -func (x MacaroonIdIndexKey) id() uint32 { return 0 } -func (x MacaroonIdIndexKey) values() []interface{} { return x.vs } -func (x MacaroonIdIndexKey) macaroonIndexKey() {} - -func (this MacaroonIdIndexKey) WithId(id uint64) MacaroonIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type MacaroonSubjectOriginIndexKey struct { - vs []interface{} -} - -func (x MacaroonSubjectOriginIndexKey) id() uint32 { return 1 } -func (x MacaroonSubjectOriginIndexKey) values() []interface{} { return x.vs } -func (x MacaroonSubjectOriginIndexKey) macaroonIndexKey() {} - -func (this MacaroonSubjectOriginIndexKey) WithSubject(subject string) MacaroonSubjectOriginIndexKey { - this.vs = []interface{}{subject} - return this -} - -func (this MacaroonSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) MacaroonSubjectOriginIndexKey { - this.vs = []interface{}{subject, origin} - return this -} - -type macaroonTable struct { - table ormtable.AutoIncrementTable -} - -func (this macaroonTable) Insert(ctx context.Context, macaroon *Macaroon) error { - return this.table.Insert(ctx, macaroon) -} - -func (this macaroonTable) Update(ctx context.Context, macaroon *Macaroon) error { - return this.table.Update(ctx, macaroon) -} - -func (this macaroonTable) Save(ctx context.Context, macaroon *Macaroon) error { - return this.table.Save(ctx, macaroon) -} - -func (this macaroonTable) Delete(ctx context.Context, macaroon *Macaroon) error { - return this.table.Delete(ctx, macaroon) -} - -func (this macaroonTable) InsertReturningId(ctx context.Context, macaroon *Macaroon) (uint64, error) { - return this.table.InsertReturningPKey(ctx, macaroon) -} - -func (this macaroonTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - return this.table.LastInsertedSequence(ctx) -} - -func (this macaroonTable) Has(ctx context.Context, id uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this macaroonTable) Get(ctx context.Context, id uint64) (*Macaroon, error) { - var macaroon Macaroon - found, err := this.table.PrimaryKey().Get(ctx, &macaroon, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &macaroon, nil -} - -func (this macaroonTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - subject, - origin, - ) -} - -func (this macaroonTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Macaroon, error) { - var macaroon Macaroon - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &macaroon, - subject, - origin, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &macaroon, nil -} - -func (this macaroonTable) List(ctx context.Context, prefixKey MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return MacaroonIterator{it}, err -} - -func (this macaroonTable) ListRange(ctx context.Context, from, to MacaroonIndexKey, opts ...ormlist.Option) (MacaroonIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return MacaroonIterator{it}, err -} - -func (this macaroonTable) DeleteBy(ctx context.Context, prefixKey MacaroonIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this macaroonTable) DeleteRange(ctx context.Context, from, to MacaroonIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this macaroonTable) doNotImplement() {} - -var _ MacaroonTable = macaroonTable{} - -func NewMacaroonTable(db ormtable.Schema) (MacaroonTable, error) { - table := db.GetTable(&Macaroon{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Macaroon{}).ProtoReflect().Descriptor().FullName())) - } - return macaroonTable{table.(ormtable.AutoIncrementTable)}, nil -} - type VerificationTable interface { Insert(ctx context.Context, verification *Verification) error Update(ctx context.Context, verification *Verification) error @@ -1185,9 +1018,8 @@ func NewVerificationTable(db ormtable.Schema) (VerificationTable, error) { type StateStore interface { AssertionTable() AssertionTable AuthenticationTable() AuthenticationTable + BiscuitTable() BiscuitTable ControllerTable() ControllerTable - GrantTable() GrantTable - MacaroonTable() MacaroonTable VerificationTable() VerificationTable doNotImplement() @@ -1196,9 +1028,8 @@ type StateStore interface { type stateStore struct { assertion AssertionTable authentication AuthenticationTable + biscuit BiscuitTable controller ControllerTable - grant GrantTable - macaroon MacaroonTable verification VerificationTable } @@ -1210,16 +1041,12 @@ func (x stateStore) AuthenticationTable() AuthenticationTable { return x.authentication } -func (x stateStore) ControllerTable() ControllerTable { - return x.controller +func (x stateStore) BiscuitTable() BiscuitTable { + return x.biscuit } -func (x stateStore) GrantTable() GrantTable { - return x.grant -} - -func (x stateStore) MacaroonTable() MacaroonTable { - return x.macaroon +func (x stateStore) ControllerTable() ControllerTable { + return x.controller } func (x stateStore) VerificationTable() VerificationTable { @@ -1241,17 +1068,12 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) { return nil, err } - controllerTable, err := NewControllerTable(db) + biscuitTable, err := NewBiscuitTable(db) if err != nil { return nil, err } - grantTable, err := NewGrantTable(db) - if err != nil { - return nil, err - } - - macaroonTable, err := NewMacaroonTable(db) + controllerTable, err := NewControllerTable(db) if err != nil { return nil, err } @@ -1264,9 +1086,8 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) { return stateStore{ assertionTable, authenticationTable, + biscuitTable, controllerTable, - grantTable, - macaroonTable, verificationTable, }, nil } diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index 11a4d3212..7fe1e9a98 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -101,7 +101,7 @@ var ( fd_Assertion_did protoreflect.FieldDescriptor fd_Assertion_controller protoreflect.FieldDescriptor fd_Assertion_subject protoreflect.FieldDescriptor - fd_Assertion_public_key protoreflect.FieldDescriptor + fd_Assertion_public_key_hex protoreflect.FieldDescriptor fd_Assertion_assertion_type protoreflect.FieldDescriptor fd_Assertion_accumulator protoreflect.FieldDescriptor fd_Assertion_creation_block protoreflect.FieldDescriptor @@ -113,7 +113,7 @@ func init() { fd_Assertion_did = md_Assertion.Fields().ByName("did") fd_Assertion_controller = md_Assertion.Fields().ByName("controller") fd_Assertion_subject = md_Assertion.Fields().ByName("subject") - fd_Assertion_public_key = md_Assertion.Fields().ByName("public_key") + fd_Assertion_public_key_hex = md_Assertion.Fields().ByName("public_key_hex") fd_Assertion_assertion_type = md_Assertion.Fields().ByName("assertion_type") fd_Assertion_accumulator = md_Assertion.Fields().ByName("accumulator") fd_Assertion_creation_block = md_Assertion.Fields().ByName("creation_block") @@ -202,9 +202,9 @@ func (x *fastReflection_Assertion) Range(f func(protoreflect.FieldDescriptor, pr return } } - if x.PublicKey != nil { - value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - if !f(fd_Assertion_public_key, value) { + if x.PublicKeyHex != "" { + value := protoreflect.ValueOfString(x.PublicKeyHex) + if !f(fd_Assertion_public_key_hex, value) { return } } @@ -247,8 +247,8 @@ func (x *fastReflection_Assertion) Has(fd protoreflect.FieldDescriptor) bool { return x.Controller != "" case "did.v1.Assertion.subject": return x.Subject != "" - case "did.v1.Assertion.public_key": - return x.PublicKey != nil + case "did.v1.Assertion.public_key_hex": + return x.PublicKeyHex != "" case "did.v1.Assertion.assertion_type": return x.AssertionType != "" case "did.v1.Assertion.accumulator": @@ -277,8 +277,8 @@ func (x *fastReflection_Assertion) Clear(fd protoreflect.FieldDescriptor) { x.Controller = "" case "did.v1.Assertion.subject": x.Subject = "" - case "did.v1.Assertion.public_key": - x.PublicKey = nil + case "did.v1.Assertion.public_key_hex": + x.PublicKeyHex = "" case "did.v1.Assertion.assertion_type": x.AssertionType = "" case "did.v1.Assertion.accumulator": @@ -310,9 +310,9 @@ func (x *fastReflection_Assertion) Get(descriptor protoreflect.FieldDescriptor) case "did.v1.Assertion.subject": value := x.Subject return protoreflect.ValueOfString(value) - case "did.v1.Assertion.public_key": - value := x.PublicKey - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.Assertion.public_key_hex": + value := x.PublicKeyHex + return protoreflect.ValueOfString(value) case "did.v1.Assertion.assertion_type": value := x.AssertionType return protoreflect.ValueOfString(value) @@ -351,8 +351,8 @@ func (x *fastReflection_Assertion) Set(fd protoreflect.FieldDescriptor, value pr x.Controller = value.Interface().(string) case "did.v1.Assertion.subject": x.Subject = value.Interface().(string) - case "did.v1.Assertion.public_key": - x.PublicKey = value.Message().Interface().(*PubKey) + case "did.v1.Assertion.public_key_hex": + x.PublicKeyHex = value.Interface().(string) case "did.v1.Assertion.assertion_type": x.AssertionType = value.Interface().(string) case "did.v1.Assertion.accumulator": @@ -381,11 +381,6 @@ func (x *fastReflection_Assertion) Set(fd protoreflect.FieldDescriptor, value pr // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Assertion) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Assertion.public_key": - if x.PublicKey == nil { - x.PublicKey = new(PubKey) - } - return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) case "did.v1.Assertion.accumulator": if x.Accumulator == nil { x.Accumulator = make(map[string][]byte) @@ -398,6 +393,8 @@ func (x *fastReflection_Assertion) Mutable(fd protoreflect.FieldDescriptor) prot panic(fmt.Errorf("field controller of message did.v1.Assertion is not mutable")) case "did.v1.Assertion.subject": panic(fmt.Errorf("field subject of message did.v1.Assertion is not mutable")) + case "did.v1.Assertion.public_key_hex": + panic(fmt.Errorf("field public_key_hex of message did.v1.Assertion is not mutable")) case "did.v1.Assertion.assertion_type": panic(fmt.Errorf("field assertion_type of message did.v1.Assertion is not mutable")) case "did.v1.Assertion.creation_block": @@ -421,9 +418,8 @@ func (x *fastReflection_Assertion) NewField(fd protoreflect.FieldDescriptor) pro return protoreflect.ValueOfString("") case "did.v1.Assertion.subject": return protoreflect.ValueOfString("") - case "did.v1.Assertion.public_key": - m := new(PubKey) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.Assertion.public_key_hex": + return protoreflect.ValueOfString("") case "did.v1.Assertion.assertion_type": return protoreflect.ValueOfString("") case "did.v1.Assertion.accumulator": @@ -512,8 +508,8 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.PublicKey != nil { - l = options.Size(x.PublicKey) + l = len(x.PublicKeyHex) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } l = len(x.AssertionType) @@ -629,17 +625,10 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x2a } - if x.PublicKey != nil { - encoded, err := options.Marshal(x.PublicKey) - 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.PublicKeyHex) > 0 { + i -= len(x.PublicKeyHex) + copy(dAtA[i:], x.PublicKeyHex) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKeyHex))) i-- dAtA[i] = 0x22 } @@ -811,9 +800,9 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 4: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyHex", 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 @@ -823,27 +812,23 @@ func (x *fastReflection_Assertion) 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.PublicKey == nil { - x.PublicKey = &PubKey{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.PublicKeyHex = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { @@ -1146,7 +1131,7 @@ var ( fd_Authentication_did protoreflect.FieldDescriptor fd_Authentication_controller protoreflect.FieldDescriptor fd_Authentication_subject protoreflect.FieldDescriptor - fd_Authentication_public_key protoreflect.FieldDescriptor + fd_Authentication_public_key_hex protoreflect.FieldDescriptor fd_Authentication_credential_id protoreflect.FieldDescriptor fd_Authentication_metadata protoreflect.FieldDescriptor fd_Authentication_creation_block protoreflect.FieldDescriptor @@ -1158,7 +1143,7 @@ func init() { fd_Authentication_did = md_Authentication.Fields().ByName("did") fd_Authentication_controller = md_Authentication.Fields().ByName("controller") fd_Authentication_subject = md_Authentication.Fields().ByName("subject") - fd_Authentication_public_key = md_Authentication.Fields().ByName("public_key") + fd_Authentication_public_key_hex = md_Authentication.Fields().ByName("public_key_hex") fd_Authentication_credential_id = md_Authentication.Fields().ByName("credential_id") fd_Authentication_metadata = md_Authentication.Fields().ByName("metadata") fd_Authentication_creation_block = md_Authentication.Fields().ByName("creation_block") @@ -1247,9 +1232,9 @@ func (x *fastReflection_Authentication) Range(f func(protoreflect.FieldDescripto return } } - if x.PublicKey != nil { - value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - if !f(fd_Authentication_public_key, value) { + if x.PublicKeyHex != "" { + value := protoreflect.ValueOfString(x.PublicKeyHex) + if !f(fd_Authentication_public_key_hex, value) { return } } @@ -1292,8 +1277,8 @@ func (x *fastReflection_Authentication) Has(fd protoreflect.FieldDescriptor) boo return x.Controller != "" case "did.v1.Authentication.subject": return x.Subject != "" - case "did.v1.Authentication.public_key": - return x.PublicKey != nil + case "did.v1.Authentication.public_key_hex": + return x.PublicKeyHex != "" case "did.v1.Authentication.credential_id": return len(x.CredentialId) != 0 case "did.v1.Authentication.metadata": @@ -1322,8 +1307,8 @@ func (x *fastReflection_Authentication) Clear(fd protoreflect.FieldDescriptor) { x.Controller = "" case "did.v1.Authentication.subject": x.Subject = "" - case "did.v1.Authentication.public_key": - x.PublicKey = nil + case "did.v1.Authentication.public_key_hex": + x.PublicKeyHex = "" case "did.v1.Authentication.credential_id": x.CredentialId = nil case "did.v1.Authentication.metadata": @@ -1355,9 +1340,9 @@ func (x *fastReflection_Authentication) Get(descriptor protoreflect.FieldDescrip case "did.v1.Authentication.subject": value := x.Subject return protoreflect.ValueOfString(value) - case "did.v1.Authentication.public_key": - value := x.PublicKey - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.Authentication.public_key_hex": + value := x.PublicKeyHex + return protoreflect.ValueOfString(value) case "did.v1.Authentication.credential_id": value := x.CredentialId return protoreflect.ValueOfBytes(value) @@ -1396,8 +1381,8 @@ func (x *fastReflection_Authentication) Set(fd protoreflect.FieldDescriptor, val x.Controller = value.Interface().(string) case "did.v1.Authentication.subject": x.Subject = value.Interface().(string) - case "did.v1.Authentication.public_key": - x.PublicKey = value.Message().Interface().(*PubKey) + case "did.v1.Authentication.public_key_hex": + x.PublicKeyHex = value.Interface().(string) case "did.v1.Authentication.credential_id": x.CredentialId = value.Bytes() case "did.v1.Authentication.metadata": @@ -1426,11 +1411,6 @@ func (x *fastReflection_Authentication) Set(fd protoreflect.FieldDescriptor, val // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Authentication) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Authentication.public_key": - if x.PublicKey == nil { - x.PublicKey = new(PubKey) - } - return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) case "did.v1.Authentication.metadata": if x.Metadata == nil { x.Metadata = make(map[string]string) @@ -1443,6 +1423,8 @@ func (x *fastReflection_Authentication) Mutable(fd protoreflect.FieldDescriptor) panic(fmt.Errorf("field controller of message did.v1.Authentication is not mutable")) case "did.v1.Authentication.subject": panic(fmt.Errorf("field subject of message did.v1.Authentication is not mutable")) + case "did.v1.Authentication.public_key_hex": + panic(fmt.Errorf("field public_key_hex of message did.v1.Authentication is not mutable")) case "did.v1.Authentication.credential_id": panic(fmt.Errorf("field credential_id of message did.v1.Authentication is not mutable")) case "did.v1.Authentication.creation_block": @@ -1466,9 +1448,8 @@ func (x *fastReflection_Authentication) NewField(fd protoreflect.FieldDescriptor return protoreflect.ValueOfString("") case "did.v1.Authentication.subject": return protoreflect.ValueOfString("") - case "did.v1.Authentication.public_key": - m := new(PubKey) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.Authentication.public_key_hex": + return protoreflect.ValueOfString("") case "did.v1.Authentication.credential_id": return protoreflect.ValueOfBytes(nil) case "did.v1.Authentication.metadata": @@ -1557,8 +1538,8 @@ func (x *fastReflection_Authentication) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.PublicKey != nil { - l = options.Size(x.PublicKey) + l = len(x.PublicKeyHex) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } l = len(x.CredentialId) @@ -1673,17 +1654,10 @@ func (x *fastReflection_Authentication) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x2a } - if x.PublicKey != nil { - encoded, err := options.Marshal(x.PublicKey) - 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.PublicKeyHex) > 0 { + i -= len(x.PublicKeyHex) + copy(dAtA[i:], x.PublicKeyHex) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKeyHex))) i-- dAtA[i] = 0x22 } @@ -1855,9 +1829,9 @@ func (x *fastReflection_Authentication) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 4: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyHex", 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 @@ -1867,27 +1841,23 @@ func (x *fastReflection_Authentication) 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.PublicKey == nil { - x.PublicKey = &PubKey{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.PublicKeyHex = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { @@ -2105,41 +2075,35 @@ func (x *fastReflection_Authentication) ProtoMethods() *protoiface.Methods { } var ( - md_Controller protoreflect.MessageDescriptor - fd_Controller_number protoreflect.FieldDescriptor - fd_Controller_did protoreflect.FieldDescriptor - fd_Controller_sonr_address protoreflect.FieldDescriptor - fd_Controller_eth_address protoreflect.FieldDescriptor - fd_Controller_btc_address protoreflect.FieldDescriptor - fd_Controller_public_key protoreflect.FieldDescriptor - fd_Controller_ks_val protoreflect.FieldDescriptor - fd_Controller_claimed_block protoreflect.FieldDescriptor - fd_Controller_creation_block protoreflect.FieldDescriptor + md_Biscuit protoreflect.MessageDescriptor + fd_Biscuit_id protoreflect.FieldDescriptor + fd_Biscuit_controller protoreflect.FieldDescriptor + fd_Biscuit_subject protoreflect.FieldDescriptor + fd_Biscuit_origin protoreflect.FieldDescriptor + fd_Biscuit_expiry_height protoreflect.FieldDescriptor + fd_Biscuit_macaroon protoreflect.FieldDescriptor ) func init() { file_did_v1_state_proto_init() - md_Controller = File_did_v1_state_proto.Messages().ByName("Controller") - fd_Controller_number = md_Controller.Fields().ByName("number") - fd_Controller_did = md_Controller.Fields().ByName("did") - fd_Controller_sonr_address = md_Controller.Fields().ByName("sonr_address") - fd_Controller_eth_address = md_Controller.Fields().ByName("eth_address") - fd_Controller_btc_address = md_Controller.Fields().ByName("btc_address") - fd_Controller_public_key = md_Controller.Fields().ByName("public_key") - fd_Controller_ks_val = md_Controller.Fields().ByName("ks_val") - fd_Controller_claimed_block = md_Controller.Fields().ByName("claimed_block") - fd_Controller_creation_block = md_Controller.Fields().ByName("creation_block") + md_Biscuit = File_did_v1_state_proto.Messages().ByName("Biscuit") + fd_Biscuit_id = md_Biscuit.Fields().ByName("id") + fd_Biscuit_controller = md_Biscuit.Fields().ByName("controller") + fd_Biscuit_subject = md_Biscuit.Fields().ByName("subject") + fd_Biscuit_origin = md_Biscuit.Fields().ByName("origin") + fd_Biscuit_expiry_height = md_Biscuit.Fields().ByName("expiry_height") + fd_Biscuit_macaroon = md_Biscuit.Fields().ByName("macaroon") } -var _ protoreflect.Message = (*fastReflection_Controller)(nil) +var _ protoreflect.Message = (*fastReflection_Biscuit)(nil) -type fastReflection_Controller Controller +type fastReflection_Biscuit Biscuit -func (x *Controller) ProtoReflect() protoreflect.Message { - return (*fastReflection_Controller)(x) +func (x *Biscuit) ProtoReflect() protoreflect.Message { + return (*fastReflection_Biscuit)(x) } -func (x *Controller) slowProtoReflect() protoreflect.Message { +func (x *Biscuit) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_state_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2151,43 +2115,43 @@ func (x *Controller) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Controller_messageType fastReflection_Controller_messageType -var _ protoreflect.MessageType = fastReflection_Controller_messageType{} +var _fastReflection_Biscuit_messageType fastReflection_Biscuit_messageType +var _ protoreflect.MessageType = fastReflection_Biscuit_messageType{} -type fastReflection_Controller_messageType struct{} +type fastReflection_Biscuit_messageType struct{} -func (x fastReflection_Controller_messageType) Zero() protoreflect.Message { - return (*fastReflection_Controller)(nil) +func (x fastReflection_Biscuit_messageType) Zero() protoreflect.Message { + return (*fastReflection_Biscuit)(nil) } -func (x fastReflection_Controller_messageType) New() protoreflect.Message { - return new(fastReflection_Controller) +func (x fastReflection_Biscuit_messageType) New() protoreflect.Message { + return new(fastReflection_Biscuit) } -func (x fastReflection_Controller_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Controller +func (x fastReflection_Biscuit_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Biscuit } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Controller) Descriptor() protoreflect.MessageDescriptor { - return md_Controller +func (x *fastReflection_Biscuit) Descriptor() protoreflect.MessageDescriptor { + return md_Biscuit } // 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_Controller) Type() protoreflect.MessageType { - return _fastReflection_Controller_messageType +func (x *fastReflection_Biscuit) Type() protoreflect.MessageType { + return _fastReflection_Biscuit_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Controller) New() protoreflect.Message { - return new(fastReflection_Controller) +func (x *fastReflection_Biscuit) New() protoreflect.Message { + return new(fastReflection_Biscuit) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Controller) Interface() protoreflect.ProtoMessage { - return (*Controller)(x) +func (x *fastReflection_Biscuit) Interface() protoreflect.ProtoMessage { + return (*Biscuit)(x) } // Range iterates over every populated field in an undefined order, @@ -2195,58 +2159,40 @@ func (x *fastReflection_Controller) 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_Controller) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Number != uint64(0) { - value := protoreflect.ValueOfUint64(x.Number) - if !f(fd_Controller_number, value) { - return - } - } - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_Controller_did, value) { - return - } - } - if x.SonrAddress != "" { - value := protoreflect.ValueOfString(x.SonrAddress) - if !f(fd_Controller_sonr_address, value) { - return - } - } - if x.EthAddress != "" { - value := protoreflect.ValueOfString(x.EthAddress) - if !f(fd_Controller_eth_address, value) { +func (x *fastReflection_Biscuit) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_Biscuit_id, value) { return } } - if x.BtcAddress != "" { - value := protoreflect.ValueOfString(x.BtcAddress) - if !f(fd_Controller_btc_address, value) { + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_Biscuit_controller, value) { return } } - if x.PublicKey != nil { - value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - if !f(fd_Controller_public_key, value) { + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_Biscuit_subject, value) { return } } - if x.KsVal != "" { - value := protoreflect.ValueOfString(x.KsVal) - if !f(fd_Controller_ks_val, value) { + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_Biscuit_origin, value) { return } } - if x.ClaimedBlock != int64(0) { - value := protoreflect.ValueOfInt64(x.ClaimedBlock) - if !f(fd_Controller_claimed_block, value) { + if x.ExpiryHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.ExpiryHeight) + if !f(fd_Biscuit_expiry_height, value) { return } } - if x.CreationBlock != int64(0) { - value := protoreflect.ValueOfInt64(x.CreationBlock) - if !f(fd_Controller_creation_block, value) { + if x.Macaroon != "" { + value := protoreflect.ValueOfString(x.Macaroon) + if !f(fd_Biscuit_macaroon, value) { return } } @@ -2263,31 +2209,25 @@ func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, p // 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_Controller) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Biscuit) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Controller.number": - return x.Number != uint64(0) - case "did.v1.Controller.did": - return x.Did != "" - case "did.v1.Controller.sonr_address": - return x.SonrAddress != "" - case "did.v1.Controller.eth_address": - return x.EthAddress != "" - case "did.v1.Controller.btc_address": - return x.BtcAddress != "" - case "did.v1.Controller.public_key": - return x.PublicKey != nil - case "did.v1.Controller.ks_val": - return x.KsVal != "" - case "did.v1.Controller.claimed_block": - return x.ClaimedBlock != int64(0) - case "did.v1.Controller.creation_block": - return x.CreationBlock != int64(0) + case "did.v1.Biscuit.id": + return x.Id != uint64(0) + case "did.v1.Biscuit.controller": + return x.Controller != "" + case "did.v1.Biscuit.subject": + return x.Subject != "" + case "did.v1.Biscuit.origin": + return x.Origin != "" + case "did.v1.Biscuit.expiry_height": + return x.ExpiryHeight != int64(0) + case "did.v1.Biscuit.macaroon": + return x.Macaroon != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Biscuit")) } - panic(fmt.Errorf("message did.v1.Controller does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Biscuit does not contain field %s", fd.FullName())) } } @@ -2297,31 +2237,25 @@ func (x *fastReflection_Controller) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Controller) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Biscuit) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Controller.number": - x.Number = uint64(0) - case "did.v1.Controller.did": - x.Did = "" - case "did.v1.Controller.sonr_address": - x.SonrAddress = "" - case "did.v1.Controller.eth_address": - x.EthAddress = "" - case "did.v1.Controller.btc_address": - x.BtcAddress = "" - case "did.v1.Controller.public_key": - x.PublicKey = nil - case "did.v1.Controller.ks_val": - x.KsVal = "" - case "did.v1.Controller.claimed_block": - x.ClaimedBlock = int64(0) - case "did.v1.Controller.creation_block": - x.CreationBlock = int64(0) + case "did.v1.Biscuit.id": + x.Id = uint64(0) + case "did.v1.Biscuit.controller": + x.Controller = "" + case "did.v1.Biscuit.subject": + x.Subject = "" + case "did.v1.Biscuit.origin": + x.Origin = "" + case "did.v1.Biscuit.expiry_height": + x.ExpiryHeight = int64(0) + case "did.v1.Biscuit.macaroon": + x.Macaroon = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Biscuit")) } - panic(fmt.Errorf("message did.v1.Controller does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Biscuit does not contain field %s", fd.FullName())) } } @@ -2331,40 +2265,31 @@ func (x *fastReflection_Controller) 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_Controller) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Biscuit) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Controller.number": - value := x.Number + case "did.v1.Biscuit.id": + value := x.Id return protoreflect.ValueOfUint64(value) - case "did.v1.Controller.did": - value := x.Did - return protoreflect.ValueOfString(value) - case "did.v1.Controller.sonr_address": - value := x.SonrAddress - return protoreflect.ValueOfString(value) - case "did.v1.Controller.eth_address": - value := x.EthAddress + case "did.v1.Biscuit.controller": + value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.Controller.btc_address": - value := x.BtcAddress + case "did.v1.Biscuit.subject": + value := x.Subject return protoreflect.ValueOfString(value) - case "did.v1.Controller.public_key": - value := x.PublicKey - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "did.v1.Controller.ks_val": - value := x.KsVal + case "did.v1.Biscuit.origin": + value := x.Origin return protoreflect.ValueOfString(value) - case "did.v1.Controller.claimed_block": - value := x.ClaimedBlock - return protoreflect.ValueOfInt64(value) - case "did.v1.Controller.creation_block": - value := x.CreationBlock + case "did.v1.Biscuit.expiry_height": + value := x.ExpiryHeight return protoreflect.ValueOfInt64(value) + case "did.v1.Biscuit.macaroon": + value := x.Macaroon + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Biscuit")) } - panic(fmt.Errorf("message did.v1.Controller does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.Biscuit does not contain field %s", descriptor.FullName())) } } @@ -2378,31 +2303,25 @@ func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Biscuit) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Controller.number": - x.Number = value.Uint() - case "did.v1.Controller.did": - x.Did = value.Interface().(string) - case "did.v1.Controller.sonr_address": - x.SonrAddress = value.Interface().(string) - case "did.v1.Controller.eth_address": - x.EthAddress = value.Interface().(string) - case "did.v1.Controller.btc_address": - x.BtcAddress = value.Interface().(string) - case "did.v1.Controller.public_key": - x.PublicKey = value.Message().Interface().(*PubKey) - case "did.v1.Controller.ks_val": - x.KsVal = value.Interface().(string) - case "did.v1.Controller.claimed_block": - x.ClaimedBlock = value.Int() - case "did.v1.Controller.creation_block": - x.CreationBlock = value.Int() + case "did.v1.Biscuit.id": + x.Id = value.Uint() + case "did.v1.Biscuit.controller": + x.Controller = value.Interface().(string) + case "did.v1.Biscuit.subject": + x.Subject = value.Interface().(string) + case "did.v1.Biscuit.origin": + x.Origin = value.Interface().(string) + case "did.v1.Biscuit.expiry_height": + x.ExpiryHeight = value.Int() + case "did.v1.Biscuit.macaroon": + x.Macaroon = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Biscuit")) } - panic(fmt.Errorf("message did.v1.Controller does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Biscuit does not contain field %s", fd.FullName())) } } @@ -2416,76 +2335,60 @@ func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value p // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Controller) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Biscuit) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Controller.public_key": - if x.PublicKey == nil { - x.PublicKey = new(PubKey) - } - return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - case "did.v1.Controller.number": - panic(fmt.Errorf("field number of message did.v1.Controller is not mutable")) - case "did.v1.Controller.did": - panic(fmt.Errorf("field did of message did.v1.Controller is not mutable")) - case "did.v1.Controller.sonr_address": - panic(fmt.Errorf("field sonr_address of message did.v1.Controller is not mutable")) - case "did.v1.Controller.eth_address": - panic(fmt.Errorf("field eth_address of message did.v1.Controller is not mutable")) - case "did.v1.Controller.btc_address": - panic(fmt.Errorf("field btc_address of message did.v1.Controller is not mutable")) - case "did.v1.Controller.ks_val": - panic(fmt.Errorf("field ks_val of message did.v1.Controller is not mutable")) - case "did.v1.Controller.claimed_block": - panic(fmt.Errorf("field claimed_block of message did.v1.Controller is not mutable")) - case "did.v1.Controller.creation_block": - panic(fmt.Errorf("field creation_block of message did.v1.Controller is not mutable")) + case "did.v1.Biscuit.id": + panic(fmt.Errorf("field id of message did.v1.Biscuit is not mutable")) + case "did.v1.Biscuit.controller": + panic(fmt.Errorf("field controller of message did.v1.Biscuit is not mutable")) + case "did.v1.Biscuit.subject": + panic(fmt.Errorf("field subject of message did.v1.Biscuit is not mutable")) + case "did.v1.Biscuit.origin": + panic(fmt.Errorf("field origin of message did.v1.Biscuit is not mutable")) + case "did.v1.Biscuit.expiry_height": + panic(fmt.Errorf("field expiry_height of message did.v1.Biscuit is not mutable")) + case "did.v1.Biscuit.macaroon": + panic(fmt.Errorf("field macaroon of message did.v1.Biscuit is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Biscuit")) } - panic(fmt.Errorf("message did.v1.Controller does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Biscuit 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_Controller) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Biscuit) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Controller.number": + case "did.v1.Biscuit.id": return protoreflect.ValueOfUint64(uint64(0)) - case "did.v1.Controller.did": - return protoreflect.ValueOfString("") - case "did.v1.Controller.sonr_address": - return protoreflect.ValueOfString("") - case "did.v1.Controller.eth_address": + case "did.v1.Biscuit.controller": return protoreflect.ValueOfString("") - case "did.v1.Controller.btc_address": + case "did.v1.Biscuit.subject": return protoreflect.ValueOfString("") - case "did.v1.Controller.public_key": - m := new(PubKey) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "did.v1.Controller.ks_val": + case "did.v1.Biscuit.origin": return protoreflect.ValueOfString("") - case "did.v1.Controller.claimed_block": - return protoreflect.ValueOfInt64(int64(0)) - case "did.v1.Controller.creation_block": + case "did.v1.Biscuit.expiry_height": return protoreflect.ValueOfInt64(int64(0)) + case "did.v1.Biscuit.macaroon": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Biscuit")) } - panic(fmt.Errorf("message did.v1.Controller does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Biscuit 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_Controller) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Biscuit) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Controller", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.Biscuit", d.FullName())) } panic("unreachable") } @@ -2493,7 +2396,7 @@ func (x *fastReflection_Controller) WhichOneof(d protoreflect.OneofDescriptor) p // 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_Controller) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Biscuit) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2504,7 +2407,7 @@ func (x *fastReflection_Controller) 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_Controller) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Biscuit) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2516,7 +2419,7 @@ func (x *fastReflection_Controller) 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_Controller) IsValid() bool { +func (x *fastReflection_Biscuit) IsValid() bool { return x != nil } @@ -2526,9 +2429,9 @@ func (x *fastReflection_Controller) 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_Controller) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Biscuit) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Controller) + x := input.Message.Interface().(*Biscuit) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2540,39 +2443,28 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Number != 0 { - n += 1 + runtime.Sov(uint64(x.Number)) - } - l = len(x.Did) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if x.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) } - l = len(x.SonrAddress) + l = len(x.Controller) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.EthAddress) + l = len(x.Subject) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.BtcAddress) + l = len(x.Origin) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.PublicKey != nil { - l = options.Size(x.PublicKey) - n += 1 + l + runtime.Sov(uint64(l)) + if x.ExpiryHeight != 0 { + n += 1 + runtime.Sov(uint64(x.ExpiryHeight)) } - l = len(x.KsVal) + l = len(x.Macaroon) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.ClaimedBlock != 0 { - n += 1 + runtime.Sov(uint64(x.ClaimedBlock)) - } - if x.CreationBlock != 0 { - n += 1 + runtime.Sov(uint64(x.CreationBlock)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -2583,7 +2475,7 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Controller) + x := input.Message.Interface().(*Biscuit) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2602,67 +2494,41 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.CreationBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.CreationBlock)) - i-- - dAtA[i] = 0x48 - } - if x.ClaimedBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedBlock)) - i-- - dAtA[i] = 0x40 - } - if len(x.KsVal) > 0 { - i -= len(x.KsVal) - copy(dAtA[i:], x.KsVal) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KsVal))) - i-- - dAtA[i] = 0x3a - } - if x.PublicKey != nil { - encoded, err := options.Marshal(x.PublicKey) - 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.Macaroon) > 0 { + i -= len(x.Macaroon) + copy(dAtA[i:], x.Macaroon) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Macaroon))) i-- dAtA[i] = 0x32 } - if len(x.BtcAddress) > 0 { - i -= len(x.BtcAddress) - copy(dAtA[i:], x.BtcAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BtcAddress))) + if x.ExpiryHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExpiryHeight)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x28 } - if len(x.EthAddress) > 0 { - i -= len(x.EthAddress) - copy(dAtA[i:], x.EthAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EthAddress))) + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) i-- dAtA[i] = 0x22 } - if len(x.SonrAddress) > 0 { - i -= len(x.SonrAddress) - copy(dAtA[i:], x.SonrAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SonrAddress))) + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) i-- dAtA[i] = 0x1a } - if len(x.Did) > 0 { - i -= len(x.Did) - copy(dAtA[i:], x.Did) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + 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] = 0x12 } - if x.Number != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Number)) + if x.Id != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) i-- dAtA[i] = 0x8 } @@ -2677,7 +2543,7 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Controller) + x := input.Message.Interface().(*Biscuit) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2709,17 +2575,17 @@ func (x *fastReflection_Controller) 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: Controller: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Biscuit: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Controller: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Biscuit: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - x.Number = 0 + x.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2729,14 +2595,14 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Number |= uint64(b&0x7F) << shift + x.Id |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + 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 { @@ -2764,11 +2630,11 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Did = string(dAtA[iNdEx:postIndex]) + x.Controller = 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 SonrAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2796,11 +2662,11 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.SonrAddress = string(dAtA[iNdEx:postIndex]) + x.Subject = 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 EthAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2828,13 +2694,13 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.EthAddress = string(dAtA[iNdEx:postIndex]) + x.Origin = 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 BtcAddress", wireType) + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType) } - var stringLen uint64 + x.ExpiryHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2844,63 +2710,14 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + x.ExpiryHeight |= int64(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.BtcAddress = 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 PublicKey", 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.PublicKey == nil { - x.PublicKey = &PubKey{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KsVal", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Macaroon", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2928,46 +2745,8 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.KsVal = string(dAtA[iNdEx:postIndex]) + x.Macaroon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedBlock", wireType) - } - x.ClaimedBlock = 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.ClaimedBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) - } - x.CreationBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.CreationBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3004,33 +2783,41 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } var ( - md_Grant protoreflect.MessageDescriptor - fd_Grant_id protoreflect.FieldDescriptor - fd_Grant_controller protoreflect.FieldDescriptor - fd_Grant_subject protoreflect.FieldDescriptor - fd_Grant_origin protoreflect.FieldDescriptor - fd_Grant_expiry_height protoreflect.FieldDescriptor + md_Controller protoreflect.MessageDescriptor + fd_Controller_number protoreflect.FieldDescriptor + fd_Controller_did protoreflect.FieldDescriptor + fd_Controller_sonr_address protoreflect.FieldDescriptor + fd_Controller_eth_address protoreflect.FieldDescriptor + fd_Controller_btc_address protoreflect.FieldDescriptor + fd_Controller_public_key_hex protoreflect.FieldDescriptor + fd_Controller_ks_val protoreflect.FieldDescriptor + fd_Controller_claimed_block protoreflect.FieldDescriptor + fd_Controller_creation_block protoreflect.FieldDescriptor ) func init() { file_did_v1_state_proto_init() - md_Grant = File_did_v1_state_proto.Messages().ByName("Grant") - fd_Grant_id = md_Grant.Fields().ByName("id") - fd_Grant_controller = md_Grant.Fields().ByName("controller") - fd_Grant_subject = md_Grant.Fields().ByName("subject") - fd_Grant_origin = md_Grant.Fields().ByName("origin") - fd_Grant_expiry_height = md_Grant.Fields().ByName("expiry_height") + md_Controller = File_did_v1_state_proto.Messages().ByName("Controller") + fd_Controller_number = md_Controller.Fields().ByName("number") + fd_Controller_did = md_Controller.Fields().ByName("did") + fd_Controller_sonr_address = md_Controller.Fields().ByName("sonr_address") + fd_Controller_eth_address = md_Controller.Fields().ByName("eth_address") + fd_Controller_btc_address = md_Controller.Fields().ByName("btc_address") + fd_Controller_public_key_hex = md_Controller.Fields().ByName("public_key_hex") + fd_Controller_ks_val = md_Controller.Fields().ByName("ks_val") + fd_Controller_claimed_block = md_Controller.Fields().ByName("claimed_block") + fd_Controller_creation_block = md_Controller.Fields().ByName("creation_block") } -var _ protoreflect.Message = (*fastReflection_Grant)(nil) +var _ protoreflect.Message = (*fastReflection_Controller)(nil) -type fastReflection_Grant Grant +type fastReflection_Controller Controller -func (x *Grant) ProtoReflect() protoreflect.Message { - return (*fastReflection_Grant)(x) +func (x *Controller) ProtoReflect() protoreflect.Message { + return (*fastReflection_Controller)(x) } -func (x *Grant) slowProtoReflect() protoreflect.Message { +func (x *Controller) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_state_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3042,43 +2829,43 @@ func (x *Grant) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Grant_messageType fastReflection_Grant_messageType -var _ protoreflect.MessageType = fastReflection_Grant_messageType{} +var _fastReflection_Controller_messageType fastReflection_Controller_messageType +var _ protoreflect.MessageType = fastReflection_Controller_messageType{} -type fastReflection_Grant_messageType struct{} +type fastReflection_Controller_messageType struct{} -func (x fastReflection_Grant_messageType) Zero() protoreflect.Message { - return (*fastReflection_Grant)(nil) +func (x fastReflection_Controller_messageType) Zero() protoreflect.Message { + return (*fastReflection_Controller)(nil) } -func (x fastReflection_Grant_messageType) New() protoreflect.Message { - return new(fastReflection_Grant) +func (x fastReflection_Controller_messageType) New() protoreflect.Message { + return new(fastReflection_Controller) } -func (x fastReflection_Grant_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Grant +func (x fastReflection_Controller_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Controller } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Grant) Descriptor() protoreflect.MessageDescriptor { - return md_Grant +func (x *fastReflection_Controller) Descriptor() protoreflect.MessageDescriptor { + return md_Controller } // 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_Grant) Type() protoreflect.MessageType { - return _fastReflection_Grant_messageType +func (x *fastReflection_Controller) Type() protoreflect.MessageType { + return _fastReflection_Controller_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Grant) New() protoreflect.Message { - return new(fastReflection_Grant) +func (x *fastReflection_Controller) New() protoreflect.Message { + return new(fastReflection_Controller) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Grant) Interface() protoreflect.ProtoMessage { - return (*Grant)(x) +func (x *fastReflection_Controller) Interface() protoreflect.ProtoMessage { + return (*Controller)(x) } // Range iterates over every populated field in an undefined order, @@ -3086,686 +2873,58 @@ func (x *fastReflection_Grant) 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_Grant) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != uint64(0) { - value := protoreflect.ValueOfUint64(x.Id) - if !f(fd_Grant_id, value) { +func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Number != uint64(0) { + value := protoreflect.ValueOfUint64(x.Number) + if !f(fd_Controller_number, value) { return } } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Grant_controller, value) { - return - } - } - if x.Subject != "" { - value := protoreflect.ValueOfString(x.Subject) - if !f(fd_Grant_subject, value) { - return - } - } - if x.Origin != "" { - value := protoreflect.ValueOfString(x.Origin) - if !f(fd_Grant_origin, value) { - return - } - } - if x.ExpiryHeight != int64(0) { - value := protoreflect.ValueOfInt64(x.ExpiryHeight) - if !f(fd_Grant_expiry_height, 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_Grant) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Grant.id": - return x.Id != uint64(0) - case "did.v1.Grant.controller": - return x.Controller != "" - case "did.v1.Grant.subject": - return x.Subject != "" - case "did.v1.Grant.origin": - return x.Origin != "" - case "did.v1.Grant.expiry_height": - return x.ExpiryHeight != int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Grant")) - } - panic(fmt.Errorf("message did.v1.Grant 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_Grant) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Grant.id": - x.Id = uint64(0) - case "did.v1.Grant.controller": - x.Controller = "" - case "did.v1.Grant.subject": - x.Subject = "" - case "did.v1.Grant.origin": - x.Origin = "" - case "did.v1.Grant.expiry_height": - x.ExpiryHeight = int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Grant")) - } - panic(fmt.Errorf("message did.v1.Grant 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_Grant) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Grant.id": - value := x.Id - return protoreflect.ValueOfUint64(value) - case "did.v1.Grant.controller": - value := x.Controller - return protoreflect.ValueOfString(value) - case "did.v1.Grant.subject": - value := x.Subject - return protoreflect.ValueOfString(value) - case "did.v1.Grant.origin": - value := x.Origin - return protoreflect.ValueOfString(value) - case "did.v1.Grant.expiry_height": - value := x.ExpiryHeight - return protoreflect.ValueOfInt64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Grant")) - } - panic(fmt.Errorf("message did.v1.Grant 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_Grant) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Grant.id": - x.Id = value.Uint() - case "did.v1.Grant.controller": - x.Controller = value.Interface().(string) - case "did.v1.Grant.subject": - x.Subject = value.Interface().(string) - case "did.v1.Grant.origin": - x.Origin = value.Interface().(string) - case "did.v1.Grant.expiry_height": - x.ExpiryHeight = value.Int() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Grant")) - } - panic(fmt.Errorf("message did.v1.Grant 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_Grant) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Grant.id": - panic(fmt.Errorf("field id of message did.v1.Grant is not mutable")) - case "did.v1.Grant.controller": - panic(fmt.Errorf("field controller of message did.v1.Grant is not mutable")) - case "did.v1.Grant.subject": - panic(fmt.Errorf("field subject of message did.v1.Grant is not mutable")) - case "did.v1.Grant.origin": - panic(fmt.Errorf("field origin of message did.v1.Grant is not mutable")) - case "did.v1.Grant.expiry_height": - panic(fmt.Errorf("field expiry_height of message did.v1.Grant is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Grant")) - } - panic(fmt.Errorf("message did.v1.Grant 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_Grant) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Grant.id": - return protoreflect.ValueOfUint64(uint64(0)) - case "did.v1.Grant.controller": - return protoreflect.ValueOfString("") - case "did.v1.Grant.subject": - return protoreflect.ValueOfString("") - case "did.v1.Grant.origin": - return protoreflect.ValueOfString("") - case "did.v1.Grant.expiry_height": - return protoreflect.ValueOfInt64(int64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Grant")) - } - panic(fmt.Errorf("message did.v1.Grant 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_Grant) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Grant", 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_Grant) 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_Grant) 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_Grant) 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_Grant) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Grant) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Id != 0 { - n += 1 + runtime.Sov(uint64(x.Id)) - } - l = len(x.Controller) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Subject) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Origin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.ExpiryHeight != 0 { - n += 1 + runtime.Sov(uint64(x.ExpiryHeight)) - } - 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().(*Grant) - 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.ExpiryHeight != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ExpiryHeight)) - i-- - dAtA[i] = 0x28 - } - if len(x.Origin) > 0 { - i -= len(x.Origin) - copy(dAtA[i:], x.Origin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) - i-- - dAtA[i] = 0x22 - } - if len(x.Subject) > 0 { - i -= len(x.Subject) - copy(dAtA[i:], x.Subject) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) - 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))) - i-- - dAtA[i] = 0x12 - } - if x.Id != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Grant) - 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: Grant: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - x.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field 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 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", 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.Subject = 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 Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType) - } - x.ExpiryHeight = 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.ExpiryHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_Controller_did, value) { + return } - 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_Macaroon protoreflect.MessageDescriptor - fd_Macaroon_id protoreflect.FieldDescriptor - fd_Macaroon_controller protoreflect.FieldDescriptor - fd_Macaroon_subject protoreflect.FieldDescriptor - fd_Macaroon_origin protoreflect.FieldDescriptor - fd_Macaroon_expiry_height protoreflect.FieldDescriptor - fd_Macaroon_macaroon protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_state_proto_init() - md_Macaroon = File_did_v1_state_proto.Messages().ByName("Macaroon") - fd_Macaroon_id = md_Macaroon.Fields().ByName("id") - fd_Macaroon_controller = md_Macaroon.Fields().ByName("controller") - fd_Macaroon_subject = md_Macaroon.Fields().ByName("subject") - fd_Macaroon_origin = md_Macaroon.Fields().ByName("origin") - fd_Macaroon_expiry_height = md_Macaroon.Fields().ByName("expiry_height") - fd_Macaroon_macaroon = md_Macaroon.Fields().ByName("macaroon") -} - -var _ protoreflect.Message = (*fastReflection_Macaroon)(nil) - -type fastReflection_Macaroon Macaroon - -func (x *Macaroon) ProtoReflect() protoreflect.Message { - return (*fastReflection_Macaroon)(x) -} - -func (x *Macaroon) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) + if x.SonrAddress != "" { + value := protoreflect.ValueOfString(x.SonrAddress) + if !f(fd_Controller_sonr_address, value) { + return } - return ms } - return mi.MessageOf(x) -} - -var _fastReflection_Macaroon_messageType fastReflection_Macaroon_messageType -var _ protoreflect.MessageType = fastReflection_Macaroon_messageType{} - -type fastReflection_Macaroon_messageType struct{} - -func (x fastReflection_Macaroon_messageType) Zero() protoreflect.Message { - return (*fastReflection_Macaroon)(nil) -} -func (x fastReflection_Macaroon_messageType) New() protoreflect.Message { - return new(fastReflection_Macaroon) -} -func (x fastReflection_Macaroon_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Macaroon -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Macaroon) Descriptor() protoreflect.MessageDescriptor { - return md_Macaroon -} - -// 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_Macaroon) Type() protoreflect.MessageType { - return _fastReflection_Macaroon_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Macaroon) New() protoreflect.Message { - return new(fastReflection_Macaroon) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Macaroon) Interface() protoreflect.ProtoMessage { - return (*Macaroon)(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_Macaroon) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != uint64(0) { - value := protoreflect.ValueOfUint64(x.Id) - if !f(fd_Macaroon_id, value) { + if x.EthAddress != "" { + value := protoreflect.ValueOfString(x.EthAddress) + if !f(fd_Controller_eth_address, value) { return } } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Macaroon_controller, value) { + if x.BtcAddress != "" { + value := protoreflect.ValueOfString(x.BtcAddress) + if !f(fd_Controller_btc_address, value) { return } } - if x.Subject != "" { - value := protoreflect.ValueOfString(x.Subject) - if !f(fd_Macaroon_subject, value) { + if x.PublicKeyHex != "" { + value := protoreflect.ValueOfString(x.PublicKeyHex) + if !f(fd_Controller_public_key_hex, value) { return } } - if x.Origin != "" { - value := protoreflect.ValueOfString(x.Origin) - if !f(fd_Macaroon_origin, value) { + if x.KsVal != "" { + value := protoreflect.ValueOfString(x.KsVal) + if !f(fd_Controller_ks_val, value) { return } } - if x.ExpiryHeight != int64(0) { - value := protoreflect.ValueOfInt64(x.ExpiryHeight) - if !f(fd_Macaroon_expiry_height, value) { + if x.ClaimedBlock != int64(0) { + value := protoreflect.ValueOfInt64(x.ClaimedBlock) + if !f(fd_Controller_claimed_block, value) { return } } - if x.Macaroon != "" { - value := protoreflect.ValueOfString(x.Macaroon) - if !f(fd_Macaroon_macaroon, value) { + if x.CreationBlock != int64(0) { + value := protoreflect.ValueOfInt64(x.CreationBlock) + if !f(fd_Controller_creation_block, value) { return } } @@ -3782,25 +2941,31 @@ func (x *fastReflection_Macaroon) Range(f func(protoreflect.FieldDescriptor, pro // 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_Macaroon) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Controller) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Macaroon.id": - return x.Id != uint64(0) - case "did.v1.Macaroon.controller": - return x.Controller != "" - case "did.v1.Macaroon.subject": - return x.Subject != "" - case "did.v1.Macaroon.origin": - return x.Origin != "" - case "did.v1.Macaroon.expiry_height": - return x.ExpiryHeight != int64(0) - case "did.v1.Macaroon.macaroon": - return x.Macaroon != "" + case "did.v1.Controller.number": + return x.Number != uint64(0) + case "did.v1.Controller.did": + return x.Did != "" + case "did.v1.Controller.sonr_address": + return x.SonrAddress != "" + case "did.v1.Controller.eth_address": + return x.EthAddress != "" + case "did.v1.Controller.btc_address": + return x.BtcAddress != "" + case "did.v1.Controller.public_key_hex": + return x.PublicKeyHex != "" + case "did.v1.Controller.ks_val": + return x.KsVal != "" + case "did.v1.Controller.claimed_block": + return x.ClaimedBlock != int64(0) + case "did.v1.Controller.creation_block": + return x.CreationBlock != int64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Macaroon")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) } - panic(fmt.Errorf("message did.v1.Macaroon does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Controller does not contain field %s", fd.FullName())) } } @@ -3810,25 +2975,31 @@ func (x *fastReflection_Macaroon) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Macaroon) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Controller) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Macaroon.id": - x.Id = uint64(0) - case "did.v1.Macaroon.controller": - x.Controller = "" - case "did.v1.Macaroon.subject": - x.Subject = "" - case "did.v1.Macaroon.origin": - x.Origin = "" - case "did.v1.Macaroon.expiry_height": - x.ExpiryHeight = int64(0) - case "did.v1.Macaroon.macaroon": - x.Macaroon = "" + case "did.v1.Controller.number": + x.Number = uint64(0) + case "did.v1.Controller.did": + x.Did = "" + case "did.v1.Controller.sonr_address": + x.SonrAddress = "" + case "did.v1.Controller.eth_address": + x.EthAddress = "" + case "did.v1.Controller.btc_address": + x.BtcAddress = "" + case "did.v1.Controller.public_key_hex": + x.PublicKeyHex = "" + case "did.v1.Controller.ks_val": + x.KsVal = "" + case "did.v1.Controller.claimed_block": + x.ClaimedBlock = int64(0) + case "did.v1.Controller.creation_block": + x.CreationBlock = int64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Macaroon")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) } - panic(fmt.Errorf("message did.v1.Macaroon does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Controller does not contain field %s", fd.FullName())) } } @@ -3838,31 +3009,40 @@ func (x *fastReflection_Macaroon) 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_Macaroon) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Macaroon.id": - value := x.Id + case "did.v1.Controller.number": + value := x.Number return protoreflect.ValueOfUint64(value) - case "did.v1.Macaroon.controller": - value := x.Controller + case "did.v1.Controller.did": + value := x.Did return protoreflect.ValueOfString(value) - case "did.v1.Macaroon.subject": - value := x.Subject + case "did.v1.Controller.sonr_address": + value := x.SonrAddress return protoreflect.ValueOfString(value) - case "did.v1.Macaroon.origin": - value := x.Origin + case "did.v1.Controller.eth_address": + value := x.EthAddress return protoreflect.ValueOfString(value) - case "did.v1.Macaroon.expiry_height": - value := x.ExpiryHeight + case "did.v1.Controller.btc_address": + value := x.BtcAddress + return protoreflect.ValueOfString(value) + case "did.v1.Controller.public_key_hex": + value := x.PublicKeyHex + return protoreflect.ValueOfString(value) + case "did.v1.Controller.ks_val": + value := x.KsVal + return protoreflect.ValueOfString(value) + case "did.v1.Controller.claimed_block": + value := x.ClaimedBlock + return protoreflect.ValueOfInt64(value) + case "did.v1.Controller.creation_block": + value := x.CreationBlock return protoreflect.ValueOfInt64(value) - case "did.v1.Macaroon.macaroon": - value := x.Macaroon - return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Macaroon")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) } - panic(fmt.Errorf("message did.v1.Macaroon does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.Controller does not contain field %s", descriptor.FullName())) } } @@ -3876,25 +3056,31 @@ func (x *fastReflection_Macaroon) Get(descriptor protoreflect.FieldDescriptor) p // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Macaroon) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Macaroon.id": - x.Id = value.Uint() - case "did.v1.Macaroon.controller": - x.Controller = value.Interface().(string) - case "did.v1.Macaroon.subject": - x.Subject = value.Interface().(string) - case "did.v1.Macaroon.origin": - x.Origin = value.Interface().(string) - case "did.v1.Macaroon.expiry_height": - x.ExpiryHeight = value.Int() - case "did.v1.Macaroon.macaroon": - x.Macaroon = value.Interface().(string) + case "did.v1.Controller.number": + x.Number = value.Uint() + case "did.v1.Controller.did": + x.Did = value.Interface().(string) + case "did.v1.Controller.sonr_address": + x.SonrAddress = value.Interface().(string) + case "did.v1.Controller.eth_address": + x.EthAddress = value.Interface().(string) + case "did.v1.Controller.btc_address": + x.BtcAddress = value.Interface().(string) + case "did.v1.Controller.public_key_hex": + x.PublicKeyHex = value.Interface().(string) + case "did.v1.Controller.ks_val": + x.KsVal = value.Interface().(string) + case "did.v1.Controller.claimed_block": + x.ClaimedBlock = value.Int() + case "did.v1.Controller.creation_block": + x.CreationBlock = value.Int() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Macaroon")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) } - panic(fmt.Errorf("message did.v1.Macaroon does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Controller does not contain field %s", fd.FullName())) } } @@ -3908,60 +3094,72 @@ func (x *fastReflection_Macaroon) Set(fd protoreflect.FieldDescriptor, value pro // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Macaroon) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Controller) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Macaroon.id": - panic(fmt.Errorf("field id of message did.v1.Macaroon is not mutable")) - case "did.v1.Macaroon.controller": - panic(fmt.Errorf("field controller of message did.v1.Macaroon is not mutable")) - case "did.v1.Macaroon.subject": - panic(fmt.Errorf("field subject of message did.v1.Macaroon is not mutable")) - case "did.v1.Macaroon.origin": - panic(fmt.Errorf("field origin of message did.v1.Macaroon is not mutable")) - case "did.v1.Macaroon.expiry_height": - panic(fmt.Errorf("field expiry_height of message did.v1.Macaroon is not mutable")) - case "did.v1.Macaroon.macaroon": - panic(fmt.Errorf("field macaroon of message did.v1.Macaroon is not mutable")) + case "did.v1.Controller.number": + panic(fmt.Errorf("field number of message did.v1.Controller is not mutable")) + case "did.v1.Controller.did": + panic(fmt.Errorf("field did of message did.v1.Controller is not mutable")) + case "did.v1.Controller.sonr_address": + panic(fmt.Errorf("field sonr_address of message did.v1.Controller is not mutable")) + case "did.v1.Controller.eth_address": + panic(fmt.Errorf("field eth_address of message did.v1.Controller is not mutable")) + case "did.v1.Controller.btc_address": + panic(fmt.Errorf("field btc_address of message did.v1.Controller is not mutable")) + case "did.v1.Controller.public_key_hex": + panic(fmt.Errorf("field public_key_hex of message did.v1.Controller is not mutable")) + case "did.v1.Controller.ks_val": + panic(fmt.Errorf("field ks_val of message did.v1.Controller is not mutable")) + case "did.v1.Controller.claimed_block": + panic(fmt.Errorf("field claimed_block of message did.v1.Controller is not mutable")) + case "did.v1.Controller.creation_block": + panic(fmt.Errorf("field creation_block of message did.v1.Controller is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Macaroon")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) } - panic(fmt.Errorf("message did.v1.Macaroon does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Controller 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_Macaroon) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Controller) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Macaroon.id": + case "did.v1.Controller.number": return protoreflect.ValueOfUint64(uint64(0)) - case "did.v1.Macaroon.controller": + case "did.v1.Controller.did": return protoreflect.ValueOfString("") - case "did.v1.Macaroon.subject": + case "did.v1.Controller.sonr_address": return protoreflect.ValueOfString("") - case "did.v1.Macaroon.origin": + case "did.v1.Controller.eth_address": return protoreflect.ValueOfString("") - case "did.v1.Macaroon.expiry_height": - return protoreflect.ValueOfInt64(int64(0)) - case "did.v1.Macaroon.macaroon": + case "did.v1.Controller.btc_address": + return protoreflect.ValueOfString("") + case "did.v1.Controller.public_key_hex": + return protoreflect.ValueOfString("") + case "did.v1.Controller.ks_val": return protoreflect.ValueOfString("") + case "did.v1.Controller.claimed_block": + return protoreflect.ValueOfInt64(int64(0)) + case "did.v1.Controller.creation_block": + return protoreflect.ValueOfInt64(int64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Macaroon")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) } - panic(fmt.Errorf("message did.v1.Macaroon does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Controller 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_Macaroon) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Controller) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Macaroon", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.Controller", d.FullName())) } panic("unreachable") } @@ -3969,7 +3167,7 @@ func (x *fastReflection_Macaroon) WhichOneof(d protoreflect.OneofDescriptor) pro // 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_Macaroon) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Controller) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -3980,7 +3178,7 @@ func (x *fastReflection_Macaroon) 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_Macaroon) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Controller) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -3992,7 +3190,7 @@ func (x *fastReflection_Macaroon) 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_Macaroon) IsValid() bool { +func (x *fastReflection_Controller) IsValid() bool { return x != nil } @@ -4002,9 +3200,9 @@ func (x *fastReflection_Macaroon) 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_Macaroon) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Macaroon) + x := input.Message.Interface().(*Controller) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4016,28 +3214,39 @@ func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Id != 0 { - n += 1 + runtime.Sov(uint64(x.Id)) + if x.Number != 0 { + n += 1 + runtime.Sov(uint64(x.Number)) } - l = len(x.Controller) + l = len(x.Did) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Subject) + l = len(x.SonrAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Origin) + l = len(x.EthAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.ExpiryHeight != 0 { - n += 1 + runtime.Sov(uint64(x.ExpiryHeight)) + l = len(x.BtcAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Macaroon) + l = len(x.PublicKeyHex) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.KsVal) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.ClaimedBlock != 0 { + n += 1 + runtime.Sov(uint64(x.ClaimedBlock)) + } + if x.CreationBlock != 0 { + n += 1 + runtime.Sov(uint64(x.CreationBlock)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -4048,7 +3257,7 @@ func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Macaroon) + x := input.Message.Interface().(*Controller) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4067,41 +3276,60 @@ func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Macaroon) > 0 { - i -= len(x.Macaroon) - copy(dAtA[i:], x.Macaroon) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Macaroon))) + if x.CreationBlock != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CreationBlock)) + i-- + dAtA[i] = 0x48 + } + if x.ClaimedBlock != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimedBlock)) + i-- + dAtA[i] = 0x40 + } + if len(x.KsVal) > 0 { + i -= len(x.KsVal) + copy(dAtA[i:], x.KsVal) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KsVal))) + i-- + dAtA[i] = 0x3a + } + if len(x.PublicKeyHex) > 0 { + i -= len(x.PublicKeyHex) + copy(dAtA[i:], x.PublicKeyHex) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKeyHex))) i-- dAtA[i] = 0x32 } - if x.ExpiryHeight != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ExpiryHeight)) + if len(x.BtcAddress) > 0 { + i -= len(x.BtcAddress) + copy(dAtA[i:], x.BtcAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BtcAddress))) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x2a } - if len(x.Origin) > 0 { - i -= len(x.Origin) - copy(dAtA[i:], x.Origin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + if len(x.EthAddress) > 0 { + i -= len(x.EthAddress) + copy(dAtA[i:], x.EthAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EthAddress))) i-- dAtA[i] = 0x22 } - if len(x.Subject) > 0 { - i -= len(x.Subject) - copy(dAtA[i:], x.Subject) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + if len(x.SonrAddress) > 0 { + i -= len(x.SonrAddress) + copy(dAtA[i:], x.SonrAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SonrAddress))) 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 len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) i-- dAtA[i] = 0x12 } - if x.Id != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + if x.Number != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Number)) i-- dAtA[i] = 0x8 } @@ -4116,7 +3344,7 @@ func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Macaroon) + x := input.Message.Interface().(*Controller) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4148,17 +3376,17 @@ func (x *fastReflection_Macaroon) 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: Macaroon: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Controller: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Macaroon: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Controller: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) } - x.Id = 0 + x.Number = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -4168,14 +3396,110 @@ func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Id |= uint64(b&0x7F) << shift + x.Number |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SonrAddress", 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.SonrAddress = 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 EthAddress", 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 } } - case 2: + 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.EthAddress = 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 Controller", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BtcAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4203,11 +3527,11 @@ func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Controller = string(dAtA[iNdEx:postIndex]) + x.BtcAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyHex", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4235,11 +3559,11 @@ func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Subject = string(dAtA[iNdEx:postIndex]) + x.PublicKeyHex = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 7: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KsVal", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4267,13 +3591,13 @@ func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Origin = string(dAtA[iNdEx:postIndex]) + x.KsVal = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 8: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedBlock", wireType) } - x.ExpiryHeight = 0 + x.ClaimedBlock = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -4283,16 +3607,16 @@ func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.ExpiryHeight |= int64(b&0x7F) << shift + x.ClaimedBlock |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Macaroon", wireType) + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) } - var stringLen uint64 + x.CreationBlock = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -4302,24 +3626,11 @@ func (x *fastReflection_Macaroon) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + x.CreationBlock |= int64(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.Macaroon = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4444,7 +3755,7 @@ var ( fd_Verification_did_method protoreflect.FieldDescriptor fd_Verification_issuer protoreflect.FieldDescriptor fd_Verification_subject protoreflect.FieldDescriptor - fd_Verification_public_key protoreflect.FieldDescriptor + fd_Verification_public_key_hex protoreflect.FieldDescriptor fd_Verification_verification_type protoreflect.FieldDescriptor fd_Verification_metadata protoreflect.FieldDescriptor fd_Verification_creation_block protoreflect.FieldDescriptor @@ -4458,7 +3769,7 @@ func init() { fd_Verification_did_method = md_Verification.Fields().ByName("did_method") fd_Verification_issuer = md_Verification.Fields().ByName("issuer") fd_Verification_subject = md_Verification.Fields().ByName("subject") - fd_Verification_public_key = md_Verification.Fields().ByName("public_key") + fd_Verification_public_key_hex = md_Verification.Fields().ByName("public_key_hex") fd_Verification_verification_type = md_Verification.Fields().ByName("verification_type") fd_Verification_metadata = md_Verification.Fields().ByName("metadata") fd_Verification_creation_block = md_Verification.Fields().ByName("creation_block") @@ -4473,7 +3784,7 @@ func (x *Verification) ProtoReflect() protoreflect.Message { } func (x *Verification) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[5] + mi := &file_did_v1_state_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4559,9 +3870,9 @@ func (x *fastReflection_Verification) Range(f func(protoreflect.FieldDescriptor, return } } - if x.PublicKey != nil { - value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) - if !f(fd_Verification_public_key, value) { + if x.PublicKeyHex != "" { + value := protoreflect.ValueOfString(x.PublicKeyHex) + if !f(fd_Verification_public_key_hex, value) { return } } @@ -4608,8 +3919,8 @@ func (x *fastReflection_Verification) Has(fd protoreflect.FieldDescriptor) bool return x.Issuer != "" case "did.v1.Verification.subject": return x.Subject != "" - case "did.v1.Verification.public_key": - return x.PublicKey != nil + case "did.v1.Verification.public_key_hex": + return x.PublicKeyHex != "" case "did.v1.Verification.verification_type": return x.VerificationType != "" case "did.v1.Verification.metadata": @@ -4642,8 +3953,8 @@ func (x *fastReflection_Verification) Clear(fd protoreflect.FieldDescriptor) { x.Issuer = "" case "did.v1.Verification.subject": x.Subject = "" - case "did.v1.Verification.public_key": - x.PublicKey = nil + case "did.v1.Verification.public_key_hex": + x.PublicKeyHex = "" case "did.v1.Verification.verification_type": x.VerificationType = "" case "did.v1.Verification.metadata": @@ -4681,9 +3992,9 @@ func (x *fastReflection_Verification) Get(descriptor protoreflect.FieldDescripto case "did.v1.Verification.subject": value := x.Subject return protoreflect.ValueOfString(value) - case "did.v1.Verification.public_key": - value := x.PublicKey - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.Verification.public_key_hex": + value := x.PublicKeyHex + return protoreflect.ValueOfString(value) case "did.v1.Verification.verification_type": value := x.VerificationType return protoreflect.ValueOfString(value) @@ -4726,8 +4037,8 @@ func (x *fastReflection_Verification) Set(fd protoreflect.FieldDescriptor, value x.Issuer = value.Interface().(string) case "did.v1.Verification.subject": x.Subject = value.Interface().(string) - case "did.v1.Verification.public_key": - x.PublicKey = value.Message().Interface().(*PubKey) + case "did.v1.Verification.public_key_hex": + x.PublicKeyHex = value.Interface().(string) case "did.v1.Verification.verification_type": x.VerificationType = value.Interface().(string) case "did.v1.Verification.metadata": @@ -4756,11 +4067,6 @@ func (x *fastReflection_Verification) Set(fd protoreflect.FieldDescriptor, value // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Verification) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Verification.public_key": - if x.PublicKey == nil { - x.PublicKey = new(PubKey) - } - return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) case "did.v1.Verification.metadata": if x.Metadata == nil { x.Metadata = make(map[string]string) @@ -4777,6 +4083,8 @@ func (x *fastReflection_Verification) Mutable(fd protoreflect.FieldDescriptor) p panic(fmt.Errorf("field issuer of message did.v1.Verification is not mutable")) case "did.v1.Verification.subject": panic(fmt.Errorf("field subject of message did.v1.Verification is not mutable")) + case "did.v1.Verification.public_key_hex": + panic(fmt.Errorf("field public_key_hex of message did.v1.Verification is not mutable")) case "did.v1.Verification.verification_type": panic(fmt.Errorf("field verification_type of message did.v1.Verification is not mutable")) case "did.v1.Verification.creation_block": @@ -4804,9 +4112,8 @@ func (x *fastReflection_Verification) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfString("") case "did.v1.Verification.subject": return protoreflect.ValueOfString("") - case "did.v1.Verification.public_key": - m := new(PubKey) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.Verification.public_key_hex": + return protoreflect.ValueOfString("") case "did.v1.Verification.verification_type": return protoreflect.ValueOfString("") case "did.v1.Verification.metadata": @@ -4903,8 +4210,8 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.PublicKey != nil { - l = options.Size(x.PublicKey) + l = len(x.PublicKeyHex) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } l = len(x.VerificationType) @@ -5019,17 +4326,10 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x3a } - if x.PublicKey != nil { - encoded, err := options.Marshal(x.PublicKey) - 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.PublicKeyHex) > 0 { + i -= len(x.PublicKeyHex) + copy(dAtA[i:], x.PublicKeyHex) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKeyHex))) i-- dAtA[i] = 0x32 } @@ -5279,9 +4579,9 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyHex", 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 @@ -5291,27 +4591,23 @@ func (x *fastReflection_Verification) 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.PublicKey == nil { - x.PublicKey = &PubKey{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.PublicKeyHex = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { @@ -5550,8 +4846,8 @@ type Assertion struct { Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // Origin of the authentication Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - // PubKey is the verification method - PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // string is the verification method + PublicKeyHex string `protobuf:"bytes,4,opt,name=public_key_hex,json=publicKeyHex,proto3" json:"public_key_hex,omitempty"` // AssertionType is the assertion type AssertionType string `protobuf:"bytes,5,opt,name=assertion_type,json=assertionType,proto3" json:"assertion_type,omitempty"` // Metadata of the authentication @@ -5601,11 +4897,11 @@ func (x *Assertion) GetSubject() string { return "" } -func (x *Assertion) GetPublicKey() *PubKey { +func (x *Assertion) GetPublicKeyHex() string { if x != nil { - return x.PublicKey + return x.PublicKeyHex } - return nil + return "" } func (x *Assertion) GetAssertionType() string { @@ -5640,8 +4936,8 @@ type Authentication struct { Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // Origin of the authentication Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - // PubKey is the verification method - PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // string is the verification method + PublicKeyHex string `protobuf:"bytes,4,opt,name=public_key_hex,json=publicKeyHex,proto3" json:"public_key_hex,omitempty"` // CredentialID is the byte representation of the credential ID CredentialId []byte `protobuf:"bytes,5,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` // Metadata of the authentication @@ -5691,11 +4987,11 @@ func (x *Authentication) GetSubject() string { return "" } -func (x *Authentication) GetPublicKey() *PubKey { +func (x *Authentication) GetPublicKeyHex() string { if x != nil { - return x.PublicKey + return x.PublicKeyHex } - return nil + return "" } func (x *Authentication) GetCredentialId() []byte { @@ -5719,34 +5015,22 @@ func (x *Authentication) GetCreationBlock() int64 { return 0 } -// Controller represents a Sonr DWN Vault -type Controller struct { +// Macaroon is a Macaroon message type. +type Biscuit struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The unique identifier of the controller - Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` - // The unique identifier of the controller - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` - // The DID of the controller - SonrAddress string `protobuf:"bytes,3,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"` - // The DID of the controller - EthAddress string `protobuf:"bytes,4,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"` - // The DID of the controller - BtcAddress string `protobuf:"bytes,5,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` - // PubKey is the verification method - PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // Pointer to the Keyshares - KsVal string `protobuf:"bytes,7,opt,name=ks_val,json=ksVal,proto3" json:"ks_val,omitempty"` - // The block number of when a user claimed the controller - ClaimedBlock int64 `protobuf:"varint,8,opt,name=claimed_block,json=claimedBlock,proto3" json:"claimed_block,omitempty"` - // CreationBlock is the block number of the creation of the controller - CreationBlock int64 `protobuf:"varint,9,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"` + Macaroon string `protobuf:"bytes,6,opt,name=macaroon,proto3" json:"macaroon,omitempty"` } -func (x *Controller) Reset() { - *x = Controller{} +func (x *Biscuit) Reset() { + *x = Biscuit{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_state_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5754,95 +5038,87 @@ func (x *Controller) Reset() { } } -func (x *Controller) String() string { +func (x *Biscuit) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Controller) ProtoMessage() {} +func (*Biscuit) ProtoMessage() {} -// Deprecated: Use Controller.ProtoReflect.Descriptor instead. -func (*Controller) Descriptor() ([]byte, []int) { +// Deprecated: Use Biscuit.ProtoReflect.Descriptor instead. +func (*Biscuit) Descriptor() ([]byte, []int) { return file_did_v1_state_proto_rawDescGZIP(), []int{2} } -func (x *Controller) GetNumber() uint64 { +func (x *Biscuit) GetId() uint64 { if x != nil { - return x.Number + return x.Id } return 0 } -func (x *Controller) GetDid() string { - if x != nil { - return x.Did - } - return "" -} - -func (x *Controller) GetSonrAddress() string { - if x != nil { - return x.SonrAddress - } - return "" -} - -func (x *Controller) GetEthAddress() string { +func (x *Biscuit) GetController() string { if x != nil { - return x.EthAddress + return x.Controller } return "" } -func (x *Controller) GetBtcAddress() string { +func (x *Biscuit) GetSubject() string { if x != nil { - return x.BtcAddress + return x.Subject } return "" } -func (x *Controller) GetPublicKey() *PubKey { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *Controller) GetKsVal() string { +func (x *Biscuit) GetOrigin() string { if x != nil { - return x.KsVal + return x.Origin } return "" } -func (x *Controller) GetClaimedBlock() int64 { +func (x *Biscuit) GetExpiryHeight() int64 { if x != nil { - return x.ClaimedBlock + return x.ExpiryHeight } return 0 } -func (x *Controller) GetCreationBlock() int64 { +func (x *Biscuit) GetMacaroon() string { if x != nil { - return x.CreationBlock + return x.Macaroon } - return 0 + return "" } -// Grant is a Grant message type. -type Grant struct { +// Controller represents a Sonr DWN Vault +type Controller struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"` + // The unique identifier of the controller + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` + // The unique identifier of the controller + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` + // The DID of the controller + SonrAddress string `protobuf:"bytes,3,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"` + // The DID of the controller + EthAddress string `protobuf:"bytes,4,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"` + // The DID of the controller + BtcAddress string `protobuf:"bytes,5,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` + // string is the verification method + PublicKeyHex string `protobuf:"bytes,6,opt,name=public_key_hex,json=publicKeyHex,proto3" json:"public_key_hex,omitempty"` + // Pointer to the Keyshares + KsVal string `protobuf:"bytes,7,opt,name=ks_val,json=ksVal,proto3" json:"ks_val,omitempty"` + // The block number of when a user claimed the controller + ClaimedBlock int64 `protobuf:"varint,8,opt,name=claimed_block,json=claimedBlock,proto3" json:"claimed_block,omitempty"` + // CreationBlock is the block number of the creation of the controller + CreationBlock int64 `protobuf:"varint,9,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` } -func (x *Grant) Reset() { - *x = Grant{} +func (x *Controller) Reset() { + *x = Controller{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_state_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5850,126 +5126,78 @@ func (x *Grant) Reset() { } } -func (x *Grant) String() string { +func (x *Controller) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Grant) ProtoMessage() {} +func (*Controller) ProtoMessage() {} -// Deprecated: Use Grant.ProtoReflect.Descriptor instead. -func (*Grant) Descriptor() ([]byte, []int) { +// Deprecated: Use Controller.ProtoReflect.Descriptor instead. +func (*Controller) Descriptor() ([]byte, []int) { return file_did_v1_state_proto_rawDescGZIP(), []int{3} } -func (x *Grant) GetId() uint64 { +func (x *Controller) GetNumber() uint64 { if x != nil { - return x.Id + return x.Number } return 0 } -func (x *Grant) GetController() string { +func (x *Controller) GetDid() string { if x != nil { - return x.Controller + return x.Did } return "" } -func (x *Grant) GetSubject() string { +func (x *Controller) GetSonrAddress() string { if x != nil { - return x.Subject + return x.SonrAddress } return "" } -func (x *Grant) GetOrigin() string { +func (x *Controller) GetEthAddress() string { if x != nil { - return x.Origin + return x.EthAddress } return "" } -func (x *Grant) GetExpiryHeight() int64 { - if x != nil { - return x.ExpiryHeight - } - return 0 -} - -// Macaroon is a Macaroon message type. -type Macaroon struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"` - Macaroon string `protobuf:"bytes,6,opt,name=macaroon,proto3" json:"macaroon,omitempty"` -} - -func (x *Macaroon) Reset() { - *x = Macaroon{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Macaroon) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Macaroon) ProtoMessage() {} - -// Deprecated: Use Macaroon.ProtoReflect.Descriptor instead. -func (*Macaroon) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{4} -} - -func (x *Macaroon) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Macaroon) GetController() string { +func (x *Controller) GetBtcAddress() string { if x != nil { - return x.Controller + return x.BtcAddress } return "" } -func (x *Macaroon) GetSubject() string { +func (x *Controller) GetPublicKeyHex() string { if x != nil { - return x.Subject + return x.PublicKeyHex } return "" } -func (x *Macaroon) GetOrigin() string { +func (x *Controller) GetKsVal() string { if x != nil { - return x.Origin + return x.KsVal } return "" } -func (x *Macaroon) GetExpiryHeight() int64 { +func (x *Controller) GetClaimedBlock() int64 { if x != nil { - return x.ExpiryHeight + return x.ClaimedBlock } return 0 } -func (x *Macaroon) GetMacaroon() string { +func (x *Controller) GetCreationBlock() int64 { if x != nil { - return x.Macaroon + return x.CreationBlock } - return "" + return 0 } // Verification represents a verification method @@ -5989,7 +5217,7 @@ type Verification struct { // The subject of the verification Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The public key of the verification - PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKeyHex string `protobuf:"bytes,6,opt,name=public_key_hex,json=publicKeyHex,proto3" json:"public_key_hex,omitempty"` // The verification method type VerificationType string `protobuf:"bytes,7,opt,name=verification_type,json=verificationType,proto3" json:"verification_type,omitempty"` // Metadata of the verification @@ -6001,7 +5229,7 @@ type Verification struct { func (x *Verification) Reset() { *x = Verification{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[5] + mi := &file_did_v1_state_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6015,7 +5243,7 @@ func (*Verification) ProtoMessage() {} // Deprecated: Use Verification.ProtoReflect.Descriptor instead. func (*Verification) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{5} + return file_did_v1_state_proto_rawDescGZIP(), []int{4} } func (x *Verification) GetDid() string { @@ -6053,11 +5281,11 @@ func (x *Verification) GetSubject() string { return "" } -func (x *Verification) GetPublicKey() *PubKey { +func (x *Verification) GetPublicKeyHex() string { if x != nil { - return x.PublicKey + return x.PublicKeyHex } - return nil + return "" } func (x *Verification) GetVerificationType() string { @@ -6088,146 +5316,132 @@ var file_did_v1_state_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x03, 0x0a, 0x09, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfc, 0x02, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x73, - 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x0b, 0x61, - 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x63, 0x63, 0x75, - 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 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, 0x0c, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x29, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x23, - 0x0a, 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, - 0x01, 0x18, 0x01, 0x22, 0x81, 0x03, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, - 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x48, 0x65, 0x78, 0x12, 0x25, 0x0a, 0x0e, 0x61, + 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x44, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, + 0x72, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x63, 0x63, 0x75, 0x6d, + 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x63, 0x63, + 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, - 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x29, 0xf2, 0x9e, - 0xd3, 0x8e, 0x03, 0x23, 0x0a, 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x12, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x10, 0x01, 0x18, 0x01, 0x18, 0x02, 0x22, 0x88, 0x03, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x10, - 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, - 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x6e, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x74, 0x63, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x73, 0x56, 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x63, - 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, 0x59, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x53, 0x0a, - 0x0a, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0c, 0x73, - 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x18, 0x01, 0x12, - 0x11, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x02, - 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x10, 0x03, 0x18, 0x01, 0x12, 0x09, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x10, 0x04, 0x18, 0x01, - 0x18, 0x03, 0x22, 0xb6, 0x01, 0x0a, 0x05, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 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, 0x18, 0x0a, 0x07, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x23, - 0x0a, 0x0d, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x48, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x3a, 0x26, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x20, 0x0a, 0x06, 0x0a, 0x02, 0x69, - 0x64, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, 0x04, 0x22, 0xd5, 0x01, 0x0a, 0x08, - 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 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, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, - 0x70, 0x69, 0x72, 0x79, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x26, 0xf2, 0x9e, 0xd3, - 0x8e, 0x03, 0x20, 0x0a, 0x06, 0x0a, 0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x0e, 0x73, - 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, - 0x01, 0x18, 0x05, 0x22, 0x84, 0x04, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x64, 0x5f, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x64, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x18, 0x0a, - 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x71, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x6b, 0x0a, - 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, - 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x12, 0x22, 0x0a, 0x1c, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x64, 0x69, 0x64, 0x5f, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x02, 0x18, 0x01, - 0x12, 0x26, 0x0a, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x69, 0x73, - 0x73, 0x75, 0x65, 0x72, 0x10, 0x03, 0x18, 0x01, 0x18, 0x06, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, - 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, - 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x3e, 0x0a, 0x10, 0x41, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 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, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, + 0x29, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x23, 0x0a, 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x18, + 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x73, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0xf8, 0x02, 0x0a, 0x0e, 0x41, + 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, + 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, + 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x48, 0x65, 0x78, 0x12, + 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x3b, 0x0a, + 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x29, 0xf2, 0x9e, 0xd3, 0x8e, + 0x03, 0x23, 0x0a, 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x12, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, + 0x01, 0x18, 0x01, 0x18, 0x02, 0x22, 0xd4, 0x01, 0x0a, 0x07, 0x42, 0x69, 0x73, 0x63, 0x75, 0x69, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 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, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x79, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x63, 0x61, + 0x72, 0x6f, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x61, 0x63, 0x61, + 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x26, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x20, 0x0a, 0x06, 0x0a, 0x02, + 0x69, 0x64, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, 0x05, 0x22, 0xff, 0x02, 0x0a, + 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x6e, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, + 0x74, 0x68, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x74, 0x63, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x62, 0x74, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x48, 0x65, 0x78, + 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6b, 0x73, 0x56, 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0e, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x3a, 0x59, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x53, 0x0a, 0x0a, 0x0a, 0x06, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x65, + 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x02, 0x18, 0x01, 0x12, 0x11, + 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x03, 0x18, + 0x01, 0x12, 0x09, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x10, 0x04, 0x18, 0x01, 0x18, 0x03, 0x22, 0xfb, + 0x03, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, + 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x5f, 0x68, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x48, 0x65, 0x78, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x3b, 0x0a, 0x0d, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x71, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, + 0x6b, 0x0a, 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x69, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x12, 0x22, + 0x0a, 0x1c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x64, 0x69, 0x64, + 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x02, + 0x18, 0x01, 0x12, 0x26, 0x0a, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, + 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x03, 0x18, 0x01, 0x18, 0x06, 0x42, 0x7a, 0x0a, 0x0a, + 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, + 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6242,32 +5456,26 @@ func file_did_v1_state_proto_rawDescGZIP() []byte { return file_did_v1_state_proto_rawDescData } -var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_did_v1_state_proto_goTypes = []interface{}{ (*Assertion)(nil), // 0: did.v1.Assertion (*Authentication)(nil), // 1: did.v1.Authentication - (*Controller)(nil), // 2: did.v1.Controller - (*Grant)(nil), // 3: did.v1.Grant - (*Macaroon)(nil), // 4: did.v1.Macaroon - (*Verification)(nil), // 5: did.v1.Verification - nil, // 6: did.v1.Assertion.AccumulatorEntry - nil, // 7: did.v1.Authentication.MetadataEntry - nil, // 8: did.v1.Verification.MetadataEntry - (*PubKey)(nil), // 9: did.v1.PubKey + (*Biscuit)(nil), // 2: did.v1.Biscuit + (*Controller)(nil), // 3: did.v1.Controller + (*Verification)(nil), // 4: did.v1.Verification + nil, // 5: did.v1.Assertion.AccumulatorEntry + nil, // 6: did.v1.Authentication.MetadataEntry + nil, // 7: did.v1.Verification.MetadataEntry } var file_did_v1_state_proto_depIdxs = []int32{ - 9, // 0: did.v1.Assertion.public_key:type_name -> did.v1.PubKey - 6, // 1: did.v1.Assertion.accumulator:type_name -> did.v1.Assertion.AccumulatorEntry - 9, // 2: did.v1.Authentication.public_key:type_name -> did.v1.PubKey - 7, // 3: did.v1.Authentication.metadata:type_name -> did.v1.Authentication.MetadataEntry - 9, // 4: did.v1.Controller.public_key:type_name -> did.v1.PubKey - 9, // 5: did.v1.Verification.public_key:type_name -> did.v1.PubKey - 8, // 6: did.v1.Verification.metadata:type_name -> did.v1.Verification.MetadataEntry - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 5, // 0: did.v1.Assertion.accumulator:type_name -> did.v1.Assertion.AccumulatorEntry + 6, // 1: did.v1.Authentication.metadata:type_name -> did.v1.Authentication.MetadataEntry + 7, // 2: did.v1.Verification.metadata:type_name -> did.v1.Verification.MetadataEntry + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_did_v1_state_proto_init() } @@ -6302,7 +5510,7 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Controller); i { + switch v := v.(*Biscuit); i { case 0: return &v.state case 1: @@ -6314,7 +5522,7 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Grant); i { + switch v := v.(*Controller); i { case 0: return &v.state case 1: @@ -6326,18 +5534,6 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Macaroon); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_state_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Verification); i { case 0: return &v.state @@ -6356,7 +5552,7 @@ func file_did_v1_state_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_state_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/api/did/v1/tx.pulsar.go b/api/did/v1/tx.pulsar.go index d74584bec..e8fdc7d63 100644 --- a/api/did/v1/tx.pulsar.go +++ b/api/did/v1/tx.pulsar.go @@ -7128,148 +7128,149 @@ var file_did_v1_tx_proto_rawDesc = []byte{ 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 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, 0xe6, 0x01, 0x0a, 0x15, 0x4d, 0x73, - 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 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, 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, 0x1c, 0x0a, 0x09, 0x61, 0x73, 0x73, 0x65, 0x72, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, - 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, - 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x65, 0x72, 0x22, 0x4b, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, - 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, - 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, - 0xbc, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, - 0x74, 0x69, 0x6f, 0x6e, 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, 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, 0x1c, 0x0a, 0x09, 0x61, 0x73, 0x73, 0x65, - 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, - 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, - 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0f, 0x82, - 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x46, - 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0xfd, 0x01, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 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, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x63, 0x61, 0x72, - 0x6f, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 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, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x49, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 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, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, - 0x68, 0x22, 0xab, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, - 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, + 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 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, 0xe6, + 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, + 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x0d, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x72, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x63, 0x61, 0x72, - 0x6f, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x54, 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, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, - 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0xba, 0x01, 0x0a, 0x17, 0x4d, 0x73, - 0x67, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, - 0x2d, 0x0a, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x75, 0x74, - 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x64, 0x12, 0x25, - 0x0a, 0x0e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x4d, 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6c, + 0x65, 0x72, 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, 0x1c, 0x0a, 0x09, + 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, + 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, + 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x4b, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x4c, 0x69, + 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x64, 0x69, 0x64, 0x22, 0xbc, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, + 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 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, 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, 0x1c, 0x0a, + 0x09, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6d, + 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x22, 0x46, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x73, + 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0xfd, 0x01, 0x0a, 0x0c, + 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 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, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, + 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x3b, 0x0a, + 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 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, 0x0c, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x49, 0x0a, 0x14, 0x4d, + 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 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, 0x17, 0x0a, + 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0xab, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x6e, + 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 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, 0x0d, 0x61, 0x73, 0x73, 0x65, 0x72, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, + 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x54, 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, 0x55, 0x6e, 0x6c, 0x69, 0x6e, + 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, + 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0xba, + 0x01, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, + 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x2d, 0x0a, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x44, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x63, + 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x4d, 0x0a, 0x1f, 0x4d, + 0x73, 0x67, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 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, 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, 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, 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, 0x32, 0xf5, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x3f, 0x0a, + 0x09, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, + 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, + 0x0a, 0x0d, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x18, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, + 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x12, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x64, 0x69, 0x64, 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, 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, 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, - 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, - 0x32, 0xf5, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x3f, 0x0a, 0x09, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x54, 0x78, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x78, 0x1a, 0x1c, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, - 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0d, 0x4c, 0x69, 0x6e, - 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, - 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x12, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x75, - 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, - 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x25, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, - 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, - 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, - 0x6e, 0x1a, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, - 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x14, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, - 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, - 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, - 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x27, - 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6c, 0x69, 0x6e, + 0x6e, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x69, + 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 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, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x55, 0x6e, 0x6c, 0x69, 0x6e, + 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, + 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x14, 0x55, 0x6e, + 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x1a, 0x27, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 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 ( @@ -7329,6 +7330,7 @@ func file_did_v1_tx_proto_init() { return } file_did_v1_genesis_proto_init() + file_did_v1_params_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgLinkAuthentication); i { diff --git a/api/service/module/v1/module.pulsar.go b/api/service/module/v1/module.pulsar.go index 26e888436..0f7d12fc7 100644 --- a/api/service/module/v1/module.pulsar.go +++ b/api/service/module/v1/module.pulsar.go @@ -104,9 +104,9 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.service.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.service.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message service.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -120,9 +120,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.service.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.service.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message service.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -136,9 +136,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.service.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.service.module.v1.Module does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message service.module.v1.Module does not contain field %s", descriptor.FullName())) } } @@ -156,9 +156,9 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.service.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.service.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message service.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -176,9 +176,9 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.service.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.service.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message service.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -189,9 +189,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.service.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: service.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.service.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message service.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -201,7 +201,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in onsonr.sonr.service.module.v1.Module", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in service.module.v1.Module", d.FullName())) } panic("unreachable") } @@ -415,30 +415,25 @@ var File_service_module_v1_module_proto protoreflect.FileDescriptor var file_service_module_v1_module_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x1d, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, - 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x32, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x28, 0xba, 0xc0, 0x96, - 0xda, 0x01, 0x22, 0x0a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x78, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x80, 0x02, 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x6e, - 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 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, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, - 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x53, 0x53, 0x4d, 0xaa, 0x02, 0x1d, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, - 0x72, 0x2e, 0x53, 0x6f, 0x6e, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1d, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, - 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x29, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, - 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x21, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x53, - 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, + 0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, + 0xc1, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 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, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x53, 0x4d, 0x58, 0xaa, 0x02, 0x11, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -455,7 +450,7 @@ func file_service_module_v1_module_proto_rawDescGZIP() []byte { var file_service_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_service_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: onsonr.sonr.service.module.v1.Module + (*Module)(nil), // 0: service.module.v1.Module } var file_service_module_v1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type diff --git a/api/service/v1/state.pulsar.go b/api/service/v1/state.pulsar.go index 7dd02efe5..c40f31343 100644 --- a/api/service/v1/state.pulsar.go +++ b/api/service/v1/state.pulsar.go @@ -177,8 +177,8 @@ func (x *fastReflection_Metadata) Range(f func(protoreflect.FieldDescriptor, pro return } } - if x.Icon != nil { - value := protoreflect.ValueOfMessage(x.Icon.ProtoReflect()) + if x.Icon != "" { + value := protoreflect.ValueOfString(x.Icon) if !f(fd_Metadata_icon, value) { return } @@ -215,7 +215,7 @@ func (x *fastReflection_Metadata) Has(fd protoreflect.FieldDescriptor) bool { case "service.v1.Metadata.category": return x.Category != "" case "service.v1.Metadata.icon": - return x.Icon != nil + return x.Icon != "" case "service.v1.Metadata.tags": return len(x.Tags) != 0 default: @@ -245,7 +245,7 @@ func (x *fastReflection_Metadata) Clear(fd protoreflect.FieldDescriptor) { case "service.v1.Metadata.category": x.Category = "" case "service.v1.Metadata.icon": - x.Icon = nil + x.Icon = "" case "service.v1.Metadata.tags": x.Tags = nil default: @@ -281,7 +281,7 @@ func (x *fastReflection_Metadata) Get(descriptor protoreflect.FieldDescriptor) p return protoreflect.ValueOfString(value) case "service.v1.Metadata.icon": value := x.Icon - return protoreflect.ValueOfMessage(value.ProtoReflect()) + return protoreflect.ValueOfString(value) case "service.v1.Metadata.tags": if len(x.Tags) == 0 { return protoreflect.ValueOfList(&_Metadata_7_list{}) @@ -319,7 +319,7 @@ func (x *fastReflection_Metadata) Set(fd protoreflect.FieldDescriptor, value pro case "service.v1.Metadata.category": x.Category = value.Interface().(string) case "service.v1.Metadata.icon": - x.Icon = value.Message().Interface().(*URI) + x.Icon = value.Interface().(string) case "service.v1.Metadata.tags": lv := value.List() clv := lv.(*_Metadata_7_list) @@ -344,11 +344,6 @@ func (x *fastReflection_Metadata) Set(fd protoreflect.FieldDescriptor, value pro // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Metadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "service.v1.Metadata.icon": - if x.Icon == nil { - x.Icon = new(URI) - } - return protoreflect.ValueOfMessage(x.Icon.ProtoReflect()) case "service.v1.Metadata.tags": if x.Tags == nil { x.Tags = []string{} @@ -365,6 +360,8 @@ func (x *fastReflection_Metadata) Mutable(fd protoreflect.FieldDescriptor) proto panic(fmt.Errorf("field description of message service.v1.Metadata is not mutable")) case "service.v1.Metadata.category": panic(fmt.Errorf("field category of message service.v1.Metadata is not mutable")) + case "service.v1.Metadata.icon": + panic(fmt.Errorf("field icon of message service.v1.Metadata is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.Metadata")) @@ -389,8 +386,7 @@ func (x *fastReflection_Metadata) NewField(fd protoreflect.FieldDescriptor) prot case "service.v1.Metadata.category": return protoreflect.ValueOfString("") case "service.v1.Metadata.icon": - m := new(URI) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + return protoreflect.ValueOfString("") case "service.v1.Metadata.tags": list := []string{} return protoreflect.ValueOfList(&_Metadata_7_list{list: &list}) @@ -482,8 +478,8 @@ func (x *fastReflection_Metadata) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Icon != nil { - l = options.Size(x.Icon) + l = len(x.Icon) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } if len(x.Tags) > 0 { @@ -530,17 +526,10 @@ func (x *fastReflection_Metadata) ProtoMethods() *protoiface.Methods { dAtA[i] = 0x3a } } - if x.Icon != nil { - encoded, err := options.Marshal(x.Icon) - 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.Icon) > 0 { + i -= len(x.Icon) + copy(dAtA[i:], x.Icon) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Icon))) i-- dAtA[i] = 0x32 } @@ -777,7 +766,7 @@ func (x *fastReflection_Metadata) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Icon", 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 @@ -787,27 +776,23 @@ func (x *fastReflection_Metadata) 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.Icon == nil { - x.Icon = &URI{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Icon); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Icon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { @@ -1488,474 +1473,6 @@ func (x *fastReflection_Profile) ProtoMethods() *protoiface.Methods { } } -var ( - md_URI protoreflect.MessageDescriptor - fd_URI_protocol protoreflect.FieldDescriptor - fd_URI_uri protoreflect.FieldDescriptor -) - -func init() { - file_service_v1_state_proto_init() - md_URI = File_service_v1_state_proto.Messages().ByName("URI") - fd_URI_protocol = md_URI.Fields().ByName("protocol") - fd_URI_uri = md_URI.Fields().ByName("uri") -} - -var _ protoreflect.Message = (*fastReflection_URI)(nil) - -type fastReflection_URI URI - -func (x *URI) ProtoReflect() protoreflect.Message { - return (*fastReflection_URI)(x) -} - -func (x *URI) slowProtoReflect() protoreflect.Message { - mi := &file_service_v1_state_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_URI_messageType fastReflection_URI_messageType -var _ protoreflect.MessageType = fastReflection_URI_messageType{} - -type fastReflection_URI_messageType struct{} - -func (x fastReflection_URI_messageType) Zero() protoreflect.Message { - return (*fastReflection_URI)(nil) -} -func (x fastReflection_URI_messageType) New() protoreflect.Message { - return new(fastReflection_URI) -} -func (x fastReflection_URI_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_URI -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_URI) Descriptor() protoreflect.MessageDescriptor { - return md_URI -} - -// 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_URI) Type() protoreflect.MessageType { - return _fastReflection_URI_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_URI) New() protoreflect.Message { - return new(fastReflection_URI) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_URI) Interface() protoreflect.ProtoMessage { - return (*URI)(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_URI) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Protocol != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Protocol)) - if !f(fd_URI_protocol, value) { - return - } - } - if x.Uri != "" { - value := protoreflect.ValueOfString(x.Uri) - if !f(fd_URI_uri, 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_URI) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "service.v1.URI.protocol": - return x.Protocol != 0 - case "service.v1.URI.uri": - return x.Uri != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.URI")) - } - panic(fmt.Errorf("message service.v1.URI 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_URI) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "service.v1.URI.protocol": - x.Protocol = 0 - case "service.v1.URI.uri": - x.Uri = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.URI")) - } - panic(fmt.Errorf("message service.v1.URI 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_URI) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "service.v1.URI.protocol": - value := x.Protocol - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "service.v1.URI.uri": - value := x.Uri - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.URI")) - } - panic(fmt.Errorf("message service.v1.URI 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_URI) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "service.v1.URI.protocol": - x.Protocol = (URI_Protocol)(value.Enum()) - case "service.v1.URI.uri": - x.Uri = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.URI")) - } - panic(fmt.Errorf("message service.v1.URI 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_URI) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "service.v1.URI.protocol": - panic(fmt.Errorf("field protocol of message service.v1.URI is not mutable")) - case "service.v1.URI.uri": - panic(fmt.Errorf("field uri of message service.v1.URI is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.URI")) - } - panic(fmt.Errorf("message service.v1.URI 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_URI) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "service.v1.URI.protocol": - return protoreflect.ValueOfEnum(0) - case "service.v1.URI.uri": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: service.v1.URI")) - } - panic(fmt.Errorf("message service.v1.URI 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_URI) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in service.v1.URI", 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_URI) 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_URI) 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_URI) 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_URI) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*URI) - 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.Protocol != 0 { - n += 1 + runtime.Sov(uint64(x.Protocol)) - } - l = len(x.Uri) - 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().(*URI) - 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.Uri) > 0 { - i -= len(x.Uri) - copy(dAtA[i:], x.Uri) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Uri))) - i-- - dAtA[i] = 0x12 - } - if x.Protocol != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Protocol)) - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*URI) - 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: URI: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: URI: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - x.Protocol = 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.Protocol |= URI_Protocol(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Uri", 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.Uri = 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 @@ -1969,52 +1486,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type URI_Protocol int32 - -const ( - URI_HTTPS URI_Protocol = 0 - URI_IPFS URI_Protocol = 1 -) - -// Enum value maps for URI_Protocol. -var ( - URI_Protocol_name = map[int32]string{ - 0: "HTTPS", - 1: "IPFS", - } - URI_Protocol_value = map[string]int32{ - "HTTPS": 0, - "IPFS": 1, - } -) - -func (x URI_Protocol) Enum() *URI_Protocol { - p := new(URI_Protocol) - *p = x - return p -} - -func (x URI_Protocol) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (URI_Protocol) Descriptor() protoreflect.EnumDescriptor { - return file_service_v1_state_proto_enumTypes[0].Descriptor() -} - -func (URI_Protocol) Type() protoreflect.EnumType { - return &file_service_v1_state_proto_enumTypes[0] -} - -func (x URI_Protocol) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use URI_Protocol.Descriptor instead. -func (URI_Protocol) EnumDescriptor() ([]byte, []int) { - return file_service_v1_state_proto_rawDescGZIP(), []int{2, 0} -} - type Metadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2025,7 +1496,7 @@ type Metadata struct { Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` Category string `protobuf:"bytes,5,opt,name=category,proto3" json:"category,omitempty"` - Icon *URI `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"` + Icon string `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"` Tags []string `protobuf:"bytes,7,rep,name=tags,proto3" json:"tags,omitempty"` } @@ -2084,11 +1555,11 @@ func (x *Metadata) GetCategory() string { return "" } -func (x *Metadata) GetIcon() *URI { +func (x *Metadata) GetIcon() string { if x != nil { return x.Icon } - return nil + return "" } func (x *Metadata) GetTags() []string { @@ -2162,56 +1633,13 @@ func (x *Profile) GetController() string { return "" } -type URI struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Protocol URI_Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=service.v1.URI_Protocol" json:"protocol,omitempty"` - Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"` -} - -func (x *URI) Reset() { - *x = URI{} - if protoimpl.UnsafeEnabled { - mi := &file_service_v1_state_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *URI) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*URI) ProtoMessage() {} - -// Deprecated: Use URI.ProtoReflect.Descriptor instead. -func (*URI) Descriptor() ([]byte, []int) { - return file_service_v1_state_proto_rawDescGZIP(), []int{2} -} - -func (x *URI) GetProtocol() URI_Protocol { - if x != nil { - return x.Protocol - } - return URI_HTTPS -} - -func (x *URI) GetUri() string { - if x != nil { - return x.Uri - } - return "" -} - var File_service_v1_state_proto protoreflect.FileDescriptor var file_service_v1_state_proto_rawDesc = []byte{ 0x0a, 0x16, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, - 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdd, 0x01, + 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, @@ -2220,39 +1648,31 @@ var file_service_v1_state_proto_rawDesc = []byte{ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x79, 0x12, 0x23, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x55, 0x52, 0x49, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, - 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x3a, 0x1e, 0xf2, - 0x9e, 0xd3, 0x8e, 0x03, 0x18, 0x0a, 0x06, 0x0a, 0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x0c, 0x0a, - 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0x91, 0x01, - 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 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, 0x12, 0x1e, 0x0a, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x3a, 0x24, 0xf2, 0x9e, 0xd3, - 0x8e, 0x03, 0x1e, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x73, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, - 0x02, 0x22, 0x6e, 0x0a, 0x03, 0x55, 0x52, 0x49, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x52, 0x49, 0x2e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, - 0x22, 0x1f, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x09, 0x0a, 0x05, - 0x48, 0x54, 0x54, 0x50, 0x53, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x46, 0x53, 0x10, - 0x01, 0x42, 0x96, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x2f, 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, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x67, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x3a, 0x1e, 0xf2, 0x9e, + 0xd3, 0x8e, 0x03, 0x18, 0x0a, 0x06, 0x0a, 0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0x91, 0x01, 0x0a, + 0x07, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 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, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x3a, 0x24, 0xf2, 0x9e, 0xd3, 0x8e, + 0x03, 0x1e, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x18, 0x02, + 0x42, 0x96, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x2f, 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, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -2267,22 +1687,17 @@ func file_service_v1_state_proto_rawDescGZIP() []byte { return file_service_v1_state_proto_rawDescData } -var file_service_v1_state_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_service_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_service_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_service_v1_state_proto_goTypes = []interface{}{ - (URI_Protocol)(0), // 0: service.v1.URI.Protocol - (*Metadata)(nil), // 1: service.v1.Metadata - (*Profile)(nil), // 2: service.v1.Profile - (*URI)(nil), // 3: service.v1.URI + (*Metadata)(nil), // 0: service.v1.Metadata + (*Profile)(nil), // 1: service.v1.Profile } var file_service_v1_state_proto_depIdxs = []int32{ - 3, // 0: service.v1.Metadata.icon:type_name -> service.v1.URI - 0, // 1: service.v1.URI.protocol:type_name -> service.v1.URI.Protocol - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } func init() { file_service_v1_state_proto_init() } @@ -2315,32 +1730,19 @@ func file_service_v1_state_proto_init() { return nil } } - file_service_v1_state_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*URI); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_v1_state_proto_rawDesc, - NumEnums: 1, - NumMessages: 3, + NumEnums: 0, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, GoTypes: file_service_v1_state_proto_goTypes, DependencyIndexes: file_service_v1_state_proto_depIdxs, - EnumInfos: file_service_v1_state_proto_enumTypes, MessageInfos: file_service_v1_state_proto_msgTypes, }.Build() File_service_v1_state_proto = out.File diff --git a/api/vault/module/v1/module.pulsar.go b/api/vault/module/v1/module.pulsar.go index 35d8ea019..1789eae62 100644 --- a/api/vault/module/v1/module.pulsar.go +++ b/api/vault/module/v1/module.pulsar.go @@ -104,9 +104,9 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.vault.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.vault.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -120,9 +120,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.vault.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.vault.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -136,9 +136,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.vault.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.vault.module.v1.Module does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", descriptor.FullName())) } } @@ -156,9 +156,9 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.vault.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.vault.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -176,9 +176,9 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.vault.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.vault.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -189,9 +189,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.vault.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.sonr.vault.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -201,7 +201,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in onsonr.sonr.vault.module.v1.Module", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in vault.module.v1.Module", d.FullName())) } panic("unreachable") } @@ -414,30 +414,25 @@ var File_vault_module_v1_module_proto protoreflect.FileDescriptor var file_vault_module_v1_module_proto_rawDesc = []byte{ 0x0a, 0x1c, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, - 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, - 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x76, 0x61, 0x75, 0x6c, - 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x30, 0x0a, - 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x26, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x20, 0x0a, - 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, - 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x78, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x42, - 0xf4, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, - 0x6f, 0x6e, 0x72, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, + 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, + 0xda, 0x01, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xb5, 0x01, 0x0a, 0x13, + 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x53, 0x56, 0x4d, 0xaa, 0x02, - 0x1b, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x53, 0x6f, 0x6e, 0x72, 0x2e, 0x56, 0x61, 0x75, - 0x6c, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1b, 0x4f, - 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x56, 0x61, 0x75, 0x6c, 0x74, - 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x27, 0x4f, 0x6e, 0x73, - 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1f, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x53, - 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x4d, 0x58, 0xaa, 0x02, 0x0f, + 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x0f, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x1b, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x11, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -454,7 +449,7 @@ func file_vault_module_v1_module_proto_rawDescGZIP() []byte { var file_vault_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_vault_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: onsonr.sonr.vault.module.v1.Module + (*Module)(nil), // 0: vault.module.v1.Module } var file_vault_module_v1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type diff --git a/buf.work.yaml b/buf.work.yaml new file mode 100644 index 000000000..494296bfa --- /dev/null +++ b/buf.work.yaml @@ -0,0 +1,4 @@ +version: v1 +directories: + - proto + - third_party/proto diff --git a/internal/dwn/fetch/serve.go b/cmd/dwn/main.go similarity index 69% rename from internal/dwn/fetch/serve.go rename to cmd/dwn/main.go index 8e44b86ea..f46fc5d0c 100644 --- a/internal/dwn/fetch/serve.go +++ b/cmd/dwn/main.go @@ -1,20 +1,64 @@ //go:build js && wasm // +build js,wasm -package fetch +package main import ( "bytes" + "encoding/json" "fmt" "io" "net/http" "net/http/httptest" + "os" "strings" "syscall/js" + "github.com/labstack/echo/v4" promise "github.com/nlepage/go-js-promise" + + "github.com/onsonr/sonr/pkg/common/ctx" + dwngen "github.com/onsonr/sonr/pkg/motr/config" + "github.com/onsonr/sonr/pkg/motr/routes" ) +const FileNameConfigJSON = "dwn.json" + +var config *dwngen.Config + +func main() { + // Load dwn config + if err := loadDwnConfig(); err != nil { + panic(err) + } + + // Setup HTTP server + e := echo.New() + e.Use(ctx.DWNSessionMiddleware(config)) + routes.RegisterWebNodeAPI(e) + routes.RegisterWebNodeViews(e) + Serve(e) +} + +func loadDwnConfig() error { + // Read dwn.json config + dwnBz, err := os.ReadFile(FileNameConfigJSON) + if err != nil { + return err + } + dwnConfig := new(dwngen.Config) + err = json.Unmarshal(dwnBz, dwnConfig) + if err != nil { + return err + } + config = dwnConfig + return nil +} + +// ╭───────────────────────────────────────────────────────╮ +// │ Serve HTTP Requests │ +// ╰───────────────────────────────────────────────────────╯ + // Serve serves HTTP requests using handler or http.DefaultServeMux if handler is nil. func Serve(handler http.Handler) func() { h := handler diff --git a/cmd/hway/bun.lockb b/cmd/gateway/bun.lockb similarity index 100% rename from cmd/hway/bun.lockb rename to cmd/gateway/bun.lockb diff --git a/cmd/hway/main.go b/cmd/gateway/main.go similarity index 66% rename from cmd/hway/main.go rename to cmd/gateway/main.go index 9d42bd747..ec0b98bb9 100644 --- a/cmd/hway/main.go +++ b/cmd/gateway/main.go @@ -4,15 +4,16 @@ package main import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/ctx" - "github.com/onsonr/sonr/pkg/workers/routes" "github.com/syumai/workers" + + "github.com/onsonr/sonr/pkg/common/ctx" + "github.com/onsonr/sonr/pkg/hway/routes" ) func main() { s := echo.New() s.Use(ctx.HighwaySessionMiddleware) routes.RegisterGatewayViews(s) - routes.RegisterGatewayAPI(s) + routes.RegisterGatewayViews(s) workers.Serve(s) } diff --git a/cmd/hway/wrangler.toml b/cmd/gateway/wrangler.toml similarity index 100% rename from cmd/hway/wrangler.toml rename to cmd/gateway/wrangler.toml diff --git a/go.mod b/go.mod index 725f90638..dc18d913d 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,6 @@ replace ( // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // See: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 - // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // See: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 @@ -87,7 +86,6 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 google.golang.org/grpc v1.64.1 google.golang.org/protobuf v1.34.2 - gopkg.in/macaroon.v2 v2.1.0 ) require ( diff --git a/go.sum b/go.sum index 79ce9d6d6..65a70efb4 100644 --- a/go.sum +++ b/go.sum @@ -1121,7 +1121,6 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= -github.com/frankban/quicktest v1.0.0/go.mod h1:R98jIehRai+d1/3Hv2//jOVCTJhW1VBavT6B6CuGq2k= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= @@ -2149,7 +2148,6 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= go4.org v0.0.0-20230225012048-214862532bf5 h1:nifaUDeh+rPaBCMPMQHZmvJf+QdpLFnuQPwx+LxVmtc= go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEbFGHD4hhz6S1ZYeaU= -golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -2975,8 +2973,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/macaroon.v2 v2.1.0 h1:HZcsjBCzq9t0eBPMKqTN/uSN6JOm78ZJ2INbqcBQOUI= -gopkg.in/macaroon.v2 v2.1.0/go.mod h1:OUb+TQP/OP0WOerC2Jp/3CwhIKyIa9kQjuc7H24e6/o= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/internal/dwn/app.wasm b/internal/dwn/app.wasm deleted file mode 100755 index 023b7384d..000000000 Binary files a/internal/dwn/app.wasm and /dev/null differ diff --git a/internal/dwn/gen/init.pkl.go b/internal/dwn/gen/init.pkl.go deleted file mode 100644 index 9cea869d9..000000000 --- a/internal/dwn/gen/init.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `dwngen`. DO NOT EDIT. -package gen - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("dwngen", Dwngen{}) - pkl.RegisterMapping("dwngen#Config", Config{}) - pkl.RegisterMapping("dwngen#Schema", Schema{}) -} diff --git a/internal/dwn/wasm/main.go b/internal/dwn/wasm/main.go deleted file mode 100644 index 32f6b8a68..000000000 --- a/internal/dwn/wasm/main.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package main - -import ( - "encoding/json" - "os" - - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/ctx" - "github.com/onsonr/sonr/internal/dwn/fetch" - dwngen "github.com/onsonr/sonr/internal/dwn/gen" - "github.com/onsonr/sonr/pkg/workers/routes" -) - -const FileNameConfigJSON = "dwn.json" - -var config *dwngen.Config - -func main() { - // Load dwn config - if err := loadDwnConfig(); err != nil { - panic(err) - } - - // Setup HTTP server - e := echo.New() - e.Use(ctx.DWNSessionMiddleware(config)) - routes.RegisterWebNodeAPI(e) - routes.RegisterWebNodeViews(e) - fetch.Serve(e) -} - -func loadDwnConfig() error { - // Read dwn.json config - dwnBz, err := os.ReadFile(FileNameConfigJSON) - if err != nil { - return err - } - dwnConfig := new(dwngen.Config) - err = json.Unmarshal(dwnBz, dwnConfig) - if err != nil { - return err - } - config = dwnConfig - return nil -} diff --git a/internal/orm/transactions/Msg.pkl.go b/internal/orm/transactions/Msg.pkl.go deleted file mode 100644 index fe8ffcc9a..000000000 --- a/internal/orm/transactions/Msg.pkl.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -type Msg interface { - GetTypeUrl() string -} diff --git a/internal/orm/transactions/MsgDidAllocateVault.pkl.go b/internal/orm/transactions/MsgDidAllocateVault.pkl.go deleted file mode 100644 index 0e691f461..000000000 --- a/internal/orm/transactions/MsgDidAllocateVault.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidAllocateVault interface { - Msg - - GetAuthority() string - - GetSubject() string - - GetToken() *pkl.Object -} - -var _ MsgDidAllocateVault = (*MsgDidAllocateVaultImpl)(nil) - -type MsgDidAllocateVaultImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Authority string `pkl:"authority"` - - Subject string `pkl:"subject"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidAllocateVaultImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidAllocateVaultImpl) GetAuthority() string { - return rcv.Authority -} - -func (rcv *MsgDidAllocateVaultImpl) GetSubject() string { - return rcv.Subject -} - -func (rcv *MsgDidAllocateVaultImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidAuthorize.pkl.go b/internal/orm/transactions/MsgDidAuthorize.pkl.go deleted file mode 100644 index b12fc046d..000000000 --- a/internal/orm/transactions/MsgDidAuthorize.pkl.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidAuthorize interface { - Msg - - GetAuthority() string - - GetController() string - - GetAddress() string - - GetOrigin() string - - GetToken() *pkl.Object -} - -var _ MsgDidAuthorize = (*MsgDidAuthorizeImpl)(nil) - -type MsgDidAuthorizeImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Authority string `pkl:"authority"` - - Controller string `pkl:"controller"` - - Address string `pkl:"address"` - - Origin string `pkl:"origin"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidAuthorizeImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidAuthorizeImpl) GetAuthority() string { - return rcv.Authority -} - -func (rcv *MsgDidAuthorizeImpl) GetController() string { - return rcv.Controller -} - -func (rcv *MsgDidAuthorizeImpl) GetAddress() string { - return rcv.Address -} - -func (rcv *MsgDidAuthorizeImpl) GetOrigin() string { - return rcv.Origin -} - -func (rcv *MsgDidAuthorizeImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidProveWitness.pkl.go b/internal/orm/transactions/MsgDidProveWitness.pkl.go deleted file mode 100644 index 8bb849194..000000000 --- a/internal/orm/transactions/MsgDidProveWitness.pkl.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidProveWitness interface { - Msg - - GetAuthority() string - - GetProperty() string - - GetWitness() []int - - GetToken() *pkl.Object -} - -var _ MsgDidProveWitness = (*MsgDidProveWitnessImpl)(nil) - -type MsgDidProveWitnessImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Authority string `pkl:"authority"` - - Property string `pkl:"property"` - - Witness []int `pkl:"witness"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidProveWitnessImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidProveWitnessImpl) GetAuthority() string { - return rcv.Authority -} - -func (rcv *MsgDidProveWitnessImpl) GetProperty() string { - return rcv.Property -} - -func (rcv *MsgDidProveWitnessImpl) GetWitness() []int { - return rcv.Witness -} - -func (rcv *MsgDidProveWitnessImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidRegisterController.pkl.go b/internal/orm/transactions/MsgDidRegisterController.pkl.go deleted file mode 100644 index 99907f455..000000000 --- a/internal/orm/transactions/MsgDidRegisterController.pkl.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidRegisterController interface { - Msg - - GetAuthority() string - - GetCid() string - - GetOrigin() string - - GetAuthentication() []*pkl.Object - - GetToken() *pkl.Object -} - -var _ MsgDidRegisterController = (*MsgDidRegisterControllerImpl)(nil) - -type MsgDidRegisterControllerImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Authority string `pkl:"authority"` - - Cid string `pkl:"cid"` - - Origin string `pkl:"origin"` - - Authentication []*pkl.Object `pkl:"authentication"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidRegisterControllerImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidRegisterControllerImpl) GetAuthority() string { - return rcv.Authority -} - -func (rcv *MsgDidRegisterControllerImpl) GetCid() string { - return rcv.Cid -} - -func (rcv *MsgDidRegisterControllerImpl) GetOrigin() string { - return rcv.Origin -} - -func (rcv *MsgDidRegisterControllerImpl) GetAuthentication() []*pkl.Object { - return rcv.Authentication -} - -func (rcv *MsgDidRegisterControllerImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidRegisterService.pkl.go b/internal/orm/transactions/MsgDidRegisterService.pkl.go deleted file mode 100644 index d234865da..000000000 --- a/internal/orm/transactions/MsgDidRegisterService.pkl.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidRegisterService interface { - Msg - - GetController() string - - GetOriginUri() string - - GetScopes() *pkl.Object - - GetDescription() string - - GetServiceEndpoints() map[string]string - - GetMetadata() *pkl.Object - - GetToken() *pkl.Object -} - -var _ MsgDidRegisterService = (*MsgDidRegisterServiceImpl)(nil) - -type MsgDidRegisterServiceImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Controller string `pkl:"controller"` - - OriginUri string `pkl:"originUri"` - - Scopes *pkl.Object `pkl:"scopes"` - - Description string `pkl:"description"` - - ServiceEndpoints map[string]string `pkl:"serviceEndpoints"` - - Metadata *pkl.Object `pkl:"metadata"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidRegisterServiceImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidRegisterServiceImpl) GetController() string { - return rcv.Controller -} - -func (rcv *MsgDidRegisterServiceImpl) GetOriginUri() string { - return rcv.OriginUri -} - -func (rcv *MsgDidRegisterServiceImpl) GetScopes() *pkl.Object { - return rcv.Scopes -} - -func (rcv *MsgDidRegisterServiceImpl) GetDescription() string { - return rcv.Description -} - -func (rcv *MsgDidRegisterServiceImpl) GetServiceEndpoints() map[string]string { - return rcv.ServiceEndpoints -} - -func (rcv *MsgDidRegisterServiceImpl) GetMetadata() *pkl.Object { - return rcv.Metadata -} - -func (rcv *MsgDidRegisterServiceImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidSyncVault.pkl.go b/internal/orm/transactions/MsgDidSyncVault.pkl.go deleted file mode 100644 index c4de4ba64..000000000 --- a/internal/orm/transactions/MsgDidSyncVault.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidSyncVault interface { - Msg - - GetController() string - - GetToken() *pkl.Object -} - -var _ MsgDidSyncVault = (*MsgDidSyncVaultImpl)(nil) - -type MsgDidSyncVaultImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Controller string `pkl:"controller"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidSyncVaultImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidSyncVaultImpl) GetController() string { - return rcv.Controller -} - -func (rcv *MsgDidSyncVaultImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgDidUpdateParams.pkl.go b/internal/orm/transactions/MsgDidUpdateParams.pkl.go deleted file mode 100644 index a3e227ab8..000000000 --- a/internal/orm/transactions/MsgDidUpdateParams.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgDidUpdateParams interface { - Msg - - GetAuthority() string - - GetParams() *pkl.Object - - GetToken() *pkl.Object -} - -var _ MsgDidUpdateParams = (*MsgDidUpdateParamsImpl)(nil) - -type MsgDidUpdateParamsImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Authority string `pkl:"authority"` - - Params *pkl.Object `pkl:"params"` - - Token *pkl.Object `pkl:"token"` -} - -// The type URL for the message -func (rcv *MsgDidUpdateParamsImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgDidUpdateParamsImpl) GetAuthority() string { - return rcv.Authority -} - -func (rcv *MsgDidUpdateParamsImpl) GetParams() *pkl.Object { - return rcv.Params -} - -func (rcv *MsgDidUpdateParamsImpl) GetToken() *pkl.Object { - return rcv.Token -} diff --git a/internal/orm/transactions/MsgGovDeposit.pkl.go b/internal/orm/transactions/MsgGovDeposit.pkl.go deleted file mode 100644 index 556d1df7f..000000000 --- a/internal/orm/transactions/MsgGovDeposit.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgGovDeposit interface { - Msg - - GetProposalId() int - - GetDepositor() string - - GetAmount() []*pkl.Object -} - -var _ MsgGovDeposit = (*MsgGovDepositImpl)(nil) - -type MsgGovDepositImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - ProposalId int `pkl:"proposalId"` - - Depositor string `pkl:"depositor"` - - Amount []*pkl.Object `pkl:"amount"` -} - -// The type URL for the message -func (rcv *MsgGovDepositImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGovDepositImpl) GetProposalId() int { - return rcv.ProposalId -} - -func (rcv *MsgGovDepositImpl) GetDepositor() string { - return rcv.Depositor -} - -func (rcv *MsgGovDepositImpl) GetAmount() []*pkl.Object { - return rcv.Amount -} diff --git a/internal/orm/transactions/MsgGovSubmitProposal.pkl.go b/internal/orm/transactions/MsgGovSubmitProposal.pkl.go deleted file mode 100644 index c33b589b6..000000000 --- a/internal/orm/transactions/MsgGovSubmitProposal.pkl.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgGovSubmitProposal interface { - Msg - - GetContent() *Proposal - - GetInitialDeposit() []*pkl.Object - - GetProposer() string -} - -var _ MsgGovSubmitProposal = (*MsgGovSubmitProposalImpl)(nil) - -// Gov module messages -type MsgGovSubmitProposalImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Content *Proposal `pkl:"content"` - - InitialDeposit []*pkl.Object `pkl:"initialDeposit"` - - Proposer string `pkl:"proposer"` -} - -// The type URL for the message -func (rcv *MsgGovSubmitProposalImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGovSubmitProposalImpl) GetContent() *Proposal { - return rcv.Content -} - -func (rcv *MsgGovSubmitProposalImpl) GetInitialDeposit() []*pkl.Object { - return rcv.InitialDeposit -} - -func (rcv *MsgGovSubmitProposalImpl) GetProposer() string { - return rcv.Proposer -} diff --git a/internal/orm/transactions/MsgGovVote.pkl.go b/internal/orm/transactions/MsgGovVote.pkl.go deleted file mode 100644 index 303cf1eee..000000000 --- a/internal/orm/transactions/MsgGovVote.pkl.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -type MsgGovVote interface { - Msg - - GetProposalId() int - - GetVoter() string - - GetOption() int -} - -var _ MsgGovVote = (*MsgGovVoteImpl)(nil) - -type MsgGovVoteImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - ProposalId int `pkl:"proposalId"` - - Voter string `pkl:"voter"` - - Option int `pkl:"option"` -} - -// The type URL for the message -func (rcv *MsgGovVoteImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGovVoteImpl) GetProposalId() int { - return rcv.ProposalId -} - -func (rcv *MsgGovVoteImpl) GetVoter() string { - return rcv.Voter -} - -func (rcv *MsgGovVoteImpl) GetOption() int { - return rcv.Option -} diff --git a/internal/orm/transactions/MsgGroupCreateGroup.pkl.go b/internal/orm/transactions/MsgGroupCreateGroup.pkl.go deleted file mode 100644 index c5dafd6bd..000000000 --- a/internal/orm/transactions/MsgGroupCreateGroup.pkl.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgGroupCreateGroup interface { - Msg - - GetAdmin() string - - GetMembers() []*pkl.Object - - GetMetadata() string -} - -var _ MsgGroupCreateGroup = (*MsgGroupCreateGroupImpl)(nil) - -// Group module messages -type MsgGroupCreateGroupImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Admin string `pkl:"admin"` - - Members []*pkl.Object `pkl:"members"` - - Metadata string `pkl:"metadata"` -} - -// The type URL for the message -func (rcv *MsgGroupCreateGroupImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGroupCreateGroupImpl) GetAdmin() string { - return rcv.Admin -} - -func (rcv *MsgGroupCreateGroupImpl) GetMembers() []*pkl.Object { - return rcv.Members -} - -func (rcv *MsgGroupCreateGroupImpl) GetMetadata() string { - return rcv.Metadata -} diff --git a/internal/orm/transactions/MsgGroupSubmitProposal.pkl.go b/internal/orm/transactions/MsgGroupSubmitProposal.pkl.go deleted file mode 100644 index c23f15391..000000000 --- a/internal/orm/transactions/MsgGroupSubmitProposal.pkl.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgGroupSubmitProposal interface { - Msg - - GetGroupPolicyAddress() string - - GetProposers() []string - - GetMetadata() string - - GetMessages() []*pkl.Object - - GetExec() int -} - -var _ MsgGroupSubmitProposal = (*MsgGroupSubmitProposalImpl)(nil) - -type MsgGroupSubmitProposalImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - GroupPolicyAddress string `pkl:"groupPolicyAddress"` - - Proposers []string `pkl:"proposers"` - - Metadata string `pkl:"metadata"` - - Messages []*pkl.Object `pkl:"messages"` - - Exec int `pkl:"exec"` -} - -// The type URL for the message -func (rcv *MsgGroupSubmitProposalImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGroupSubmitProposalImpl) GetGroupPolicyAddress() string { - return rcv.GroupPolicyAddress -} - -func (rcv *MsgGroupSubmitProposalImpl) GetProposers() []string { - return rcv.Proposers -} - -func (rcv *MsgGroupSubmitProposalImpl) GetMetadata() string { - return rcv.Metadata -} - -func (rcv *MsgGroupSubmitProposalImpl) GetMessages() []*pkl.Object { - return rcv.Messages -} - -func (rcv *MsgGroupSubmitProposalImpl) GetExec() int { - return rcv.Exec -} diff --git a/internal/orm/transactions/MsgGroupVote.pkl.go b/internal/orm/transactions/MsgGroupVote.pkl.go deleted file mode 100644 index a79ce6899..000000000 --- a/internal/orm/transactions/MsgGroupVote.pkl.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -type MsgGroupVote interface { - Msg - - GetProposalId() int - - GetVoter() string - - GetOption() int - - GetMetadata() string - - GetExec() int -} - -var _ MsgGroupVote = (*MsgGroupVoteImpl)(nil) - -type MsgGroupVoteImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - ProposalId int `pkl:"proposalId"` - - Voter string `pkl:"voter"` - - Option int `pkl:"option"` - - Metadata string `pkl:"metadata"` - - Exec int `pkl:"exec"` -} - -// The type URL for the message -func (rcv *MsgGroupVoteImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgGroupVoteImpl) GetProposalId() int { - return rcv.ProposalId -} - -func (rcv *MsgGroupVoteImpl) GetVoter() string { - return rcv.Voter -} - -func (rcv *MsgGroupVoteImpl) GetOption() int { - return rcv.Option -} - -func (rcv *MsgGroupVoteImpl) GetMetadata() string { - return rcv.Metadata -} - -func (rcv *MsgGroupVoteImpl) GetExec() int { - return rcv.Exec -} diff --git a/internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go b/internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go deleted file mode 100644 index 44a019af4..000000000 --- a/internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgStakingBeginRedelegate interface { - Msg - - GetDelegatorAddress() string - - GetValidatorSrcAddress() string - - GetValidatorDstAddress() string - - GetAmount() *pkl.Object -} - -var _ MsgStakingBeginRedelegate = (*MsgStakingBeginRedelegateImpl)(nil) - -type MsgStakingBeginRedelegateImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - DelegatorAddress string `pkl:"delegatorAddress"` - - ValidatorSrcAddress string `pkl:"validatorSrcAddress"` - - ValidatorDstAddress string `pkl:"validatorDstAddress"` - - Amount *pkl.Object `pkl:"amount"` -} - -// The type URL for the message -func (rcv *MsgStakingBeginRedelegateImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgStakingBeginRedelegateImpl) GetDelegatorAddress() string { - return rcv.DelegatorAddress -} - -func (rcv *MsgStakingBeginRedelegateImpl) GetValidatorSrcAddress() string { - return rcv.ValidatorSrcAddress -} - -func (rcv *MsgStakingBeginRedelegateImpl) GetValidatorDstAddress() string { - return rcv.ValidatorDstAddress -} - -func (rcv *MsgStakingBeginRedelegateImpl) GetAmount() *pkl.Object { - return rcv.Amount -} diff --git a/internal/orm/transactions/MsgStakingCreateValidator.pkl.go b/internal/orm/transactions/MsgStakingCreateValidator.pkl.go deleted file mode 100644 index d904a71c6..000000000 --- a/internal/orm/transactions/MsgStakingCreateValidator.pkl.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgStakingCreateValidator interface { - Msg - - GetDescription() *pkl.Object - - GetCommission() *pkl.Object - - GetMinSelfDelegation() string - - GetDelegatorAddress() string - - GetValidatorAddress() string - - GetPubkey() *pkl.Object - - GetValue() *pkl.Object -} - -var _ MsgStakingCreateValidator = (*MsgStakingCreateValidatorImpl)(nil) - -// Staking module messages -type MsgStakingCreateValidatorImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - Description *pkl.Object `pkl:"description"` - - Commission *pkl.Object `pkl:"commission"` - - MinSelfDelegation string `pkl:"minSelfDelegation"` - - DelegatorAddress string `pkl:"delegatorAddress"` - - ValidatorAddress string `pkl:"validatorAddress"` - - Pubkey *pkl.Object `pkl:"pubkey"` - - Value *pkl.Object `pkl:"value"` -} - -// The type URL for the message -func (rcv *MsgStakingCreateValidatorImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgStakingCreateValidatorImpl) GetDescription() *pkl.Object { - return rcv.Description -} - -func (rcv *MsgStakingCreateValidatorImpl) GetCommission() *pkl.Object { - return rcv.Commission -} - -func (rcv *MsgStakingCreateValidatorImpl) GetMinSelfDelegation() string { - return rcv.MinSelfDelegation -} - -func (rcv *MsgStakingCreateValidatorImpl) GetDelegatorAddress() string { - return rcv.DelegatorAddress -} - -func (rcv *MsgStakingCreateValidatorImpl) GetValidatorAddress() string { - return rcv.ValidatorAddress -} - -func (rcv *MsgStakingCreateValidatorImpl) GetPubkey() *pkl.Object { - return rcv.Pubkey -} - -func (rcv *MsgStakingCreateValidatorImpl) GetValue() *pkl.Object { - return rcv.Value -} diff --git a/internal/orm/transactions/MsgStakingDelegate.pkl.go b/internal/orm/transactions/MsgStakingDelegate.pkl.go deleted file mode 100644 index 9dd6fa824..000000000 --- a/internal/orm/transactions/MsgStakingDelegate.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgStakingDelegate interface { - Msg - - GetDelegatorAddress() string - - GetValidatorAddress() string - - GetAmount() *pkl.Object -} - -var _ MsgStakingDelegate = (*MsgStakingDelegateImpl)(nil) - -type MsgStakingDelegateImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - DelegatorAddress string `pkl:"delegatorAddress"` - - ValidatorAddress string `pkl:"validatorAddress"` - - Amount *pkl.Object `pkl:"amount"` -} - -// The type URL for the message -func (rcv *MsgStakingDelegateImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgStakingDelegateImpl) GetDelegatorAddress() string { - return rcv.DelegatorAddress -} - -func (rcv *MsgStakingDelegateImpl) GetValidatorAddress() string { - return rcv.ValidatorAddress -} - -func (rcv *MsgStakingDelegateImpl) GetAmount() *pkl.Object { - return rcv.Amount -} diff --git a/internal/orm/transactions/MsgStakingUndelegate.pkl.go b/internal/orm/transactions/MsgStakingUndelegate.pkl.go deleted file mode 100644 index ffc2395e6..000000000 --- a/internal/orm/transactions/MsgStakingUndelegate.pkl.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -type MsgStakingUndelegate interface { - Msg - - GetDelegatorAddress() string - - GetValidatorAddress() string - - GetAmount() *pkl.Object -} - -var _ MsgStakingUndelegate = (*MsgStakingUndelegateImpl)(nil) - -type MsgStakingUndelegateImpl struct { - // The type URL for the message - TypeUrl string `pkl:"typeUrl"` - - DelegatorAddress string `pkl:"delegatorAddress"` - - ValidatorAddress string `pkl:"validatorAddress"` - - Amount *pkl.Object `pkl:"amount"` -} - -// The type URL for the message -func (rcv *MsgStakingUndelegateImpl) GetTypeUrl() string { - return rcv.TypeUrl -} - -func (rcv *MsgStakingUndelegateImpl) GetDelegatorAddress() string { - return rcv.DelegatorAddress -} - -func (rcv *MsgStakingUndelegateImpl) GetValidatorAddress() string { - return rcv.ValidatorAddress -} - -func (rcv *MsgStakingUndelegateImpl) GetAmount() *pkl.Object { - return rcv.Amount -} diff --git a/internal/orm/transactions/Proposal.pkl.go b/internal/orm/transactions/Proposal.pkl.go deleted file mode 100644 index 4a3e8bd62..000000000 --- a/internal/orm/transactions/Proposal.pkl.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -// Base class for all proposals -type Proposal struct { - // The title of the proposal - Title string `pkl:"title"` - - // The description of the proposal - Description string `pkl:"description"` -} diff --git a/internal/orm/transactions/Transactions.pkl.go b/internal/orm/transactions/Transactions.pkl.go deleted file mode 100644 index 5a551b8c4..000000000 --- a/internal/orm/transactions/Transactions.pkl.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import ( - "context" - - "github.com/apple/pkl-go/pkl" -) - -type Transactions 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) { - 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 Transactions -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Transactions, error) { - var ret Transactions - if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { - return nil, err - } - return &ret, nil -} diff --git a/internal/orm/transactions/TxBody.pkl.go b/internal/orm/transactions/TxBody.pkl.go deleted file mode 100644 index 8a8c23263..000000000 --- a/internal/orm/transactions/TxBody.pkl.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -import "github.com/apple/pkl-go/pkl" - -// Represents a transaction body -type TxBody struct { - Messages []Msg `pkl:"messages"` - - Memo *string `pkl:"memo"` - - TimeoutHeight *int `pkl:"timeoutHeight"` - - ExtensionOptions *[]*pkl.Object `pkl:"extensionOptions"` - - NonCriticalExtensionOptions *[]*pkl.Object `pkl:"nonCriticalExtensionOptions"` -} diff --git a/internal/orm/transactions/init.pkl.go b/internal/orm/transactions/init.pkl.go deleted file mode 100644 index 211bc2e21..000000000 --- a/internal/orm/transactions/init.pkl.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated from Pkl module `transactions`. DO NOT EDIT. -package transactions - -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/pkg/common/README.md b/pkg/common/README.md new file mode 100644 index 000000000..019b25ff1 --- /dev/null +++ b/pkg/common/README.md @@ -0,0 +1 @@ +# Common diff --git a/internal/ctx/cookies.go b/pkg/common/ctx/cookies.go similarity index 100% rename from internal/ctx/cookies.go rename to pkg/common/ctx/cookies.go diff --git a/internal/ctx/ctx_dwn.go b/pkg/common/ctx/ctx_dwn.go similarity index 92% rename from internal/ctx/ctx_dwn.go rename to pkg/common/ctx/ctx_dwn.go index 41556f555..a616ff1da 100644 --- a/internal/ctx/ctx_dwn.go +++ b/pkg/common/ctx/ctx_dwn.go @@ -5,7 +5,8 @@ import ( "net/http" "github.com/labstack/echo/v4" - dwngen "github.com/onsonr/sonr/internal/dwn/gen" + + "github.com/onsonr/sonr/pkg/motr/config" ) // ╭───────────────────────────────────────────────────────────╮ @@ -51,12 +52,12 @@ func (s *DWNContext) ChainID() string { } // Schema returns the vault schema from the cookies. -func (s *DWNContext) Schema() *dwngen.Schema { +func (s *DWNContext) Schema() *config.Schema { v, err := ReadCookie(s.Context, CookieKeyVaultSchema) if err != nil { return nil } - var schema dwngen.Schema + var schema config.Schema err = json.Unmarshal([]byte(v), &schema) if err != nil { return nil @@ -74,7 +75,7 @@ func GetDWNContext(c echo.Context) (*DWNContext, error) { } // HighwaySessionMiddleware establishes a Session Cookie. -func DWNSessionMiddleware(config *dwngen.Config) echo.MiddlewareFunc { +func DWNSessionMiddleware(config *config.Config) echo.MiddlewareFunc { return func(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { sessionID := GetSessionID(c) diff --git a/internal/ctx/ctx_hway.go b/pkg/common/ctx/ctx_hway.go similarity index 100% rename from internal/ctx/ctx_hway.go rename to pkg/common/ctx/ctx_hway.go diff --git a/internal/ctx/headers.go b/pkg/common/ctx/headers.go similarity index 94% rename from internal/ctx/headers.go rename to pkg/common/ctx/headers.go index 26258e138..004b52252 100644 --- a/internal/ctx/headers.go +++ b/pkg/common/ctx/headers.go @@ -4,7 +4,8 @@ import ( "encoding/json" "github.com/labstack/echo/v4" - dwngen "github.com/onsonr/sonr/internal/dwn/gen" + + dwngen "github.com/onsonr/sonr/pkg/motr/config" ) type HeaderKey string diff --git a/internal/ctx/request.go b/pkg/common/ctx/request.go similarity index 100% rename from internal/ctx/request.go rename to pkg/common/ctx/request.go diff --git a/internal/ctx/response.go b/pkg/common/ctx/response.go similarity index 100% rename from internal/ctx/response.go rename to pkg/common/ctx/response.go diff --git a/internal/ctx/utils.go b/pkg/common/ctx/utils.go similarity index 100% rename from internal/ctx/utils.go rename to pkg/common/ctx/utils.go diff --git a/pkg/common/types/ipfs.pb.go b/pkg/common/types/ipfs.pb.go new file mode 100644 index 000000000..ca688b554 --- /dev/null +++ b/pkg/common/types/ipfs.pb.go @@ -0,0 +1,64 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: common/v1/ipfs.proto + +package commonv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_common_v1_ipfs_proto protoreflect.FileDescriptor + +var file_common_v1_ipfs_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x70, 0x66, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_common_v1_ipfs_proto_goTypes = []interface{}{} +var file_common_v1_ipfs_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_common_v1_ipfs_proto_init() } +func file_common_v1_ipfs_proto_init() { + if File_common_v1_ipfs_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_v1_ipfs_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_v1_ipfs_proto_goTypes, + DependencyIndexes: file_common_v1_ipfs_proto_depIdxs, + }.Build() + File_common_v1_ipfs_proto = out.File + file_common_v1_ipfs_proto_rawDesc = nil + file_common_v1_ipfs_proto_goTypes = nil + file_common_v1_ipfs_proto_depIdxs = nil +} diff --git a/pkg/common/types/keys.pb.go b/pkg/common/types/keys.pb.go new file mode 100644 index 000000000..f0c0237fc --- /dev/null +++ b/pkg/common/types/keys.pb.go @@ -0,0 +1,377 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: common/v1/keys.proto + +package commonv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// PubKey defines a public key for a did +type PubKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` + RawKey *RawKey `protobuf:"bytes,3,opt,name=raw_key,json=rawKey,proto3" json:"raw_key,omitempty"` + Jwk *JSONWebKey `protobuf:"bytes,4,opt,name=jwk,proto3" json:"jwk,omitempty"` +} + +func (x *PubKey) Reset() { + *x = PubKey{} + if protoimpl.UnsafeEnabled { + mi := &file_common_v1_keys_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PubKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PubKey) ProtoMessage() {} + +func (x *PubKey) ProtoReflect() protoreflect.Message { + mi := &file_common_v1_keys_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PubKey.ProtoReflect.Descriptor instead. +func (*PubKey) Descriptor() ([]byte, []int) { + return file_common_v1_keys_proto_rawDescGZIP(), []int{0} +} + +func (x *PubKey) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *PubKey) GetKeyType() string { + if x != nil { + return x.KeyType + } + return "" +} + +func (x *PubKey) GetRawKey() *RawKey { + if x != nil { + return x.RawKey + } + return nil +} + +func (x *PubKey) GetJwk() *JSONWebKey { + if x != nil { + return x.Jwk + } + return nil +} + +// JWK represents a JSON Web Key +type JSONWebKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"` // Key Type + Crv string `protobuf:"bytes,2,opt,name=crv,proto3" json:"crv,omitempty"` // Curve (for EC and OKP keys) + X string `protobuf:"bytes,3,opt,name=x,proto3" json:"x,omitempty"` // X coordinate (for EC and OKP keys) + Y string `protobuf:"bytes,4,opt,name=y,proto3" json:"y,omitempty"` // Y coordinate (for EC keys) + N string `protobuf:"bytes,5,opt,name=n,proto3" json:"n,omitempty"` // Modulus (for RSA keys) + E string `protobuf:"bytes,6,opt,name=e,proto3" json:"e,omitempty"` // Exponent (for RSA keys) +} + +func (x *JSONWebKey) Reset() { + *x = JSONWebKey{} + if protoimpl.UnsafeEnabled { + mi := &file_common_v1_keys_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JSONWebKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JSONWebKey) ProtoMessage() {} + +func (x *JSONWebKey) ProtoReflect() protoreflect.Message { + mi := &file_common_v1_keys_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) +} + +// Deprecated: Use JSONWebKey.ProtoReflect.Descriptor instead. +func (*JSONWebKey) Descriptor() ([]byte, []int) { + return file_common_v1_keys_proto_rawDescGZIP(), []int{1} +} + +func (x *JSONWebKey) GetKty() string { + if x != nil { + return x.Kty + } + return "" +} + +func (x *JSONWebKey) GetCrv() string { + if x != nil { + return x.Crv + } + return "" +} + +func (x *JSONWebKey) GetX() string { + if x != nil { + return x.X + } + return "" +} + +func (x *JSONWebKey) GetY() string { + if x != nil { + return x.Y + } + return "" +} + +func (x *JSONWebKey) GetN() string { + if x != nil { + return x.N + } + return "" +} + +func (x *JSONWebKey) GetE() string { + if x != nil { + return x.E + } + return "" +} + +type RawKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Algorithm string `protobuf:"bytes,1,opt,name=algorithm,proto3" json:"algorithm,omitempty"` + Encoding string `protobuf:"bytes,2,opt,name=encoding,proto3" json:"encoding,omitempty"` + Curve string `protobuf:"bytes,3,opt,name=curve,proto3" json:"curve,omitempty"` + Key []byte `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *RawKey) Reset() { + *x = RawKey{} + if protoimpl.UnsafeEnabled { + mi := &file_common_v1_keys_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RawKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RawKey) ProtoMessage() {} + +func (x *RawKey) ProtoReflect() protoreflect.Message { + mi := &file_common_v1_keys_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) +} + +// Deprecated: Use RawKey.ProtoReflect.Descriptor instead. +func (*RawKey) Descriptor() ([]byte, []int) { + return file_common_v1_keys_proto_rawDescGZIP(), []int{2} +} + +func (x *RawKey) GetAlgorithm() string { + if x != nil { + return x.Algorithm + } + return "" +} + +func (x *RawKey) GetEncoding() string { + if x != nil { + return x.Encoding + } + return "" +} + +func (x *RawKey) GetCurve() string { + if x != nil { + return x.Curve + } + return "" +} + +func (x *RawKey) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +var File_common_v1_keys_proto protoreflect.FileDescriptor + +var file_common_v1_keys_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x65, 0x79, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x22, 0x8c, 0x01, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x72, + 0x61, 0x77, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x4b, 0x65, 0x79, 0x52, + 0x06, 0x72, 0x61, 0x77, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x57, 0x65, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6a, 0x77, 0x6b, + 0x22, 0x68, 0x0a, 0x0a, 0x4a, 0x53, 0x4f, 0x4e, 0x57, 0x65, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x74, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, + 0x72, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, + 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x79, 0x12, 0x0c, + 0x0a, 0x01, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6e, 0x12, 0x0c, 0x0a, 0x01, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, 0x6a, 0x0a, 0x06, 0x52, 0x61, + 0x77, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, + 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x14, + 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, + 0x75, 0x72, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_common_v1_keys_proto_rawDescOnce sync.Once + file_common_v1_keys_proto_rawDescData = file_common_v1_keys_proto_rawDesc +) + +func file_common_v1_keys_proto_rawDescGZIP() []byte { + file_common_v1_keys_proto_rawDescOnce.Do(func() { + file_common_v1_keys_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_v1_keys_proto_rawDescData) + }) + return file_common_v1_keys_proto_rawDescData +} + +var file_common_v1_keys_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_common_v1_keys_proto_goTypes = []interface{}{ + (*PubKey)(nil), // 0: common.v1.PubKey + (*JSONWebKey)(nil), // 1: common.v1.JSONWebKey + (*RawKey)(nil), // 2: common.v1.RawKey +} +var file_common_v1_keys_proto_depIdxs = []int32{ + 2, // 0: common.v1.PubKey.raw_key:type_name -> common.v1.RawKey + 1, // 1: common.v1.PubKey.jwk:type_name -> common.v1.JSONWebKey + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_common_v1_keys_proto_init() } +func file_common_v1_keys_proto_init() { + if File_common_v1_keys_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_v1_keys_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PubKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_v1_keys_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JSONWebKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_v1_keys_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RawKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_v1_keys_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_v1_keys_proto_goTypes, + DependencyIndexes: file_common_v1_keys_proto_depIdxs, + MessageInfos: file_common_v1_keys_proto_msgTypes, + }.Build() + File_common_v1_keys_proto = out.File + file_common_v1_keys_proto_rawDesc = nil + file_common_v1_keys_proto_goTypes = nil + file_common_v1_keys_proto_depIdxs = nil +} diff --git a/pkg/common/types/uri.pb.go b/pkg/common/types/uri.pb.go new file mode 100644 index 000000000..c73ea70ec --- /dev/null +++ b/pkg/common/types/uri.pb.go @@ -0,0 +1,215 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: common/v1/uri.proto + +package commonv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type URI_URIProtocol int32 + +const ( + URI_HTTPS URI_URIProtocol = 0 + URI_IPFS URI_URIProtocol = 1 + URI_IPNS URI_URIProtocol = 2 + URI_DID URI_URIProtocol = 3 +) + +// Enum value maps for URI_URIProtocol. +var ( + URI_URIProtocol_name = map[int32]string{ + 0: "HTTPS", + 1: "IPFS", + 2: "IPNS", + 3: "DID", + } + URI_URIProtocol_value = map[string]int32{ + "HTTPS": 0, + "IPFS": 1, + "IPNS": 2, + "DID": 3, + } +) + +func (x URI_URIProtocol) Enum() *URI_URIProtocol { + p := new(URI_URIProtocol) + *p = x + return p +} + +func (x URI_URIProtocol) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (URI_URIProtocol) Descriptor() protoreflect.EnumDescriptor { + return file_common_v1_uri_proto_enumTypes[0].Descriptor() +} + +func (URI_URIProtocol) Type() protoreflect.EnumType { + return &file_common_v1_uri_proto_enumTypes[0] +} + +func (x URI_URIProtocol) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use URI_URIProtocol.Descriptor instead. +func (URI_URIProtocol) EnumDescriptor() ([]byte, []int) { + return file_common_v1_uri_proto_rawDescGZIP(), []int{0, 0} +} + +type URI struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Protocol URI_URIProtocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=common.v1.URI_URIProtocol" json:"protocol,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *URI) Reset() { + *x = URI{} + if protoimpl.UnsafeEnabled { + mi := &file_common_v1_uri_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *URI) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*URI) ProtoMessage() {} + +func (x *URI) ProtoReflect() protoreflect.Message { + mi := &file_common_v1_uri_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use URI.ProtoReflect.Descriptor instead. +func (*URI) Descriptor() ([]byte, []int) { + return file_common_v1_uri_proto_rawDescGZIP(), []int{0} +} + +func (x *URI) GetProtocol() URI_URIProtocol { + if x != nil { + return x.Protocol + } + return URI_HTTPS +} + +func (x *URI) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_common_v1_uri_proto protoreflect.FileDescriptor + +var file_common_v1_uri_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x72, 0x69, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x22, 0x8a, 0x01, 0x0a, 0x03, 0x55, 0x52, 0x49, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x52, 0x49, 0x2e, 0x55, 0x52, 0x49, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x35, 0x0a, 0x0b, 0x55, 0x52, 0x49, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x48, 0x54, 0x54, 0x50, 0x53, 0x10, 0x00, + 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, 0x46, 0x53, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x50, + 0x4e, 0x53, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x49, 0x44, 0x10, 0x03, 0x42, 0x32, 0x5a, + 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, + 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_v1_uri_proto_rawDescOnce sync.Once + file_common_v1_uri_proto_rawDescData = file_common_v1_uri_proto_rawDesc +) + +func file_common_v1_uri_proto_rawDescGZIP() []byte { + file_common_v1_uri_proto_rawDescOnce.Do(func() { + file_common_v1_uri_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_v1_uri_proto_rawDescData) + }) + return file_common_v1_uri_proto_rawDescData +} + +var file_common_v1_uri_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_common_v1_uri_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_v1_uri_proto_goTypes = []interface{}{ + (URI_URIProtocol)(0), // 0: common.v1.URI.URIProtocol + (*URI)(nil), // 1: common.v1.URI +} +var file_common_v1_uri_proto_depIdxs = []int32{ + 0, // 0: common.v1.URI.protocol:type_name -> common.v1.URI.URIProtocol + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_common_v1_uri_proto_init() } +func file_common_v1_uri_proto_init() { + if File_common_v1_uri_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_v1_uri_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*URI); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_v1_uri_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_v1_uri_proto_goTypes, + DependencyIndexes: file_common_v1_uri_proto_depIdxs, + EnumInfos: file_common_v1_uri_proto_enumTypes, + MessageInfos: file_common_v1_uri_proto_msgTypes, + }.Build() + File_common_v1_uri_proto = out.File + file_common_v1_uri_proto_rawDesc = nil + file_common_v1_uri_proto_goTypes = nil + file_common_v1_uri_proto_depIdxs = nil +} diff --git a/pkg/core/README.md b/pkg/core/README.md new file mode 100644 index 000000000..3b616f93d --- /dev/null +++ b/pkg/core/README.md @@ -0,0 +1 @@ +# Core diff --git a/pkg/core/appmodule/environment.go b/pkg/core/appmodule/environment.go new file mode 100644 index 000000000..187daaeca --- /dev/null +++ b/pkg/core/appmodule/environment.go @@ -0,0 +1,30 @@ +package appmodule + +import ( + "cosmossdk.io/core/event" + "cosmossdk.io/core/gas" + "cosmossdk.io/core/header" + "cosmossdk.io/core/store" + + "github.com/onsonr/sonr/pkg/core/branch" + "github.com/onsonr/sonr/pkg/core/log" + "github.com/onsonr/sonr/pkg/core/router" + "github.com/onsonr/sonr/pkg/core/transaction" +) + +// Environment is used to get all services to their respective module. +// Contract: All fields of environment are always populated by runtime. +type Environment struct { + Logger log.Logger + + BranchService branch.Service + EventService event.Service + GasService gas.Service + HeaderService header.Service + QueryRouterService router.Service + MsgRouterService router.Service + TransactionService transaction.Service + + KVStoreService store.KVStoreService + MemStoreService store.MemoryStoreService +} diff --git a/pkg/core/branch/branch.go b/pkg/core/branch/branch.go new file mode 100644 index 000000000..79634cf43 --- /dev/null +++ b/pkg/core/branch/branch.go @@ -0,0 +1,34 @@ +// Package branch contains the core branch service interface. +package branch + +import ( + "context" + "errors" +) + +// ErrGasLimitExceeded is returned when the gas limit is exceeded in a +// Service.ExecuteWithGasLimit call. +var ErrGasLimitExceeded = errors.New("branch: gas limit exceeded") + +// Service is the branch service interface. It can be used to execute +// code paths in an isolated execution context that can be reverted. +// A revert typically means a rollback on events and state changes. +type Service interface { + // Execute executes the given function in an isolated context. If the + // `f` function returns an error, the execution is considered failed, + // and every change made affecting the execution context is rolled back. + // If the function returns nil, the execution is considered successful, and + // committed. + // The context.Context passed to the `f` function is a child of the context + // passed to the Execute function, and is what should be used with other + // core services in order to ensure the execution remains isolated. + Execute(ctx context.Context, f func(ctx context.Context) error) error + // ExecuteWithGasLimit executes the given function `f` in an isolated context, + // with the provided gas limit, this is advanced usage and is used to disallow + // an execution path to consume an indefinite amount of gas. + // If the execution fails or succeeds the gas limit is still applied to the + // parent context, the function returns a gasUsed value which is the amount + // of gas used by the execution path. If the execution path exceeds the gas + // ErrGasLimitExceeded is returned. + ExecuteWithGasLimit(ctx context.Context, gasLimit uint64, f func(ctx context.Context) error) (gasUsed uint64, err error) +} diff --git a/pkg/core/log/logger.go b/pkg/core/log/logger.go new file mode 100644 index 000000000..6065e8173 --- /dev/null +++ b/pkg/core/log/logger.go @@ -0,0 +1,29 @@ +package log + +const ModuleKey = "module" + +// Logger defines basic logger functionality that all previous versions of the Logger interface should +// support. Library users should prefer to use this interface when possible, then type case to Logger +// to see if WithContext is supported. +type Logger interface { + // Info takes a message and a set of key/value pairs and logs with level INFO. + // The key of the tuple must be a string. + Info(msg string, keyVals ...any) + + // Warn takes a message and a set of key/value pairs and logs with level WARN. + // The key of the tuple must be a string. + Warn(msg string, keyVals ...any) + + // Error takes a message and a set of key/value pairs and logs with level ERR. + // The key of the tuple must be a string. + Error(msg string, keyVals ...any) + + // Debug takes a message and a set of key/value pairs and logs with level DEBUG. + // The key of the tuple must be a string. + Debug(msg string, keyVals ...any) + + // Impl returns the underlying logger implementation. + // It is used to access the full functionalities of the underlying logger. + // Advanced users can type cast the returned value to the actual logger. + Impl() any +} diff --git a/pkg/core/router/service.go b/pkg/core/router/service.go new file mode 100644 index 000000000..ead11bfbe --- /dev/null +++ b/pkg/core/router/service.go @@ -0,0 +1,16 @@ +package router + +import ( + "context" + + "github.com/onsonr/sonr/pkg/core/transaction" +) + +// Service is the interface that wraps the basic methods for a router. +// A router can be a query router or a message router. +type Service interface { + // CanInvoke returns an error if the given request cannot be invoked. + CanInvoke(ctx context.Context, typeURL string) error + // Invoke execute a message or query. The response should be type casted by the caller to the expected response. + Invoke(ctx context.Context, req transaction.Msg) (res transaction.Msg, err error) +} diff --git a/pkg/core/transaction/service.go b/pkg/core/transaction/service.go new file mode 100644 index 000000000..57ec9c7be --- /dev/null +++ b/pkg/core/transaction/service.go @@ -0,0 +1,25 @@ +package transaction + +import "context" + +// ExecMode defines the execution mode +type ExecMode uint8 + +// All possible execution modes. +// For backwards compatibility and easier casting, the exec mode values must be the same as in cosmos/cosmos-sdk/types package. +const ( + ExecModeCheck ExecMode = iota + ExecModeReCheck + ExecModeSimulate + _ + _ + _ + _ + ExecModeFinalize +) + +// Service creates a transaction service. +type Service interface { + // ExecMode returns the current execution mode. + ExecMode(ctx context.Context) ExecMode +} diff --git a/pkg/core/transaction/transaction.go b/pkg/core/transaction/transaction.go new file mode 100644 index 000000000..3efd88b5a --- /dev/null +++ b/pkg/core/transaction/transaction.go @@ -0,0 +1,45 @@ +package transaction + +type ( + // Msg uses structural types to define the interface for a message. + Msg = interface { + Reset() + String() string + ProtoMessage() + } + Identity = []byte +) + +// GenericMsg defines a generic version of a Msg. +// The GenericMsg refers to the non pointer version of Msg, +// and is required to allow its instantiations in generic contexts. +type GenericMsg[T any] interface { + *T + Msg +} + +// Codec defines the TX codec, which converts a TX from bytes to its concrete representation. +type Codec[T Tx] interface { + // Decode decodes the tx bytes into a DecodedTx, containing + // both concrete and bytes representation of the tx. + Decode([]byte) (T, error) + // DecodeJSON decodes the tx JSON bytes into a DecodedTx + DecodeJSON([]byte) (T, error) +} + +// Tx defines the interface for a transaction. +// All custom transactions must implement this interface. +type Tx interface { + // Hash returns the unique identifier for the Tx. + Hash() [32]byte + // GetMessages returns the list of state transitions of the Tx. + GetMessages() ([]Msg, error) + // GetSenders returns the tx state transition sender. + GetSenders() ([]Identity, error) // TODO reduce this to a single identity if accepted + // GetGasLimit returns the gas limit of the tx. Must return math.MaxUint64 for infinite gas + // txs. + GetGasLimit() (uint64, error) + // Bytes returns the encoded version of this tx. Note: this is ideally cached + // from the first instance of the decoding of the tx. + Bytes() []byte +} diff --git a/pkg/hway/README.md b/pkg/hway/README.md new file mode 100644 index 000000000..9a88828c3 --- /dev/null +++ b/pkg/hway/README.md @@ -0,0 +1 @@ +# Hway diff --git a/pkg/workers/handlers/jsonrpc.go b/pkg/hway/handlers/jsonrpc.go similarity index 100% rename from pkg/workers/handlers/jsonrpc.go rename to pkg/hway/handlers/jsonrpc.go diff --git a/pkg/workers/handlers/querier.go b/pkg/hway/handlers/querier.go similarity index 100% rename from pkg/workers/handlers/querier.go rename to pkg/hway/handlers/querier.go diff --git a/pkg/hway/handlers/sync.go b/pkg/hway/handlers/sync.go new file mode 100644 index 000000000..62fb99ec9 --- /dev/null +++ b/pkg/hway/handlers/sync.go @@ -0,0 +1,13 @@ +package handlers + +import "github.com/labstack/echo/v4" + +func FetchInitial(e echo.Context) error { + // Implement database schema endpoint + return nil +} + +func FetchCurrent(e echo.Context) error { + // Implement account entries endpoint + return nil +} diff --git a/pkg/workers/routes/gateway.go b/pkg/hway/routes/routes.go similarity index 100% rename from pkg/workers/routes/gateway.go rename to pkg/hway/routes/routes.go diff --git a/pkg/hway/types/api.pb.go b/pkg/hway/types/api.pb.go new file mode 100644 index 000000000..32a95f644 --- /dev/null +++ b/pkg/hway/types/api.pb.go @@ -0,0 +1,535 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: hway/v1/api.proto + +package types + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GetJWKSRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetJWKSRequest) Reset() { + *x = GetJWKSRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hway_v1_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetJWKSRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetJWKSRequest) ProtoMessage() {} + +func (x *GetJWKSRequest) ProtoReflect() protoreflect.Message { + mi := &file_hway_v1_api_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetJWKSRequest.ProtoReflect.Descriptor instead. +func (*GetJWKSRequest) Descriptor() ([]byte, []int) { + return file_hway_v1_api_proto_rawDescGZIP(), []int{0} +} + +type GetJWKSResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Jwks string `protobuf:"bytes,1,opt,name=jwks,proto3" json:"jwks,omitempty"` +} + +func (x *GetJWKSResponse) Reset() { + *x = GetJWKSResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hway_v1_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetJWKSResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetJWKSResponse) ProtoMessage() {} + +func (x *GetJWKSResponse) ProtoReflect() protoreflect.Message { + mi := &file_hway_v1_api_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) +} + +// Deprecated: Use GetJWKSResponse.ProtoReflect.Descriptor instead. +func (*GetJWKSResponse) Descriptor() ([]byte, []int) { + return file_hway_v1_api_proto_rawDescGZIP(), []int{1} +} + +func (x *GetJWKSResponse) GetJwks() string { + if x != nil { + return x.Jwks + } + return "" +} + +type GetTokenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,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 *GetTokenRequest) Reset() { + *x = GetTokenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hway_v1_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTokenRequest) ProtoMessage() {} + +func (x *GetTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_hway_v1_api_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) +} + +// Deprecated: Use GetTokenRequest.ProtoReflect.Descriptor instead. +func (*GetTokenRequest) Descriptor() ([]byte, []int) { + return file_hway_v1_api_proto_rawDescGZIP(), []int{2} +} + +func (x *GetTokenRequest) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *GetTokenRequest) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *GetTokenRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *GetTokenRequest) GetAsset() string { + if x != nil { + return x.Asset + } + return "" +} + +type GetTokenResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *GetTokenResponse) Reset() { + *x = GetTokenResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hway_v1_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTokenResponse) ProtoMessage() {} + +func (x *GetTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_hway_v1_api_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) +} + +// Deprecated: Use GetTokenResponse.ProtoReflect.Descriptor instead. +func (*GetTokenResponse) Descriptor() ([]byte, []int) { + return file_hway_v1_api_proto_rawDescGZIP(), []int{3} +} + +func (x *GetTokenResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +type GrantAuthorizationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,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"` + Assertion string `protobuf:"bytes,5,opt,name=assertion,proto3" json:"assertion,omitempty"` +} + +func (x *GrantAuthorizationRequest) Reset() { + *x = GrantAuthorizationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hway_v1_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrantAuthorizationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrantAuthorizationRequest) ProtoMessage() {} + +func (x *GrantAuthorizationRequest) ProtoReflect() protoreflect.Message { + mi := &file_hway_v1_api_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) +} + +// Deprecated: Use GrantAuthorizationRequest.ProtoReflect.Descriptor instead. +func (*GrantAuthorizationRequest) Descriptor() ([]byte, []int) { + return file_hway_v1_api_proto_rawDescGZIP(), []int{4} +} + +func (x *GrantAuthorizationRequest) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *GrantAuthorizationRequest) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *GrantAuthorizationRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *GrantAuthorizationRequest) GetAsset() string { + if x != nil { + return x.Asset + } + return "" +} + +func (x *GrantAuthorizationRequest) GetAssertion() string { + if x != nil { + return x.Assertion + } + return "" +} + +type GrantAuthorizationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *GrantAuthorizationResponse) Reset() { + *x = GrantAuthorizationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_hway_v1_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrantAuthorizationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrantAuthorizationResponse) ProtoMessage() {} + +func (x *GrantAuthorizationResponse) ProtoReflect() protoreflect.Message { + mi := &file_hway_v1_api_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) +} + +// Deprecated: Use GrantAuthorizationResponse.ProtoReflect.Descriptor instead. +func (*GrantAuthorizationResponse) Descriptor() ([]byte, []int) { + return file_hway_v1_api_proto_rawDescGZIP(), []int{5} +} + +func (x *GrantAuthorizationResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +var File_hway_v1_api_proto protoreflect.FileDescriptor + +var file_hway_v1_api_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x22, 0x10, 0x0a, 0x0e, + 0x47, 0x65, 0x74, 0x4a, 0x57, 0x4b, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x25, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4a, 0x57, 0x4b, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6a, 0x77, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6a, 0x77, 0x6b, 0x73, 0x22, 0x6b, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, + 0x65, 0x74, 0x22, 0x28, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x93, 0x01, 0x0a, + 0x19, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x1a, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xe7, 0x01, 0x0a, 0x07, 0x48, 0x69, 0x67, 0x68, 0x77, + 0x61, 0x79, 0x12, 0x3c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4a, 0x57, 0x4b, 0x53, 0x12, 0x17, 0x2e, + 0x68, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x57, 0x4b, 0x53, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x57, 0x4b, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x3f, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x2e, 0x68, + 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5d, 0x0a, 0x12, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x68, 0x77, + 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, + 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x68, + 0x77, 0x61, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_hway_v1_api_proto_rawDescOnce sync.Once + file_hway_v1_api_proto_rawDescData = file_hway_v1_api_proto_rawDesc +) + +func file_hway_v1_api_proto_rawDescGZIP() []byte { + file_hway_v1_api_proto_rawDescOnce.Do(func() { + file_hway_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_hway_v1_api_proto_rawDescData) + }) + return file_hway_v1_api_proto_rawDescData +} + +var file_hway_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_hway_v1_api_proto_goTypes = []interface{}{ + (*GetJWKSRequest)(nil), // 0: hway.v1.GetJWKSRequest + (*GetJWKSResponse)(nil), // 1: hway.v1.GetJWKSResponse + (*GetTokenRequest)(nil), // 2: hway.v1.GetTokenRequest + (*GetTokenResponse)(nil), // 3: hway.v1.GetTokenResponse + (*GrantAuthorizationRequest)(nil), // 4: hway.v1.GrantAuthorizationRequest + (*GrantAuthorizationResponse)(nil), // 5: hway.v1.GrantAuthorizationResponse +} +var file_hway_v1_api_proto_depIdxs = []int32{ + 0, // 0: hway.v1.Highway.GetJWKS:input_type -> hway.v1.GetJWKSRequest + 2, // 1: hway.v1.Highway.GetToken:input_type -> hway.v1.GetTokenRequest + 4, // 2: hway.v1.Highway.GrantAuthorization:input_type -> hway.v1.GrantAuthorizationRequest + 1, // 3: hway.v1.Highway.GetJWKS:output_type -> hway.v1.GetJWKSResponse + 3, // 4: hway.v1.Highway.GetToken:output_type -> hway.v1.GetTokenResponse + 5, // 5: hway.v1.Highway.GrantAuthorization:output_type -> hway.v1.GrantAuthorizationResponse + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_hway_v1_api_proto_init() } +func file_hway_v1_api_proto_init() { + if File_hway_v1_api_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_hway_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetJWKSRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hway_v1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetJWKSResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hway_v1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hway_v1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTokenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hway_v1_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrantAuthorizationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hway_v1_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GrantAuthorizationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_hway_v1_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_hway_v1_api_proto_goTypes, + DependencyIndexes: file_hway_v1_api_proto_depIdxs, + MessageInfos: file_hway_v1_api_proto_msgTypes, + }.Build() + File_hway_v1_api_proto = out.File + file_hway_v1_api_proto_rawDesc = nil + file_hway_v1_api_proto_goTypes = nil + file_hway_v1_api_proto_depIdxs = nil +} diff --git a/pkg/hway/types/client.pb.go b/pkg/hway/types/client.pb.go new file mode 100644 index 000000000..6fc6c8616 --- /dev/null +++ b/pkg/hway/types/client.pb.go @@ -0,0 +1,63 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: hway/v1/client.proto + +package types + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_hway_v1_client_proto protoreflect.FileDescriptor + +var file_hway_v1_client_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x42, + 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x68, 0x77, + 0x61, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, +} + +var file_hway_v1_client_proto_goTypes = []interface{}{} +var file_hway_v1_client_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_hway_v1_client_proto_init() } +func file_hway_v1_client_proto_init() { + if File_hway_v1_client_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_hway_v1_client_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_hway_v1_client_proto_goTypes, + DependencyIndexes: file_hway_v1_client_proto_depIdxs, + }.Build() + File_hway_v1_client_proto = out.File + file_hway_v1_client_proto_rawDesc = nil + file_hway_v1_client_proto_goTypes = nil + file_hway_v1_client_proto_depIdxs = nil +} diff --git a/pkg/motr/README.md b/pkg/motr/README.md new file mode 100644 index 000000000..cab2301c5 --- /dev/null +++ b/pkg/motr/README.md @@ -0,0 +1 @@ +# Motr diff --git a/internal/dwn/gen/Config.pkl.go b/pkg/motr/config/Config.pkl.go similarity index 88% rename from internal/dwn/gen/Config.pkl.go rename to pkg/motr/config/Config.pkl.go index e08b568dd..95032bf97 100644 --- a/internal/dwn/gen/Config.pkl.go +++ b/pkg/motr/config/Config.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `dwngen`. DO NOT EDIT. -package gen +// Code generated from Pkl module `dwn`. DO NOT EDIT. +package config type Config struct { IpfsGatewayUrl string `pkl:"ipfsGatewayUrl" json:"ipfsGatewayUrl,omitempty"` diff --git a/internal/dwn/gen/Dwngen.pkl.go b/pkg/motr/config/Dwn.pkl.go similarity index 68% rename from internal/dwn/gen/Dwngen.pkl.go rename to pkg/motr/config/Dwn.pkl.go index 4f7431936..8b8b4d9ca 100644 --- a/internal/dwn/gen/Dwngen.pkl.go +++ b/pkg/motr/config/Dwn.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `dwngen`. DO NOT EDIT. -package gen +// Code generated from Pkl module `dwn`. DO NOT EDIT. +package config import ( "context" @@ -7,11 +7,11 @@ import ( "github.com/apple/pkl-go/pkl" ) -type Dwngen struct { +type Dwn struct { } -// LoadFromPath loads the pkl module at the given path and evaluates it into a Dwngen -func LoadFromPath(ctx context.Context, path string) (ret *Dwngen, err error) { +// LoadFromPath loads the pkl module at the given path and evaluates it into a Dwn +func LoadFromPath(ctx context.Context, path string) (ret *Dwn, 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 *Dwngen, err error) { return ret, err } -// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Dwngen -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Dwngen, error) { - var ret Dwngen +// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Dwn +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Dwn, error) { + var ret Dwn if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { return nil, err } diff --git a/internal/dwn/gen/Schema.pkl.go b/pkg/motr/config/Schema.pkl.go similarity index 87% rename from internal/dwn/gen/Schema.pkl.go rename to pkg/motr/config/Schema.pkl.go index eb9b6edfe..f05180f0f 100644 --- a/internal/dwn/gen/Schema.pkl.go +++ b/pkg/motr/config/Schema.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `dwngen`. DO NOT EDIT. -package gen +// Code generated from Pkl module `dwn`. DO NOT EDIT. +package config type Schema struct { Version int `pkl:"version"` diff --git a/pkg/motr/config/init.pkl.go b/pkg/motr/config/init.pkl.go new file mode 100644 index 000000000..5b5b2afa0 --- /dev/null +++ b/pkg/motr/config/init.pkl.go @@ -0,0 +1,10 @@ +// Code generated from Pkl module `dwn`. DO NOT EDIT. +package config + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("dwn", Dwn{}) + pkl.RegisterMapping("dwn#Config", Config{}) + pkl.RegisterMapping("dwn#Schema", Schema{}) +} diff --git a/internal/dwn/embed.go b/pkg/motr/embed.go similarity index 59% rename from internal/dwn/embed.go rename to pkg/motr/embed.go index c56183bbd..c4e6c99d2 100644 --- a/internal/dwn/embed.go +++ b/pkg/motr/embed.go @@ -1,30 +1,27 @@ -package dwn +package motr import ( _ "embed" "encoding/json" "github.com/ipfs/boxo/files" - "github.com/onsonr/sonr/internal/dwn/gen" - "github.com/onsonr/sonr/pkg/nebula" + + "github.com/onsonr/sonr/pkg/motr/config" + "github.com/onsonr/sonr/pkg/motr/static" ) const ( - FileNameAppWASM = "app.wasm" - FileNameConfigJSON = "dwn.json" + FileNameConfigJSON = "dwn.pkl" FileNameIndexHTML = "index.html" FileNameWorkerJS = "sw.js" ) -//go:embed app.wasm -var dwnWasmData []byte - -//go:embed sw.js +//go:embed static/sw.js var swJSData []byte // NewVaultDirectory creates a new directory with the default files -func NewVaultDirectory(cnfg *gen.Config) (files.Node, error) { - idxFile, err := nebula.BuildVaultFile(cnfg) +func NewVaultDirectory(cnfg *config.Config) (files.Node, error) { + idxFile, err := static.BuildVaultFile(cnfg) if err != nil { return nil, err } @@ -33,7 +30,6 @@ func NewVaultDirectory(cnfg *gen.Config) (files.Node, error) { return nil, err } fileMap := map[string]files.Node{ - FileNameAppWASM: files.NewBytesFile(dwnWasmData), FileNameConfigJSON: files.NewBytesFile(cnfgBz), FileNameIndexHTML: idxFile, FileNameWorkerJS: files.NewBytesFile(swJSData), diff --git a/pkg/workers/handlers/auth.go b/pkg/motr/handlers/auth.go similarity index 84% rename from pkg/workers/handlers/auth.go rename to pkg/motr/handlers/auth.go index 6b3ee13ed..2ed26e8a9 100644 --- a/pkg/workers/handlers/auth.go +++ b/pkg/motr/handlers/auth.go @@ -4,24 +4,20 @@ import ( "github.com/go-webauthn/webauthn/protocol" "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/orm" + "github.com/onsonr/sonr/pkg/motr/types/orm" ) -type authAPI struct{} - -var Auth = new(authAPI) - // ╭───────────────────────────────────────────────────────────╮ // │ Login Handlers │ // ╰───────────────────────────────────────────────────────────╯ // LoginSubjectCheck handles the login subject check. -func (a *authAPI) LoginSubjectCheck(e echo.Context) error { +func LoginSubjectCheck(e echo.Context) error { return e.JSON(200, "HandleCredentialAssertion") } // LoginSubjectStart handles the login subject start. -func (a *authAPI) LoginSubjectStart(e echo.Context) error { +func LoginSubjectStart(e echo.Context) error { opts := &protocol.PublicKeyCredentialRequestOptions{ UserVerification: "preferred", Challenge: []byte("challenge"), @@ -30,7 +26,7 @@ func (a *authAPI) LoginSubjectStart(e echo.Context) error { } // LoginSubjectFinish handles the login subject finish. -func (a *authAPI) LoginSubjectFinish(e echo.Context) error { +func LoginSubjectFinish(e echo.Context) error { var crr protocol.CredentialAssertionResponse if err := e.Bind(&crr); err != nil { return err @@ -43,13 +39,13 @@ func (a *authAPI) LoginSubjectFinish(e echo.Context) error { // ╰───────────────────────────────────────────────────────────╯ // RegisterSubjectCheck handles the register subject check. -func (a *authAPI) RegisterSubjectCheck(e echo.Context) error { +func RegisterSubjectCheck(e echo.Context) error { subject := e.FormValue("subject") return e.JSON(200, subject) } // RegisterSubjectStart handles the register subject start. -func (a *authAPI) RegisterSubjectStart(e echo.Context) error { +func RegisterSubjectStart(e echo.Context) error { // Get subject and address subject := e.FormValue("subject") address := e.FormValue("address") @@ -63,7 +59,7 @@ func (a *authAPI) RegisterSubjectStart(e echo.Context) error { } // RegisterSubjectFinish handles the register subject finish. -func (a *authAPI) RegisterSubjectFinish(e echo.Context) error { +func RegisterSubjectFinish(e echo.Context) error { // Deserialize the JSON into a temporary struct var ccr protocol.CredentialCreationResponse if err := e.Bind(&ccr); err != nil { diff --git a/pkg/motr/handlers/openid.go b/pkg/motr/handlers/openid.go new file mode 100644 index 000000000..0f7c8417e --- /dev/null +++ b/pkg/motr/handlers/openid.go @@ -0,0 +1,23 @@ +package handlers + +import ( + "github.com/labstack/echo/v4" +) + +func GrantAuthorization(e echo.Context) error { + // Implement authorization endpoint using passkey authentication + // Store session data in cache + return nil +} + +func GetJWKS(e echo.Context) error { + // Implement token endpoint + // Use cached session data for validation + return nil +} + +func GetToken(e echo.Context) error { + // Implement token endpoint + // Use cached session data for validation + return nil +} diff --git a/pkg/motr/routes/routes.go b/pkg/motr/routes/routes.go new file mode 100644 index 000000000..71ee2f696 --- /dev/null +++ b/pkg/motr/routes/routes.go @@ -0,0 +1,26 @@ +package routes + +import ( + "github.com/labstack/echo/v4" + + "github.com/onsonr/sonr/pkg/motr/handlers" +) + +// RegisterWebNodeAPI registers the Decentralized Web Node API routes. +func RegisterWebNodeAPI(e *echo.Echo) { + g1 := e.Group("api") + g1.GET("/register/:subject/start", handlers.RegisterSubjectStart) + g1.POST("/register/:subject/check", handlers.RegisterSubjectCheck) + g1.POST("/register/:subject/finish", handlers.RegisterSubjectFinish) + + g1.GET("/login/:subject/start", handlers.LoginSubjectStart) + g1.POST("/login/:subject/check", handlers.LoginSubjectCheck) + g1.POST("/login/:subject/finish", handlers.LoginSubjectFinish) + + g1.GET("/:origin/grant/jwks", handlers.GetJWKS) + g1.GET("/:origin/grant/token", handlers.GetToken) + g1.POST("/:origin/grant/:subject", handlers.GrantAuthorization) +} + +func RegisterWebNodeViews(e *echo.Echo) { +} diff --git a/pkg/nebula/index.go b/pkg/motr/static/index.go similarity index 74% rename from pkg/nebula/index.go rename to pkg/motr/static/index.go index 7bbebfad8..079d92da6 100644 --- a/pkg/nebula/index.go +++ b/pkg/motr/static/index.go @@ -1,16 +1,17 @@ -package nebula +package static import ( "bytes" "context" "github.com/ipfs/boxo/files" - "github.com/onsonr/sonr/internal/dwn/gen" + + dwn "github.com/onsonr/sonr/pkg/motr/config" "github.com/onsonr/sonr/pkg/nebula/views" ) // BuildVaultFile builds the index.html file for the vault -func BuildVaultFile(cnfg *gen.Config) (files.Node, error) { +func BuildVaultFile(cnfg *dwn.Config) (files.Node, error) { w := bytes.NewBuffer(nil) err := views.VaultIndexFile().Render(context.Background(), w) if err != nil { diff --git a/internal/dwn/sw.js b/pkg/motr/static/sw.js similarity index 100% rename from internal/dwn/sw.js rename to pkg/motr/static/sw.js diff --git a/pkg/motr/types/api.pb.go b/pkg/motr/types/api.pb.go new file mode 100644 index 000000000..fa349d9ca --- /dev/null +++ b/pkg/motr/types/api.pb.go @@ -0,0 +1,342 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: motr/v1/api.proto + +package types + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PinRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` +} + +func (x *PinRequest) Reset() { + *x = PinRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_motr_v1_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PinRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PinRequest) ProtoMessage() {} + +func (x *PinRequest) ProtoReflect() protoreflect.Message { + mi := &file_motr_v1_api_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PinRequest.ProtoReflect.Descriptor instead. +func (*PinRequest) Descriptor() ([]byte, []int) { + return file_motr_v1_api_proto_rawDescGZIP(), []int{0} +} + +func (x *PinRequest) GetCid() string { + if x != nil { + return x.Cid + } + return "" +} + +type PinResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *PinResponse) Reset() { + *x = PinResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_motr_v1_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PinResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PinResponse) ProtoMessage() {} + +func (x *PinResponse) ProtoReflect() protoreflect.Message { + mi := &file_motr_v1_api_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) +} + +// Deprecated: Use PinResponse.ProtoReflect.Descriptor instead. +func (*PinResponse) Descriptor() ([]byte, []int) { + return file_motr_v1_api_proto_rawDescGZIP(), []int{1} +} + +func (x *PinResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type UnpinRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` +} + +func (x *UnpinRequest) Reset() { + *x = UnpinRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_motr_v1_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnpinRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnpinRequest) ProtoMessage() {} + +func (x *UnpinRequest) ProtoReflect() protoreflect.Message { + mi := &file_motr_v1_api_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) +} + +// Deprecated: Use UnpinRequest.ProtoReflect.Descriptor instead. +func (*UnpinRequest) Descriptor() ([]byte, []int) { + return file_motr_v1_api_proto_rawDescGZIP(), []int{2} +} + +func (x *UnpinRequest) GetCid() string { + if x != nil { + return x.Cid + } + return "" +} + +type UnpinResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *UnpinResponse) Reset() { + *x = UnpinResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_motr_v1_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnpinResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnpinResponse) ProtoMessage() {} + +func (x *UnpinResponse) ProtoReflect() protoreflect.Message { + mi := &file_motr_v1_api_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) +} + +// Deprecated: Use UnpinResponse.ProtoReflect.Descriptor instead. +func (*UnpinResponse) Descriptor() ([]byte, []int) { + return file_motr_v1_api_proto_rawDescGZIP(), []int{3} +} + +func (x *UnpinResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +var File_motr_v1_api_proto protoreflect.FileDescriptor + +var file_motr_v1_api_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x6d, 0x6f, 0x74, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6d, 0x6f, 0x74, 0x72, 0x2e, 0x76, 0x31, 0x22, 0x1e, 0x0a, 0x0a, + 0x50, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x0b, + 0x50, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x20, 0x0a, 0x0c, 0x55, 0x6e, 0x70, 0x69, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x0d, 0x55, 0x6e, 0x70, 0x69, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x32, 0x70, 0x0a, 0x04, 0x4d, 0x6f, 0x74, 0x72, 0x12, 0x30, 0x0a, 0x03, 0x50, 0x69, + 0x6e, 0x12, 0x13, 0x2e, 0x6d, 0x6f, 0x74, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x6d, 0x6f, 0x74, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, + 0x55, 0x6e, 0x70, 0x69, 0x6e, 0x12, 0x15, 0x2e, 0x6d, 0x6f, 0x74, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x6e, 0x70, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, + 0x6f, 0x74, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x70, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x6d, 0x6f, 0x74, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_motr_v1_api_proto_rawDescOnce sync.Once + file_motr_v1_api_proto_rawDescData = file_motr_v1_api_proto_rawDesc +) + +func file_motr_v1_api_proto_rawDescGZIP() []byte { + file_motr_v1_api_proto_rawDescOnce.Do(func() { + file_motr_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_motr_v1_api_proto_rawDescData) + }) + return file_motr_v1_api_proto_rawDescData +} + +var file_motr_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_motr_v1_api_proto_goTypes = []interface{}{ + (*PinRequest)(nil), // 0: motr.v1.PinRequest + (*PinResponse)(nil), // 1: motr.v1.PinResponse + (*UnpinRequest)(nil), // 2: motr.v1.UnpinRequest + (*UnpinResponse)(nil), // 3: motr.v1.UnpinResponse +} +var file_motr_v1_api_proto_depIdxs = []int32{ + 0, // 0: motr.v1.Motr.Pin:input_type -> motr.v1.PinRequest + 2, // 1: motr.v1.Motr.Unpin:input_type -> motr.v1.UnpinRequest + 1, // 2: motr.v1.Motr.Pin:output_type -> motr.v1.PinResponse + 3, // 3: motr.v1.Motr.Unpin:output_type -> motr.v1.UnpinResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_motr_v1_api_proto_init() } +func file_motr_v1_api_proto_init() { + if File_motr_v1_api_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_motr_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PinRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_motr_v1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PinResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_motr_v1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnpinRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_motr_v1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnpinResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_motr_v1_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_motr_v1_api_proto_goTypes, + DependencyIndexes: file_motr_v1_api_proto_depIdxs, + MessageInfos: file_motr_v1_api_proto_msgTypes, + }.Build() + File_motr_v1_api_proto = out.File + file_motr_v1_api_proto_rawDesc = nil + file_motr_v1_api_proto_goTypes = nil + file_motr_v1_api_proto_depIdxs = nil +} diff --git a/internal/orm/Account.pkl.go b/pkg/motr/types/orm/Account.pkl.go similarity index 100% rename from internal/orm/Account.pkl.go rename to pkg/motr/types/orm/Account.pkl.go diff --git a/internal/orm/Asset.pkl.go b/pkg/motr/types/orm/Asset.pkl.go similarity index 100% rename from internal/orm/Asset.pkl.go rename to pkg/motr/types/orm/Asset.pkl.go diff --git a/internal/orm/Chain.pkl.go b/pkg/motr/types/orm/Chain.pkl.go similarity index 100% rename from internal/orm/Chain.pkl.go rename to pkg/motr/types/orm/Chain.pkl.go diff --git a/internal/orm/Credential.pkl.go b/pkg/motr/types/orm/Credential.pkl.go similarity index 100% rename from internal/orm/Credential.pkl.go rename to pkg/motr/types/orm/Credential.pkl.go diff --git a/internal/orm/DID.pkl.go b/pkg/motr/types/orm/DID.pkl.go similarity index 60% rename from internal/orm/DID.pkl.go rename to pkg/motr/types/orm/DID.pkl.go index 8e4ee3f0a..6e630df07 100644 --- a/internal/orm/DID.pkl.go +++ b/pkg/motr/types/orm/DID.pkl.go @@ -2,11 +2,11 @@ package orm import ( - "github.com/onsonr/sonr/internal/orm/keyalgorithm" - "github.com/onsonr/sonr/internal/orm/keycurve" - "github.com/onsonr/sonr/internal/orm/keyencoding" - "github.com/onsonr/sonr/internal/orm/keyrole" - "github.com/onsonr/sonr/internal/orm/keytype" + "github.com/onsonr/sonr/pkg/motr/types/orm/keyalgorithm" + "github.com/onsonr/sonr/pkg/motr/types/orm/keycurve" + "github.com/onsonr/sonr/pkg/motr/types/orm/keyencoding" + "github.com/onsonr/sonr/pkg/motr/types/orm/keyrole" + "github.com/onsonr/sonr/pkg/motr/types/orm/keytype" ) type DID struct { diff --git a/internal/orm/Grant.pkl.go b/pkg/motr/types/orm/Grant.pkl.go similarity index 100% rename from internal/orm/Grant.pkl.go rename to pkg/motr/types/orm/Grant.pkl.go diff --git a/internal/orm/JWK.pkl.go b/pkg/motr/types/orm/JWK.pkl.go similarity index 100% rename from internal/orm/JWK.pkl.go rename to pkg/motr/types/orm/JWK.pkl.go diff --git a/internal/orm/Keyshare.pkl.go b/pkg/motr/types/orm/Keyshare.pkl.go similarity index 100% rename from internal/orm/Keyshare.pkl.go rename to pkg/motr/types/orm/Keyshare.pkl.go diff --git a/internal/orm/Orm.pkl.go b/pkg/motr/types/orm/Orm.pkl.go similarity index 100% rename from internal/orm/Orm.pkl.go rename to pkg/motr/types/orm/Orm.pkl.go diff --git a/internal/orm/Profile.pkl.go b/pkg/motr/types/orm/Profile.pkl.go similarity index 100% rename from internal/orm/Profile.pkl.go rename to pkg/motr/types/orm/Profile.pkl.go diff --git a/internal/orm/assettype/AssetType.pkl.go b/pkg/motr/types/orm/assettype/AssetType.pkl.go similarity index 100% rename from internal/orm/assettype/AssetType.pkl.go rename to pkg/motr/types/orm/assettype/AssetType.pkl.go diff --git a/internal/orm/didmethod/DIDMethod.pkl.go b/pkg/motr/types/orm/didmethod/DIDMethod.pkl.go similarity index 100% rename from internal/orm/didmethod/DIDMethod.pkl.go rename to pkg/motr/types/orm/didmethod/DIDMethod.pkl.go diff --git a/internal/orm/init.pkl.go b/pkg/motr/types/orm/init.pkl.go similarity index 100% rename from internal/orm/init.pkl.go rename to pkg/motr/types/orm/init.pkl.go diff --git a/internal/orm/keyalgorithm/KeyAlgorithm.pkl.go b/pkg/motr/types/orm/keyalgorithm/KeyAlgorithm.pkl.go similarity index 100% rename from internal/orm/keyalgorithm/KeyAlgorithm.pkl.go rename to pkg/motr/types/orm/keyalgorithm/KeyAlgorithm.pkl.go diff --git a/internal/orm/keycurve/KeyCurve.pkl.go b/pkg/motr/types/orm/keycurve/KeyCurve.pkl.go similarity index 100% rename from internal/orm/keycurve/KeyCurve.pkl.go rename to pkg/motr/types/orm/keycurve/KeyCurve.pkl.go diff --git a/internal/orm/keyencoding/KeyEncoding.pkl.go b/pkg/motr/types/orm/keyencoding/KeyEncoding.pkl.go similarity index 100% rename from internal/orm/keyencoding/KeyEncoding.pkl.go rename to pkg/motr/types/orm/keyencoding/KeyEncoding.pkl.go diff --git a/internal/orm/keyrole/KeyRole.pkl.go b/pkg/motr/types/orm/keyrole/KeyRole.pkl.go similarity index 100% rename from internal/orm/keyrole/KeyRole.pkl.go rename to pkg/motr/types/orm/keyrole/KeyRole.pkl.go diff --git a/internal/orm/keysharerole/KeyShareRole.pkl.go b/pkg/motr/types/orm/keysharerole/KeyShareRole.pkl.go similarity index 100% rename from internal/orm/keysharerole/KeyShareRole.pkl.go rename to pkg/motr/types/orm/keysharerole/KeyShareRole.pkl.go diff --git a/internal/orm/keytype/KeyType.pkl.go b/pkg/motr/types/orm/keytype/KeyType.pkl.go similarity index 100% rename from internal/orm/keytype/KeyType.pkl.go rename to pkg/motr/types/orm/keytype/KeyType.pkl.go diff --git a/internal/orm/permissiongrant/PermissionGrant.pkl.go b/pkg/motr/types/orm/permissiongrant/PermissionGrant.pkl.go similarity index 100% rename from internal/orm/permissiongrant/PermissionGrant.pkl.go rename to pkg/motr/types/orm/permissiongrant/PermissionGrant.pkl.go diff --git a/internal/orm/permissionscope/PermissionScope.pkl.go b/pkg/motr/types/orm/permissionscope/PermissionScope.pkl.go similarity index 100% rename from internal/orm/permissionscope/PermissionScope.pkl.go rename to pkg/motr/types/orm/permissionscope/PermissionScope.pkl.go diff --git a/internal/orm/schema.go b/pkg/motr/types/orm/schema.go similarity index 100% rename from internal/orm/schema.go rename to pkg/motr/types/orm/schema.go diff --git a/internal/orm/webauthn.go b/pkg/motr/types/orm/webauthn.go similarity index 100% rename from internal/orm/webauthn.go rename to pkg/motr/types/orm/webauthn.go diff --git a/pkg/nebula/marketing/section_arch.templ b/pkg/nebula/marketing/section_arch.templ index 8c828a50e..ce51901cd 100644 --- a/pkg/nebula/marketing/section_arch.templ +++ b/pkg/nebula/marketing/section_arch.templ @@ -1,8 +1,8 @@ package marketing import ( - models "github.com/onsonr/sonr/internal/orm/marketing" "github.com/onsonr/sonr/pkg/nebula/global" + models "github.com/onsonr/sonr/pkg/nebula/types" ) // ╭───────────────────────────────────────────────────────────╮ diff --git a/pkg/nebula/marketing/section_arch_templ.go b/pkg/nebula/marketing/section_arch_templ.go index d81293a73..538845904 100644 --- a/pkg/nebula/marketing/section_arch_templ.go +++ b/pkg/nebula/marketing/section_arch_templ.go @@ -9,8 +9,8 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - models "github.com/onsonr/sonr/internal/orm/marketing" "github.com/onsonr/sonr/pkg/nebula/global" + models "github.com/onsonr/sonr/pkg/nebula/types" ) // ╭───────────────────────────────────────────────────────────╮ diff --git a/pkg/nebula/marketing/section_cta.templ b/pkg/nebula/marketing/section_cta.templ index f32e9f6b0..07d87b740 100644 --- a/pkg/nebula/marketing/section_cta.templ +++ b/pkg/nebula/marketing/section_cta.templ @@ -1,6 +1,6 @@ package marketing -import models "github.com/onsonr/sonr/internal/orm/marketing" +import models "github.com/onsonr/sonr/pkg/nebula/types" // ╭───────────────────────────────────────────────────────────╮ // │ Data Model │ diff --git a/pkg/nebula/marketing/section_cta_templ.go b/pkg/nebula/marketing/section_cta_templ.go index f9457fa50..9ccb79420 100644 --- a/pkg/nebula/marketing/section_cta_templ.go +++ b/pkg/nebula/marketing/section_cta_templ.go @@ -8,7 +8,7 @@ package marketing import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import models "github.com/onsonr/sonr/internal/orm/marketing" +import models "github.com/onsonr/sonr/pkg/nebula/types" // ╭───────────────────────────────────────────────────────────╮ // │ Data Model │ diff --git a/pkg/nebula/marketing/section_hero.templ b/pkg/nebula/marketing/section_hero.templ index 749d66b19..816dbf74a 100644 --- a/pkg/nebula/marketing/section_hero.templ +++ b/pkg/nebula/marketing/section_hero.templ @@ -2,8 +2,8 @@ package marketing import ( "fmt" - models "github.com/onsonr/sonr/internal/orm/marketing" "github.com/onsonr/sonr/pkg/nebula/global/ui" + models "github.com/onsonr/sonr/pkg/nebula/types" ) // ╭───────────────────────────────────────────────────────────╮ diff --git a/pkg/nebula/marketing/section_hero_templ.go b/pkg/nebula/marketing/section_hero_templ.go index 5ca335062..e3a284a0a 100644 --- a/pkg/nebula/marketing/section_hero_templ.go +++ b/pkg/nebula/marketing/section_hero_templ.go @@ -10,8 +10,8 @@ import templruntime "github.com/a-h/templ/runtime" import ( "fmt" - models "github.com/onsonr/sonr/internal/orm/marketing" "github.com/onsonr/sonr/pkg/nebula/global/ui" + models "github.com/onsonr/sonr/pkg/nebula/types" ) // ╭───────────────────────────────────────────────────────────╮ diff --git a/pkg/nebula/marketing/section_highlights.templ b/pkg/nebula/marketing/section_highlights.templ index 711a452b8..7ed4496b1 100644 --- a/pkg/nebula/marketing/section_highlights.templ +++ b/pkg/nebula/marketing/section_highlights.templ @@ -2,7 +2,7 @@ package marketing import ( "fmt" - models "github.com/onsonr/sonr/internal/orm/marketing" + models "github.com/onsonr/sonr/pkg/nebula/types" ) // ╭───────────────────────────────────────────────────────────╮ diff --git a/pkg/nebula/marketing/section_highlights_templ.go b/pkg/nebula/marketing/section_highlights_templ.go index 08f0b6d0b..7db4c2961 100644 --- a/pkg/nebula/marketing/section_highlights_templ.go +++ b/pkg/nebula/marketing/section_highlights_templ.go @@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime" import ( "fmt" - models "github.com/onsonr/sonr/internal/orm/marketing" + models "github.com/onsonr/sonr/pkg/nebula/types" ) // ╭───────────────────────────────────────────────────────────╮ diff --git a/pkg/nebula/marketing/section_lowlights.templ b/pkg/nebula/marketing/section_lowlights.templ index 40c3ebc66..f2e3d08cd 100644 --- a/pkg/nebula/marketing/section_lowlights.templ +++ b/pkg/nebula/marketing/section_lowlights.templ @@ -1,8 +1,8 @@ package marketing import ( - models "github.com/onsonr/sonr/internal/orm/marketing" global "github.com/onsonr/sonr/pkg/nebula/global" + models "github.com/onsonr/sonr/pkg/nebula/types" ) // ╭───────────────────────────────────────────────────────────╮ diff --git a/pkg/nebula/marketing/section_lowlights_templ.go b/pkg/nebula/marketing/section_lowlights_templ.go index a0c495788..e3ac78ced 100644 --- a/pkg/nebula/marketing/section_lowlights_templ.go +++ b/pkg/nebula/marketing/section_lowlights_templ.go @@ -9,8 +9,8 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - models "github.com/onsonr/sonr/internal/orm/marketing" global "github.com/onsonr/sonr/pkg/nebula/global" + models "github.com/onsonr/sonr/pkg/nebula/types" ) // ╭───────────────────────────────────────────────────────────╮ diff --git a/pkg/nebula/marketing/section_mission.templ b/pkg/nebula/marketing/section_mission.templ index 738ffcd50..a48e9296b 100644 --- a/pkg/nebula/marketing/section_mission.templ +++ b/pkg/nebula/marketing/section_mission.templ @@ -1,6 +1,6 @@ package marketing -import models "github.com/onsonr/sonr/internal/orm/marketing" +import models "github.com/onsonr/sonr/pkg/nebula/types" // mission is the (3rd) home page mission section var mission = &models.Mission{ diff --git a/pkg/nebula/marketing/section_mission_templ.go b/pkg/nebula/marketing/section_mission_templ.go index e46abce2a..f5c2da36e 100644 --- a/pkg/nebula/marketing/section_mission_templ.go +++ b/pkg/nebula/marketing/section_mission_templ.go @@ -8,7 +8,7 @@ package marketing import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import models "github.com/onsonr/sonr/internal/orm/marketing" +import models "github.com/onsonr/sonr/pkg/nebula/types" // mission is the (3rd) home page mission section var mission = &models.Mission{ diff --git a/pkg/nebula/routes/auth.go b/pkg/nebula/routes/auth.go index 336aa4eb9..17a179b60 100644 --- a/pkg/nebula/routes/auth.go +++ b/pkg/nebula/routes/auth.go @@ -4,7 +4,8 @@ import ( "log" "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/ctx" + + "github.com/onsonr/sonr/pkg/common/ctx" "github.com/onsonr/sonr/pkg/nebula/modals" "github.com/onsonr/sonr/pkg/nebula/views" ) diff --git a/pkg/nebula/routes/home.go b/pkg/nebula/routes/home.go index c8ff70fe4..0525b9dfd 100644 --- a/pkg/nebula/routes/home.go +++ b/pkg/nebula/routes/home.go @@ -4,7 +4,8 @@ import ( "log" "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/internal/ctx" + + "github.com/onsonr/sonr/pkg/common/ctx" "github.com/onsonr/sonr/pkg/nebula/marketing" ) diff --git a/internal/orm/marketing/models.go b/pkg/nebula/types/marketing.go similarity index 99% rename from internal/orm/marketing/models.go rename to pkg/nebula/types/marketing.go index 89ebb6025..e035f71f0 100644 --- a/internal/orm/marketing/models.go +++ b/pkg/nebula/types/marketing.go @@ -1,4 +1,4 @@ -package marketing +package types type Button struct { Text string diff --git a/pkg/workers/README.md b/pkg/workers/README.md deleted file mode 100644 index 4684b1afa..000000000 --- a/pkg/workers/README.md +++ /dev/null @@ -1 +0,0 @@ -# Workers diff --git a/pkg/workers/client/http.go b/pkg/workers/client/http.go deleted file mode 100644 index bcdc78a4b..000000000 --- a/pkg/workers/client/http.go +++ /dev/null @@ -1,47 +0,0 @@ -package client - -import "net/http" - -// SonrClient is a REST HTTP client for Querying Module Endpoints -// for the Sonr blockchain. -type SonrClient struct { - apiURL string -} - -// NewLocal creates a new SonrClient for local development. -func NewLocal() (*SonrClient, error) { - // create http client - client := &SonrClient{ - apiURL: "http://localhost:1323", - } - // Issue ping to check if server is up - resp, err := http.Get(client.apiURL + "/genesis") - if err != nil { - return nil, err - } - defer resp.Body.Close() - // Check if server is up - if resp.StatusCode != http.StatusOK { - return nil, err - } - return client, nil -} - -// NewRemote creates a new SonrClient for remote production. -func NewRemote(url string) (*SonrClient, error) { - // create http client - client := &SonrClient{ - apiURL: url, - } - // Issue ping to check if server is up - resp, err := http.Get(client.apiURL + "/genesis") - if err != nil { - return nil, err - } - defer resp.Body.Close() - // Check if server is up - if resp.StatusCode != http.StatusOK { - return nil, err - } - return client, nil -} diff --git a/pkg/workers/handlers/openid.go b/pkg/workers/handlers/openid.go deleted file mode 100644 index 3d061f31c..000000000 --- a/pkg/workers/handlers/openid.go +++ /dev/null @@ -1,31 +0,0 @@ -package handlers - -import ( - "github.com/labstack/echo/v4" -) - -func (a *openidAPI) GrantAuthorization(e echo.Context) error { - // Implement authorization endpoint using passkey authentication - // Store session data in cache - return nil -} - -func (a *openidAPI) GetJWKS(e echo.Context) error { - // Implement token endpoint - // Use cached session data for validation - return nil -} - -func (a *openidAPI) GetToken(e echo.Context) error { - // Implement token endpoint - // Use cached session data for validation - return nil -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Group Structures │ -// ╰───────────────────────────────────────────────────────────╯ - -type openidAPI struct{} - -var OpenID = new(openidAPI) diff --git a/pkg/workers/handlers/sync.go b/pkg/workers/handlers/sync.go deleted file mode 100644 index d6a3996c3..000000000 --- a/pkg/workers/handlers/sync.go +++ /dev/null @@ -1,25 +0,0 @@ -package handlers - -import "github.com/labstack/echo/v4" - -// ╭───────────────────────────────────────────────────────────╮ -// │ Dexie Database Handlers │ -// ╰───────────────────────────────────────────────────────────╯ - -func (a *syncAPI) FetchInitial(e echo.Context) error { - // Implement database schema endpoint - return nil -} - -func (a *syncAPI) FetchCurrent(e echo.Context) error { - // Implement account entries endpoint - return nil -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Group Structures │ -// ╰───────────────────────────────────────────────────────────╯ - -type syncAPI struct{} - -var Sync = new(syncAPI) diff --git a/pkg/workers/routes/webnode.go b/pkg/workers/routes/webnode.go deleted file mode 100644 index fa0cb3900..000000000 --- a/pkg/workers/routes/webnode.go +++ /dev/null @@ -1,33 +0,0 @@ -package routes - -import ( - "github.com/labstack/echo/v4" - - "github.com/onsonr/sonr/pkg/nebula/routes" - "github.com/onsonr/sonr/pkg/workers/handlers" -) - -// RegisterWebNodeAPI registers the Decentralized Web Node API routes. -func RegisterWebNodeAPI(e *echo.Echo) { - g1 := e.Group("api") - g1.GET("/register/:subject/start", handlers.Auth.RegisterSubjectStart) - g1.POST("/register/:subject/check", handlers.Auth.RegisterSubjectCheck) - g1.POST("/register/:subject/finish", handlers.Auth.RegisterSubjectFinish) - - g1.GET("/login/:subject/start", handlers.Auth.LoginSubjectStart) - g1.POST("/login/:subject/check", handlers.Auth.LoginSubjectCheck) - g1.POST("/login/:subject/finish", handlers.Auth.LoginSubjectFinish) - - g1.GET("/:origin/grant/jwks", handlers.OpenID.GetJWKS) - g1.GET("/:origin/grant/token", handlers.OpenID.GetToken) - g1.POST("/:origin/grant/:subject", handlers.OpenID.GrantAuthorization) -} - -// RegisterWebNodeViews registers the Decentralized Web Node HTMX views. -func RegisterWebNodeViews(e *echo.Echo) { - e.File("/", "index.html") - e.GET("/#", routes.CurrentViewRoute) - e.GET("/login", routes.LoginModalRoute) - e.File("/config", "config.json") - e.GET("/register", routes.RegisterModalRoute) -} diff --git a/pkl/Txns.pkl b/pkl/Txns.pkl deleted file mode 100644 index e658489b1..000000000 --- a/pkl/Txns.pkl +++ /dev/null @@ -1,174 +0,0 @@ -@go.Package { name = "github.com/onsonr/sonr/internal/orm/transactions" } - -module transactions - -import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" - -/// Common Cosmos SDK types -typealias Coin = Dynamic -typealias AccAddress = String -typealias ValAddress = String -typealias Timestamp = String - -/// Base class for all messages -abstract class Msg { - /// The type URL for the message - typeUrl: String -} - -/// Base class for all proposals -class Proposal { - /// The title of the proposal - title: String - - /// The description of the proposal - description: String -} - -/// Gov module messages -class MsgGovSubmitProposal extends Msg { - typeUrl = "/cosmos.gov.v1beta1.MsgSubmitProposal" - content: Proposal - initialDeposit: List - proposer: AccAddress -} - -class MsgGovVote extends Msg { - typeUrl = "/cosmos.gov.v1beta1.MsgVote" - proposalId: Int - voter: AccAddress - option: Int -} - -class MsgGovDeposit extends Msg { - typeUrl = "/cosmos.gov.v1beta1.MsgDeposit" - proposalId: Int - depositor: AccAddress - amount: List -} - -/// Group module messages - class MsgGroupCreateGroup extends Msg { - typeUrl = "/cosmos.group.v1.MsgCreateGroup" - admin: AccAddress - members: List - metadata: String - } - - class MsgGroupSubmitProposal extends Msg { - typeUrl = "/cosmos.group.v1.MsgSubmitProposal" - groupPolicyAddress: AccAddress - proposers: List - metadata: String - messages: List - exec: Int - } - - class MsgGroupVote extends Msg { - typeUrl = "/cosmos.group.v1.MsgVote" - proposalId: Int - voter: AccAddress - option: Int - metadata: String - exec: Int - } - -/// Staking module messages - class MsgStakingCreateValidator extends Msg { - typeUrl = "/cosmos.staking.v1beta1.MsgCreateValidator" - description: Dynamic - commission: Dynamic - minSelfDelegation: String - delegatorAddress: AccAddress - validatorAddress: ValAddress - pubkey: Dynamic - value: Coin - } - - class MsgStakingDelegate extends Msg { - typeUrl = "/cosmos.staking.v1beta1.MsgDelegate" - delegatorAddress: AccAddress - validatorAddress: ValAddress - amount: Coin - } - - class MsgStakingUndelegate extends Msg { - typeUrl = "/cosmos.staking.v1beta1.MsgUndelegate" - delegatorAddress: AccAddress - validatorAddress: ValAddress - amount: Coin - } - - class MsgStakingBeginRedelegate extends Msg { - typeUrl = "/cosmos.staking.v1beta1.MsgBeginRedelegate" - delegatorAddress: AccAddress - validatorSrcAddress: ValAddress - validatorDstAddress: ValAddress - amount: Coin - } - class MsgDidUpdateParams extends Msg { - typeUrl = "/sonr.did.v1.MsgUpdateParams" - authority: AccAddress - params: Dynamic - token: Dynamic - } - - class MsgDidAllocateVault extends Msg { - typeUrl = "/sonr.did.v1.MsgAllocateVault" - authority: AccAddress - subject: String - token: Dynamic - } - - class MsgDidProveWitness extends Msg { - typeUrl = "/sonr.did.v1.MsgProveWitness" - authority: AccAddress - property: String - witness: Listing - token: Dynamic - } - - class MsgDidSyncVault extends Msg { - typeUrl = "/sonr.did.v1.MsgSyncVault" - controller: AccAddress - token: Dynamic - } - -class MsgDidRegisterController extends Msg { - typeUrl = "/sonr.did.v1.MsgRegisterController" - authority: AccAddress - cid: String - origin: String - authentication: List - token: Dynamic - } - -class MsgDidAuthorize extends Msg { - typeUrl = "/sonr.did.v1.MsgAuthorize" - authority: AccAddress - controller: AccAddress - address: AccAddress - origin: String - token: Dynamic - } - -class MsgDidRegisterService extends Msg { - typeUrl = "/sonr.did.v1.MsgRegisterService" - controller: AccAddress - originUri: String - scopes: Dynamic - description: String - serviceEndpoints: Map - metadata: Dynamic - token: Dynamic - } - -/// Represents a transaction body -class TxBody { - messages: List - memo: String? - timeoutHeight: Int? - extensionOptions: List? - nonCriticalExtensionOptions: List? -} - diff --git a/proto/README.md b/proto/README.md index 184b8d63d..d99969d9a 100644 --- a/proto/README.md +++ b/proto/README.md @@ -10,10 +10,6 @@ This directory contains the protobuf definitions for the Sonr blockchain. The `did` directory contains the protobuf definitions for the DID module. -### `macaroon` - -The `macaroon` directory contains the protobuf definitions for the Macaroon module. - ### `service` The `service` directory contains the protobuf definitions for the Service module. @@ -21,5 +17,3 @@ The `service` directory contains the protobuf definitions for the Service module ### `vault` The `vault` directory contains the protobuf definitions for the Vault module. - -### `buf.gen.gogo.yaml` diff --git a/proto/buf.lock b/proto/buf.lock index e9e9d3b8f..b003e48f9 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -19,8 +19,13 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: e7f8d366f5264595bcc4cd4139af9973 - digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509 + commit: c0913f24652a4cfc95f77d97443a5005 + digest: shake256:0ef3248c6235d420fe61f373154adcde6b94e3297f82472b1d8d8c3747240b61b4a10405e2a6f8ac1c98816ac6e690ea7871024aa5ae0e035cd540214667ceed + - remote: buf.build + owner: onsonr + repository: thirdparty + commit: 915d759135b04de684c86d9cf5daf256 + digest: shake256:13d0254ab4884f2d47f21d229dc3b17ea859f81d8283c021956ccd0da864228a939d055c8c85a86c66307fd7bd19654da6b3fb89fccd6c6d38ee46651a5951b5 - remote: buf.build owner: protocolbuffers repository: wellknowntypes diff --git a/proto/buf.yaml b/proto/buf.yaml index af2b76670..d16bcb9d8 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -5,6 +5,7 @@ deps: - buf.build/cosmos/cosmos-proto - buf.build/cosmos/gogo-proto - buf.build/googleapis/googleapis + - buf.build/onsonr/thirdparty breaking: use: - FILE diff --git a/proto/did/module/v1/module.proto b/proto/did/module/v1/module.proto index c813587d2..3e6599ea6 100644 --- a/proto/did/module/v1/module.proto +++ b/proto/did/module/v1/module.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package onsonr.sonr.did.module.v1; +package did.module.v1; import "cosmos/app/v1alpha1/module.proto"; // Module is the app config object of the module. // Learn more: https://docs.cosmos.network/main/building-modules/depinject message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/onsonr/sonr/x/did"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/onsonr/sonr"}; } diff --git a/proto/did/v1/genesis.proto b/proto/did/v1/genesis.proto index 4bc2a52e2..2544ecc9f 100644 --- a/proto/did/v1/genesis.proto +++ b/proto/did/v1/genesis.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package did.v1; import "amino/amino.proto"; +import "did/v1/params.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; @@ -9,63 +10,16 @@ option go_package = "github.com/onsonr/sonr/x/did/types"; // GenesisState defines the module genesis state message GenesisState { // Params defines all the parameters of the module. - Params params = 1 [ (gogoproto.nullable) = false ]; + Params params = 1 [(gogoproto.nullable) = false]; } -// Params defines the set of module parameters. -message Params { - option (amino.name) = "did/params"; - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // Whitelisted Assets - - // Whitelisted Key Types - map allowed_public_keys = 2; - - // ConveyancePreference defines the conveyance preference - string conveyance_preference = 3; - - // AttestationFormats defines the attestation formats - repeated string attestation_formats = 4; -} - -// KeyInfo defines information for accepted PubKey types -message KeyInfo { - string role = 1; - string algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K" - string encoding = 3; // e.g., "hex", "base64", "multibase" - string curve = 4; // e.g., "P256", "P384", "P521", "X25519", "X448", - // "Ed25519", "Ed448", "secp256k1" -} - -message Keyshares { - string validator_cid = 1; - string user_cid = 2; - int64 last_updated_block = 3; -} - -// PubKey defines a public key for a did -message PubKey { - string role = 1; - string key_type = 2; - RawKey raw_key = 3; - JSONWebKey jwk = 4; -} - -// JWK represents a JSON Web Key -message JSONWebKey { - string kty = 1; // Key Type - string crv = 2; // Curve (for EC and OKP keys) - string x = 3; // X coordinate (for EC and OKP keys) - string y = 4; // Y coordinate (for EC keys) - string n = 5; // Modulus (for RSA keys) - string e = 6; // Exponent (for RSA keys) -} - -message RawKey { - string algorithm = 1; - string encoding = 2; - string curve = 3; - bytes key = 4; +// Document defines a DID document +message Document { + string id = 1; + string controller = 2; // The DID of the controller + repeated string authentication = 3; + repeated string assertion_method = 4; + repeated string capability_delegation = 5; + repeated string capability_invocation = 6; + repeated string service = 7; } diff --git a/proto/did/v1/params.proto b/proto/did/v1/params.proto new file mode 100644 index 000000000..a27e60ec0 --- /dev/null +++ b/proto/did/v1/params.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package did.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/onsonr/sonr/x/did/types"; + +// Params defines the set of module parameters. +message Params { + option (amino.name) = "did/params"; + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + // Whitelisted Assets + + // Whitelisted Key Types + map allowed_public_keys = 2; + + // ConveyancePreference defines the conveyance preference + string conveyance_preference = 3; + + // AttestationFormats defines the attestation formats + repeated string attestation_formats = 4; +} + +// KeyInfo defines information for accepted PubKey types +message KeyInfo { + string role = 1; + string algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K" + string encoding = 3; // e.g., "hex", "base64", "multibase" + string curve = 4; // e.g., "P256", "P384", "P521", "X25519", "X448", + // "Ed25519", "Ed448", "secp256k1" +} diff --git a/proto/did/v1/query.proto b/proto/did/v1/query.proto index 42559bf7f..4d3a54396 100644 --- a/proto/did/v1/query.proto +++ b/proto/did/v1/query.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package did.v1; import "did/v1/genesis.proto"; +import "did/v1/params.proto"; import "google/api/annotations.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; @@ -18,11 +19,6 @@ service Query { option (google.api.http).get = "/did/v1/{did}"; } - // Sign signs a message with the DID document - rpc Sign(QuerySignRequest) returns (QuerySignResponse) { - option (google.api.http).post = "/did/v1/{did}/sign"; - } - // Verify verifies a message with the DID document rpc Verify(QueryVerifyRequest) returns (QueryVerifyResponse) { option (google.api.http).post = "/did/v1/{did}/verify"; @@ -79,14 +75,3 @@ message QueryVerifyResponse { // valid is the validity of the signature bool valid = 1; } - -// Document defines a DID document -message Document { - string id = 1; - string controller = 2; // The DID of the controller - repeated string authentication = 3; - repeated string assertion_method = 4; - repeated string capability_delegation = 5; - repeated string capability_invocation = 6; - repeated string service = 7; -} diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index ccffbe3dc..3d4576380 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -9,9 +9,13 @@ option go_package = "github.com/onsonr/sonr/x/did/types"; message Assertion { option (cosmos.orm.v1.table) = { - id : 1 - primary_key : {fields : "did"} - index : {id : 1 fields : "controller,subject" unique : true} + id: 1 + primary_key: {fields: "did"} + index: { + id: 1 + fields: "controller,subject" + unique: true + } }; // The unique identifier of the assertion @@ -23,8 +27,8 @@ message Assertion { // Origin of the authentication string subject = 3; - // PubKey is the verification method - PubKey public_key = 4; + // string is the verification method + string public_key_hex = 4; // AssertionType is the assertion type string assertion_type = 5; @@ -38,9 +42,13 @@ message Assertion { message Authentication { option (cosmos.orm.v1.table) = { - id : 2 - primary_key : {fields : "did"} - index : {id : 1 fields : "controller,subject" unique : true} + id: 2 + primary_key: {fields: "did"} + index: { + id: 1 + fields: "controller,subject" + unique: true + } }; // The unique identifier of the authentication @@ -52,8 +60,8 @@ message Authentication { // Origin of the authentication string subject = 3; - // PubKey is the verification method - PubKey public_key = 4; + // string is the verification method + string public_key_hex = 4; // CredentialID is the byte representation of the credential ID bytes credential_id = 5; @@ -65,15 +73,57 @@ message Authentication { int64 creation_block = 7; } +// Macaroon is a Macaroon message type. +message Biscuit { + option (cosmos.orm.v1.table) = { + id: 5 + primary_key: { + fields: "id" + auto_increment: true + } + index: { + id: 1 + fields: "subject,origin" + unique: true + } + }; + + uint64 id = 1; + string controller = 2; + string subject = 3; + string origin = 4; + int64 expiry_height = 5; + string macaroon = 6; +} + // Controller represents a Sonr DWN Vault message Controller { option (cosmos.orm.v1.table) = { - id : 3 - primary_key : {fields : "number" auto_increment : true} - index : {id : 1 fields : "sonr_address" unique : true} - index : {id : 2 fields : "eth_address" unique : true} - index : {id : 3 fields : "btc_address" unique : true} - index : {id : 4 fields : "did" unique : true} + id: 3 + primary_key: { + fields: "number" + auto_increment: true + } + index: { + id: 1 + fields: "sonr_address" + unique: true + } + index: { + id: 2 + fields: "eth_address" + unique: true + } + index: { + id: 3 + fields: "btc_address" + unique: true + } + index: { + id: 4 + fields: "did" + unique: true + } }; // The unique identifier of the controller @@ -91,8 +141,8 @@ message Controller { // The DID of the controller string btc_address = 5; - // PubKey is the verification method - PubKey public_key = 6; + // string is the verification method + string public_key_hex = 6; // Pointer to the Keyshares string ks_val = 7; @@ -104,45 +154,26 @@ message Controller { int64 creation_block = 9; } -// Grant is a Grant message type. -message Grant { - option (cosmos.orm.v1.table) = { - id : 4 - primary_key : {fields : "id" auto_increment : true} - index : {id : 1 fields : "subject,origin" unique : true} - }; - - uint64 id = 1; - string controller = 2; - string subject = 3; - string origin = 4; - int64 expiry_height = 5; -} - -// Macaroon is a Macaroon message type. -message Macaroon { - option (cosmos.orm.v1.table) = { - id : 5 - primary_key : {fields : "id" auto_increment : true} - index : {id : 1 fields : "subject,origin" unique : true} - }; - - uint64 id = 1; - string controller = 2; - string subject = 3; - string origin = 4; - int64 expiry_height = 5; - string macaroon = 6; -} - // Verification represents a verification method message Verification { option (cosmos.orm.v1.table) = { - id : 6 - primary_key : {fields : "did"} - index : {id : 1 fields : "issuer,subject" unique : true} - index : {id : 2 fields : "controller,did_method,issuer" unique : true} - index : {id : 3 fields : "verification_type,subject,issuer" unique : true} + id: 6 + primary_key: {fields: "did"} + index: { + id: 1 + fields: "issuer,subject" + unique: true + } + index: { + id: 2 + fields: "controller,did_method,issuer" + unique: true + } + index: { + id: 3 + fields: "verification_type,subject,issuer" + unique: true + } }; // The unique identifier of the verification @@ -161,7 +192,7 @@ message Verification { string subject = 5; // The public key of the verification - PubKey public_key = 6; + string public_key_hex = 6; // The verification method type string verification_type = 7; diff --git a/proto/did/v1/tx.proto b/proto/did/v1/tx.proto index 20a310c3f..c451ad2e8 100644 --- a/proto/did/v1/tx.proto +++ b/proto/did/v1/tx.proto @@ -5,6 +5,7 @@ package did.v1; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "did/v1/genesis.proto"; +import "did/v1/params.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; @@ -21,16 +22,13 @@ service Msg { rpc LinkAssertion(MsgLinkAssertion) returns (MsgLinkAssertionResponse); // LinkAuthentication links an authentication to a controller. - rpc LinkAuthentication(MsgLinkAuthentication) - returns (MsgLinkAuthenticationResponse); + rpc LinkAuthentication(MsgLinkAuthentication) returns (MsgLinkAuthenticationResponse); // UnlinkAssertion unlinks an assertion from a controller. - rpc UnlinkAssertion(MsgUnlinkAssertion) - returns (MsgUnlinkAssertionResponse); + rpc UnlinkAssertion(MsgUnlinkAssertion) returns (MsgUnlinkAssertionResponse); // UnlinkAuthentication unlinks an authentication from a controller. - rpc UnlinkAuthentication(MsgUnlinkAuthentication) - returns (MsgUnlinkAuthenticationResponse); + rpc UnlinkAuthentication(MsgUnlinkAuthentication) returns (MsgUnlinkAuthenticationResponse); // UpdateParams defines a governance operation for updating the parameters. rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); @@ -41,7 +39,7 @@ message MsgLinkAuthentication { option (cosmos.msg.v1.signer) = "controller"; // Controller is the address of the controller to authenticate. - string controller = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Subject is the subject of the authentication. string subject = 2; @@ -72,7 +70,7 @@ message MsgLinkAssertion { option (cosmos.msg.v1.signer) = "controller"; // Controller is the address of the controller to authenticate. - string controller = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Subject is the subject of the authentication. string subject = 2; @@ -95,13 +93,12 @@ message MsgLinkAssertionResponse { string did = 2; } - // MsgExecuteTx is the message type for the ExecuteTx RPC. message MsgExecuteTx { option (cosmos.msg.v1.signer) = "controller"; // Controller is the address of the controller to authenticate. - string controller = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Messages is the list of messages to execute. map messages = 2; @@ -121,7 +118,7 @@ message MsgUnlinkAssertion { option (cosmos.msg.v1.signer) = "controller"; // Controller is the address of the controller to authenticate. - string controller = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Assertion is the assertion of the authentication. string assertion_did = 2; @@ -146,7 +143,7 @@ message MsgUnlinkAuthentication { option (cosmos.msg.v1.signer) = "controller"; // Controller is the address of the controller to authenticate. - string controller = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Subject is the subject of the authentication. string authentication_did = 2; @@ -173,10 +170,10 @@ message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; // authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // params defines the parameters to update. - Params params = 2 [ (gogoproto.nullable) = false ]; + Params params = 2 [(gogoproto.nullable) = false]; // token is the macron token to authenticate the operation. string token = 3; diff --git a/proto/service/module/v1/module.proto b/proto/service/module/v1/module.proto index 115913b1c..15a603131 100644 --- a/proto/service/module/v1/module.proto +++ b/proto/service/module/v1/module.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package onsonr.sonr.service.module.v1; +package service.module.v1; import "cosmos/app/v1alpha1/module.proto"; // Module is the app config object of the module. // Learn more: https://docs.cosmos.network/main/building-modules/depinject message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/onsonr/sonr/x/service"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/onsonr/sonr"}; } diff --git a/proto/service/v1/state.proto b/proto/service/v1/state.proto index 78c6520f2..b9a84b191 100644 --- a/proto/service/v1/state.proto +++ b/proto/service/v1/state.proto @@ -9,9 +9,16 @@ option go_package = "github.com/onsonr/sonr/x/service/types"; message Metadata { option (cosmos.orm.v1.table) = { - id : 1 - primary_key : {fields : "id" auto_increment : true} - index : {id : 1 fields : "origin" unique : true} + id: 1 + primary_key: { + fields: "id" + auto_increment: true + } + index: { + id: 1 + fields: "origin" + unique: true + } }; uint64 id = 1; @@ -19,16 +26,20 @@ message Metadata { string name = 3; string description = 4; string category = 5; - URI icon = 6; + string icon = 6; repeated string tags = 7; } // Profile represents a DID alias message Profile { option (cosmos.orm.v1.table) = { - id : 2 - primary_key : {fields : "id"} - index : {id : 1 fields : "subject,origin" unique : true} + id: 2 + primary_key: {fields: "id"} + index: { + id: 1 + fields: "subject,origin" + unique: true + } }; // The unique identifier of the alias @@ -43,13 +54,3 @@ message Profile { // Controller of the alias string controller = 4; } - -message URI { - enum Protocol { - HTTPS = 0; - IPFS = 1; - } - - Protocol protocol = 1; - string uri = 2; -} diff --git a/proto/service/v1/tx.proto b/proto/service/v1/tx.proto index 35bbb4e77..063b48c61 100644 --- a/proto/service/v1/tx.proto +++ b/proto/service/v1/tx.proto @@ -29,12 +29,12 @@ message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; // authority is the address of the governance account. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // params defines the parameters to update. // // NOTE: All parameters must be supplied. - Params params = 2 [ (gogoproto.nullable) = false ]; + Params params = 2 [(gogoproto.nullable) = false]; } // MsgUpdateParamsResponse defines the response structure for executing a @@ -48,7 +48,7 @@ message MsgRegisterService { option (cosmos.msg.v1.signer) = "controller"; // authority is the address of the governance account. - string controller = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // origin is the origin of the request in wildcard form. Requires valid TXT // record in DNS. diff --git a/proto/vault/module/v1/module.proto b/proto/vault/module/v1/module.proto index 3501fc75b..c3d0166ee 100644 --- a/proto/vault/module/v1/module.proto +++ b/proto/vault/module/v1/module.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package onsonr.sonr.vault.module.v1; +package vault.module.v1; import "cosmos/app/v1alpha1/module.proto"; // Module is the app config object of the module. // Learn more: https://docs.cosmos.network/main/building-modules/depinject message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/onsonr/sonr/x/vault"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/onsonr/sonr"}; } diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index aeac42056..844cbdbaf 100644 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -3,6 +3,7 @@ set -e GO_MOD_PACKAGE="github.com/onsonr/sonr" +ROOT_DIR=$(git rev-parse --show-toplevel) echo "Generating gogo proto code" cd proto @@ -28,7 +29,7 @@ rm -rf github.com # Copy files over for dep injection rm -rf api && mkdir api -custom_modules=$(find . -name 'module' -type d -not -path "./proto/*") +custom_modules=$(find . -name 'module' -type d -not -path "./proto/*" -not -path "./.cache/*") # get the 1 up directory (so ./cosmos/mint/module becomes ./cosmos/mint) # remove the relative path starter from base namespaces. so ./cosmos/mint becomes cosmos/mint @@ -48,3 +49,19 @@ for module in $base_namespace; do rm -rf $module done + +cd $ROOT_DIR + +echo "Generating third-party proto code" +cd third_party/proto +buf generate + +echo "Copying generated proto code" +cd $ROOT_DIR/github.com/onsonr/sonr/pkg + +cp -r hway/types/* $ROOT_DIR/pkg/hway/types +cp -r common/types/* $ROOT_DIR/pkg/common/types +cp -r motr/types/* $ROOT_DIR/pkg/motr/types + +echo "Cleaning up" +rm -rf $ROOT_DIR/github.com diff --git a/pkl/README.md b/third_party/pkl/README.md similarity index 100% rename from pkl/README.md rename to third_party/pkl/README.md diff --git a/pkl/DWN.pkl b/third_party/pkl/src/sonr.configs.v1/DWN.pkl similarity index 90% rename from pkl/DWN.pkl rename to third_party/pkl/src/sonr.configs.v1/DWN.pkl index 05fc73f79..546b7da85 100644 --- a/pkl/DWN.pkl +++ b/third_party/pkl/src/sonr.configs.v1/DWN.pkl @@ -1,6 +1,6 @@ -@go.Package { name = "github.com/onsonr/sonr/internal/dwn/gen" } +@go.Package { name = "github.com/onsonr/sonr/pkg/motr/config" } -module dwngen +module dwn import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" diff --git a/pkl/ORM.pkl b/third_party/pkl/src/sonr.models.v1/ORM.pkl similarity index 98% rename from pkl/ORM.pkl rename to third_party/pkl/src/sonr.models.v1/ORM.pkl index 4847f7cac..c074e3619 100644 --- a/pkl/ORM.pkl +++ b/third_party/pkl/src/sonr.models.v1/ORM.pkl @@ -1,4 +1,4 @@ -@go.Package { name = "github.com/onsonr/sonr/internal/orm" } +@go.Package { name = "github.com/onsonr/sonr/pkg/motr/types/orm" } module orm diff --git a/third_party/proto/README.md b/third_party/proto/README.md new file mode 100644 index 000000000..a8b7e3ffd --- /dev/null +++ b/third_party/proto/README.md @@ -0,0 +1,19 @@ +# Sonr Third Party Protobuf + +## Overview + +This directory contains the protobuf definitions for packages that are not part of the Sonr blockchain. + +## Directory Structure + +### `hway` + +The `hway` directory contains the protobuf definitions for the Highway gateway. + +### `ipfs` + +The `ipfs` directory contains the protobuf definitions for the IPFS Network. + +### `motr` + +The `motr` directory contains the protobuf definitions for the Motr client. diff --git a/third_party/proto/buf.gen.yaml b/third_party/proto/buf.gen.yaml new file mode 100644 index 000000000..85f837e44 --- /dev/null +++ b/third_party/proto/buf.gen.yaml @@ -0,0 +1,7 @@ +version: v1 +plugins: + - name: go + out: ../.. + - name: grpc-gateway + out: ../.. + opt: logtostderr=true,allow_colon_final_segments=true diff --git a/third_party/proto/buf.lock b/third_party/proto/buf.lock new file mode 100644 index 000000000..fdb5ceebd --- /dev/null +++ b/third_party/proto/buf.lock @@ -0,0 +1,38 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: cosmos + repository: cosmos-proto + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: 05419252bcc241ea8023acf1ed4cadc5 + digest: shake256:1e54a48c19a8b59d35e0a7efa76402939f515f2d8005df099856f24c37c20a52800308f025abb8cffcd014d437b49707388aaca4865d9d063d8f25d5d4eb77d5 + - remote: buf.build + owner: cosmos + repository: gogo-proto + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba + - remote: buf.build + owner: googleapis + repository: googleapis + commit: c0913f24652a4cfc95f77d97443a5005 + digest: shake256:0ef3248c6235d420fe61f373154adcde6b94e3297f82472b1d8d8c3747240b61b4a10405e2a6f8ac1c98816ac6e690ea7871024aa5ae0e035cd540214667ceed + - remote: buf.build + owner: onsonr + repository: sonr + commit: e2a05b1a59154da6be3fe148cf01a375 + digest: shake256:0714d88978fe9a1d7b438b13ee1e95aeaef24c7f3667957da60b9a9d8f2ad55f40c2fb84409e21d47738969bff02fa16682340449653508a2ce6196ac2aec36b + - remote: buf.build + owner: protocolbuffers + repository: wellknowntypes + commit: 657250e6a39648cbb169d079a60bd9ba + digest: shake256:00de25001b8dd2e29d85fc4bcc3ede7aed886d76d67f5e0f7a9b320b90f871d3eb73507d50818d823a0512f3f8db77a11c043685528403e31ff3fef18323a9fb + - remote: buf.build + owner: tendermint + repository: tendermint + commit: 33ed361a90514289beabf3189e1d7665 + digest: shake256:038267e06294714fd883610626554b04a127b576b4e253befb4206cb72d5d3c1eeccacd4b9ec8e3fb891f7c14e1cb0f770c077d2989638995b0a61c85afedb1d diff --git a/third_party/proto/buf.yaml b/third_party/proto/buf.yaml new file mode 100644 index 000000000..5015909eb --- /dev/null +++ b/third_party/proto/buf.yaml @@ -0,0 +1,15 @@ +version: v1 +name: buf.build/onsonr/thirdparty +deps: + - buf.build/onsonr/sonr +lint: + use: + - DEFAULT + - COMMENTS + - FILE_LOWER_SNAKE_CASE + except: + - UNARY_RPC + - COMMENT_FIELD + - SERVICE_SUFFIX + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME diff --git a/third_party/proto/common/v1/ipfs.proto b/third_party/proto/common/v1/ipfs.proto new file mode 100644 index 000000000..65ec027a2 --- /dev/null +++ b/third_party/proto/common/v1/ipfs.proto @@ -0,0 +1,5 @@ +syntax = "proto3"; + +package common.v1; + +option go_package = "github.com/onsonr/sonr/pkg/common/types;commonv1"; diff --git a/third_party/proto/common/v1/keys.proto b/third_party/proto/common/v1/keys.proto new file mode 100644 index 000000000..2791c656d --- /dev/null +++ b/third_party/proto/common/v1/keys.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package common.v1; + +option go_package = "github.com/onsonr/sonr/pkg/common/types;commonv1"; + +// PubKey defines a public key for a did +message PubKey { + string role = 1; + string key_type = 2; + RawKey raw_key = 3; + JSONWebKey jwk = 4; +} + +// JWK represents a JSON Web Key +message JSONWebKey { + string kty = 1; // Key Type + string crv = 2; // Curve (for EC and OKP keys) + string x = 3; // X coordinate (for EC and OKP keys) + string y = 4; // Y coordinate (for EC keys) + string n = 5; // Modulus (for RSA keys) + string e = 6; // Exponent (for RSA keys) +} + +message RawKey { + string algorithm = 1; + string encoding = 2; + string curve = 3; + bytes key = 4; +} diff --git a/third_party/proto/common/v1/uri.proto b/third_party/proto/common/v1/uri.proto new file mode 100644 index 000000000..365a0e4d3 --- /dev/null +++ b/third_party/proto/common/v1/uri.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package common.v1; + +option go_package = "github.com/onsonr/sonr/pkg/common/types;commonv1"; + +message URI { + enum URIProtocol { + HTTPS = 0; + IPFS = 1; + IPNS = 2; + DID = 3; + } + URIProtocol protocol = 1; + string value = 2; +} diff --git a/third_party/proto/hway/v1/api.proto b/third_party/proto/hway/v1/api.proto new file mode 100644 index 000000000..b473407ac --- /dev/null +++ b/third_party/proto/hway/v1/api.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package hway.v1; + +option go_package = "github.com/onsonr/sonr/pkg/hway/types"; + +service Highway { + rpc GetJWKS(GetJWKSRequest) returns (GetJWKSResponse); + rpc GetToken(GetTokenRequest) returns (GetTokenResponse); + rpc GrantAuthorization(GrantAuthorizationRequest) returns (GrantAuthorizationResponse); +} + +message GetJWKSRequest {} + +message GetJWKSResponse { + string jwks = 1; +} + +message GetTokenRequest { + string subject = 1; + string origin = 2; + string key = 3; + string asset = 4; +} + +message GetTokenResponse { + string token = 1; +} + +message GrantAuthorizationRequest { + string subject = 1; + string origin = 2; + string key = 3; + string asset = 4; + string assertion = 5; +} + +message GrantAuthorizationResponse { + string token = 1; +} diff --git a/third_party/proto/hway/v1/client.proto b/third_party/proto/hway/v1/client.proto new file mode 100644 index 000000000..a77ad48ef --- /dev/null +++ b/third_party/proto/hway/v1/client.proto @@ -0,0 +1,3 @@ +package hway.v1; + +option go_package = "github.com/onsonr/sonr/pkg/hway/types"; diff --git a/third_party/proto/motr/v1/api.proto b/third_party/proto/motr/v1/api.proto new file mode 100644 index 000000000..e0606f00c --- /dev/null +++ b/third_party/proto/motr/v1/api.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package motr.v1; + +option go_package = "github.com/onsonr/sonr/pkg/motr/types"; + +service Motr { + rpc Pin(PinRequest) returns (PinResponse); + rpc Unpin(UnpinRequest) returns (UnpinResponse); +} + +message PinRequest { + string cid = 1; +} + +message PinResponse { + bool success = 1; +} + +message UnpinRequest { + string cid = 1; +} + +message UnpinResponse { + bool success = 1; +} diff --git a/x/did/types/controller.go b/x/did/controller/base.go similarity index 63% rename from x/did/types/controller.go rename to x/did/controller/base.go index a3e0d4dfc..43beea8bb 100644 --- a/x/did/types/controller.go +++ b/x/did/controller/base.go @@ -1,20 +1,20 @@ -package types +package controller import ( "github.com/onsonr/crypto/mpc" - sdk "github.com/cosmos/cosmos-sdk/types" - didv1 "github.com/onsonr/sonr/api/did/v1" + commonv1 "github.com/onsonr/sonr/pkg/common/types" + "github.com/onsonr/sonr/x/did/types" ) type ControllerI interface { ChainID() string - GetPubKey() *didv1.PubKey + GetPubKey() *commonv1.PubKey SonrAddress() string RawPublicKey() []byte } -func NewController(shares []mpc.Share) (ControllerI, error) { +func New(shares []mpc.Share) (ControllerI, error) { var ( valKs = shares[0] userKs = shares[1] @@ -23,7 +23,7 @@ func NewController(shares []mpc.Share) (ControllerI, error) { if err != nil { return nil, err } - sonrAddr, err := ComputeSonrAddress(pb) + sonrAddr, err := types.ComputeSonrAddr(pb) if err != nil { return nil, err } @@ -36,14 +36,6 @@ func NewController(shares []mpc.Share) (ControllerI, error) { }, nil } -func LoadControllerFromTableEntry(ctx sdk.Context, entry *didv1.Controller) (ControllerI, error) { - return &controller{ - address: entry.Did, - chainID: ctx.ChainID(), - publicKey: entry.PublicKey.RawKey.Key, - }, nil -} - type controller struct { userKs mpc.Share valKs mpc.Share @@ -57,10 +49,10 @@ func (c *controller) ChainID() string { return c.chainID } -func (c *controller) GetPubKey() *didv1.PubKey { - return &didv1.PubKey{ +func (c *controller) GetPubKey() *commonv1.PubKey { + return &commonv1.PubKey{ KeyType: "ecdsa", - RawKey: &didv1.RawKey{ + RawKey: &commonv1.RawKey{ Algorithm: "secp256k1", Key: c.publicKey, }, diff --git a/x/did/controller/signer/actor.go b/x/did/controller/signer/actor.go new file mode 100644 index 000000000..f158c30fa --- /dev/null +++ b/x/did/controller/signer/actor.go @@ -0,0 +1 @@ +package signer diff --git a/x/did/controller/signer/context.go b/x/did/controller/signer/context.go new file mode 100644 index 000000000..f158c30fa --- /dev/null +++ b/x/did/controller/signer/context.go @@ -0,0 +1 @@ +package signer diff --git a/x/did/types/mpc/signer.go b/x/did/controller/signer/signer.go similarity index 97% rename from x/did/types/mpc/signer.go rename to x/did/controller/signer/signer.go index ad54e9c3b..5db3a24c7 100644 --- a/x/did/types/mpc/signer.go +++ b/x/did/controller/signer/signer.go @@ -1,4 +1,4 @@ -package mpc +package signer import ( "context" diff --git a/x/did/controller/table.go b/x/did/controller/table.go new file mode 100644 index 000000000..62ae0cfe6 --- /dev/null +++ b/x/did/controller/table.go @@ -0,0 +1,20 @@ +package controller + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common/hexutil" + + didv1 "github.com/onsonr/sonr/api/did/v1" +) + +func LoadFromTableEntry(ctx sdk.Context, entry *didv1.Controller) (ControllerI, error) { + k, err := hexutil.Decode(entry.PublicKeyHex) + if err != nil { + return nil, err + } + return &controller{ + address: entry.Did, + chainID: ctx.ChainID(), + publicKey: k, + }, nil +} diff --git a/x/did/controller/wallet/pubkey.go b/x/did/controller/wallet/pubkey.go new file mode 100644 index 000000000..509738b9a --- /dev/null +++ b/x/did/controller/wallet/pubkey.go @@ -0,0 +1,140 @@ +package wallet + +import ( + "bytes" + "fmt" + "strings" + + sdk "github.com/cosmos/cosmos-sdk/crypto/types" + "google.golang.org/protobuf/proto" + + commonv1 "github.com/onsonr/sonr/pkg/common/types" +) + +type PubKeyI interface { + GetRole() string + GetKeyType() string + GetRawKey() *commonv1.RawKey + GetJwk() *commonv1.JSONWebKey +} + +// PubKey defines a generic pubkey. +type PublicKey interface { + VerifySignature(msg, sig []byte) bool +} + +type PubKeyG[T any] interface { + *T + PublicKey +} + +type pubKeyImpl struct { + decode func(b []byte) (PublicKey, error) + validate func(key PublicKey) error +} + +// func WithSecp256K1PubKey() Option { +// return WithPubKeyWithValidationFunc(func(pt *secp256k1.PubKey) error { +// _, err := dcrd_secp256k1.ParsePubKey(pt.Key) +// return err +// }) +// } +// +// func WithPubKey[T any, PT PubKeyG[T]]() Option { +// return WithPubKeyWithValidationFunc[T, PT](func(_ PT) error { +// return nil +// }) +// } +// +// func WithPubKeyWithValidationFunc[T any, PT PubKeyG[T]](validateFn func(PT) error) Option { +// pkImpl := pubKeyImpl{ +// decode: func(b []byte) (PublicKey, error) { +// key := PT(new(T)) +// err := gogoproto.Unmarshal(b, key) +// if err != nil { +// return nil, err +// } +// return key, nil +// }, +// validate: func(k PublicKey) error { +// concrete, ok := k.(PT) +// if !ok { +// return fmt.Errorf( +// "invalid pubkey type passed for validation, wanted: %T, got: %T", +// concrete, +// k, +// ) +// } +// return validateFn(concrete) +// }, +// } +// return func(a *Account) { +// a.supportedPubKeys[gogoproto.MessageName(PT(new(T)))] = pkImpl +// } +// } +func nameFromTypeURL(url string) string { + name := url + if i := strings.LastIndexByte(url, '/'); i >= 0 { + name = name[i+len("/"):] + } + return name +} + +// CustomPubKey represents a custom secp256k1 public key. +type CustomPubKey struct { + proto.Message + + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +// NewCustomPubKeyFromRawBytes creates a new CustomPubKey from raw bytes. +func NewCustomPubKeyFromRawBytes(key []byte) (*CustomPubKey, error) { + // Validate the key length and format + if len(key) != 33 { + return nil, fmt.Errorf("invalid key length; expected 33 bytes, got %d", len(key)) + } + if key[0] != 0x02 && key[0] != 0x03 { + return nil, fmt.Errorf("invalid key format; expected 0x02 or 0x03 as the first byte, got 0x%02x", key[0]) + } + + return &CustomPubKey{Key: key}, nil +} + +// Bytes returns the byte representation of the public key. +func (pk *CustomPubKey) Bytes() []byte { + return pk.Key +} + +// Equals checks if two public keys are equal. +func (pk *CustomPubKey) Equals(other sdk.PubKey) bool { + return bytes.EqualFold(pk.Bytes(), other.Bytes()) +} + +// Type returns the type of the public key. +func (pk *CustomPubKey) Type() string { + return "custom-secp256k1" +} + +// Marshal implements the proto.Message interface. +func (pk *CustomPubKey) Marshal() ([]byte, error) { + return proto.Marshal(pk) +} + +// Unmarshal implements the proto.Message interface. +func (pk *CustomPubKey) Unmarshal(data []byte) error { + return proto.Unmarshal(data, pk) +} + +// Address returns the address derived from the public key. +func (pk *CustomPubKey) Address() []byte { + // Implement address derivation logic here + // For simplicity, this example uses a placeholder + return []byte("derived-address") +} + +// VerifySignature verifies a signature using the public key. +func (pk *CustomPubKey) VerifySignature(msg []byte, sig []byte) bool { + // Implement signature verification logic here + // For simplicity, this example uses a placeholder + return true +} diff --git a/x/did/controller/wallet/txns.go b/x/did/controller/wallet/txns.go new file mode 100644 index 000000000..23a750732 --- /dev/null +++ b/x/did/controller/wallet/txns.go @@ -0,0 +1 @@ +package wallet diff --git a/x/did/controller/wallet/wallet.go b/x/did/controller/wallet/wallet.go new file mode 100644 index 000000000..23a750732 --- /dev/null +++ b/x/did/controller/wallet/wallet.go @@ -0,0 +1 @@ +package wallet diff --git a/x/did/keeper/controller.go b/x/did/keeper/controller.go deleted file mode 100644 index fa792fbde..000000000 --- a/x/did/keeper/controller.go +++ /dev/null @@ -1,31 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/onsonr/crypto/mpc" - "github.com/onsonr/sonr/x/did/types" -) - -func (k Keeper) NewController(ctx sdk.Context) (types.ControllerI, error) { - shares, err := mpc.GenerateKeyshares() - if err != nil { - return nil, err - } - controller, err := types.NewController(shares) - if err != nil { - return nil, err - } - return controller, nil -} - -func (k Keeper) ResolveController(ctx sdk.Context, did string) (types.ControllerI, error) { - ct, err := k.OrmDB.ControllerTable().GetByDid(ctx, did) - if err != nil { - return nil, err - } - c, err := types.LoadControllerFromTableEntry(ctx, ct) - if err != nil { - return nil, err - } - return c, nil -} diff --git a/x/did/keeper/genesis.go b/x/did/keeper/genesis.go index 74ba610c4..1292523b6 100644 --- a/x/did/keeper/genesis.go +++ b/x/did/keeper/genesis.go @@ -4,11 +4,37 @@ import ( "context" "cosmossdk.io/log" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/onsonr/crypto/mpc" + + "github.com/onsonr/sonr/x/did/controller" "github.com/onsonr/sonr/x/did/types" ) +func (k Keeper) NewController(ctx sdk.Context) (controller.ControllerI, error) { + shares, err := mpc.GenerateKeyshares() + if err != nil { + return nil, err + } + controller, err := controller.New(shares) + if err != nil { + return nil, err + } + return controller, nil +} + +func (k Keeper) ResolveController(ctx sdk.Context, did string) (controller.ControllerI, error) { + ct, err := k.OrmDB.ControllerTable().GetByDid(ctx, did) + if err != nil { + return nil, err + } + c, err := controller.LoadFromTableEntry(ctx, ct) + if err != nil { + return nil, err + } + return c, nil +} + // Logger returns the logger func (k Keeper) Logger() log.Logger { return k.logger diff --git a/x/did/keeper/issuer.go b/x/did/keeper/issuer.go deleted file mode 100644 index ab8d5136e..000000000 --- a/x/did/keeper/issuer.go +++ /dev/null @@ -1,59 +0,0 @@ -package keeper - -import ( - "crypto/sha256" - "fmt" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - didtypes "github.com/onsonr/sonr/x/did/types" - "gopkg.in/macaroon.v2" -) - -var fourYears = time.Hour * 24 * 365 * 4 - -// IssueAdminMacaroon creates a macaroon with the specified parameters. -func (k Keeper) IssueAdminMacaroon(sdkctx sdk.Context, controller didtypes.ControllerI) (*macaroon.Macaroon, error) { - // Derive the root key by hashing the shared MPC public key - rootKey := sha256.Sum256([]byte(controller.RawPublicKey())) - // Create the macaroon - m, err := macaroon.New(rootKey[:], []byte(controller.SonrAddress()), controller.ChainID(), macaroon.LatestVersion) - if err != nil { - return nil, err - } - - // Add the block expiry caveat - caveat := fmt.Sprintf("block-expiry=%d", calculateBlockExpiry(sdkctx, fourYears)) - err = m.AddFirstPartyCaveat([]byte(caveat)) - if err != nil { - return nil, err - } - - return m, nil -} - -// IssueServiceMacaroon creates a macaroon with the specified parameters. -func (k Keeper) IssueServiceMacaroon(sdkctx sdk.Context, sharedMPCPubKey, location, id string, blockExpiry uint64) (*macaroon.Macaroon, error) { - // Derive the root key by hashing the shared MPC public key - rootKey := sha256.Sum256([]byte(sharedMPCPubKey)) - // Create the macaroon - m, err := macaroon.New(rootKey[:], []byte(id), location, macaroon.LatestVersion) - if err != nil { - return nil, err - } - - // Add the block expiry caveat - caveat := fmt.Sprintf("block-expiry=%d", blockExpiry) - err = m.AddFirstPartyCaveat([]byte(caveat)) - if err != nil { - return nil, err - } - - return m, nil -} - -func calculateBlockExpiry(sdkctx sdk.Context, duration time.Duration) uint64 { - blockTime := sdkctx.BlockTime() - avgBlockTime := float64(blockTime.Sub(blockTime).Seconds()) - return uint64(duration.Seconds() / avgBlockTime) -} diff --git a/x/did/types/account.go b/x/did/types/account.go deleted file mode 100644 index 16be5f447..000000000 --- a/x/did/types/account.go +++ /dev/null @@ -1,12 +0,0 @@ -package types - -type SonrAccount struct { - ID string - Name string - Address string - PublicKey string - ChainCode string - Index string - Controller string - CreatedAt string -} diff --git a/x/did/types/accstd/exports.go b/x/did/types/accstd/exports.go new file mode 100644 index 000000000..320c72c27 --- /dev/null +++ b/x/did/types/accstd/exports.go @@ -0,0 +1,166 @@ +// Package accountstd exports the types and functions that are used by developers to implement smart accounts. +package accstd + +import ( + "bytes" + "context" + "errors" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" + + "github.com/onsonr/sonr/pkg/core/transaction" + "github.com/onsonr/sonr/x/did/types/accstd/internal/accounts" +) + +var ( + accountsModuleAddress = address.Module("accounts") + ErrInvalidType = errors.New("invalid type") +) + +// Interface is the exported interface of an Account. +type Interface = accounts.Account + +// ExecuteBuilder is the exported type of ExecuteBuilder. +type ExecuteBuilder = accounts.ExecuteBuilder + +// QueryBuilder is the exported type of QueryBuilder. +type QueryBuilder = accounts.QueryBuilder + +// InitBuilder is the exported type of InitBuilder. +type InitBuilder = accounts.InitBuilder + +// AccountCreatorFunc is the exported type of AccountCreatorFunc. +type AccountCreatorFunc = accounts.AccountCreatorFunc + +func DIAccount[A Interface](name string, constructor func(deps Dependencies) (A, error)) DepinjectAccount { + return DepinjectAccount{MakeAccount: AddAccount(name, constructor)} +} + +type DepinjectAccount struct { + MakeAccount AccountCreatorFunc +} + +func (DepinjectAccount) IsManyPerContainerType() {} + +// Dependencies is the exported type of Dependencies. +type Dependencies = accounts.Dependencies + +func RegisterExecuteHandler[ + Req any, ProtoReq accounts.ProtoMsgG[Req], Resp any, ProtoResp accounts.ProtoMsgG[Resp], +](router *ExecuteBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error), +) { + accounts.RegisterExecuteHandler(router, handler) +} + +// RegisterQueryHandler registers a query handler for a smart account that uses protobuf. +func RegisterQueryHandler[ + Req any, ProtoReq accounts.ProtoMsgG[Req], Resp any, ProtoResp accounts.ProtoMsgG[Resp], +](router *QueryBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error), +) { + accounts.RegisterQueryHandler(router, handler) +} + +// RegisterInitHandler registers an initialisation handler for a smart account that uses protobuf. +func RegisterInitHandler[ + Req any, ProtoReq accounts.ProtoMsgG[Req], Resp any, ProtoResp accounts.ProtoMsgG[Resp], +](router *InitBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error), +) { + accounts.RegisterInitHandler(router, handler) +} + +// AddAccount is a helper function to add a smart account to the list of smart accounts. +func AddAccount[A Interface](name string, constructor func(deps Dependencies) (A, error)) AccountCreatorFunc { + return func(deps accounts.Dependencies) (string, accounts.Account, error) { + acc, err := constructor(deps) + return name, acc, err + } +} + +// Whoami returns the address of the account being invoked. +func Whoami(ctx context.Context) []byte { + return accounts.Whoami(ctx) +} + +// Sender returns the sender of the execution request. +func Sender(ctx context.Context) []byte { + return accounts.Sender(ctx) +} + +// HasSender checks if the execution context was sent from the provided sender +func HasSender(ctx context.Context, wantSender []byte) bool { + return bytes.Equal(Sender(ctx), wantSender) +} + +// SenderIsSelf checks if the sender of the request is the account itself. +func SenderIsSelf(ctx context.Context) bool { return HasSender(ctx, Whoami(ctx)) } + +// SenderIsAccountsModule returns true if the sender of the execution request is the accounts module. +func SenderIsAccountsModule(ctx context.Context) bool { + return bytes.Equal(Sender(ctx), accountsModuleAddress) +} + +// Funds returns if any funds were sent during the execute or init request. In queries this +// returns nil. +func Funds(ctx context.Context) sdk.Coins { return accounts.Funds(ctx) } + +func ExecModule[MsgResp, Msg transaction.Msg](ctx context.Context, msg Msg) (resp MsgResp, err error) { + untyped, err := accounts.ExecModule(ctx, msg) + if err != nil { + return resp, err + } + return assertOrErr[MsgResp](untyped) +} + +// QueryModule can be used by an account to execute a module query. +func QueryModule[Resp, Req transaction.Msg](ctx context.Context, req Req) (resp Resp, err error) { + untyped, err := accounts.QueryModule(ctx, req) + if err != nil { + return resp, err + } + return assertOrErr[Resp](untyped) +} + +// UnpackAny unpacks a protobuf Any message generically. +func UnpackAny[Msg any, ProtoMsg accounts.ProtoMsgG[Msg]](any *accounts.Any) (*Msg, error) { + return accounts.UnpackAny[Msg, ProtoMsg](any) +} + +// PackAny packs a protobuf Any message generically. +func PackAny(msg transaction.Msg) (*accounts.Any, error) { + return accounts.PackAny(msg) +} + +// ExecModuleAnys can be used to execute a list of messages towards a module +// when those messages are packed in Any messages. The function returns a list +// of responses packed in Any messages. +func ExecModuleAnys(ctx context.Context, msgs []*accounts.Any) ([]*accounts.Any, error) { + responses := make([]*accounts.Any, len(msgs)) + for i, msg := range msgs { + concreteMessage, err := accounts.UnpackAnyRaw(msg) + if err != nil { + return nil, fmt.Errorf("error unpacking message %d: %w", i, err) + } + resp, err := accounts.ExecModule(ctx, concreteMessage) + if err != nil { + return nil, fmt.Errorf("error executing message %d: %w", i, err) + } + // pack again + respAnyPB, err := accounts.PackAny(resp) + if err != nil { + return nil, fmt.Errorf("error packing response %d: %w", i, err) + } + responses[i] = respAnyPB + } + return responses, nil +} + +// asserts the given any to the provided generic, returns ErrInvalidType if it can't. +func assertOrErr[T any](r any) (concrete T, err error) { + concrete, ok := r.(T) + if !ok { + return concrete, ErrInvalidType + } + return concrete, nil +} diff --git a/x/did/types/accstd/internal/accounts/api_builder.go b/x/did/types/accstd/internal/accounts/api_builder.go new file mode 100644 index 000000000..f7fcf66f6 --- /dev/null +++ b/x/did/types/accstd/internal/accounts/api_builder.go @@ -0,0 +1,112 @@ +package accounts + +import ( + "context" + "errors" + "fmt" + + "github.com/onsonr/sonr/pkg/core/transaction" +) + +var ( + errNoInitHandler = errors.New("no init handler") + errNoExecuteHandler = errors.New("account does not accept messages") + errInvalidMessage = errors.New("invalid message") +) + +// NewInitBuilder creates a new InitBuilder instance. +func NewInitBuilder() *InitBuilder { + return &InitBuilder{} +} + +// InitBuilder defines a smart account's initialisation handler builder. +type InitBuilder struct { + // handler is the handler function that will be called when the smart account is initialized. + // Although the function here is defined to take an any, the smart account will work + // with a typed version of it. + handler func(ctx context.Context, initRequest transaction.Msg) (initResponse transaction.Msg, err error) + + // schema is the schema of the message that will be passed to the handler function. + schema HandlerSchema +} + +// makeHandler returns the handler function that will be called when the smart account is initialized. +// It returns an error if no handler was registered. +func (i *InitBuilder) makeHandler() (func(ctx context.Context, initRequest transaction.Msg) (initResponse transaction.Msg, err error), error) { + if i.handler == nil { + return nil, errNoInitHandler + } + return i.handler, nil +} + +// NewExecuteBuilder creates a new ExecuteBuilder instance. +func NewExecuteBuilder() *ExecuteBuilder { + return &ExecuteBuilder{ + handlers: make(map[string]func(ctx context.Context, executeRequest transaction.Msg) (executeResponse transaction.Msg, err error)), + handlersSchema: make(map[string]HandlerSchema), + } +} + +// ExecuteBuilder defines a smart account's execution router, it will be used to map an execution message +// to a handler function for a specific account. +type ExecuteBuilder struct { + // handlers is a map of handler functions that will be called when the smart account is executed. + handlers map[string]func(ctx context.Context, executeRequest transaction.Msg) (executeResponse transaction.Msg, err error) + + // handlersSchema is a map of schemas for the messages that will be passed to the handler functions + // and the messages that will be returned by the handler functions. + handlersSchema map[string]HandlerSchema + + // err is the error that occurred before building the handler function. + err error +} + +func (r *ExecuteBuilder) makeHandler() (func(ctx context.Context, executeRequest transaction.Msg) (executeResponse transaction.Msg, err error), error) { + // if no handler is registered it's fine, it means the account will not be accepting execution or query messages. + if len(r.handlers) == 0 { + return func(ctx context.Context, _ transaction.Msg) (_ transaction.Msg, err error) { + return nil, errNoExecuteHandler + }, nil + } + + if r.err != nil { + return nil, r.err + } + + // build the real execution handler + return func(ctx context.Context, executeRequest transaction.Msg) (executeResponse transaction.Msg, err error) { + messageName := MessageName(executeRequest) + handler, ok := r.handlers[messageName] + if !ok { + return nil, fmt.Errorf("%w: no handler for message %s", errInvalidMessage, messageName) + } + return handler(ctx, executeRequest) + }, nil +} + +// NewQueryBuilder creates a new QueryBuilder instance. +func NewQueryBuilder() *QueryBuilder { + return &QueryBuilder{ + er: NewExecuteBuilder(), + } +} + +// QueryBuilder defines a smart account's query router, it will be used to map a query message +// to a handler function for a specific account. +type QueryBuilder struct { + // er is the ExecuteBuilder, since there's no difference between the execution and query handlers API. + er *ExecuteBuilder +} + +func (r *QueryBuilder) makeHandler() (func(ctx context.Context, queryRequest transaction.Msg) (queryResponse transaction.Msg, err error), error) { + return r.er.makeHandler() +} + +// IsRoutingError returns true if the error is a routing error, +// which typically occurs when a message cannot be matched to a handler. +func IsRoutingError(err error) bool { + if err == nil { + return false + } + return errors.Is(err, errInvalidMessage) +} diff --git a/x/did/types/accstd/internal/accounts/context.go b/x/did/types/accstd/internal/accounts/context.go new file mode 100644 index 000000000..9cc72f17a --- /dev/null +++ b/x/did/types/accstd/internal/accounts/context.go @@ -0,0 +1,124 @@ +package accounts + +import ( + "context" + "encoding/binary" + + "cosmossdk.io/collections" + "cosmossdk.io/core/store" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/onsonr/sonr/pkg/core/transaction" + "github.com/onsonr/sonr/x/did/types/accstd/internal/prefixstore" +) + +var AccountStatePrefix = collections.NewPrefix(255) + +type ( + ModuleExecFunc = func(ctx context.Context, sender []byte, msg transaction.Msg) (transaction.Msg, error) + ModuleQueryFunc = func(ctx context.Context, queryReq transaction.Msg) (transaction.Msg, error) +) + +type contextKey struct{} + +type contextValue struct { + store store.KVStore // store is the prefixed store for the account. + sender []byte // sender is the address of the entity invoking the account action. + whoami []byte // whoami is the address of the account being invoked. + funds sdk.Coins // funds reports the coins sent alongside the request. + parentContext context.Context // parentContext that was used to build the account context. + moduleExec ModuleExecFunc // moduleExec is a function that executes a module message, when the resp type is unknown. + moduleQuery ModuleQueryFunc // moduleQuery is a function that queries a module. +} + +func addCtx(ctx context.Context, value contextValue) context.Context { + return context.WithValue(ctx, contextKey{}, value) +} + +func getCtx(ctx context.Context) contextValue { + return ctx.Value(contextKey{}).(contextValue) +} + +// MakeAccountContext creates a new account execution context given: +// storeSvc: which fetches the x/accounts module store. +// accountAddr: the address of the account being invoked, which is used to give the +// account a prefixed storage. +// sender: the address of entity invoking the account action. +// moduleExec: a function that executes a module message. +// moduleQuery: a function that queries a module. +func MakeAccountContext( + ctx context.Context, + storeSvc store.KVStoreService, + accNumber uint64, + accountAddr []byte, + sender []byte, + funds sdk.Coins, + moduleExec ModuleExecFunc, + moduleQuery ModuleQueryFunc, +) context.Context { + return addCtx(ctx, contextValue{ + store: makeAccountStore(ctx, storeSvc, accNumber), + sender: sender, + whoami: accountAddr, + funds: funds, + parentContext: ctx, + moduleExec: moduleExec, + moduleQuery: moduleQuery, + }) +} + +func SetSender(ctx context.Context, sender []byte) context.Context { + v := getCtx(ctx) + v.sender = sender + return addCtx(v.parentContext, v) +} + +// makeAccountStore creates the prefixed store for the account. +// It uses the number of the account, this gives constant size +// bytes prefixes for the account state. +func makeAccountStore(ctx context.Context, storeSvc store.KVStoreService, accNum uint64) store.KVStore { + prefix := make([]byte, 8) + binary.BigEndian.PutUint64(prefix, accNum) + return prefixstore.New(storeSvc.OpenKVStore(ctx), append(AccountStatePrefix, prefix...)) +} + +// ExecModule can be used to execute a message towards a module, when the response type is unknown. +func ExecModule(ctx context.Context, msg transaction.Msg) (transaction.Msg, error) { + // get sender + v := getCtx(ctx) + + resp, err := v.moduleExec(v.parentContext, v.whoami, msg) + if err != nil { + return nil, err + } + + return resp, nil +} + +// QueryModule can be used by an account to execute a module query. +func QueryModule(ctx context.Context, req transaction.Msg) (transaction.Msg, error) { + // we do not need to check the sender in a query because it is not a state transition. + // we also unwrap the original context. + v := getCtx(ctx) + resp, err := v.moduleQuery(v.parentContext, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// openKVStore returns the prefixed store for the account given the context. +func openKVStore(ctx context.Context) store.KVStore { return getCtx(ctx).store } + +// Sender returns the address of the entity invoking the account action. +func Sender(ctx context.Context) []byte { + return getCtx(ctx).sender +} + +// Whoami returns the address of the account being invoked. +func Whoami(ctx context.Context) []byte { + return getCtx(ctx).whoami +} + +// Funds returns the funds associated with the execution context. +func Funds(ctx context.Context) sdk.Coins { return getCtx(ctx).funds } diff --git a/x/did/types/accstd/internal/accounts/encoding.go b/x/did/types/accstd/internal/accounts/encoding.go new file mode 100644 index 000000000..aab7cf73e --- /dev/null +++ b/x/did/types/accstd/internal/accounts/encoding.go @@ -0,0 +1,66 @@ +package accounts + +import ( + "fmt" + "reflect" + "strings" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/gogoproto/proto" + + "github.com/onsonr/sonr/pkg/core/transaction" +) + +// ProtoMsgG is a generic interface for protobuf messages. +type ProtoMsgG[T any] interface { + *T + transaction.Msg +} + +type Any = codectypes.Any + +func FindMessageByName(name string) (transaction.Msg, error) { + typ := proto.MessageType(name) + if typ == nil { + return nil, fmt.Errorf("no message type found for %s", name) + } + return reflect.New(typ.Elem()).Interface().(transaction.Msg), nil +} + +func MessageName(msg transaction.Msg) string { + return proto.MessageName(msg) +} + +// PackAny packs a proto message into an anypb.Any. +func PackAny(msg transaction.Msg) (*Any, error) { + return codectypes.NewAnyWithValue(msg) +} + +// UnpackAny unpacks an anypb.Any into a proto message. +func UnpackAny[T any, PT ProtoMsgG[T]](anyPB *Any) (PT, error) { + to := new(T) + return to, UnpackAnyTo(anyPB, PT(to)) +} + +func UnpackAnyTo(anyPB *Any, to transaction.Msg) error { + return proto.Unmarshal(anyPB.Value, to) +} + +func UnpackAnyRaw(anyPB *Any) (proto.Message, error) { + split := strings.Split(anyPB.TypeUrl, "/") + name := split[len(split)-1] + typ := proto.MessageType(name) + if typ == nil { + return nil, fmt.Errorf("no message type found for %s", name) + } + to := reflect.New(typ.Elem()).Interface().(proto.Message) + return to, UnpackAnyTo(anyPB, to) +} + +func Merge(a, b transaction.Msg) { + proto.Merge(a, b) +} + +func Equal(a, b transaction.Msg) bool { + return proto.Equal(a, b) +} diff --git a/x/did/types/accstd/internal/accounts/implementation.go b/x/did/types/accstd/internal/accounts/implementation.go new file mode 100644 index 000000000..f19b3798d --- /dev/null +++ b/x/did/types/accstd/internal/accounts/implementation.go @@ -0,0 +1,157 @@ +package accounts + +import ( + "context" + "fmt" + + "cosmossdk.io/collections" + "cosmossdk.io/core/address" + "github.com/cosmos/cosmos-sdk/codec" + gogoproto "github.com/cosmos/gogoproto/proto" + + "github.com/onsonr/sonr/pkg/core/appmodule" + "github.com/onsonr/sonr/pkg/core/transaction" +) + +// Dependencies are passed to the constructor of a smart account. +type Dependencies struct { + SchemaBuilder *collections.SchemaBuilder + AddressCodec address.Codec + Environment appmodule.Environment + LegacyStateCodec interface { + Marshal(gogoproto.Message) ([]byte, error) + Unmarshal([]byte, gogoproto.Message) error + } +} + +// AccountCreatorFunc is a function that creates an account. +type AccountCreatorFunc = func(deps Dependencies) (string, Account, error) + +// MakeAccountsMap creates a map of account names to account implementations +// from a list of account creator functions. +func MakeAccountsMap( + cdc codec.Codec, + addressCodec address.Codec, + env appmodule.Environment, + accounts []AccountCreatorFunc, +) (map[string]Implementation, error) { + accountsMap := make(map[string]Implementation, len(accounts)) + for _, makeAccount := range accounts { + stateSchemaBuilder := collections.NewSchemaBuilderFromAccessor(openKVStore) + deps := Dependencies{ + SchemaBuilder: stateSchemaBuilder, + AddressCodec: addressCodec, + Environment: env, + LegacyStateCodec: cdc, + } + name, accountInterface, err := makeAccount(deps) + if err != nil { + return nil, fmt.Errorf("failed to create account %s: %w", name, err) + } + if _, ok := accountsMap[name]; ok { + return nil, fmt.Errorf("account %s is already registered", name) + } + impl, err := newImplementation(stateSchemaBuilder, accountInterface) + if err != nil { + return nil, fmt.Errorf("failed to create implementation for account %s: %w", name, err) + } + accountsMap[name] = impl + } + + return accountsMap, nil +} + +// newImplementation creates a new Implementation instance given an Account implementer. +func newImplementation(schemaBuilder *collections.SchemaBuilder, account Account) (Implementation, error) { + // make init handler + ir := NewInitBuilder() + account.RegisterInitHandler(ir) + initHandler, err := ir.makeHandler() + if err != nil { + return Implementation{}, err + } + + // make execute handler + er := NewExecuteBuilder() + account.RegisterExecuteHandlers(er) + executeHandler, err := er.makeHandler() + if err != nil { + return Implementation{}, err + } + + // make query handler + qr := NewQueryBuilder() + account.RegisterQueryHandlers(qr) + queryHandler, err := qr.makeHandler() + if err != nil { + return Implementation{}, err + } + + // build schema + schema, err := schemaBuilder.Build() + if err != nil { + return Implementation{}, err + } + return Implementation{ + Init: initHandler, + Execute: executeHandler, + Query: queryHandler, + CollectionsSchema: schema, + InitHandlerSchema: ir.schema, + QueryHandlersSchema: qr.er.handlersSchema, + ExecuteHandlersSchema: er.handlersSchema, + }, nil +} + +// Implementation wraps an Account implementer in order to provide a concrete +// and non-generic implementation usable by the x/accounts module. +type Implementation struct { + // Init defines the initialisation handler for the smart account. + Init func(ctx context.Context, msg transaction.Msg) (resp transaction.Msg, err error) + // Execute defines the execution handler for the smart account. + Execute func(ctx context.Context, msg transaction.Msg) (resp transaction.Msg, err error) + // Query defines the query handler for the smart account. + Query func(ctx context.Context, msg transaction.Msg) (resp transaction.Msg, err error) + // CollectionsSchema represents the state schema. + CollectionsSchema collections.Schema + // InitHandlerSchema represents the init handler schema. + InitHandlerSchema HandlerSchema + // QueryHandlersSchema is the schema of the query handlers. + QueryHandlersSchema map[string]HandlerSchema + // ExecuteHandlersSchema is the schema of the execute handlers. + ExecuteHandlersSchema map[string]HandlerSchema +} + +// HasExec returns true if the account can execute the given msg. +func (i Implementation) HasExec(m transaction.Msg) bool { + _, ok := i.ExecuteHandlersSchema[MessageName(m)] + return ok +} + +// HasQuery returns true if the account can execute the given request. +func (i Implementation) HasQuery(m transaction.Msg) bool { + _, ok := i.QueryHandlersSchema[MessageName(m)] + return ok +} + +// HasInit returns true if the account uses the provided init message. +func (i Implementation) HasInit(m transaction.Msg) bool { + return i.InitHandlerSchema.RequestSchema.Name == MessageName(m) +} + +// MessageSchema defines the schema of a message. +// A message can also define a state schema. +type MessageSchema struct { + // Name identifies the message name, this must be queryable from some reflection service. + Name string + // New is used to create a new message instance for the schema. + New func() transaction.Msg +} + +// HandlerSchema defines the schema of a handler. +type HandlerSchema struct { + // RequestSchema defines the schema of the request. + RequestSchema MessageSchema + // ResponseSchema defines the schema of the response. + ResponseSchema MessageSchema +} diff --git a/x/did/types/accstd/internal/accounts/interface.go b/x/did/types/accstd/internal/accounts/interface.go new file mode 100644 index 000000000..93d4a48c6 --- /dev/null +++ b/x/did/types/accstd/internal/accounts/interface.go @@ -0,0 +1,17 @@ +package accounts + +// Account defines a smart account interface. +type Account interface { + // RegisterInitHandler allows the smart account to register an initialisation handler, using + // the provided InitBuilder. The handler will be called when the smart account is initialized + // (deployed). + RegisterInitHandler(builder *InitBuilder) + + // RegisterExecuteHandlers allows the smart account to register execution handlers. + // The smart account might also decide to not register any execution handler. + RegisterExecuteHandlers(builder *ExecuteBuilder) + + // RegisterQueryHandlers allows the smart account to register query handlers. The smart account + // might also decide to not register any query handler. + RegisterQueryHandlers(builder *QueryBuilder) +} diff --git a/x/did/types/accstd/internal/accounts/protoaccount.go b/x/did/types/accstd/internal/accounts/protoaccount.go new file mode 100644 index 000000000..be859b4ca --- /dev/null +++ b/x/did/types/accstd/internal/accounts/protoaccount.go @@ -0,0 +1,78 @@ +package accounts + +import ( + "context" + "fmt" + + "google.golang.org/protobuf/proto" + + "github.com/onsonr/sonr/pkg/core/transaction" +) + +// RegisterInitHandler registers an initialisation handler for a smart account that uses protobuf. +func RegisterInitHandler[ + Req any, ProtoReq ProtoMsgG[Req], Resp any, ProtoResp ProtoMsgG[Resp], +](router *InitBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error), +) { + reqName := MessageName(ProtoReq(new(Req))) + + router.handler = func(ctx context.Context, initRequest transaction.Msg) (initResponse transaction.Msg, err error) { + concrete, ok := initRequest.(ProtoReq) + if !ok { + return nil, fmt.Errorf("%w: wanted %s, got %T", errInvalidMessage, reqName, initRequest) + } + return handler(ctx, concrete) + } + + router.schema = HandlerSchema{ + RequestSchema: *NewProtoMessageSchema[Req, ProtoReq](), + ResponseSchema: *NewProtoMessageSchema[Resp, ProtoResp](), + } +} + +// RegisterExecuteHandler registers an execution handler for a smart account that uses protobuf. +func RegisterExecuteHandler[ + Req any, ProtoReq ProtoMsgG[Req], Resp any, ProtoResp ProtoMsgG[Resp], +](router *ExecuteBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error), +) { + reqName := MessageName(ProtoReq(new(Req))) + // check if not registered already + if _, ok := router.handlers[reqName]; ok { + router.err = fmt.Errorf("handler already registered for message %s", reqName) + return + } + + router.handlers[reqName] = func(ctx context.Context, executeRequest transaction.Msg) (executeResponse transaction.Msg, err error) { + concrete, ok := executeRequest.(ProtoReq) + if !ok { + return nil, fmt.Errorf("%w: wanted %s, got %T", errInvalidMessage, reqName, executeRequest) + } + return handler(ctx, concrete) + } + + router.handlersSchema[reqName] = HandlerSchema{ + RequestSchema: *NewProtoMessageSchema[Req, ProtoReq](), + ResponseSchema: *NewProtoMessageSchema[Resp, ProtoResp](), + } +} + +// RegisterQueryHandler registers a query handler for a smart account that uses protobuf. +func RegisterQueryHandler[ + Req any, ProtoReq ProtoMsgG[Req], Resp any, ProtoResp ProtoMsgG[Resp], +](router *QueryBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error), +) { + RegisterExecuteHandler(router.er, handler) +} + +func NewProtoMessageSchema[T any, PT ProtoMsgG[T]]() *MessageSchema { + msg := PT(new(T)) + if _, ok := (interface{}(msg)).(proto.Message); ok { + panic("protov2 messages are not supported") + } + return &MessageSchema{ + Name: MessageName(msg), + New: func() transaction.Msg { + return PT(new(T)) + }, + } +} diff --git a/x/did/types/accstd/internal/prefixstore/prefixstore.go b/x/did/types/accstd/internal/prefixstore/prefixstore.go new file mode 100644 index 000000000..ef84b7070 --- /dev/null +++ b/x/did/types/accstd/internal/prefixstore/prefixstore.go @@ -0,0 +1,223 @@ +// Package prefixstore provides a store that prefixes all keys with a given +// prefix. It is used to isolate storage reads and writes for an account. +// Implementation taken from cosmossdk.io/store/prefix, and adapted to +// the cosmossdk.io/core/store.KVStore interface. +package prefixstore + +import ( + "bytes" + "errors" + + "cosmossdk.io/core/store" +) + +// New creates a new prefix store using the provided bytes prefix. +func New(store store.KVStore, prefix []byte) store.KVStore { + return Store{ + parent: store, + prefix: prefix, + } +} + +var _ store.KVStore = Store{} + +// Store is similar with cometbft/cometbft-db/blob/v1.0.1/prefixdb.go +// both gives access only to the limited subset of the store +// for convenience or safety +type Store struct { + parent store.KVStore + prefix []byte +} + +func cloneAppend(bz, tail []byte) (res []byte) { + res = make([]byte, len(bz)+len(tail)) + copy(res, bz) + copy(res[len(bz):], tail) + return +} + +func (s Store) key(key []byte) (res []byte) { + if key == nil { + panic("nil key on Store") + } + res = cloneAppend(s.prefix, key) + return +} + +// Implements KVStore +func (s Store) Get(key []byte) ([]byte, error) { + return s.parent.Get(s.key(key)) +} + +// Implements KVStore +func (s Store) Has(key []byte) (bool, error) { + return s.parent.Has(s.key(key)) +} + +// Implements KVStore +func (s Store) Set(key, value []byte) error { + return s.parent.Set(s.key(key), value) +} + +// Implements KVStore +func (s Store) Delete(key []byte) error { return s.parent.Delete(s.key(key)) } + +// Implements KVStore +// Check https://github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go#L109 +func (s Store) Iterator(start, end []byte) (store.Iterator, error) { + newstart := cloneAppend(s.prefix, start) + + var newend []byte + if end == nil { + newend = cpIncr(s.prefix) + } else { + newend = cloneAppend(s.prefix, end) + } + + iter, err := s.parent.Iterator(newstart, newend) + if err != nil { + return nil, err + } + + return newPrefixIterator(s.prefix, start, end, iter), nil +} + +// ReverseIterator implements KVStore +// Check https://github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go#L132 +func (s Store) ReverseIterator(start, end []byte) (store.Iterator, error) { + newstart := cloneAppend(s.prefix, start) + + var newend []byte + if end == nil { + newend = cpIncr(s.prefix) + } else { + newend = cloneAppend(s.prefix, end) + } + + iter, err := s.parent.ReverseIterator(newstart, newend) + if err != nil { + return nil, err + } + + return newPrefixIterator(s.prefix, start, end, iter), nil +} + +var _ store.Iterator = (*prefixIterator)(nil) + +type prefixIterator struct { + prefix []byte + start []byte + end []byte + iter store.Iterator + valid bool +} + +func newPrefixIterator(prefix, start, end []byte, parent store.Iterator) *prefixIterator { + return &prefixIterator{ + prefix: prefix, + start: start, + end: end, + iter: parent, + valid: parent.Valid() && bytes.HasPrefix(parent.Key(), prefix), + } +} + +// Implements Iterator +func (pi *prefixIterator) Domain() ([]byte, []byte) { + return pi.start, pi.end +} + +// Implements Iterator +func (pi *prefixIterator) Valid() bool { + return pi.valid && pi.iter.Valid() +} + +// Implements Iterator +func (pi *prefixIterator) Next() { + if !pi.valid { + panic("prefixIterator invalid, cannot call Next()") + } + + if pi.iter.Next(); !pi.iter.Valid() || !bytes.HasPrefix(pi.iter.Key(), pi.prefix) { + // TODO: shouldn't pi be set to nil instead? + pi.valid = false + } +} + +// Implements Iterator +func (pi *prefixIterator) Key() (key []byte) { + if !pi.valid { + panic("prefixIterator invalid, cannot call Key()") + } + + key = pi.iter.Key() + key = stripPrefix(key, pi.prefix) + + return +} + +// Implements Iterator +func (pi *prefixIterator) Value() []byte { + if !pi.valid { + panic("prefixIterator invalid, cannot call Value()") + } + + return pi.iter.Value() +} + +// Implements Iterator +func (pi *prefixIterator) Close() error { + return pi.iter.Close() +} + +// Error returns an error if the prefixIterator is invalid defined by the Valid +// method. +func (pi *prefixIterator) Error() error { + if !pi.Valid() { + return errors.New("invalid prefixIterator") + } + + return nil +} + +// copied from github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go +func stripPrefix(key, prefix []byte) []byte { + if len(key) < len(prefix) || !bytes.Equal(key[:len(prefix)], prefix) { + panic("should not happen") + } + + return key[len(prefix):] +} + +// wrapping types.PrefixEndBytes +func cpIncr(bz []byte) []byte { + return prefixEndBytes(bz) +} + +// prefixEndBytes returns the []byte that would end a +// range query for all []byte with a certain prefix +// Deals with last byte of prefix being FF without overflowing +func prefixEndBytes(prefix []byte) []byte { + if len(prefix) == 0 { + return nil + } + + end := make([]byte, len(prefix)) + copy(end, prefix) + + for { + if end[len(end)-1] != byte(255) { + end[len(end)-1]++ + break + } + + end = end[:len(end)-1] + + if len(end) == 0 { + end = nil + break + } + } + + return end +} diff --git a/x/did/types/address.go b/x/did/types/compute.go similarity index 72% rename from x/did/types/address.go rename to x/did/types/compute.go index faf63d532..8c9b78e1b 100644 --- a/x/did/types/address.go +++ b/x/did/types/compute.go @@ -9,8 +9,8 @@ import ( "golang.org/x/crypto/sha3" ) -// ComputeSonrAddress computes the Sonr address from a public key -func ComputeSonrAddress(pk []byte) (string, error) { +// ComputeSonrAddr computes the Sonr address from a public key +func ComputeSonrAddr(pk []byte) (string, error) { sonrAddr, err := bech32.ConvertAndEncode("idx", pk) if err != nil { return "", err @@ -18,8 +18,8 @@ func ComputeSonrAddress(pk []byte) (string, error) { return sonrAddr, nil } -// ComputeBitcoinAddress computes the Bitcoin address from a public key -func ComputeBitcoinAddress(pk []byte) (string, error) { +// ComputeBitcoinAddr computes the Bitcoin address from a public key +func ComputeBitcoinAddr(pk []byte) (string, error) { btcAddr, err := bech32.ConvertAndEncode("bc", pk) if err != nil { return "", err @@ -27,8 +27,8 @@ func ComputeBitcoinAddress(pk []byte) (string, error) { return btcAddr, nil } -// ComputeEthAddress computes the Ethereum address from a public key -func ComputeEthAddress(pk *ecdsa.PublicKey) string { +// ComputeEthereumAddr computes the Ethereum address from a public key +func ComputeEthereumAddr(pk *ecdsa.PublicKey) string { // Generate Ethereum address address := ethcrypto.PubkeyToAddress(*pk) diff --git a/x/did/types/genesis.pb.go b/x/did/types/genesis.pb.go index efc94527a..fdc02dfc4 100644 --- a/x/did/types/genesis.pb.go +++ b/x/did/types/genesis.pb.go @@ -70,218 +70,29 @@ func (m *GenesisState) GetParams() Params { return Params{} } -// Params defines the set of module parameters. -type Params struct { - // Whitelisted Key Types - 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"` - // ConveyancePreference defines the conveyance preference - ConveyancePreference string `protobuf:"bytes,3,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` - // AttestationFormats defines the attestation formats - AttestationFormats []string `protobuf:"bytes,4,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) { +// Document defines a DID document +type Document 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"` + Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"` + AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { return fileDescriptor_fda181cae44f7c00, []int{1} } -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetAllowedPublicKeys() map[string]*KeyInfo { - if m != nil { - return m.AllowedPublicKeys - } - return nil -} - -func (m *Params) GetConveyancePreference() string { - if m != nil { - return m.ConveyancePreference - } - return "" -} - -func (m *Params) GetAttestationFormats() []string { - if m != nil { - return m.AttestationFormats - } - return nil -} - -// KeyInfo defines information for accepted PubKey types -type KeyInfo struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` - Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` - Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` -} - -func (m *KeyInfo) Reset() { *m = KeyInfo{} } -func (m *KeyInfo) String() string { return proto.CompactTextString(m) } -func (*KeyInfo) ProtoMessage() {} -func (*KeyInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{2} -} -func (m *KeyInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *KeyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_KeyInfo.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 *KeyInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeyInfo.Merge(m, src) -} -func (m *KeyInfo) XXX_Size() int { - return m.Size() -} -func (m *KeyInfo) XXX_DiscardUnknown() { - xxx_messageInfo_KeyInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_KeyInfo proto.InternalMessageInfo - -func (m *KeyInfo) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -func (m *KeyInfo) GetAlgorithm() string { - if m != nil { - return m.Algorithm - } - return "" -} - -func (m *KeyInfo) GetEncoding() string { - if m != nil { - return m.Encoding - } - return "" -} - -func (m *KeyInfo) GetCurve() string { - if m != nil { - return m.Curve - } - return "" -} - -type Keyshares struct { - ValidatorCid string `protobuf:"bytes,1,opt,name=validator_cid,json=validatorCid,proto3" json:"validator_cid,omitempty"` - UserCid string `protobuf:"bytes,2,opt,name=user_cid,json=userCid,proto3" json:"user_cid,omitempty"` - LastUpdatedBlock int64 `protobuf:"varint,3,opt,name=last_updated_block,json=lastUpdatedBlock,proto3" json:"last_updated_block,omitempty"` -} - -func (m *Keyshares) Reset() { *m = Keyshares{} } -func (m *Keyshares) String() string { return proto.CompactTextString(m) } -func (*Keyshares) ProtoMessage() {} -func (*Keyshares) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{3} -} -func (m *Keyshares) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Keyshares) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Keyshares.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Keyshares) XXX_Merge(src proto.Message) { - xxx_messageInfo_Keyshares.Merge(m, src) -} -func (m *Keyshares) XXX_Size() int { - return m.Size() -} -func (m *Keyshares) XXX_DiscardUnknown() { - xxx_messageInfo_Keyshares.DiscardUnknown(m) -} - -var xxx_messageInfo_Keyshares proto.InternalMessageInfo - -func (m *Keyshares) GetValidatorCid() string { - if m != nil { - return m.ValidatorCid - } - return "" -} - -func (m *Keyshares) GetUserCid() string { - if m != nil { - return m.UserCid - } - return "" -} - -func (m *Keyshares) GetLastUpdatedBlock() int64 { - if m != nil { - return m.LastUpdatedBlock - } - return 0 -} - -// PubKey defines a public key for a did -type PubKey struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` - RawKey *RawKey `protobuf:"bytes,3,opt,name=raw_key,json=rawKey,proto3" json:"raw_key,omitempty"` - Jwk *JSONWebKey `protobuf:"bytes,4,opt,name=jwk,proto3" json:"jwk,omitempty"` -} - -func (m *PubKey) Reset() { *m = PubKey{} } -func (m *PubKey) String() string { return proto.CompactTextString(m) } -func (*PubKey) ProtoMessage() {} -func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{4} -} -func (m *PubKey) XXX_Unmarshal(b []byte) error { +func (m *Document) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PubKey.Marshal(b, m, deterministic) + return xxx_messageInfo_Document.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -291,297 +102,100 @@ func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *PubKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKey.Merge(m, src) +func (m *Document) XXX_Merge(src proto.Message) { + xxx_messageInfo_Document.Merge(m, src) } -func (m *PubKey) XXX_Size() int { +func (m *Document) XXX_Size() int { return m.Size() } -func (m *PubKey) XXX_DiscardUnknown() { - xxx_messageInfo_PubKey.DiscardUnknown(m) +func (m *Document) XXX_DiscardUnknown() { + xxx_messageInfo_Document.DiscardUnknown(m) } -var xxx_messageInfo_PubKey proto.InternalMessageInfo +var xxx_messageInfo_Document proto.InternalMessageInfo -func (m *PubKey) GetRole() string { +func (m *Document) GetId() string { if m != nil { - return m.Role + return m.Id } return "" } -func (m *PubKey) GetKeyType() string { +func (m *Document) GetController() string { if m != nil { - return m.KeyType + return m.Controller } return "" } -func (m *PubKey) GetRawKey() *RawKey { +func (m *Document) GetAuthentication() []string { if m != nil { - return m.RawKey + return m.Authentication } return nil } -func (m *PubKey) GetJwk() *JSONWebKey { +func (m *Document) GetAssertionMethod() []string { if m != nil { - return m.Jwk + return m.AssertionMethod } return nil } -// JWK represents a JSON Web Key -type JSONWebKey struct { - Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"` - Crv string `protobuf:"bytes,2,opt,name=crv,proto3" json:"crv,omitempty"` - X string `protobuf:"bytes,3,opt,name=x,proto3" json:"x,omitempty"` - Y string `protobuf:"bytes,4,opt,name=y,proto3" json:"y,omitempty"` - N string `protobuf:"bytes,5,opt,name=n,proto3" json:"n,omitempty"` - E string `protobuf:"bytes,6,opt,name=e,proto3" json:"e,omitempty"` -} - -func (m *JSONWebKey) Reset() { *m = JSONWebKey{} } -func (m *JSONWebKey) String() string { return proto.CompactTextString(m) } -func (*JSONWebKey) ProtoMessage() {} -func (*JSONWebKey) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{5} -} -func (m *JSONWebKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *JSONWebKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_JSONWebKey.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 *JSONWebKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_JSONWebKey.Merge(m, src) -} -func (m *JSONWebKey) XXX_Size() int { - return m.Size() -} -func (m *JSONWebKey) XXX_DiscardUnknown() { - xxx_messageInfo_JSONWebKey.DiscardUnknown(m) -} - -var xxx_messageInfo_JSONWebKey proto.InternalMessageInfo - -func (m *JSONWebKey) GetKty() string { - if m != nil { - return m.Kty - } - return "" -} - -func (m *JSONWebKey) GetCrv() string { - if m != nil { - return m.Crv - } - return "" -} - -func (m *JSONWebKey) GetX() string { - if m != nil { - return m.X - } - return "" -} - -func (m *JSONWebKey) GetY() string { - if m != nil { - return m.Y - } - return "" -} - -func (m *JSONWebKey) GetN() string { - if m != nil { - return m.N - } - return "" -} - -func (m *JSONWebKey) GetE() string { +func (m *Document) GetCapabilityDelegation() []string { if m != nil { - return m.E + return m.CapabilityDelegation } - return "" -} - -type RawKey struct { - Algorithm string `protobuf:"bytes,1,opt,name=algorithm,proto3" json:"algorithm,omitempty"` - Encoding string `protobuf:"bytes,2,opt,name=encoding,proto3" json:"encoding,omitempty"` - Curve string `protobuf:"bytes,3,opt,name=curve,proto3" json:"curve,omitempty"` - Key []byte `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` -} - -func (m *RawKey) Reset() { *m = RawKey{} } -func (m *RawKey) String() string { return proto.CompactTextString(m) } -func (*RawKey) ProtoMessage() {} -func (*RawKey) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{6} -} -func (m *RawKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RawKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RawKey.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 *RawKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_RawKey.Merge(m, src) -} -func (m *RawKey) XXX_Size() int { - return m.Size() -} -func (m *RawKey) XXX_DiscardUnknown() { - xxx_messageInfo_RawKey.DiscardUnknown(m) -} - -var xxx_messageInfo_RawKey proto.InternalMessageInfo - -func (m *RawKey) GetAlgorithm() string { - if m != nil { - return m.Algorithm - } - return "" -} - -func (m *RawKey) GetEncoding() string { - if m != nil { - return m.Encoding - } - return "" + return nil } -func (m *RawKey) GetCurve() string { +func (m *Document) GetCapabilityInvocation() []string { if m != nil { - return m.Curve + return m.CapabilityInvocation } - return "" + return nil } -func (m *RawKey) GetKey() []byte { +func (m *Document) GetService() []string { if m != nil { - return m.Key + return m.Service } return nil } func init() { proto.RegisterType((*GenesisState)(nil), "did.v1.GenesisState") - proto.RegisterType((*Params)(nil), "did.v1.Params") - proto.RegisterMapType((map[string]*KeyInfo)(nil), "did.v1.Params.AllowedPublicKeysEntry") - proto.RegisterType((*KeyInfo)(nil), "did.v1.KeyInfo") - proto.RegisterType((*Keyshares)(nil), "did.v1.Keyshares") - proto.RegisterType((*PubKey)(nil), "did.v1.PubKey") - proto.RegisterType((*JSONWebKey)(nil), "did.v1.JSONWebKey") - proto.RegisterType((*RawKey)(nil), "did.v1.RawKey") + proto.RegisterType((*Document)(nil), "did.v1.Document") } func init() { proto.RegisterFile("did/v1/genesis.proto", fileDescriptor_fda181cae44f7c00) } var fileDescriptor_fda181cae44f7c00 = []byte{ - // 655 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x4f, 0x4f, 0x13, 0x4f, - 0x18, 0xee, 0xb6, 0x65, 0xa1, 0x43, 0x7f, 0x3f, 0x61, 0xa8, 0xba, 0x34, 0xa6, 0x34, 0x55, 0x62, - 0x63, 0x48, 0x37, 0xc0, 0xc5, 0x10, 0x2e, 0x62, 0xd4, 0x68, 0x13, 0x6d, 0x16, 0x89, 0x89, 0x97, - 0xcd, 0x74, 0xf7, 0xa5, 0x5d, 0xba, 0x9d, 0x69, 0x66, 0xa7, 0x5b, 0xe6, 0x0b, 0x78, 0xf0, 0xe4, - 0xd1, 0x23, 0x1f, 0xc1, 0x8b, 0xdf, 0x81, 0x23, 0x47, 0x4f, 0xc6, 0xc0, 0x41, 0x3f, 0x86, 0x99, - 0x99, 0x2d, 0x05, 0x83, 0x5e, 0x66, 0xdf, 0xe7, 0x79, 0xde, 0xbc, 0xff, 0xb3, 0xa8, 0x12, 0x46, - 0xa1, 0x9b, 0x6e, 0xba, 0x3d, 0xa0, 0x90, 0x44, 0x49, 0x6b, 0xc4, 0x99, 0x60, 0xd8, 0x0e, 0xa3, - 0xb0, 0x95, 0x6e, 0x56, 0x97, 0xc9, 0x30, 0xa2, 0xcc, 0xd5, 0xaf, 0x91, 0xaa, 0x95, 0x1e, 0xeb, - 0x31, 0x6d, 0xba, 0xca, 0x32, 0x6c, 0x63, 0x17, 0x95, 0x5f, 0x98, 0x08, 0xfb, 0x82, 0x08, 0xc0, - 0x1b, 0xc8, 0x1e, 0x11, 0x4e, 0x86, 0x89, 0x63, 0xd5, 0xad, 0xe6, 0xe2, 0xd6, 0xff, 0x2d, 0x13, - 0xb1, 0xd5, 0xd1, 0xec, 0x5e, 0xf1, 0xf4, 0xfb, 0x5a, 0xce, 0xcb, 0x7c, 0x1a, 0x5f, 0xf3, 0xc8, - 0x36, 0x02, 0x3e, 0x40, 0x2b, 0x24, 0x8e, 0xd9, 0x04, 0x42, 0x7f, 0x34, 0xee, 0xc6, 0x51, 0xe0, - 0x0f, 0x40, 0x26, 0x4e, 0xbe, 0x5e, 0x68, 0x2e, 0x6e, 0xad, 0x5f, 0x8f, 0xd2, 0x7a, 0x62, 0x3c, - 0x3b, 0xda, 0xb1, 0x0d, 0x32, 0x79, 0x46, 0x05, 0x97, 0xde, 0x32, 0xf9, 0x93, 0xc7, 0xdb, 0xe8, - 0x76, 0xc0, 0x68, 0x0a, 0x92, 0xd0, 0x00, 0xfc, 0x11, 0x87, 0x43, 0xe0, 0x40, 0x03, 0x70, 0x0a, - 0x75, 0xab, 0x59, 0xf2, 0x2a, 0x33, 0xb1, 0x73, 0xa9, 0x61, 0x17, 0xad, 0x10, 0x21, 0x20, 0x11, - 0x44, 0x44, 0x8c, 0xfa, 0x87, 0x8c, 0x0f, 0x89, 0x48, 0x9c, 0x62, 0xbd, 0xd0, 0x2c, 0x79, 0xf8, - 0x8a, 0xf4, 0xdc, 0x28, 0xd5, 0x03, 0x74, 0xe7, 0xe6, 0x92, 0xf0, 0x12, 0x2a, 0x0c, 0x40, 0xea, - 0x61, 0x94, 0x3c, 0x65, 0xe2, 0x75, 0x34, 0x97, 0x92, 0x78, 0x0c, 0x4e, 0x5e, 0x0f, 0xe8, 0xd6, - 0xb4, 0xb5, 0x36, 0xc8, 0x97, 0xf4, 0x90, 0x79, 0x46, 0xdd, 0xc9, 0x3f, 0xb6, 0x76, 0xee, 0x7e, - 0x3e, 0x59, 0xcb, 0xfd, 0x3a, 0x59, 0xb3, 0x3e, 0xfe, 0xfc, 0xf2, 0x08, 0xa9, 0x85, 0x65, 0x73, - 0x1b, 0xa2, 0xf9, 0xcc, 0x1d, 0x63, 0x54, 0xe4, 0x2c, 0x86, 0x2c, 0x83, 0xb6, 0xf1, 0x3d, 0x54, - 0x22, 0x71, 0x8f, 0xf1, 0x48, 0xf4, 0x87, 0x3a, 0x4d, 0xc9, 0x9b, 0x11, 0xb8, 0x8a, 0x16, 0x80, - 0x06, 0x2c, 0x8c, 0x68, 0x2f, 0x9b, 0xc2, 0x25, 0xc6, 0x15, 0x34, 0x17, 0x8c, 0x79, 0x0a, 0x4e, - 0x51, 0x0b, 0x06, 0x34, 0x24, 0x2a, 0xa9, 0x8e, 0xfa, 0x84, 0x43, 0x82, 0xef, 0xa3, 0xff, 0x52, - 0x12, 0x47, 0x21, 0x11, 0x8c, 0xfb, 0x41, 0x14, 0x66, 0x99, 0xcb, 0x97, 0xe4, 0xd3, 0x28, 0xc4, - 0xab, 0x68, 0x61, 0x9c, 0x80, 0xd1, 0x4d, 0x01, 0xf3, 0x0a, 0x2b, 0x69, 0x03, 0xe1, 0x98, 0x24, - 0xc2, 0x1f, 0x8f, 0x42, 0x22, 0x20, 0xf4, 0xbb, 0x31, 0x0b, 0x06, 0xba, 0x90, 0x82, 0xb7, 0xa4, - 0x94, 0x03, 0x23, 0xec, 0x29, 0xbe, 0xf1, 0xc1, 0x42, 0x76, 0x67, 0xdc, 0x6d, 0x83, 0xbc, 0xb1, - 0xd3, 0x55, 0xb4, 0x30, 0x00, 0xe9, 0x0b, 0x39, 0x82, 0x69, 0x9e, 0x01, 0xc8, 0xb7, 0x72, 0x04, - 0xf8, 0x21, 0x9a, 0xe7, 0x64, 0xa2, 0xae, 0x48, 0x07, 0xbf, 0x72, 0x8a, 0x1e, 0x99, 0xb4, 0x41, - 0x7a, 0x36, 0xd7, 0x5f, 0xfc, 0x00, 0x15, 0x8e, 0x26, 0x03, 0xdd, 0xf1, 0xe2, 0x16, 0x9e, 0x3a, - 0xbd, 0xda, 0x7f, 0xf3, 0xfa, 0x1d, 0xa8, 0xc4, 0x9e, 0x92, 0x1b, 0x7d, 0x84, 0x66, 0x94, 0x5e, - 0xab, 0x98, 0xad, 0x55, 0x68, 0x26, 0xe0, 0x69, 0x56, 0x84, 0x32, 0x71, 0x19, 0x59, 0xc7, 0xd9, - 0x80, 0xad, 0x63, 0x85, 0x64, 0x36, 0x55, 0x4b, 0x2a, 0x44, 0x9d, 0x39, 0x83, 0xa8, 0x42, 0xe0, - 0xd8, 0x06, 0x41, 0xe3, 0x08, 0xd9, 0xa6, 0xc2, 0xeb, 0x7b, 0xb4, 0xfe, 0xb5, 0xc7, 0xfc, 0xdf, - 0xf6, 0x58, 0xb8, 0xb2, 0xc7, 0xe9, 0x31, 0xaa, 0x2a, 0xca, 0xfa, 0x18, 0xf7, 0x76, 0x4f, 0xcf, - 0x6b, 0xd6, 0xd9, 0x79, 0xcd, 0xfa, 0x71, 0x5e, 0xb3, 0x3e, 0x5d, 0xd4, 0x72, 0x67, 0x17, 0xb5, - 0xdc, 0xb7, 0x8b, 0x5a, 0xee, 0x7d, 0xa3, 0x17, 0x89, 0xfe, 0xb8, 0xdb, 0x0a, 0xd8, 0xd0, 0x65, - 0x34, 0x61, 0x94, 0xbb, 0xfa, 0x39, 0x76, 0xd5, 0x1d, 0xaa, 0x81, 0x27, 0x5d, 0x5b, 0xff, 0x03, - 0xb6, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x19, 0xe9, 0x6d, 0x4c, 0x04, 0x00, 0x00, + // 344 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x91, 0xc1, 0x6a, 0xea, 0x40, + 0x14, 0x86, 0x93, 0xe8, 0x8d, 0xd7, 0xb9, 0x17, 0xdb, 0x4e, 0x2d, 0x04, 0x17, 0xa9, 0xb8, 0x28, + 0x16, 0x4a, 0x06, 0xeb, 0xd6, 0x95, 0x08, 0xa5, 0x8b, 0x42, 0xb1, 0xbb, 0x6e, 0x64, 0xcc, 0x0c, + 0x71, 0x20, 0x99, 0x13, 0x66, 0xc6, 0x50, 0xdf, 0xa2, 0x7d, 0x2b, 0x97, 0x2e, 0xbb, 0x2a, 0x45, + 0x5f, 0xa4, 0x38, 0x49, 0x6d, 0x71, 0x73, 0x38, 0xe7, 0xfb, 0xff, 0xff, 0xcc, 0xc0, 0x41, 0x6d, + 0x26, 0x18, 0x29, 0x06, 0x24, 0xe1, 0x92, 0x6b, 0xa1, 0xa3, 0x5c, 0x81, 0x01, 0xec, 0x33, 0xc1, + 0xa2, 0x62, 0xd0, 0x39, 0xa3, 0x99, 0x90, 0x40, 0x6c, 0x2d, 0xa5, 0xce, 0x79, 0x15, 0xc8, 0xa9, + 0xa2, 0x59, 0xe5, 0xef, 0xb4, 0x13, 0x48, 0xc0, 0xb6, 0x64, 0xdf, 0x95, 0xb4, 0x37, 0x42, 0xff, + 0xef, 0xca, 0xb5, 0x4f, 0x86, 0x1a, 0x8e, 0x6f, 0x90, 0x5f, 0xa6, 0x02, 0xb7, 0xeb, 0xf6, 0xff, + 0xdd, 0xb6, 0xa2, 0xf2, 0x99, 0xe8, 0xd1, 0xd2, 0x71, 0x7d, 0xfd, 0x71, 0xe9, 0x4c, 0x2b, 0x4f, + 0xef, 0xcd, 0x43, 0x7f, 0x27, 0x10, 0x2f, 0x33, 0x2e, 0x0d, 0x6e, 0x21, 0x4f, 0x30, 0x1b, 0x6b, + 0x4e, 0x3d, 0xc1, 0x70, 0x88, 0x50, 0x0c, 0xd2, 0x28, 0x48, 0x53, 0xae, 0x02, 0xcf, 0xf2, 0x5f, + 0x04, 0x5f, 0xa1, 0x16, 0x5d, 0x9a, 0x05, 0x97, 0x46, 0xc4, 0xd4, 0x08, 0x90, 0x41, 0xad, 0x5b, + 0xeb, 0x37, 0xa7, 0x47, 0x14, 0x5f, 0xa3, 0x53, 0xaa, 0x35, 0x57, 0xfb, 0x61, 0x96, 0x71, 0xb3, + 0x00, 0x16, 0xd4, 0xad, 0xf3, 0xe4, 0xc0, 0x1f, 0x2c, 0xc6, 0x43, 0x74, 0x11, 0xd3, 0x9c, 0xce, + 0x45, 0x2a, 0xcc, 0x6a, 0xc6, 0x78, 0xca, 0x93, 0x72, 0xf3, 0x1f, 0xeb, 0x6f, 0xff, 0x88, 0x93, + 0x83, 0x76, 0x14, 0x12, 0xb2, 0x80, 0xea, 0x3b, 0xfe, 0x71, 0xe8, 0xfe, 0xa0, 0xe1, 0x00, 0x35, + 0x34, 0x57, 0x85, 0x88, 0x79, 0xd0, 0xb0, 0xb6, 0xef, 0x71, 0x3c, 0x5a, 0x6f, 0x43, 0x77, 0xb3, + 0x0d, 0xdd, 0xcf, 0x6d, 0xe8, 0xbe, 0xee, 0x42, 0x67, 0xb3, 0x0b, 0x9d, 0xf7, 0x5d, 0xe8, 0x3c, + 0xf7, 0x12, 0x61, 0x16, 0xcb, 0x79, 0x14, 0x43, 0x46, 0x40, 0x6a, 0x90, 0x8a, 0xd8, 0xf2, 0x42, + 0xf6, 0xf7, 0x32, 0xab, 0x9c, 0xeb, 0xb9, 0x6f, 0xcf, 0x32, 0xfc, 0x0a, 0x00, 0x00, 0xff, 0xff, + 0x44, 0xa7, 0x3d, 0xf3, 0xf4, 0x01, 0x00, 0x00, } -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.AllowedPublicKeys) != len(that1.AllowedPublicKeys) { - return false - } - for i := range this.AllowedPublicKeys { - if !this.AllowedPublicKeys[i].Equal(that1.AllowedPublicKeys[i]) { - return false - } - } - if this.ConveyancePreference != that1.ConveyancePreference { - return false - } - if len(this.AttestationFormats) != len(that1.AttestationFormats) { - return false - } - for i := range this.AttestationFormats { - if this.AttestationFormats[i] != that1.AttestationFormats[i] { - return false - } - } - return true -} func (m *GenesisState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -615,7 +229,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Params) Marshal() (dAtA []byte, err error) { +func (m *Document) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -625,338 +239,85 @@ func (m *Params) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Params) MarshalTo(dAtA []byte) (int, error) { +func (m *Document) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.AttestationFormats) > 0 { - for iNdEx := len(m.AttestationFormats) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.AttestationFormats[iNdEx]) - copy(dAtA[i:], m.AttestationFormats[iNdEx]) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.AttestationFormats[iNdEx]))) + if len(m.Service) > 0 { + for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Service[iNdEx]) + copy(dAtA[i:], m.Service[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Service[iNdEx]))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x3a } } - if len(m.ConveyancePreference) > 0 { - i -= len(m.ConveyancePreference) - copy(dAtA[i:], m.ConveyancePreference) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ConveyancePreference))) - i-- - dAtA[i] = 0x1a - } - if len(m.AllowedPublicKeys) > 0 { - 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-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintGenesis(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintGenesis(dAtA, i, uint64(baseI-i)) + if len(m.CapabilityInvocation) > 0 { + for iNdEx := len(m.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CapabilityInvocation[iNdEx]) + copy(dAtA[i:], m.CapabilityInvocation[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.CapabilityInvocation[iNdEx]))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x32 } } - return len(dAtA) - i, nil -} - -func (m *KeyInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if len(m.CapabilityDelegation) > 0 { + for iNdEx := len(m.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CapabilityDelegation[iNdEx]) + copy(dAtA[i:], m.CapabilityDelegation[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.CapabilityDelegation[iNdEx]))) + i-- + dAtA[i] = 0x2a + } } - return dAtA[:n], nil -} - -func (m *KeyInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *KeyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Curve) > 0 { - i -= len(m.Curve) - copy(dAtA[i:], m.Curve) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Curve))) - i-- - dAtA[i] = 0x22 + if len(m.AssertionMethod) > 0 { + for iNdEx := len(m.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AssertionMethod[iNdEx]) + copy(dAtA[i:], m.AssertionMethod[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.AssertionMethod[iNdEx]))) + i-- + dAtA[i] = 0x22 + } } - if len(m.Encoding) > 0 { - i -= len(m.Encoding) - copy(dAtA[i:], m.Encoding) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Encoding))) - i-- - dAtA[i] = 0x1a + if len(m.Authentication) > 0 { + for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Authentication[iNdEx]) + copy(dAtA[i:], m.Authentication[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Authentication[iNdEx]))) + i-- + dAtA[i] = 0x1a + } } - if len(m.Algorithm) > 0 { - i -= len(m.Algorithm) - copy(dAtA[i:], m.Algorithm) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Algorithm))) + 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] = 0x12 } - if len(m.Role) > 0 { - i -= len(m.Role) - copy(dAtA[i:], m.Role) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Role))) + 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 *Keyshares) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Keyshares) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Keyshares) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastUpdatedBlock != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.LastUpdatedBlock)) - i-- - dAtA[i] = 0x18 - } - if len(m.UserCid) > 0 { - i -= len(m.UserCid) - copy(dAtA[i:], m.UserCid) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.UserCid))) - i-- - dAtA[i] = 0x12 - } - if len(m.ValidatorCid) > 0 { - i -= len(m.ValidatorCid) - copy(dAtA[i:], m.ValidatorCid) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorCid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PubKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PubKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Jwk != nil { - { - size, err := m.Jwk.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.RawKey != nil { - { - size, err := m.RawKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.KeyType) > 0 { - i -= len(m.KeyType) - copy(dAtA[i:], m.KeyType) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.KeyType))) - i-- - dAtA[i] = 0x12 - } - if len(m.Role) > 0 { - i -= len(m.Role) - copy(dAtA[i:], m.Role) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Role))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *JSONWebKey) 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 *JSONWebKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *JSONWebKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.E) > 0 { - i -= len(m.E) - copy(dAtA[i:], m.E) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.E))) - i-- - dAtA[i] = 0x32 - } - if len(m.N) > 0 { - i -= len(m.N) - copy(dAtA[i:], m.N) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.N))) - i-- - dAtA[i] = 0x2a - } - if len(m.Y) > 0 { - i -= len(m.Y) - copy(dAtA[i:], m.Y) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Y))) - i-- - dAtA[i] = 0x22 - } - if len(m.X) > 0 { - i -= len(m.X) - copy(dAtA[i:], m.X) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.X))) - i-- - dAtA[i] = 0x1a - } - if len(m.Crv) > 0 { - i -= len(m.Crv) - copy(dAtA[i:], m.Crv) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Crv))) - i-- - dAtA[i] = 0x12 - } - if len(m.Kty) > 0 { - i -= len(m.Kty) - copy(dAtA[i:], m.Kty) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Kty))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RawKey) 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 *RawKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RawKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x22 - } - if len(m.Curve) > 0 { - i -= len(m.Curve) - copy(dAtA[i:], m.Curve) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Curve))) - i-- - dAtA[i] = 0x1a - } - if len(m.Encoding) > 0 { - i -= len(m.Encoding) - copy(dAtA[i:], m.Encoding) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Encoding))) - i-- - dAtA[i] = 0x12 - } - if len(m.Algorithm) > 0 { - i -= len(m.Algorithm) - copy(dAtA[i:], m.Algorithm) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Algorithm))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } dAtA[offset] = uint8(v) return base @@ -972,810 +333,60 @@ func (m *GenesisState) Size() (n int) { return n } -func (m *Params) Size() (n int) { +func (m *Document) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.AllowedPublicKeys) > 0 { - 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)) - } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) } - l = len(m.ConveyancePreference) + l = len(m.Controller) if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - if len(m.AttestationFormats) > 0 { - for _, s := range m.AttestationFormats { + if len(m.Authentication) > 0 { + for _, s := range m.Authentication { l = len(s) n += 1 + l + sovGenesis(uint64(l)) } } - return n -} - -func (m *KeyInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Role) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Algorithm) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Encoding) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Curve) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} - -func (m *Keyshares) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorCid) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.UserCid) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.LastUpdatedBlock != 0 { - n += 1 + sovGenesis(uint64(m.LastUpdatedBlock)) - } - return n -} - -func (m *PubKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Role) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.KeyType) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.RawKey != nil { - l = m.RawKey.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - if m.Jwk != nil { - l = m.Jwk.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} - -func (m *JSONWebKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kty) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Crv) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.X) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Y) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.N) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.E) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} - -func (m *RawKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Algorithm) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Encoding) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Curve) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - 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 *Params) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowedPublicKeys", 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.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 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", 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.ConveyancePreference = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", 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.AttestationFormats = append(m.AttestationFormats, string(dAtA[iNdEx:postIndex])) - 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 - 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: KeyInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: KeyInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", 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.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Algorithm", 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.Algorithm = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Encoding", 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.Encoding = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Curve", 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.Curve = string(dAtA[iNdEx:postIndex]) - 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 *Keyshares) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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: Keyshares: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Keyshares: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.ValidatorCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UserCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.UserCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastUpdatedBlock", wireType) - } - m.LastUpdatedBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastUpdatedBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := 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 len(m.AssertionMethod) > 0 { + for _, s := range m.AssertionMethod { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) } } - - if iNdEx > l { - return io.ErrUnexpectedEOF + if len(m.CapabilityDelegation) > 0 { + for _, s := range m.CapabilityDelegation { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } } - return nil + if len(m.CapabilityInvocation) > 0 { + for _, s := range m.CapabilityInvocation { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Service) > 0 { + for _, s := range m.Service { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *PubKey) Unmarshal(dAtA []byte) error { +func (m *GenesisState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1798,115 +409,15 @@ func (m *PubKey) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PubKey: wiretype end group for non-group") + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", 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.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field KeyType", 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.KeyType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RawKey", 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.RawKey == nil { - m.RawKey = &RawKey{} - } - if err := m.RawKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Jwk", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1933,10 +444,7 @@ func (m *PubKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Jwk == nil { - m.Jwk = &JSONWebKey{} - } - if err := m.Jwk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1961,7 +469,7 @@ func (m *PubKey) Unmarshal(dAtA []byte) error { } return nil } -func (m *JSONWebKey) Unmarshal(dAtA []byte) error { +func (m *Document) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1984,15 +492,15 @@ func (m *JSONWebKey) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: JSONWebKey: wiretype end group for non-group") + return fmt.Errorf("proto: Document: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: JSONWebKey: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kty", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2020,11 +528,11 @@ func (m *JSONWebKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Kty = string(dAtA[iNdEx:postIndex]) + m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Crv", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2052,11 +560,11 @@ func (m *JSONWebKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Crv = string(dAtA[iNdEx:postIndex]) + m.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2084,11 +592,11 @@ func (m *JSONWebKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.X = string(dAtA[iNdEx:postIndex]) + m.Authentication = append(m.Authentication, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Y", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AssertionMethod", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2116,11 +624,11 @@ func (m *JSONWebKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Y = string(dAtA[iNdEx:postIndex]) + m.AssertionMethod = append(m.AssertionMethod, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field N", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CapabilityDelegation", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2148,125 +656,11 @@ func (m *JSONWebKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.N = string(dAtA[iNdEx:postIndex]) + m.CapabilityDelegation = append(m.CapabilityDelegation, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field E", 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.E = string(dAtA[iNdEx:postIndex]) - 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 *RawKey) 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: RawKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RawKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Algorithm", 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.Algorithm = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CapabilityInvocation", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2294,11 +688,11 @@ func (m *RawKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Encoding = string(dAtA[iNdEx:postIndex]) + m.CapabilityInvocation = append(m.CapabilityInvocation, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 3: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2326,41 +720,7 @@ func (m *RawKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Curve = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", 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.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } + m.Service = append(m.Service, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/did/types/mpc/secp256k1_pk.go b/x/did/types/mpc/secp256k1_pk.go deleted file mode 100644 index dbebfa45e..000000000 --- a/x/did/types/mpc/secp256k1_pk.go +++ /dev/null @@ -1,68 +0,0 @@ -package mpc - -import ( - "bytes" - "fmt" - - "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/golang/protobuf/proto" -) - -// CustomPubKey represents a custom secp256k1 public key. -type CustomPubKey struct { - proto.Message - - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -// NewCustomPubKeyFromRawBytes creates a new CustomPubKey from raw bytes. -func NewCustomPubKeyFromRawBytes(key []byte) (*CustomPubKey, error) { - // Validate the key length and format - if len(key) != 33 { - return nil, fmt.Errorf("invalid key length; expected 33 bytes, got %d", len(key)) - } - if key[0] != 0x02 && key[0] != 0x03 { - return nil, fmt.Errorf("invalid key format; expected 0x02 or 0x03 as the first byte, got 0x%02x", key[0]) - } - - return &CustomPubKey{Key: key}, nil -} - -// Bytes returns the byte representation of the public key. -func (pk *CustomPubKey) Bytes() []byte { - return pk.Key -} - -// Equals checks if two public keys are equal. -func (pk *CustomPubKey) Equals(other types.PubKey) bool { - return bytes.EqualFold(pk.Bytes(), other.Bytes()) -} - -// Type returns the type of the public key. -func (pk *CustomPubKey) Type() string { - return "custom-secp256k1" -} - -// Marshal implements the proto.Message interface. -func (pk *CustomPubKey) Marshal() ([]byte, error) { - return proto.Marshal(pk) -} - -// Unmarshal implements the proto.Message interface. -func (pk *CustomPubKey) Unmarshal(data []byte) error { - return proto.Unmarshal(data, pk) -} - -// Address returns the address derived from the public key. -func (pk *CustomPubKey) Address() []byte { - // Implement address derivation logic here - // For simplicity, this example uses a placeholder - return []byte("derived-address") -} - -// VerifySignature verifies a signature using the public key. -func (pk *CustomPubKey) VerifySignature(msg []byte, sig []byte) bool { - // Implement signature verification logic here - // For simplicity, this example uses a placeholder - return true -} diff --git a/x/did/types/params.go b/x/did/types/params.go index af24005a5..a88f388d9 100644 --- a/x/did/types/params.go +++ b/x/did/types/params.go @@ -4,10 +4,10 @@ import ( "encoding/json" fmt "fmt" - "github.com/onsonr/sonr/internal/orm/keyalgorithm" - "github.com/onsonr/sonr/internal/orm/keycurve" - "github.com/onsonr/sonr/internal/orm/keyencoding" - "github.com/onsonr/sonr/internal/orm/keyrole" + "github.com/onsonr/sonr/pkg/motr/types/orm/keyalgorithm" + "github.com/onsonr/sonr/pkg/motr/types/orm/keycurve" + "github.com/onsonr/sonr/pkg/motr/types/orm/keyencoding" + "github.com/onsonr/sonr/pkg/motr/types/orm/keyrole" ) // DefaultParams returns default module parameters. diff --git a/x/did/types/params.pb.go b/x/did/types/params.pb.go new file mode 100644 index 000000000..5f551f6e0 --- /dev/null +++ b/x/did/types/params.pb.go @@ -0,0 +1,931 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: did/v1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the set of module parameters. +type Params struct { + // Whitelisted Key Types + 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"` + // ConveyancePreference defines the conveyance preference + ConveyancePreference string `protobuf:"bytes,3,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` + // AttestationFormats defines the attestation formats + AttestationFormats []string `protobuf:"bytes,4,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_9d62d07335ae093e, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetAllowedPublicKeys() map[string]*KeyInfo { + if m != nil { + return m.AllowedPublicKeys + } + return nil +} + +func (m *Params) GetConveyancePreference() string { + if m != nil { + return m.ConveyancePreference + } + return "" +} + +func (m *Params) GetAttestationFormats() []string { + if m != nil { + return m.AttestationFormats + } + return nil +} + +// KeyInfo defines information for accepted PubKey types +type KeyInfo struct { + Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` + Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` + Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` +} + +func (m *KeyInfo) Reset() { *m = KeyInfo{} } +func (m *KeyInfo) String() string { return proto.CompactTextString(m) } +func (*KeyInfo) ProtoMessage() {} +func (*KeyInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_9d62d07335ae093e, []int{1} +} +func (m *KeyInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KeyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_KeyInfo.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 *KeyInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_KeyInfo.Merge(m, src) +} +func (m *KeyInfo) XXX_Size() int { + return m.Size() +} +func (m *KeyInfo) XXX_DiscardUnknown() { + xxx_messageInfo_KeyInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_KeyInfo proto.InternalMessageInfo + +func (m *KeyInfo) GetRole() string { + if m != nil { + return m.Role + } + return "" +} + +func (m *KeyInfo) GetAlgorithm() string { + if m != nil { + return m.Algorithm + } + return "" +} + +func (m *KeyInfo) GetEncoding() string { + if m != nil { + return m.Encoding + } + return "" +} + +func (m *KeyInfo) GetCurve() string { + if m != nil { + return m.Curve + } + return "" +} + +func init() { + proto.RegisterType((*Params)(nil), "did.v1.Params") + proto.RegisterMapType((map[string]*KeyInfo)(nil), "did.v1.Params.AllowedPublicKeysEntry") + proto.RegisterType((*KeyInfo)(nil), "did.v1.KeyInfo") +} + +func init() { proto.RegisterFile("did/v1/params.proto", fileDescriptor_9d62d07335ae093e) } + +var fileDescriptor_9d62d07335ae093e = []byte{ + // 412 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x73, 0x49, 0x1a, 0xc8, 0x75, 0x80, 0x5e, 0x02, 0x58, 0x11, 0x72, 0xa3, 0x48, 0x95, + 0x2c, 0x06, 0x9f, 0xda, 0x2e, 0xa8, 0x62, 0x01, 0x09, 0x24, 0xd4, 0x25, 0xb2, 0xd4, 0x85, 0xc5, + 0xba, 0xd8, 0x2f, 0xee, 0xa9, 0xf6, 0x3d, 0xeb, 0x7c, 0x36, 0xf8, 0x2b, 0x30, 0x31, 0x32, 0xf6, + 0x23, 0xb0, 0xf0, 0x1d, 0x18, 0x3b, 0x32, 0xa2, 0x64, 0x80, 0x8f, 0x81, 0x7c, 0x17, 0x5a, 0x84, + 0x58, 0x9e, 0xfe, 0xef, 0xfd, 0xfe, 0x7a, 0xef, 0xdd, 0x3b, 0x3a, 0x49, 0x65, 0xca, 0x9b, 0x63, + 0x5e, 0x0a, 0x2d, 0x8a, 0x2a, 0x2c, 0x35, 0x1a, 0x64, 0xa3, 0x54, 0xa6, 0x61, 0x73, 0x3c, 0x3b, + 0x10, 0x85, 0x54, 0xc8, 0x6d, 0x74, 0x68, 0x36, 0xcd, 0x30, 0x43, 0x2b, 0x79, 0xa7, 0x5c, 0x75, + 0xf1, 0xb5, 0x4f, 0x47, 0x4b, 0xdb, 0x81, 0x5d, 0xd0, 0x89, 0xc8, 0x73, 0x7c, 0x0f, 0x69, 0x5c, + 0xd6, 0xab, 0x5c, 0x26, 0xf1, 0x15, 0xb4, 0x95, 0xd7, 0x9f, 0x0f, 0x82, 0xfd, 0x93, 0xa3, 0xd0, + 0x75, 0x0e, 0x9d, 0x39, 0x7c, 0xe9, 0x9c, 0x4b, 0x6b, 0x3c, 0x87, 0xb6, 0x7a, 0xad, 0x8c, 0x6e, + 0xa3, 0x03, 0xf1, 0x6f, 0x9d, 0x9d, 0xd2, 0x47, 0x09, 0xaa, 0x06, 0x5a, 0xa1, 0x12, 0x88, 0x4b, + 0x0d, 0x6b, 0xd0, 0xa0, 0x12, 0xf0, 0x06, 0x73, 0x12, 0x8c, 0xa3, 0xe9, 0x1d, 0x5c, 0xde, 0x32, + 0xc6, 0xe9, 0x44, 0x18, 0x03, 0x95, 0x11, 0x46, 0xa2, 0x8a, 0xd7, 0xa8, 0x0b, 0x61, 0x2a, 0x6f, + 0x38, 0x1f, 0x04, 0xe3, 0x88, 0xfd, 0x85, 0xde, 0x38, 0x32, 0xbb, 0xa0, 0x8f, 0xff, 0xbf, 0x12, + 0x7b, 0x48, 0x07, 0x57, 0xd0, 0x7a, 0xc4, 0x4e, 0xeb, 0x24, 0x3b, 0xa2, 0x7b, 0x8d, 0xc8, 0x6b, + 0xf0, 0xfa, 0x73, 0x12, 0xec, 0x9f, 0x3c, 0xf8, 0xf3, 0xb4, 0x73, 0x68, 0xdf, 0xaa, 0x35, 0x46, + 0x8e, 0x9e, 0xf5, 0x9f, 0x93, 0xb3, 0x27, 0x9f, 0xaf, 0x0f, 0x7b, 0xbf, 0xae, 0x0f, 0xc9, 0xc7, + 0x9f, 0x5f, 0x9e, 0xd1, 0xee, 0xe2, 0xee, 0xdc, 0x8b, 0x82, 0xde, 0xdb, 0xd9, 0x19, 0xa3, 0x43, + 0x8d, 0x39, 0xec, 0x26, 0x58, 0xcd, 0x9e, 0xd2, 0xb1, 0xc8, 0x33, 0xd4, 0xd2, 0x5c, 0x16, 0x76, + 0xcc, 0x38, 0xba, 0x2b, 0xb0, 0x19, 0xbd, 0x0f, 0x2a, 0xc1, 0x54, 0xaa, 0x6c, 0x77, 0x85, 0xdb, + 0x9c, 0x4d, 0xe9, 0x5e, 0x52, 0xeb, 0x06, 0xbc, 0xa1, 0x05, 0x2e, 0x79, 0xf5, 0xe2, 0xdb, 0xc6, + 0x27, 0x37, 0x1b, 0x9f, 0xfc, 0xd8, 0xf8, 0xe4, 0xd3, 0xd6, 0xef, 0xdd, 0x6c, 0xfd, 0xde, 0xf7, + 0xad, 0xdf, 0x7b, 0xb7, 0xc8, 0xa4, 0xb9, 0xac, 0x57, 0x61, 0x82, 0x05, 0x47, 0x55, 0xa1, 0xd2, + 0xdc, 0x86, 0x0f, 0xbc, 0xdb, 0xd6, 0xb4, 0x25, 0x54, 0xab, 0x91, 0xfd, 0xeb, 0xd3, 0xdf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xd2, 0xa2, 0x88, 0x53, 0x33, 0x02, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.AllowedPublicKeys) != len(that1.AllowedPublicKeys) { + return false + } + for i := range this.AllowedPublicKeys { + if !this.AllowedPublicKeys[i].Equal(that1.AllowedPublicKeys[i]) { + return false + } + } + if this.ConveyancePreference != that1.ConveyancePreference { + return false + } + if len(this.AttestationFormats) != len(that1.AttestationFormats) { + return false + } + for i := range this.AttestationFormats { + if this.AttestationFormats[i] != that1.AttestationFormats[i] { + return false + } + } + return true +} +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AttestationFormats) > 0 { + for iNdEx := len(m.AttestationFormats) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AttestationFormats[iNdEx]) + copy(dAtA[i:], m.AttestationFormats[iNdEx]) + i = encodeVarintParams(dAtA, i, uint64(len(m.AttestationFormats[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.ConveyancePreference) > 0 { + i -= len(m.ConveyancePreference) + copy(dAtA[i:], m.ConveyancePreference) + i = encodeVarintParams(dAtA, i, uint64(len(m.ConveyancePreference))) + i-- + dAtA[i] = 0x1a + } + if len(m.AllowedPublicKeys) > 0 { + 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 = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintParams(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintParams(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + return len(dAtA) - i, nil +} + +func (m *KeyInfo) 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 *KeyInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KeyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Curve) > 0 { + i -= len(m.Curve) + copy(dAtA[i:], m.Curve) + i = encodeVarintParams(dAtA, i, uint64(len(m.Curve))) + i-- + dAtA[i] = 0x22 + } + if len(m.Encoding) > 0 { + i -= len(m.Encoding) + copy(dAtA[i:], m.Encoding) + i = encodeVarintParams(dAtA, i, uint64(len(m.Encoding))) + i-- + dAtA[i] = 0x1a + } + if len(m.Algorithm) > 0 { + i -= len(m.Algorithm) + copy(dAtA[i:], m.Algorithm) + i = encodeVarintParams(dAtA, i, uint64(len(m.Algorithm))) + i-- + dAtA[i] = 0x12 + } + if len(m.Role) > 0 { + i -= len(m.Role) + copy(dAtA[i:], m.Role) + i = encodeVarintParams(dAtA, i, uint64(len(m.Role))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllowedPublicKeys) > 0 { + for k, v := range m.AllowedPublicKeys { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovParams(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovParams(uint64(len(k))) + l + n += mapEntrySize + 1 + sovParams(uint64(mapEntrySize)) + } + } + l = len(m.ConveyancePreference) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + if len(m.AttestationFormats) > 0 { + for _, s := range m.AttestationFormats { + l = len(s) + n += 1 + l + sovParams(uint64(l)) + } + } + return n +} + +func (m *KeyInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Role) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + l = len(m.Algorithm) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + l = len(m.Encoding) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + l = len(m.Curve) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedPublicKeys", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + 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 ErrIntOverflowParams + } + 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 ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthParams + } + 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 ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthParams + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthParams + } + 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 := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AllowedPublicKeys[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConveyancePreference = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AttestationFormats = append(m.AttestationFormats, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + 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 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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: KeyInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KeyInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Role = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Algorithm = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Encoding = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Curve = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/did/types/pubkey/pubkey.go b/x/did/types/pubkey/pubkey.go deleted file mode 100644 index 2cfd2866e..000000000 --- a/x/did/types/pubkey/pubkey.go +++ /dev/null @@ -1,76 +0,0 @@ -package pubkey - -import ( - "strings" - - didv1 "github.com/onsonr/sonr/api/did/v1" -) - -type PubKeyI interface { - GetRole() string - GetKeyType() string - GetRawKey() *didv1.RawKey - GetJwk() *didv1.JSONWebKey -} - -// PubKey defines a generic pubkey. -type PublicKey interface { - VerifySignature(msg, sig []byte) bool -} - -type PubKeyG[T any] interface { - *T - PublicKey -} - -type pubKeyImpl struct { - decode func(b []byte) (PublicKey, error) - validate func(key PublicKey) error -} - -// func WithSecp256K1PubKey() Option { -// return WithPubKeyWithValidationFunc(func(pt *secp256k1.PubKey) error { -// _, err := dcrd_secp256k1.ParsePubKey(pt.Key) -// return err -// }) -// } -// -// func WithPubKey[T any, PT PubKeyG[T]]() Option { -// return WithPubKeyWithValidationFunc[T, PT](func(_ PT) error { -// return nil -// }) -// } -// -// func WithPubKeyWithValidationFunc[T any, PT PubKeyG[T]](validateFn func(PT) error) Option { -// pkImpl := pubKeyImpl{ -// decode: func(b []byte) (PublicKey, error) { -// key := PT(new(T)) -// err := gogoproto.Unmarshal(b, key) -// if err != nil { -// return nil, err -// } -// return key, nil -// }, -// validate: func(k PublicKey) error { -// concrete, ok := k.(PT) -// if !ok { -// return fmt.Errorf( -// "invalid pubkey type passed for validation, wanted: %T, got: %T", -// concrete, -// k, -// ) -// } -// return validateFn(concrete) -// }, -// } -// return func(a *Account) { -// a.supportedPubKeys[gogoproto.MessageName(PT(new(T)))] = pkImpl -// } -// } -func nameFromTypeURL(url string) string { - name := url - if i := strings.LastIndexByte(url, '/'); i >= 0 { - name = name[i+len("/"):] - } - return name -} diff --git a/x/did/types/query.pb.go b/x/did/types/query.pb.go index 8c2d96202..d9681537c 100644 --- a/x/did/types/query.pb.go +++ b/x/did/types/query.pb.go @@ -443,99 +443,6 @@ func (m *QueryVerifyResponse) GetValid() bool { return false } -// Document defines a DID document -type Document 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"` - Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"` - AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` - CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` - CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` - Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"` -} - -func (m *Document) Reset() { *m = Document{} } -func (m *Document) String() string { return proto.CompactTextString(m) } -func (*Document) ProtoMessage() {} -func (*Document) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{7} -} -func (m *Document) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Document.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 *Document) XXX_Merge(src proto.Message) { - xxx_messageInfo_Document.Merge(m, src) -} -func (m *Document) XXX_Size() int { - return m.Size() -} -func (m *Document) XXX_DiscardUnknown() { - xxx_messageInfo_Document.DiscardUnknown(m) -} - -var xxx_messageInfo_Document proto.InternalMessageInfo - -func (m *Document) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Document) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -func (m *Document) GetAuthentication() []string { - if m != nil { - return m.Authentication - } - return nil -} - -func (m *Document) GetAssertionMethod() []string { - if m != nil { - return m.AssertionMethod - } - return nil -} - -func (m *Document) GetCapabilityDelegation() []string { - if m != nil { - return m.CapabilityDelegation - } - return nil -} - -func (m *Document) GetCapabilityInvocation() []string { - if m != nil { - return m.CapabilityInvocation - } - return nil -} - -func (m *Document) GetService() []string { - if m != nil { - return m.Service - } - return nil -} - func init() { proto.RegisterType((*QueryRequest)(nil), "did.v1.QueryRequest") proto.RegisterType((*QueryParamsResponse)(nil), "did.v1.QueryParamsResponse") @@ -544,53 +451,42 @@ func init() { proto.RegisterType((*QuerySignResponse)(nil), "did.v1.QuerySignResponse") proto.RegisterType((*QueryVerifyRequest)(nil), "did.v1.QueryVerifyRequest") proto.RegisterType((*QueryVerifyResponse)(nil), "did.v1.QueryVerifyResponse") - proto.RegisterType((*Document)(nil), "did.v1.Document") } func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) } var fileDescriptor_ae1fa9bb626e2869 = []byte{ - // 625 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0x41, 0x6f, 0xd3, 0x4c, - 0x10, 0x6d, 0x92, 0xc6, 0x6d, 0xe7, 0xfb, 0x48, 0xc3, 0xe2, 0x56, 0x26, 0x44, 0x56, 0xb5, 0x87, - 0xaa, 0x08, 0x14, 0xab, 0xed, 0x15, 0x2e, 0xa8, 0x17, 0x0e, 0x48, 0x90, 0x22, 0x90, 0xb8, 0x94, - 0x6d, 0x76, 0x70, 0x57, 0x75, 0x76, 0x53, 0xef, 0xc6, 0x22, 0x42, 0x70, 0xe0, 0x17, 0x80, 0xb8, - 0xf3, 0x7b, 0x38, 0x56, 0xe2, 0xc2, 0x11, 0xb5, 0x1c, 0xf9, 0x11, 0xc8, 0xeb, 0x75, 0x1a, 0x5b, - 0x70, 0x44, 0x5c, 0xa2, 0xcc, 0x9b, 0x99, 0xb7, 0x6f, 0x76, 0xdf, 0x18, 0x08, 0x17, 0x3c, 0xca, - 0x76, 0xa3, 0xb3, 0x29, 0xa6, 0xb3, 0xc1, 0x24, 0x55, 0x46, 0x11, 0x8f, 0x0b, 0x3e, 0xc8, 0x76, - 0x7b, 0xbe, 0xcb, 0xc5, 0x28, 0x51, 0x0b, 0x5d, 0x64, 0x7b, 0xfd, 0x58, 0xa9, 0x38, 0xc1, 0x88, - 0x4d, 0x44, 0xc4, 0xa4, 0x54, 0x86, 0x19, 0xa1, 0xa4, 0xcb, 0xd2, 0x97, 0xf0, 0xff, 0x93, 0x9c, - 0x6a, 0x88, 0x67, 0x53, 0xd4, 0x86, 0x74, 0xa1, 0xc5, 0x05, 0x0f, 0x1a, 0x5b, 0x8d, 0x9d, 0xb5, - 0x61, 0xfe, 0x97, 0x6c, 0x82, 0xa7, 0x52, 0x11, 0x0b, 0x19, 0x34, 0x2d, 0xe8, 0xa2, 0xbc, 0xf2, - 0x14, 0x67, 0x41, 0xab, 0xa8, 0x3c, 0xc5, 0x19, 0xf1, 0xa1, 0xcd, 0xb4, 0x46, 0x13, 0x2c, 0x5b, - 0xac, 0x08, 0xe8, 0x7d, 0xb8, 0x61, 0x4f, 0x78, 0xcc, 0x52, 0x36, 0xd6, 0x43, 0xd4, 0x13, 0x25, - 0x35, 0x92, 0x6d, 0xf0, 0x26, 0x16, 0xb1, 0x67, 0xfd, 0xb7, 0xd7, 0x19, 0x14, 0x53, 0x0c, 0x5c, - 0x9d, 0xcb, 0xd2, 0x03, 0xf0, 0x9d, 0x40, 0xad, 0x92, 0x0c, 0xe7, 0xfd, 0x77, 0x61, 0x95, 0xab, - 0xd1, 0x74, 0x8c, 0xd2, 0x38, 0x86, 0x6e, 0xc9, 0x70, 0xe0, 0xf0, 0xe1, 0xbc, 0x82, 0xbe, 0x83, - 0xae, 0x65, 0x39, 0x14, 0xb1, 0xfc, 0x6b, 0xa3, 0x92, 0x00, 0x56, 0xc6, 0xa8, 0x35, 0x8b, 0x31, - 0x68, 0x5b, 0xbc, 0x0c, 0xe9, 0x2e, 0x5c, 0x5f, 0x38, 0xdf, 0x8d, 0xd0, 0x87, 0x35, 0x2d, 0x62, - 0xc9, 0xcc, 0x34, 0x45, 0x27, 0xe3, 0x0a, 0xa0, 0x9f, 0x1b, 0x40, 0x6c, 0xcf, 0x33, 0x4c, 0xc5, - 0xab, 0xd9, 0x3f, 0x50, 0x5d, 0x15, 0xe8, 0xd5, 0x05, 0xde, 0x71, 0x0f, 0x5b, 0xea, 0x73, 0x53, - 0xf9, 0xd0, 0xce, 0x58, 0xe2, 0x24, 0xae, 0x0e, 0x8b, 0x80, 0x7e, 0x6c, 0xc2, 0x6a, 0xf9, 0x2e, - 0xa4, 0x03, 0xcd, 0xf9, 0x08, 0x4d, 0xc1, 0x49, 0x08, 0x30, 0x52, 0xd2, 0xa4, 0x2a, 0x49, 0x30, - 0x75, 0x53, 0x2c, 0x20, 0x64, 0x1b, 0x3a, 0x6c, 0x6a, 0x4e, 0x50, 0x1a, 0x31, 0xb2, 0xee, 0x0d, - 0x5a, 0x5b, 0xad, 0x9d, 0xb5, 0x61, 0x0d, 0x25, 0xb7, 0xa1, 0x9b, 0x8f, 0x94, 0xe6, 0xc1, 0xd1, - 0x18, 0xcd, 0x89, 0xe2, 0xc1, 0xb2, 0xad, 0x5c, 0x9f, 0xe3, 0x8f, 0x2c, 0x4c, 0xf6, 0x61, 0x63, - 0xc4, 0x26, 0xec, 0x58, 0x24, 0xc2, 0xcc, 0x8e, 0x38, 0x26, 0x18, 0x17, 0xcc, 0x6d, 0x5b, 0xef, - 0x5f, 0x25, 0x0f, 0xe6, 0xb9, 0x5a, 0x93, 0x90, 0x99, 0x72, 0x72, 0xbc, 0x7a, 0xd3, 0xc3, 0x79, - 0x2e, 0xbf, 0x5e, 0x8d, 0x69, 0x26, 0x46, 0x18, 0xac, 0xd8, 0xb2, 0x32, 0xdc, 0xfb, 0xd9, 0x84, - 0xb6, 0xbd, 0x41, 0x72, 0x08, 0x5e, 0x61, 0x7b, 0xe2, 0x97, 0x26, 0x5e, 0xdc, 0xca, 0xde, 0xad, - 0x0a, 0x5a, 0xdd, 0x24, 0xba, 0xf9, 0xfe, 0xeb, 0x8f, 0x4f, 0xcd, 0x2e, 0xe9, 0x44, 0x6e, 0xff, - 0x8b, 0xcd, 0x21, 0x4f, 0x61, 0xc5, 0x2d, 0xcd, 0x1f, 0x58, 0xfb, 0x35, 0xb4, 0xb2, 0x60, 0x74, - 0xc3, 0xd2, 0xae, 0x93, 0x6b, 0x25, 0xed, 0x1b, 0x2e, 0xf8, 0x5b, 0xf2, 0x1c, 0x96, 0x73, 0x13, - 0x93, 0xa0, 0xd2, 0xbc, 0xb0, 0x57, 0xbd, 0x9b, 0xbf, 0xc9, 0x38, 0xce, 0x9e, 0xe5, 0xf4, 0x29, - 0xa9, 0x70, 0x46, 0xb9, 0xa7, 0xc8, 0x11, 0x78, 0x85, 0x93, 0x48, 0xaf, 0x42, 0x50, 0xb1, 0x7f, - 0xed, 0x26, 0xaa, 0xd6, 0xa3, 0x7d, 0x4b, 0xbf, 0x49, 0xfd, 0x2a, 0x7d, 0x66, 0xab, 0x1e, 0xdc, - 0xfb, 0x72, 0x11, 0x36, 0xce, 0x2f, 0xc2, 0xc6, 0xf7, 0x8b, 0xb0, 0xf1, 0xe1, 0x32, 0x5c, 0x3a, - 0xbf, 0x0c, 0x97, 0xbe, 0x5d, 0x86, 0x4b, 0x2f, 0x68, 0x2c, 0xcc, 0xc9, 0xf4, 0x78, 0x30, 0x52, - 0xe3, 0x48, 0x49, 0xad, 0x64, 0x1a, 0xd9, 0x9f, 0xd7, 0x96, 0xc7, 0xcc, 0x26, 0xa8, 0x8f, 0x3d, - 0xfb, 0xbd, 0xdc, 0xff, 0x15, 0x00, 0x00, 0xff, 0xff, 0xb9, 0xc1, 0x21, 0x0f, 0x81, 0x05, 0x00, - 0x00, + // 478 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x53, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x53, 0xe2, 0xb6, 0x03, 0x94, 0xb0, 0x35, 0x91, 0x15, 0x22, 0x0b, 0xed, 0x01, 0x21, + 0x81, 0x6c, 0xa5, 0x5c, 0xe1, 0x82, 0xfa, 0x01, 0xe0, 0x22, 0x0e, 0x5c, 0xc0, 0xed, 0x0e, 0x66, + 0xd5, 0x64, 0xd7, 0xf5, 0xae, 0x2d, 0x2c, 0x04, 0x07, 0xbe, 0x00, 0xa9, 0x77, 0xbe, 0x87, 0x63, + 0x25, 0x2e, 0x1c, 0x51, 0xc2, 0x87, 0xa0, 0xac, 0xd7, 0x25, 0x1b, 0x89, 0x23, 0xea, 0xc5, 0xf2, + 0xbc, 0x79, 0xf3, 0xe6, 0x8d, 0x67, 0x0c, 0x84, 0x71, 0x96, 0xd4, 0xd3, 0xe4, 0xac, 0xc2, 0xb2, + 0x89, 0x8b, 0x52, 0x6a, 0x49, 0x7c, 0xc6, 0x59, 0x5c, 0x4f, 0xc7, 0x81, 0xcd, 0xe5, 0x28, 0x50, + 0x71, 0xd5, 0x66, 0xc7, 0xfb, 0x16, 0x2d, 0xb2, 0x32, 0x9b, 0x77, 0xe0, 0x24, 0x97, 0x32, 0x9f, + 0x61, 0x92, 0x15, 0x3c, 0xc9, 0x84, 0x90, 0x3a, 0xd3, 0x5c, 0x0a, 0x9b, 0xa5, 0x6f, 0xe1, 0xc6, + 0x8b, 0x95, 0x7e, 0x8a, 0x67, 0x15, 0x2a, 0x4d, 0x86, 0xb0, 0xc5, 0x38, 0x0b, 0xbd, 0x7b, 0xde, + 0x83, 0xdd, 0x74, 0xf5, 0x4a, 0x46, 0xe0, 0xcb, 0x92, 0xe7, 0x5c, 0x84, 0x7d, 0x03, 0xda, 0x68, + 0xc5, 0x3c, 0xc5, 0x26, 0xdc, 0x6a, 0x99, 0xa7, 0xd8, 0x90, 0x00, 0x06, 0x99, 0x52, 0xa8, 0xc3, + 0x6b, 0x06, 0x6b, 0x03, 0xfa, 0x14, 0xf6, 0x4d, 0x87, 0xe7, 0xc6, 0x54, 0x8a, 0xaa, 0x90, 0x42, + 0x21, 0xb9, 0x0f, 0x7e, 0x6b, 0xd3, 0xf4, 0xba, 0x7e, 0xb0, 0x17, 0xb7, 0xa3, 0xc5, 0x96, 0x67, + 0xb3, 0xf4, 0x10, 0x02, 0x6b, 0x50, 0xc9, 0x59, 0x8d, 0x97, 0xf5, 0x8f, 0x60, 0x87, 0xc9, 0x93, + 0x6a, 0x8e, 0x42, 0x5b, 0x85, 0x61, 0xa7, 0x70, 0x68, 0xf1, 0xf4, 0x92, 0x41, 0x3f, 0xc3, 0xd0, + 0xa8, 0x1c, 0xf1, 0x5c, 0xfc, 0xb7, 0x51, 0x49, 0x08, 0xdb, 0x73, 0x54, 0x2a, 0xcb, 0x31, 0x1c, + 0x18, 0xbc, 0x0b, 0xe9, 0x14, 0x6e, 0xaf, 0xf5, 0xb7, 0x23, 0x4c, 0x60, 0x57, 0xf1, 0x5c, 0x64, + 0xba, 0x2a, 0xd1, 0xda, 0xf8, 0x0b, 0xd0, 0x6f, 0x1e, 0x10, 0x53, 0xf3, 0x0a, 0x4b, 0xfe, 0xae, + 0xb9, 0x02, 0xd7, 0xae, 0x41, 0x7f, 0xd3, 0xe0, 0x43, 0xbb, 0xd8, 0xce, 0x9f, 0x9d, 0x2a, 0x80, + 0x41, 0x9d, 0xcd, 0xac, 0xc5, 0x9d, 0xb4, 0x0d, 0x0e, 0xce, 0xfb, 0x30, 0x30, 0x6c, 0x72, 0x04, + 0x7e, 0xbb, 0x62, 0x12, 0x74, 0x0b, 0x5b, 0xbf, 0xc0, 0xf1, 0x5d, 0x07, 0x75, 0xaf, 0x86, 0x8e, + 0xbe, 0xfc, 0xf8, 0x7d, 0xde, 0x1f, 0x92, 0xbd, 0xc4, 0x39, 0x75, 0xf2, 0x12, 0xb6, 0xed, 0x81, + 0xfc, 0x43, 0x75, 0xb2, 0x81, 0x3a, 0xc7, 0x44, 0xef, 0x18, 0xd9, 0x5b, 0xe4, 0x66, 0x27, 0xfb, + 0x91, 0x71, 0xf6, 0x89, 0xbc, 0x01, 0xbf, 0x1d, 0x8e, 0x8c, 0x9d, 0x72, 0x67, 0x23, 0x1b, 0x86, + 0xdd, 0xaf, 0x41, 0x27, 0x46, 0x79, 0x44, 0x03, 0x47, 0x39, 0xa9, 0x0d, 0xeb, 0xd9, 0x93, 0xef, + 0x8b, 0xc8, 0xbb, 0x58, 0x44, 0xde, 0xaf, 0x45, 0xe4, 0x7d, 0x5d, 0x46, 0xbd, 0x8b, 0x65, 0xd4, + 0xfb, 0xb9, 0x8c, 0x7a, 0xaf, 0x69, 0xce, 0xf5, 0xfb, 0xea, 0x38, 0x3e, 0x91, 0xf3, 0x44, 0x0a, + 0x25, 0x45, 0x99, 0x98, 0xc7, 0x07, 0xa3, 0xa3, 0x9b, 0x02, 0xd5, 0xb1, 0x6f, 0x7e, 0xe1, 0xc7, + 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x63, 0xf5, 0x0e, 0x9a, 0x29, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -609,8 +505,6 @@ type QueryClient interface { Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) - // Sign signs a message with the DID document - Sign(ctx context.Context, in *QuerySignRequest, opts ...grpc.CallOption) (*QuerySignResponse, error) // Verify verifies a message with the DID document Verify(ctx context.Context, in *QueryVerifyRequest, opts ...grpc.CallOption) (*QueryVerifyResponse, error) } @@ -641,15 +535,6 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grp return out, nil } -func (c *queryClient) Sign(ctx context.Context, in *QuerySignRequest, opts ...grpc.CallOption) (*QuerySignResponse, error) { - out := new(QuerySignResponse) - err := c.cc.Invoke(ctx, "/did.v1.Query/Sign", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) Verify(ctx context.Context, in *QueryVerifyRequest, opts ...grpc.CallOption) (*QueryVerifyResponse, error) { out := new(QueryVerifyResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Verify", in, out, opts...) @@ -665,8 +550,6 @@ type QueryServer interface { Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) // Resolve queries the DID document by its id. Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) - // Sign signs a message with the DID document - Sign(context.Context, *QuerySignRequest) (*QuerySignResponse, error) // Verify verifies a message with the DID document Verify(context.Context, *QueryVerifyRequest) (*QueryVerifyResponse, error) } @@ -681,9 +564,6 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryRequest) func (*UnimplementedQueryServer) Resolve(ctx context.Context, req *QueryRequest) (*QueryResolveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } -func (*UnimplementedQueryServer) Sign(ctx context.Context, req *QuerySignRequest) (*QuerySignResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Sign not implemented") -} func (*UnimplementedQueryServer) Verify(ctx context.Context, req *QueryVerifyRequest) (*QueryVerifyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Verify not implemented") } @@ -728,24 +608,6 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_Sign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySignRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Sign(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/did.v1.Query/Sign", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Sign(ctx, req.(*QuerySignRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_Verify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryVerifyRequest) if err := dec(in); err != nil { @@ -777,10 +639,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Resolve", Handler: _Query_Resolve_Handler, }, - { - MethodName: "Sign", - Handler: _Query_Sign_Handler, - }, { MethodName: "Verify", Handler: _Query_Verify_Handler, @@ -1097,88 +955,6 @@ func (m *QueryVerifyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Document) 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 *Document) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Service) > 0 { - for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Service[iNdEx]) - copy(dAtA[i:], m.Service[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Service[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if len(m.CapabilityInvocation) > 0 { - for iNdEx := len(m.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CapabilityInvocation[iNdEx]) - copy(dAtA[i:], m.CapabilityInvocation[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.CapabilityInvocation[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.CapabilityDelegation) > 0 { - for iNdEx := len(m.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CapabilityDelegation[iNdEx]) - copy(dAtA[i:], m.CapabilityDelegation[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.CapabilityDelegation[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.AssertionMethod) > 0 { - for iNdEx := len(m.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.AssertionMethod[iNdEx]) - copy(dAtA[i:], m.AssertionMethod[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AssertionMethod[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Authentication) > 0 { - for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Authentication[iNdEx]) - copy(dAtA[i:], m.Authentication[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Authentication[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Controller) > 0 { - i -= len(m.Controller) - copy(dAtA[i:], m.Controller) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Controller))) - i-- - dAtA[i] = 0x12 - } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1328,53 +1104,6 @@ func (m *QueryVerifyResponse) Size() (n int) { return n } -func (m *Document) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Controller) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.Authentication) > 0 { - for _, s := range m.Authentication { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.AssertionMethod) > 0 { - for _, s := range m.AssertionMethod { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.CapabilityDelegation) > 0 { - for _, s := range m.CapabilityDelegation { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.CapabilityInvocation) > 0 { - for _, s := range m.CapabilityInvocation { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.Service) > 0 { - for _, s := range m.Service { - 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 } @@ -2335,280 +2064,6 @@ func (m *QueryVerifyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *Document) 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: Document: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Document: 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 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.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 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.Controller = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authentication", 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.Authentication = append(m.Authentication, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssertionMethod", 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.AssertionMethod = append(m.AssertionMethod, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CapabilityDelegation", 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.CapabilityDelegation = append(m.CapabilityDelegation, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CapabilityInvocation", 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.CapabilityInvocation = append(m.CapabilityInvocation, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service = append(m.Service, 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 b43c6c14d..7a30f0396 100644 --- a/x/did/types/query.pb.gw.go +++ b/x/did/types/query.pb.gw.go @@ -141,78 +141,6 @@ func local_request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marsha } -var ( - filter_Query_Sign_0 = &utilities.DoubleArray{Encoding: map[string]int{"did": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Sign_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySignRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["did"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") - } - - protoReq.Did, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sign_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Sign(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Sign_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySignRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["did"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") - } - - protoReq.Did, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sign_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Sign(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Query_Verify_0 = &utilities.DoubleArray{Encoding: map[string]int{"did": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) @@ -337,29 +265,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("POST", pattern_Query_Sign_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Sign_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sign_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_Query_Verify_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -464,26 +369,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("POST", pattern_Query_Sign_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Sign_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sign_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("POST", pattern_Query_Verify_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -512,8 +397,6 @@ var ( pattern_Query_Resolve_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 0}, []string{"did", "v1"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Sign_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 0, 2, 2}, []string{"did", "v1", "sign"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Verify_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 0, 2, 2}, []string{"did", "v1", "verify"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -522,7 +405,5 @@ var ( forward_Query_Resolve_0 = runtime.ForwardResponseMessage - forward_Query_Sign_0 = runtime.ForwardResponseMessage - forward_Query_Verify_0 = runtime.ForwardResponseMessage ) diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index a28a0d272..5699701fa 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -30,8 +30,8 @@ type Assertion struct { Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // Origin of the authentication Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - // PubKey is the verification method - PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // string is the verification method + PublicKeyHex string `protobuf:"bytes,4,opt,name=public_key_hex,json=publicKeyHex,proto3" json:"public_key_hex,omitempty"` // AssertionType is the assertion type AssertionType string `protobuf:"bytes,5,opt,name=assertion_type,json=assertionType,proto3" json:"assertion_type,omitempty"` // Metadata of the authentication @@ -94,11 +94,11 @@ func (m *Assertion) GetSubject() string { return "" } -func (m *Assertion) GetPublicKey() *PubKey { +func (m *Assertion) GetPublicKeyHex() string { if m != nil { - return m.PublicKey + return m.PublicKeyHex } - return nil + return "" } func (m *Assertion) GetAssertionType() string { @@ -129,8 +129,8 @@ type Authentication struct { Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // Origin of the authentication Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - // PubKey is the verification method - PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // string is the verification method + PublicKeyHex string `protobuf:"bytes,4,opt,name=public_key_hex,json=publicKeyHex,proto3" json:"public_key_hex,omitempty"` // CredentialID is the byte representation of the credential ID CredentialId []byte `protobuf:"bytes,5,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` // Metadata of the authentication @@ -193,11 +193,11 @@ func (m *Authentication) GetSubject() string { return "" } -func (m *Authentication) GetPublicKey() *PubKey { +func (m *Authentication) GetPublicKeyHex() string { if m != nil { - return m.PublicKey + return m.PublicKeyHex } - return nil + return "" } func (m *Authentication) GetCredentialId() []byte { @@ -221,40 +221,28 @@ func (m *Authentication) GetCreationBlock() int64 { return 0 } -// Controller represents a Sonr DWN Vault -type Controller struct { - // The unique identifier of the controller - Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` - // The unique identifier of the controller - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` - // The DID of the controller - SonrAddress string `protobuf:"bytes,3,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"` - // The DID of the controller - EthAddress string `protobuf:"bytes,4,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"` - // The DID of the controller - BtcAddress string `protobuf:"bytes,5,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` - // PubKey is the verification method - PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // Pointer to the Keyshares - KsVal string `protobuf:"bytes,7,opt,name=ks_val,json=ksVal,proto3" json:"ks_val,omitempty"` - // The block number of when a user claimed the controller - ClaimedBlock int64 `protobuf:"varint,8,opt,name=claimed_block,json=claimedBlock,proto3" json:"claimed_block,omitempty"` - // CreationBlock is the block number of the creation of the controller - CreationBlock int64 `protobuf:"varint,9,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` +// Macaroon is a Macaroon message type. +type Biscuit struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"` + Macaroon string `protobuf:"bytes,6,opt,name=macaroon,proto3" json:"macaroon,omitempty"` } -func (m *Controller) Reset() { *m = Controller{} } -func (m *Controller) String() string { return proto.CompactTextString(m) } -func (*Controller) ProtoMessage() {} -func (*Controller) Descriptor() ([]byte, []int) { +func (m *Biscuit) Reset() { *m = Biscuit{} } +func (m *Biscuit) String() string { return proto.CompactTextString(m) } +func (*Biscuit) ProtoMessage() {} +func (*Biscuit) Descriptor() ([]byte, []int) { return fileDescriptor_f44bb702879c34b4, []int{2} } -func (m *Controller) XXX_Unmarshal(b []byte) error { +func (m *Biscuit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Controller) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Biscuit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Controller.Marshal(b, m, deterministic) + return xxx_messageInfo_Biscuit.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -264,102 +252,94 @@ func (m *Controller) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Controller) XXX_Merge(src proto.Message) { - xxx_messageInfo_Controller.Merge(m, src) +func (m *Biscuit) XXX_Merge(src proto.Message) { + xxx_messageInfo_Biscuit.Merge(m, src) } -func (m *Controller) XXX_Size() int { +func (m *Biscuit) XXX_Size() int { return m.Size() } -func (m *Controller) XXX_DiscardUnknown() { - xxx_messageInfo_Controller.DiscardUnknown(m) +func (m *Biscuit) XXX_DiscardUnknown() { + xxx_messageInfo_Biscuit.DiscardUnknown(m) } -var xxx_messageInfo_Controller proto.InternalMessageInfo +var xxx_messageInfo_Biscuit proto.InternalMessageInfo -func (m *Controller) GetNumber() uint64 { +func (m *Biscuit) GetId() uint64 { if m != nil { - return m.Number + return m.Id } return 0 } -func (m *Controller) GetDid() string { - if m != nil { - return m.Did - } - return "" -} - -func (m *Controller) GetSonrAddress() string { - if m != nil { - return m.SonrAddress - } - return "" -} - -func (m *Controller) GetEthAddress() string { +func (m *Biscuit) GetController() string { if m != nil { - return m.EthAddress + return m.Controller } return "" } -func (m *Controller) GetBtcAddress() string { +func (m *Biscuit) GetSubject() string { if m != nil { - return m.BtcAddress + return m.Subject } return "" } -func (m *Controller) GetPublicKey() *PubKey { - if m != nil { - return m.PublicKey - } - return nil -} - -func (m *Controller) GetKsVal() string { +func (m *Biscuit) GetOrigin() string { if m != nil { - return m.KsVal + return m.Origin } return "" } -func (m *Controller) GetClaimedBlock() int64 { +func (m *Biscuit) GetExpiryHeight() int64 { if m != nil { - return m.ClaimedBlock + return m.ExpiryHeight } return 0 } -func (m *Controller) GetCreationBlock() int64 { +func (m *Biscuit) GetMacaroon() string { if m != nil { - return m.CreationBlock + return m.Macaroon } - return 0 + return "" } -// Grant is a Grant message type. -type Grant struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"` +// Controller represents a Sonr DWN Vault +type Controller struct { + // The unique identifier of the controller + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` + // The unique identifier of the controller + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` + // The DID of the controller + SonrAddress string `protobuf:"bytes,3,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"` + // The DID of the controller + EthAddress string `protobuf:"bytes,4,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"` + // The DID of the controller + BtcAddress string `protobuf:"bytes,5,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` + // string is the verification method + PublicKeyHex string `protobuf:"bytes,6,opt,name=public_key_hex,json=publicKeyHex,proto3" json:"public_key_hex,omitempty"` + // Pointer to the Keyshares + KsVal string `protobuf:"bytes,7,opt,name=ks_val,json=ksVal,proto3" json:"ks_val,omitempty"` + // The block number of when a user claimed the controller + ClaimedBlock int64 `protobuf:"varint,8,opt,name=claimed_block,json=claimedBlock,proto3" json:"claimed_block,omitempty"` + // CreationBlock is the block number of the creation of the controller + CreationBlock int64 `protobuf:"varint,9,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"` } -func (m *Grant) Reset() { *m = Grant{} } -func (m *Grant) String() string { return proto.CompactTextString(m) } -func (*Grant) ProtoMessage() {} -func (*Grant) Descriptor() ([]byte, []int) { +func (m *Controller) Reset() { *m = Controller{} } +func (m *Controller) String() string { return proto.CompactTextString(m) } +func (*Controller) ProtoMessage() {} +func (*Controller) Descriptor() ([]byte, []int) { return fileDescriptor_f44bb702879c34b4, []int{3} } -func (m *Grant) XXX_Unmarshal(b []byte) error { +func (m *Controller) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Controller) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Grant.Marshal(b, m, deterministic) + return xxx_messageInfo_Controller.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -369,136 +349,79 @@ func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Grant) XXX_Merge(src proto.Message) { - xxx_messageInfo_Grant.Merge(m, src) +func (m *Controller) XXX_Merge(src proto.Message) { + xxx_messageInfo_Controller.Merge(m, src) } -func (m *Grant) XXX_Size() int { +func (m *Controller) XXX_Size() int { return m.Size() } -func (m *Grant) XXX_DiscardUnknown() { - xxx_messageInfo_Grant.DiscardUnknown(m) +func (m *Controller) XXX_DiscardUnknown() { + xxx_messageInfo_Controller.DiscardUnknown(m) } -var xxx_messageInfo_Grant proto.InternalMessageInfo +var xxx_messageInfo_Controller proto.InternalMessageInfo -func (m *Grant) GetId() uint64 { +func (m *Controller) GetNumber() uint64 { if m != nil { - return m.Id + return m.Number } return 0 } -func (m *Grant) GetController() string { +func (m *Controller) GetDid() string { if m != nil { - return m.Controller + return m.Did } return "" } -func (m *Grant) GetSubject() string { +func (m *Controller) GetSonrAddress() string { if m != nil { - return m.Subject + return m.SonrAddress } return "" } -func (m *Grant) GetOrigin() string { +func (m *Controller) GetEthAddress() string { if m != nil { - return m.Origin + return m.EthAddress } return "" } -func (m *Grant) GetExpiryHeight() int64 { - if m != nil { - return m.ExpiryHeight - } - return 0 -} - -// Macaroon is a Macaroon message type. -type Macaroon struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - ExpiryHeight int64 `protobuf:"varint,5,opt,name=expiry_height,json=expiryHeight,proto3" json:"expiry_height,omitempty"` - Macaroon string `protobuf:"bytes,6,opt,name=macaroon,proto3" json:"macaroon,omitempty"` -} - -func (m *Macaroon) Reset() { *m = Macaroon{} } -func (m *Macaroon) String() string { return proto.CompactTextString(m) } -func (*Macaroon) ProtoMessage() {} -func (*Macaroon) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{4} -} -func (m *Macaroon) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Macaroon) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Macaroon.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 *Macaroon) XXX_Merge(src proto.Message) { - xxx_messageInfo_Macaroon.Merge(m, src) -} -func (m *Macaroon) XXX_Size() int { - return m.Size() -} -func (m *Macaroon) XXX_DiscardUnknown() { - xxx_messageInfo_Macaroon.DiscardUnknown(m) -} - -var xxx_messageInfo_Macaroon proto.InternalMessageInfo - -func (m *Macaroon) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Macaroon) GetController() string { +func (m *Controller) GetBtcAddress() string { if m != nil { - return m.Controller + return m.BtcAddress } return "" } -func (m *Macaroon) GetSubject() string { +func (m *Controller) GetPublicKeyHex() string { if m != nil { - return m.Subject + return m.PublicKeyHex } return "" } -func (m *Macaroon) GetOrigin() string { +func (m *Controller) GetKsVal() string { if m != nil { - return m.Origin + return m.KsVal } return "" } -func (m *Macaroon) GetExpiryHeight() int64 { +func (m *Controller) GetClaimedBlock() int64 { if m != nil { - return m.ExpiryHeight + return m.ClaimedBlock } return 0 } -func (m *Macaroon) GetMacaroon() string { +func (m *Controller) GetCreationBlock() int64 { if m != nil { - return m.Macaroon + return m.CreationBlock } - return "" + return 0 } // Verification represents a verification method @@ -514,7 +437,7 @@ type Verification struct { // The subject of the verification Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // The public key of the verification - PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKeyHex string `protobuf:"bytes,6,opt,name=public_key_hex,json=publicKeyHex,proto3" json:"public_key_hex,omitempty"` // The verification method type VerificationType string `protobuf:"bytes,7,opt,name=verification_type,json=verificationType,proto3" json:"verification_type,omitempty"` // Metadata of the verification @@ -527,7 +450,7 @@ func (m *Verification) Reset() { *m = Verification{} } func (m *Verification) String() string { return proto.CompactTextString(m) } func (*Verification) ProtoMessage() {} func (*Verification) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{5} + return fileDescriptor_f44bb702879c34b4, []int{4} } func (m *Verification) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -591,11 +514,11 @@ func (m *Verification) GetSubject() string { return "" } -func (m *Verification) GetPublicKey() *PubKey { +func (m *Verification) GetPublicKeyHex() string { if m != nil { - return m.PublicKey + return m.PublicKeyHex } - return nil + return "" } func (m *Verification) GetVerificationType() string { @@ -624,9 +547,8 @@ func init() { proto.RegisterMapType((map[string][]byte)(nil), "did.v1.Assertion.AccumulatorEntry") proto.RegisterType((*Authentication)(nil), "did.v1.Authentication") proto.RegisterMapType((map[string]string)(nil), "did.v1.Authentication.MetadataEntry") + proto.RegisterType((*Biscuit)(nil), "did.v1.Biscuit") proto.RegisterType((*Controller)(nil), "did.v1.Controller") - proto.RegisterType((*Grant)(nil), "did.v1.Grant") - proto.RegisterType((*Macaroon)(nil), "did.v1.Macaroon") proto.RegisterType((*Verification)(nil), "did.v1.Verification") proto.RegisterMapType((map[string]string)(nil), "did.v1.Verification.MetadataEntry") } @@ -634,61 +556,59 @@ func init() { func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ - // 849 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x96, 0x61, 0x8b, 0xe3, 0x44, - 0x18, 0xc7, 0x77, 0x9a, 0x36, 0xd7, 0x3c, 0xed, 0x96, 0xdc, 0xb0, 0x9e, 0x61, 0xd1, 0x5a, 0x73, - 0x7a, 0xac, 0xb8, 0xb6, 0xdc, 0xf9, 0x46, 0x56, 0x39, 0xdc, 0x53, 0x51, 0x39, 0x16, 0x24, 0xca, - 0x81, 0xbe, 0x29, 0x93, 0xcc, 0xd8, 0x8e, 0x4d, 0x32, 0x75, 0x32, 0x29, 0xd7, 0x97, 0x82, 0x82, - 0xaf, 0xc4, 0x4f, 0xe0, 0xc7, 0xf0, 0x33, 0xf8, 0xf2, 0x40, 0x04, 0x5f, 0xca, 0xee, 0x37, 0xf0, - 0x13, 0xc8, 0xcc, 0x24, 0x6d, 0xaa, 0x87, 0x7b, 0xae, 0x82, 0xf7, 0xa6, 0x74, 0xfe, 0x79, 0xf2, - 0xe4, 0x79, 0x7e, 0xff, 0xcc, 0x33, 0x01, 0x4c, 0x39, 0x9d, 0xac, 0x6e, 0x4f, 0x0a, 0x45, 0x14, - 0x1b, 0x2f, 0xa5, 0x50, 0x02, 0xbb, 0x94, 0xd3, 0xf1, 0xea, 0xf6, 0xe1, 0xb3, 0x89, 0x28, 0x32, - 0x51, 0x4c, 0x84, 0xcc, 0x74, 0x88, 0x90, 0x99, 0x0d, 0x38, 0x3c, 0xa8, 0x6e, 0x9a, 0xb1, 0x9c, - 0x15, 0xbc, 0xb0, 0x6a, 0xf8, 0x8d, 0x03, 0xde, 0x69, 0x51, 0x30, 0xa9, 0xb8, 0xc8, 0xb1, 0x0f, - 0x0e, 0xe5, 0x34, 0x40, 0x23, 0x74, 0xe4, 0x45, 0xfa, 0x2f, 0x1e, 0x02, 0x24, 0x22, 0x57, 0x52, - 0xa4, 0x29, 0x93, 0x41, 0xcb, 0x5c, 0x68, 0x28, 0x38, 0x80, 0x6b, 0x45, 0x19, 0x7f, 0xc1, 0x12, - 0x15, 0x38, 0xe6, 0x62, 0xbd, 0xc4, 0xaf, 0x01, 0x2c, 0xcb, 0x38, 0xe5, 0xc9, 0x74, 0xc1, 0xd6, - 0x41, 0x7b, 0x84, 0x8e, 0x7a, 0x77, 0x06, 0x63, 0x5b, 0xe5, 0xf8, 0xa3, 0x32, 0xbe, 0xcf, 0xd6, - 0x91, 0x67, 0x23, 0xee, 0xb3, 0x35, 0x7e, 0x19, 0x06, 0xa4, 0xae, 0x63, 0xaa, 0xd6, 0x4b, 0x16, - 0x74, 0x4c, 0xbe, 0xfd, 0x8d, 0xfa, 0xc9, 0x7a, 0xc9, 0xf0, 0xbb, 0xd0, 0x23, 0x49, 0x52, 0x66, - 0x65, 0x4a, 0x94, 0x90, 0x81, 0x3b, 0x72, 0x8e, 0x7a, 0x77, 0xc2, 0x3a, 0xed, 0xa6, 0x93, 0xf1, - 0xe9, 0x36, 0xe8, 0xbd, 0x5c, 0xc9, 0x75, 0xd4, 0xbc, 0x4d, 0x3f, 0x2c, 0x91, 0x8c, 0x98, 0x67, - 0xc5, 0xa9, 0x48, 0x16, 0xc1, 0xb5, 0x11, 0x3a, 0x72, 0xa2, 0xfd, 0x5a, 0xbd, 0xa7, 0xc5, 0xc3, - 0xbb, 0xe0, 0xff, 0x39, 0x8f, 0x46, 0xa4, 0xfb, 0xa9, 0x10, 0x2d, 0xd8, 0x1a, 0x1f, 0x40, 0x67, - 0x45, 0xd2, 0x92, 0x19, 0x3a, 0xfd, 0xc8, 0x2e, 0x4e, 0x5a, 0x6f, 0xa0, 0x93, 0x57, 0x7e, 0xff, - 0xe1, 0xe7, 0xef, 0x9c, 0x9b, 0xd0, 0x31, 0x58, 0x71, 0x00, 0x78, 0x4b, 0xee, 0xb8, 0xe2, 0xe4, - 0xa3, 0x00, 0x05, 0x28, 0xfc, 0xca, 0x81, 0xc1, 0x69, 0xa9, 0xe6, 0x2c, 0x57, 0x3c, 0x21, 0xff, - 0xb7, 0x19, 0x37, 0x41, 0x93, 0xa0, 0xba, 0x18, 0x92, 0x4e, 0x39, 0x35, 0x5e, 0xf4, 0xa3, 0xfe, - 0x56, 0xfc, 0x90, 0xe2, 0xb7, 0xa1, 0x9b, 0x31, 0x45, 0x28, 0x51, 0xa4, 0xf2, 0xe1, 0xa5, 0x8d, - 0x0f, 0x3b, 0x9d, 0x8c, 0xcf, 0xaa, 0x30, 0xeb, 0xc4, 0xe6, 0xae, 0x27, 0xb5, 0xe1, 0x4d, 0xd8, - 0xdf, 0xc9, 0x70, 0x99, 0x07, 0xde, 0x95, 0x3c, 0x68, 0x85, 0xdf, 0x3a, 0x00, 0xef, 0x6c, 0x69, - 0xde, 0x00, 0x37, 0x2f, 0xb3, 0x98, 0x49, 0xf3, 0xa0, 0x76, 0x54, 0xad, 0x6a, 0x5f, 0x5a, 0x5b, - 0x5f, 0x5e, 0x84, 0x7e, 0x21, 0x72, 0x39, 0x25, 0x94, 0x4a, 0x56, 0x14, 0x15, 0xfc, 0x9e, 0xd6, - 0x4e, 0xad, 0x84, 0x5f, 0x80, 0x1e, 0x53, 0xf3, 0x4d, 0x44, 0xdb, 0x7a, 0xc7, 0xd4, 0xbc, 0x11, - 0x10, 0xab, 0x64, 0x13, 0x60, 0x5f, 0x7e, 0x88, 0x55, 0x52, 0x07, 0xec, 0x5a, 0xe8, 0x5e, 0x66, - 0xe1, 0x33, 0xe0, 0x2e, 0x8a, 0xe9, 0x8a, 0xa4, 0x86, 0xa9, 0x17, 0x75, 0x16, 0xc5, 0x03, 0x92, - 0x1a, 0x67, 0x53, 0xc2, 0x33, 0x46, 0x2b, 0xe2, 0x5d, 0x43, 0xbc, 0x5f, 0x89, 0x06, 0xf8, 0x63, - 0x7c, 0xf1, 0x1e, 0xe3, 0xcb, 0xc9, 0xa7, 0x06, 0xed, 0xc7, 0x00, 0x35, 0x28, 0x1f, 0x61, 0xbc, - 0x8b, 0x42, 0x93, 0xc5, 0xd7, 0x77, 0x7a, 0xf7, 0x5b, 0x56, 0x6a, 0x74, 0xeb, 0x3b, 0x01, 0xc2, - 0x9e, 0xc1, 0xea, 0xb7, 0x03, 0x14, 0x38, 0xe1, 0x8f, 0x08, 0x3a, 0xef, 0x4b, 0x92, 0x2b, 0x3c, - 0x80, 0x56, 0xb5, 0x09, 0xda, 0x51, 0xeb, 0x5f, 0xed, 0x81, 0x1b, 0xe0, 0x0a, 0xc9, 0x67, 0x3c, - 0xaf, 0xe8, 0x57, 0x2b, 0x8d, 0x84, 0x3d, 0x5c, 0x72, 0xb9, 0x9e, 0xce, 0x19, 0x9f, 0xcd, 0x95, - 0x61, 0xef, 0x44, 0x7d, 0x2b, 0x7e, 0x60, 0xb4, 0x93, 0x5b, 0xa6, 0xd7, 0x11, 0xb8, 0xba, 0x1c, - 0x1f, 0xe1, 0x03, 0x18, 0x54, 0x79, 0x8f, 0x6d, 0x1a, 0xf3, 0x0e, 0xb5, 0xc3, 0x5f, 0x10, 0x74, - 0xcf, 0x48, 0x42, 0xa4, 0x10, 0xf9, 0x53, 0x52, 0x3b, 0x3e, 0x84, 0x6e, 0x56, 0x95, 0x64, 0xde, - 0x1b, 0x2f, 0xda, 0xac, 0x9f, 0xb0, 0xaf, 0x4e, 0xf8, 0x75, 0x1b, 0xfa, 0x0f, 0x98, 0xe4, 0x9f, - 0x5f, 0x7d, 0x3a, 0x3d, 0x0f, 0x40, 0x39, 0x9d, 0x66, 0x4c, 0xcd, 0x05, 0xad, 0x1a, 0xf4, 0x28, - 0xa7, 0x67, 0x46, 0xd0, 0x2d, 0xf2, 0xa2, 0x28, 0x99, 0xac, 0x5b, 0xb4, 0xab, 0x26, 0x94, 0xce, - 0xdf, 0x0d, 0xb5, 0x4b, 0x77, 0xc4, 0xab, 0x70, 0x7d, 0xd5, 0xe8, 0xc0, 0x1e, 0x32, 0x76, 0x73, - 0xf8, 0xcd, 0x0b, 0xe6, 0x9c, 0xb9, 0xdb, 0x18, 0x6e, 0xdd, 0xdd, 0x43, 0xa6, 0x89, 0xe1, 0x1f, - 0x8c, 0x36, 0xef, 0x3f, 0x1f, 0x6d, 0x5f, 0x1a, 0xef, 0x16, 0xf5, 0x68, 0x3b, 0x80, 0x81, 0x45, - 0xd6, 0x1c, 0x6b, 0x38, 0x84, 0xe7, 0x1a, 0x03, 0x6f, 0x6b, 0xc0, 0xb1, 0x8d, 0x35, 0xbb, 0xf1, - 0x16, 0x8c, 0xfe, 0x42, 0xa6, 0x4e, 0x52, 0xc7, 0x39, 0x01, 0x0a, 0xdc, 0x7b, 0x6f, 0xfd, 0x74, - 0x3e, 0x44, 0x8f, 0xce, 0x87, 0xe8, 0xb7, 0xf3, 0x21, 0xfa, 0xfe, 0x62, 0xb8, 0xf7, 0xe8, 0x62, - 0xb8, 0xf7, 0xeb, 0xc5, 0x70, 0xef, 0xb3, 0x70, 0xc6, 0xd5, 0xbc, 0x8c, 0xc7, 0x89, 0xc8, 0x26, - 0x22, 0xd7, 0x33, 0x60, 0x62, 0x7e, 0x1e, 0x4e, 0xf4, 0x77, 0x87, 0xce, 0x58, 0xc4, 0xae, 0xf9, - 0xe6, 0x78, 0xfd, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0xac, 0xdb, 0xa3, 0xc0, 0x08, 0x00, - 0x00, + // 821 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x95, 0xdf, 0x8a, 0x23, 0x45, + 0x14, 0xc6, 0xa7, 0xba, 0x27, 0x3d, 0x93, 0x33, 0x99, 0xd0, 0x5b, 0x8c, 0x6b, 0x31, 0x68, 0x8c, + 0xd9, 0x75, 0x19, 0x71, 0x48, 0x58, 0xbd, 0x91, 0x51, 0x16, 0x67, 0x54, 0x58, 0x91, 0xbd, 0x89, + 0xb2, 0xa0, 0x37, 0xa1, 0xba, 0xab, 0x9c, 0x94, 0xe9, 0xee, 0x8a, 0x55, 0xd5, 0x61, 0xf2, 0x12, + 0xe2, 0x13, 0xf8, 0x3c, 0x5e, 0x2e, 0xe8, 0x85, 0x97, 0x32, 0xf3, 0x06, 0x5e, 0x09, 0x0a, 0x4a, + 0x55, 0x75, 0x27, 0x1d, 0x37, 0xb0, 0xba, 0x0a, 0x7b, 0x13, 0x72, 0xbe, 0x3e, 0xf5, 0xe7, 0xfc, + 0xce, 0xd7, 0xa7, 0x01, 0x33, 0xc1, 0x46, 0x8b, 0xfb, 0x23, 0x6d, 0xa8, 0xe1, 0xc3, 0xb9, 0x92, + 0x46, 0xe2, 0x88, 0x09, 0x36, 0x5c, 0xdc, 0x3f, 0x7e, 0x39, 0x95, 0x3a, 0x97, 0x7a, 0x24, 0x55, + 0x6e, 0x53, 0xa4, 0xca, 0x7d, 0xc2, 0xf1, 0x51, 0xb5, 0xe8, 0x92, 0x17, 0x5c, 0x0b, 0xed, 0xd5, + 0xc1, 0x1f, 0x01, 0xb4, 0xcf, 0xb5, 0xe6, 0xca, 0x08, 0x59, 0xe0, 0x18, 0x42, 0x26, 0x18, 0x41, + 0x7d, 0x74, 0xd2, 0x1e, 0xdb, 0xbf, 0xb8, 0x07, 0x90, 0xca, 0xc2, 0x28, 0x99, 0x65, 0x5c, 0x91, + 0xc0, 0x3d, 0x68, 0x28, 0x98, 0xc0, 0x9e, 0x2e, 0x93, 0xaf, 0x79, 0x6a, 0x48, 0xe8, 0x1e, 0xd6, + 0x21, 0xbe, 0x0b, 0xdd, 0x79, 0x99, 0x64, 0x22, 0x9d, 0xcc, 0xf8, 0x72, 0x32, 0xe5, 0x57, 0x64, + 0xd7, 0x25, 0x74, 0xbc, 0xfa, 0x29, 0x5f, 0x3e, 0xe4, 0x57, 0xf8, 0x0d, 0xe8, 0xd2, 0xfa, 0xf8, + 0x89, 0x59, 0xce, 0x39, 0x69, 0xb9, 0xac, 0xc3, 0x95, 0xfa, 0xf9, 0x72, 0xce, 0xf1, 0x47, 0x70, + 0x40, 0xd3, 0xb4, 0xcc, 0xcb, 0x8c, 0x1a, 0xa9, 0x48, 0xd4, 0x0f, 0x4f, 0x0e, 0xde, 0x1e, 0x0c, + 0x7d, 0xcd, 0xc3, 0x55, 0x01, 0xc3, 0xf3, 0x75, 0xd2, 0xc7, 0x85, 0x51, 0xcb, 0x71, 0x73, 0x99, + 0x3d, 0x2c, 0x55, 0x9c, 0xba, 0xb3, 0x92, 0x4c, 0xa6, 0x33, 0xb2, 0xd7, 0x47, 0x27, 0xe1, 0xf8, + 0xb0, 0x56, 0x2f, 0xac, 0x78, 0xfc, 0x00, 0xe2, 0xbf, 0xef, 0x63, 0xc9, 0xcc, 0xf8, 0xb2, 0x26, + 0x33, 0xe3, 0x4b, 0x7c, 0x04, 0xad, 0x05, 0xcd, 0x4a, 0xee, 0xa0, 0x74, 0xc6, 0x3e, 0x38, 0x0b, + 0xde, 0x45, 0x67, 0x6f, 0xfe, 0xfa, 0xfd, 0x8f, 0xdf, 0x86, 0x77, 0xa0, 0xe5, 0x68, 0x62, 0x02, + 0x78, 0x0d, 0xec, 0xb4, 0xc2, 0x13, 0x23, 0x82, 0x08, 0x1a, 0xfc, 0x16, 0x40, 0xf7, 0xbc, 0x34, + 0x53, 0x5e, 0x18, 0x91, 0xd2, 0x17, 0xd4, 0x83, 0x3b, 0x60, 0x01, 0x30, 0x7b, 0x07, 0x9a, 0x4d, + 0x04, 0x73, 0x2d, 0xe8, 0x8c, 0x3b, 0x6b, 0xf1, 0x13, 0x86, 0x3f, 0x80, 0xfd, 0x9c, 0x1b, 0xca, + 0xa8, 0xa1, 0x15, 0xfe, 0xbb, 0x2b, 0xfc, 0x1b, 0x05, 0x0c, 0x1f, 0x55, 0x69, 0xbe, 0x01, 0xab, + 0x55, 0xff, 0x94, 0xfe, 0x7b, 0x70, 0xb8, 0xb1, 0xc3, 0xb3, 0xd0, 0xb7, 0x9f, 0x0b, 0x7d, 0x30, + 0xf8, 0x09, 0xc1, 0xde, 0x85, 0xd0, 0x69, 0x29, 0x0c, 0xee, 0x42, 0x50, 0x21, 0xdf, 0x1d, 0x07, + 0xff, 0x89, 0xf8, 0x6d, 0x88, 0xa4, 0x12, 0x97, 0xa2, 0xa8, 0x48, 0x57, 0x91, 0x65, 0xcc, 0xaf, + 0xe6, 0x42, 0xd9, 0x2e, 0x88, 0xcb, 0xa9, 0x71, 0x8c, 0xc3, 0x71, 0xc7, 0x8b, 0x0f, 0x9d, 0x86, + 0x8f, 0x61, 0x3f, 0xa7, 0x29, 0x55, 0x52, 0x16, 0x24, 0x72, 0xcb, 0x57, 0xf1, 0xd9, 0x3d, 0x57, + 0x59, 0x1f, 0x22, 0x7b, 0xd5, 0x18, 0xe1, 0x23, 0xe8, 0x56, 0x67, 0x9e, 0xfa, 0x23, 0x5c, 0x59, + 0xad, 0xc1, 0x9f, 0x01, 0xc0, 0x87, 0xeb, 0x9b, 0xde, 0x86, 0xa8, 0x28, 0xf3, 0x84, 0xab, 0xaa, + 0xba, 0x2a, 0xaa, 0x5d, 0x16, 0xac, 0x5d, 0xf6, 0x3a, 0x74, 0xb4, 0x2c, 0xd4, 0x84, 0x32, 0xa6, + 0xb8, 0xd6, 0x55, 0x61, 0x07, 0x56, 0x3b, 0xf7, 0x12, 0x7e, 0x0d, 0x0e, 0xb8, 0x99, 0xae, 0x32, + 0x7c, 0x85, 0xc0, 0xcd, 0xb4, 0x91, 0x90, 0x98, 0x74, 0x95, 0xe0, 0x5f, 0x65, 0x48, 0x4c, 0x5a, + 0x27, 0x3c, 0x6d, 0xc8, 0x68, 0x8b, 0x21, 0x5f, 0x82, 0x68, 0xa6, 0x27, 0x0b, 0x9a, 0x39, 0x87, + 0xb4, 0xc7, 0xad, 0x99, 0x7e, 0x4c, 0x33, 0xe7, 0xd3, 0x8c, 0x8a, 0x9c, 0xb3, 0xca, 0x3f, 0xfb, + 0x9e, 0x61, 0x25, 0x3a, 0xfb, 0x6c, 0x71, 0x59, 0x7b, 0x8b, 0xcb, 0xce, 0xbe, 0x70, 0x38, 0x3f, + 0x03, 0xa8, 0xf9, 0xc4, 0x08, 0xe3, 0x4d, 0x02, 0x16, 0x28, 0xbe, 0xb5, 0x51, 0x72, 0x1c, 0x78, + 0xa9, 0x51, 0x64, 0x1c, 0x12, 0x84, 0xdb, 0x8e, 0x66, 0xbc, 0x4b, 0x10, 0x09, 0x07, 0xbf, 0x87, + 0xd0, 0x79, 0xcc, 0x95, 0xf8, 0xea, 0xf9, 0xdf, 0xe8, 0x57, 0x01, 0x98, 0x60, 0x93, 0x9c, 0x9b, + 0xa9, 0x64, 0x55, 0x27, 0xda, 0x4c, 0xb0, 0x47, 0x4e, 0xb0, 0x4d, 0x15, 0x5a, 0x97, 0x5c, 0xd5, + 0x26, 0xf3, 0x51, 0xd3, 0x96, 0xad, 0x67, 0x0d, 0x82, 0x6d, 0xdc, 0xdf, 0x82, 0x5b, 0x8b, 0xc6, + 0xc5, 0xfd, 0x3c, 0xf6, 0x2d, 0x88, 0x9b, 0x0f, 0xdc, 0x48, 0x7e, 0xd0, 0x18, 0x08, 0xfb, 0x9b, + 0xf3, 0xb8, 0x59, 0xfd, 0xbf, 0x18, 0x07, 0xed, 0xff, 0x7d, 0x1c, 0x7c, 0xe3, 0xba, 0x3c, 0xab, + 0xc7, 0xc1, 0x11, 0x74, 0x3d, 0xa9, 0xe6, 0x28, 0xc0, 0x03, 0x78, 0xa5, 0x31, 0x24, 0xd6, 0xdc, + 0x4f, 0x7d, 0xae, 0xeb, 0xf9, 0x3d, 0xe8, 0x3f, 0x45, 0xa6, 0xde, 0xa4, 0xce, 0x0b, 0x09, 0x22, + 0xd1, 0xc5, 0xfb, 0x3f, 0x5c, 0xf7, 0xd0, 0x93, 0xeb, 0x1e, 0xfa, 0xe5, 0xba, 0x87, 0xbe, 0xbb, + 0xe9, 0xed, 0x3c, 0xb9, 0xe9, 0xed, 0xfc, 0x7c, 0xd3, 0xdb, 0xf9, 0x72, 0x70, 0x29, 0xcc, 0xb4, + 0x4c, 0x86, 0xa9, 0xcc, 0x47, 0xb2, 0xb0, 0x4e, 0x1b, 0xb9, 0x9f, 0xab, 0x91, 0xfd, 0x32, 0xdb, + 0x1d, 0x75, 0x12, 0xb9, 0xaf, 0xf2, 0x3b, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xce, 0xd1, 0x02, + 0x2a, 0xe2, 0x07, 0x00, 0x00, } func (m *Assertion) Marshal() (dAtA []byte, err error) { @@ -744,15 +664,10 @@ func (m *Assertion) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a } - if m.PublicKey != nil { - { - size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } + if len(m.PublicKeyHex) > 0 { + i -= len(m.PublicKeyHex) + copy(dAtA[i:], m.PublicKeyHex) + i = encodeVarintState(dAtA, i, uint64(len(m.PublicKeyHex))) i-- dAtA[i] = 0x22 } @@ -831,15 +746,10 @@ func (m *Authentication) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a } - if m.PublicKey != nil { - { - size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } + if len(m.PublicKeyHex) > 0 { + i -= len(m.PublicKeyHex) + copy(dAtA[i:], m.PublicKeyHex) + i = encodeVarintState(dAtA, i, uint64(len(m.PublicKeyHex))) i-- dAtA[i] = 0x22 } @@ -867,6 +777,67 @@ func (m *Authentication) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Biscuit) 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 *Biscuit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Biscuit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Macaroon) > 0 { + i -= len(m.Macaroon) + copy(dAtA[i:], m.Macaroon) + i = encodeVarintState(dAtA, i, uint64(len(m.Macaroon))) + i-- + dAtA[i] = 0x32 + } + if m.ExpiryHeight != 0 { + i = encodeVarintState(dAtA, i, uint64(m.ExpiryHeight)) + i-- + dAtA[i] = 0x28 + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintState(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x22 + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintState(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x1a + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintState(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *Controller) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -904,15 +875,10 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a } - if m.PublicKey != nil { - { - size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } + if len(m.PublicKeyHex) > 0 { + i -= len(m.PublicKeyHex) + copy(dAtA[i:], m.PublicKeyHex) + i = encodeVarintState(dAtA, i, uint64(len(m.PublicKeyHex))) i-- dAtA[i] = 0x32 } @@ -952,122 +918,7 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Grant) 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 *Grant) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ExpiryHeight != 0 { - i = encodeVarintState(dAtA, i, uint64(m.ExpiryHeight)) - i-- - dAtA[i] = 0x28 - } - if len(m.Origin) > 0 { - i -= len(m.Origin) - copy(dAtA[i:], m.Origin) - i = encodeVarintState(dAtA, i, uint64(len(m.Origin))) - i-- - dAtA[i] = 0x22 - } - if len(m.Subject) > 0 { - i -= len(m.Subject) - copy(dAtA[i:], m.Subject) - i = encodeVarintState(dAtA, i, uint64(len(m.Subject))) - i-- - dAtA[i] = 0x1a - } - if len(m.Controller) > 0 { - i -= len(m.Controller) - copy(dAtA[i:], m.Controller) - i = encodeVarintState(dAtA, i, uint64(len(m.Controller))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintState(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Macaroon) 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 *Macaroon) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Macaroon) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Macaroon) > 0 { - i -= len(m.Macaroon) - copy(dAtA[i:], m.Macaroon) - i = encodeVarintState(dAtA, i, uint64(len(m.Macaroon))) - i-- - dAtA[i] = 0x32 - } - if m.ExpiryHeight != 0 { - i = encodeVarintState(dAtA, i, uint64(m.ExpiryHeight)) - i-- - dAtA[i] = 0x28 - } - if len(m.Origin) > 0 { - i -= len(m.Origin) - copy(dAtA[i:], m.Origin) - i = encodeVarintState(dAtA, i, uint64(len(m.Origin))) - i-- - dAtA[i] = 0x22 - } - if len(m.Subject) > 0 { - i -= len(m.Subject) - copy(dAtA[i:], m.Subject) - i = encodeVarintState(dAtA, i, uint64(len(m.Subject))) - i-- - dAtA[i] = 0x1a - } - if len(m.Controller) > 0 { - i -= len(m.Controller) - copy(dAtA[i:], m.Controller) - i = encodeVarintState(dAtA, i, uint64(len(m.Controller))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintState(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Verification) Marshal() (dAtA []byte, err error) { +func (m *Verification) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1118,15 +969,10 @@ func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a } - if m.PublicKey != nil { - { - size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } + if len(m.PublicKeyHex) > 0 { + i -= len(m.PublicKeyHex) + copy(dAtA[i:], m.PublicKeyHex) + i = encodeVarintState(dAtA, i, uint64(len(m.PublicKeyHex))) i-- dAtA[i] = 0x32 } @@ -1197,8 +1043,8 @@ func (m *Assertion) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.PublicKey != nil { - l = m.PublicKey.Size() + l = len(m.PublicKeyHex) + if l > 0 { n += 1 + l + sovState(uint64(l)) } l = len(m.AssertionType) @@ -1241,8 +1087,8 @@ func (m *Authentication) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.PublicKey != nil { - l = m.PublicKey.Size() + l = len(m.PublicKeyHex) + if l > 0 { n += 1 + l + sovState(uint64(l)) } l = len(m.CredentialId) @@ -1263,102 +1109,75 @@ func (m *Authentication) Size() (n int) { return n } -func (m *Controller) Size() (n int) { +func (m *Biscuit) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Number != 0 { - n += 1 + sovState(uint64(m.Number)) - } - l = len(m.Did) - if l > 0 { - n += 1 + l + sovState(uint64(l)) + if m.Id != 0 { + n += 1 + sovState(uint64(m.Id)) } - l = len(m.SonrAddress) + l = len(m.Controller) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.EthAddress) + l = len(m.Subject) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.BtcAddress) + l = len(m.Origin) if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.PublicKey != nil { - l = m.PublicKey.Size() - n += 1 + l + sovState(uint64(l)) + if m.ExpiryHeight != 0 { + n += 1 + sovState(uint64(m.ExpiryHeight)) } - l = len(m.KsVal) + l = len(m.Macaroon) if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.ClaimedBlock != 0 { - n += 1 + sovState(uint64(m.ClaimedBlock)) - } - if m.CreationBlock != 0 { - n += 1 + sovState(uint64(m.CreationBlock)) - } return n } -func (m *Grant) Size() (n int) { +func (m *Controller) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Id != 0 { - n += 1 + sovState(uint64(m.Id)) + if m.Number != 0 { + n += 1 + sovState(uint64(m.Number)) } - l = len(m.Controller) + l = len(m.Did) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Subject) + l = len(m.SonrAddress) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Origin) + l = len(m.EthAddress) if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.ExpiryHeight != 0 { - n += 1 + sovState(uint64(m.ExpiryHeight)) - } - return n -} - -func (m *Macaroon) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovState(uint64(m.Id)) - } - l = len(m.Controller) + l = len(m.BtcAddress) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Subject) + l = len(m.PublicKeyHex) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Origin) + l = len(m.KsVal) if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.ExpiryHeight != 0 { - n += 1 + sovState(uint64(m.ExpiryHeight)) + if m.ClaimedBlock != 0 { + n += 1 + sovState(uint64(m.ClaimedBlock)) } - l = len(m.Macaroon) - if l > 0 { - n += 1 + l + sovState(uint64(l)) + if m.CreationBlock != 0 { + n += 1 + sovState(uint64(m.CreationBlock)) } return n } @@ -1389,8 +1208,8 @@ func (m *Verification) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.PublicKey != nil { - l = m.PublicKey.Size() + l = len(m.PublicKeyHex) + if l > 0 { n += 1 + l + sovState(uint64(l)) } l = len(m.VerificationType) @@ -1544,9 +1363,9 @@ func (m *Assertion) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyHex", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1556,27 +1375,23 @@ func (m *Assertion) 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 ErrInvalidLengthState } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - if m.PublicKey == nil { - m.PublicKey = &PubKey{} - } - if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.PublicKeyHex = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { @@ -1905,9 +1720,9 @@ func (m *Authentication) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyHex", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -1917,27 +1732,23 @@ func (m *Authentication) 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 ErrInvalidLengthState } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - if m.PublicKey == nil { - m.PublicKey = &PubKey{} - } - if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.PublicKeyHex = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { @@ -2063,347 +1874,44 @@ func (m *Authentication) Unmarshal(dAtA []byte) error { if iNdEx >= l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthState - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthState - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipState(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Metadata[mapkey] = mapvalue - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) - } - m.CreationBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreationBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipState(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Controller) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Controller: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Controller: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) - } - m.Number = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Number |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Did = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SonrAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SonrAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EthAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EthAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BtcAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BtcAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthState + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthState + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PublicKey == nil { - m.PublicKey = &PubKey{} - } - if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Metadata[mapkey] = mapvalue iNdEx = postIndex case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field KsVal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.KsVal = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedBlock", wireType) - } - m.ClaimedBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ClaimedBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) } @@ -2443,7 +1951,7 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } return nil } -func (m *Grant) Unmarshal(dAtA []byte) error { +func (m *Biscuit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2466,10 +1974,10 @@ func (m *Grant) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Grant: wiretype end group for non-group") + return fmt.Errorf("proto: Biscuit: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Biscuit: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2606,6 +2114,38 @@ func (m *Grant) Unmarshal(dAtA []byte) error { break } } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Macaroon", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Macaroon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) @@ -2627,7 +2167,7 @@ func (m *Grant) Unmarshal(dAtA []byte) error { } return nil } -func (m *Macaroon) Unmarshal(dAtA []byte) error { +func (m *Controller) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2650,17 +2190,17 @@ func (m *Macaroon) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Macaroon: wiretype end group for non-group") + return fmt.Errorf("proto: Controller: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Macaroon: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Controller: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) } - m.Id = 0 + m.Number = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -2670,14 +2210,14 @@ func (m *Macaroon) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Id |= uint64(b&0x7F) << shift + m.Number |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2705,11 +2245,11 @@ func (m *Macaroon) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Controller = string(dAtA[iNdEx:postIndex]) + m.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SonrAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2737,11 +2277,11 @@ func (m *Macaroon) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Subject = string(dAtA[iNdEx:postIndex]) + m.SonrAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EthAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2769,13 +2309,13 @@ func (m *Macaroon) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Origin = string(dAtA[iNdEx:postIndex]) + m.EthAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiryHeight", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BtcAddress", wireType) } - m.ExpiryHeight = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -2785,14 +2325,27 @@ func (m *Macaroon) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ExpiryHeight |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BtcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Macaroon", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyHex", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2820,8 +2373,78 @@ func (m *Macaroon) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Macaroon = string(dAtA[iNdEx:postIndex]) + m.PublicKeyHex = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KsVal", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KsVal = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedBlock", wireType) + } + m.ClaimedBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClaimedBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType) + } + m.CreationBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) @@ -3034,9 +2657,9 @@ func (m *Verification) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyHex", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -3046,27 +2669,23 @@ func (m *Verification) 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 ErrInvalidLengthState } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - if m.PublicKey == nil { - m.PublicKey = &PubKey{} - } - if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.PublicKeyHex = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { diff --git a/x/did/types/tx.pb.go b/x/did/types/tx.pb.go index 3e25a3a4f..c1d6c5817 100644 --- a/x/did/types/tx.pb.go +++ b/x/did/types/tx.pb.go @@ -783,55 +783,56 @@ func init() { func init() { proto.RegisterFile("did/v1/tx.proto", fileDescriptor_d73284df019ff211) } var fileDescriptor_d73284df019ff211 = []byte{ - // 767 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcd, 0x4e, 0xdb, 0x4c, - 0x14, 0xcd, 0x10, 0x08, 0xe4, 0x92, 0x10, 0xbe, 0x51, 0x3e, 0xc5, 0x58, 0x90, 0x44, 0x46, 0xa8, - 0x08, 0x95, 0x44, 0x50, 0xa9, 0x42, 0xb4, 0x6a, 0x05, 0x2a, 0x15, 0x88, 0x46, 0x6a, 0x5d, 0xba, - 0x61, 0x93, 0x1a, 0x7b, 0xe4, 0xb8, 0x24, 0x9e, 0xc8, 0x33, 0x41, 0xc9, 0xae, 0xea, 0x13, 0xf4, - 0x05, 0xfa, 0x04, 0xdd, 0xb0, 0xe8, 0xaa, 0xea, 0x03, 0xb0, 0x44, 0x5d, 0x75, 0x55, 0x55, 0x20, - 0x95, 0x27, 0xe8, 0xb2, 0x52, 0x35, 0x76, 0xe2, 0xd8, 0xf9, 0x29, 0x08, 0x50, 0x37, 0x91, 0xef, - 0x3d, 0xf7, 0x9e, 0x39, 0xf7, 0x78, 0x66, 0x62, 0x48, 0x19, 0x96, 0x51, 0x3c, 0x5a, 0x29, 0xf2, - 0x66, 0xa1, 0xee, 0x50, 0x4e, 0x71, 0xcc, 0xb0, 0x8c, 0xc2, 0xd1, 0x8a, 0x9c, 0xd1, 0x29, 0xab, - 0x51, 0x56, 0xac, 0x31, 0x53, 0xe0, 0x35, 0x66, 0x7a, 0x05, 0xf2, 0x8c, 0x07, 0x94, 0xdd, 0xa8, - 0xe8, 0x05, 0x6d, 0x28, 0xdd, 0x26, 0x33, 0x89, 0x4d, 0x98, 0xe5, 0x67, 0x4d, 0x6a, 0x52, 0xaf, - 0x5a, 0x3c, 0x79, 0x59, 0xe5, 0x27, 0x82, 0xff, 0x4b, 0xcc, 0x7c, 0x66, 0xd9, 0x87, 0x1b, 0x0d, - 0x5e, 0x21, 0x36, 0xb7, 0x74, 0x8d, 0x5b, 0xd4, 0xc6, 0x6b, 0x00, 0x3a, 0xb5, 0xb9, 0x43, 0xab, - 0x55, 0xe2, 0x48, 0x28, 0x8f, 0x16, 0xe3, 0x9b, 0xd2, 0xd7, 0x4f, 0xcb, 0xe9, 0xf6, 0x5a, 0x1b, - 0x86, 0xe1, 0x10, 0xc6, 0x5e, 0x72, 0xc7, 0xb2, 0x4d, 0x35, 0x50, 0x8b, 0x25, 0x18, 0x67, 0x8d, - 0x83, 0x37, 0x44, 0xe7, 0xd2, 0x88, 0x68, 0x53, 0x3b, 0x21, 0x9e, 0x85, 0xb8, 0xc6, 0x18, 0x71, - 0xc4, 0x02, 0x52, 0xd4, 0xc5, 0xba, 0x09, 0x3c, 0x0f, 0x49, 0xdd, 0x21, 0x86, 0xd0, 0xa0, 0x55, - 0xcb, 0x96, 0x21, 0x8d, 0xe6, 0xd1, 0x62, 0x42, 0x4d, 0x74, 0x93, 0x3b, 0x06, 0x5e, 0x80, 0xa9, - 0x9a, 0xa6, 0x6b, 0x0e, 0xa5, 0x76, 0x99, 0xd3, 0x43, 0x62, 0x4b, 0x63, 0x2e, 0x4f, 0xb2, 0x93, - 0xdd, 0x13, 0xc9, 0xf5, 0xd4, 0xbb, 0x8b, 0xe3, 0xa5, 0x80, 0x28, 0x65, 0x17, 0xe6, 0x06, 0xce, - 0xa9, 0x12, 0x56, 0xa7, 0x36, 0x23, 0x9e, 0x6a, 0x5d, 0x27, 0x8c, 0xb9, 0xc3, 0x4e, 0xa8, 0x9d, - 0x10, 0x4f, 0x43, 0xd4, 0xb0, 0x8c, 0xf6, 0x2c, 0xe2, 0x51, 0xf9, 0x82, 0x60, 0xba, 0xc3, 0xe6, - 0xcb, 0xff, 0xf7, 0x86, 0xf5, 0x7b, 0x31, 0x7a, 0x25, 0x2f, 0x9e, 0x82, 0xd4, 0xab, 0xfe, 0x5a, - 0x36, 0xfc, 0x46, 0x90, 0x28, 0x31, 0x73, 0xab, 0x49, 0xf4, 0x06, 0x27, 0x7b, 0xcd, 0x1b, 0x58, - 0xf0, 0x08, 0x26, 0x6a, 0x84, 0x31, 0xcd, 0x24, 0x4c, 0x1a, 0xc9, 0x47, 0x17, 0x27, 0x57, 0x95, - 0x82, 0x77, 0x04, 0x0a, 0xc1, 0x15, 0x0a, 0xa5, 0x76, 0xd1, 0x96, 0xcd, 0x9d, 0x96, 0xea, 0xf7, - 0x0c, 0xb0, 0x22, 0x3a, 0xc0, 0x0a, 0xf9, 0x01, 0x24, 0x43, 0x0c, 0x62, 0xa8, 0x43, 0xd2, 0xf2, - 0xa4, 0xaa, 0xe2, 0x11, 0xa7, 0x61, 0xec, 0x48, 0xab, 0x36, 0x88, 0x3b, 0x68, 0x42, 0xf5, 0x82, - 0xf5, 0x91, 0x35, 0xd4, 0xef, 0xe3, 0x0e, 0xa4, 0x83, 0xe2, 0xae, 0xe0, 0x61, 0x06, 0xc6, 0x79, - 0xb3, 0x5c, 0xd1, 0x58, 0xa5, 0xed, 0x63, 0x8c, 0x37, 0xb7, 0x35, 0x56, 0x51, 0x3e, 0x22, 0xc0, - 0x25, 0x66, 0xbe, 0xb2, 0xab, 0xb7, 0xb4, 0xa7, 0xe6, 0x21, 0xe9, 0x6f, 0x94, 0x72, 0xf7, 0xbd, - 0x25, 0xfc, 0xe4, 0x13, 0xcb, 0xb8, 0xa2, 0x6b, 0xfd, 0x83, 0x6f, 0x83, 0xdc, 0x2f, 0xf6, 0x5a, - 0x5b, 0xe8, 0x33, 0x82, 0x4c, 0x97, 0xea, 0xb6, 0x6e, 0xa0, 0x65, 0xc0, 0x5a, 0x88, 0x2b, 0xe0, - 0xc0, 0x7f, 0x61, 0xe4, 0x26, 0x36, 0x94, 0x20, 0x37, 0x44, 0xfb, 0xb5, 0xbc, 0xf8, 0x80, 0x20, - 0x25, 0xf8, 0xea, 0x86, 0xc6, 0xc9, 0x73, 0xcd, 0xd1, 0x6a, 0x0c, 0xdf, 0x87, 0xb8, 0xd0, 0x4b, - 0x1d, 0x8b, 0xb7, 0x2e, 0xb5, 0xa0, 0x5b, 0x8a, 0xef, 0x42, 0xac, 0xee, 0x32, 0xb8, 0x0b, 0x4c, - 0xae, 0x4e, 0x75, 0x4e, 0x93, 0xc7, 0xbb, 0x39, 0x7a, 0xf2, 0x3d, 0x17, 0x51, 0xdb, 0x35, 0x62, - 0xcf, 0x07, 0xe7, 0xf6, 0x82, 0xf5, 0x29, 0x31, 0x6f, 0x97, 0x53, 0x99, 0xf1, 0x5e, 0x55, 0x40, - 0x5e, 0x67, 0xcc, 0xd5, 0x5f, 0x51, 0x88, 0x96, 0x98, 0x89, 0x1f, 0x43, 0xbc, 0x7b, 0x1b, 0xa4, - 0x07, 0x9d, 0x60, 0x79, 0x76, 0x50, 0xd6, 0xf7, 0x6b, 0x17, 0x92, 0xe1, 0x5b, 0x55, 0x0a, 0x94, - 0x87, 0x10, 0x39, 0x3f, 0x0c, 0xf1, 0xc9, 0xf6, 0x01, 0x0f, 0xf8, 0x63, 0x9b, 0xeb, 0xed, 0x0b, - 0xc1, 0xf2, 0xc2, 0x5f, 0x61, 0x9f, 0xfb, 0x05, 0xa4, 0x7a, 0x0f, 0xab, 0x1c, 0xe8, 0xec, 0xc1, - 0x64, 0x65, 0x38, 0xe6, 0x53, 0xbe, 0x86, 0xf4, 0xc0, 0x73, 0x90, 0xeb, 0xef, 0x0d, 0x4b, 0xbe, - 0x73, 0x49, 0x81, 0xbf, 0xc2, 0x36, 0x24, 0x42, 0xbb, 0x2b, 0x13, 0x6c, 0x0c, 0x00, 0x72, 0x6e, - 0x08, 0xd0, 0x61, 0x92, 0xc7, 0xde, 0x5e, 0x1c, 0x2f, 0xa1, 0xcd, 0x87, 0x27, 0x67, 0x59, 0x74, - 0x7a, 0x96, 0x45, 0x3f, 0xce, 0xb2, 0xe8, 0xfd, 0x79, 0x36, 0x72, 0x7a, 0x9e, 0x8d, 0x7c, 0x3b, - 0xcf, 0x46, 0xf6, 0x15, 0xd3, 0xe2, 0x95, 0xc6, 0x41, 0x41, 0xa7, 0xb5, 0x22, 0xb5, 0x19, 0xb5, - 0x9d, 0xa2, 0xfb, 0xd3, 0x2c, 0x8a, 0xaf, 0x13, 0xde, 0xaa, 0x13, 0x76, 0x10, 0x73, 0xbf, 0x41, - 0xee, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0x93, 0x06, 0x64, 0x08, 0xfe, 0x08, 0x00, 0x00, + // 775 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcd, 0x4e, 0xdb, 0x4a, + 0x14, 0x8e, 0x09, 0x04, 0x72, 0x48, 0x08, 0x77, 0x6e, 0xae, 0x62, 0x2c, 0x48, 0x22, 0x23, 0x74, + 0x11, 0x2a, 0x89, 0xa0, 0x52, 0x85, 0x68, 0xd5, 0x0a, 0x54, 0x2a, 0x10, 0x8d, 0xd4, 0xba, 0x74, + 0xc3, 0x26, 0x35, 0xf6, 0xc8, 0x71, 0x49, 0x3c, 0x91, 0x67, 0x82, 0x92, 0x5d, 0xd5, 0x27, 0xe8, + 0x0b, 0xf4, 0x09, 0xba, 0x61, 0xd1, 0x55, 0xd5, 0x07, 0x60, 0x89, 0xba, 0xea, 0xaa, 0xaa, 0x40, + 0x2a, 0x4f, 0xd0, 0x65, 0xa5, 0x6a, 0xfc, 0x17, 0x3b, 0x3f, 0x05, 0x01, 0xea, 0x26, 0xf2, 0x39, + 0xdf, 0x39, 0xdf, 0x7c, 0xe7, 0xf3, 0xcc, 0xc4, 0x90, 0xd1, 0x4d, 0xbd, 0x7c, 0xb4, 0x52, 0x66, + 0xed, 0x52, 0xd3, 0x26, 0x8c, 0xa0, 0x84, 0x6e, 0xea, 0xa5, 0xa3, 0x15, 0x29, 0xa7, 0x11, 0xda, + 0x20, 0xb4, 0xdc, 0xa0, 0x06, 0xc7, 0x1b, 0xd4, 0x70, 0x0b, 0xa4, 0x19, 0x17, 0xa8, 0x3a, 0x51, + 0xd9, 0x0d, 0x3c, 0x28, 0xeb, 0x91, 0x19, 0xd8, 0xc2, 0xd4, 0xf4, 0xb3, 0xff, 0x7a, 0xd9, 0xa6, + 0x6a, 0xab, 0x8d, 0xa0, 0xd4, 0x20, 0x06, 0x71, 0x29, 0xf8, 0x93, 0x9b, 0x95, 0x7f, 0x08, 0xf0, + 0x5f, 0x85, 0x1a, 0x4f, 0x4d, 0xeb, 0x70, 0xa3, 0xc5, 0x6a, 0xd8, 0x62, 0xa6, 0xa6, 0x32, 0x93, + 0x58, 0x68, 0x0d, 0x40, 0x23, 0x16, 0xb3, 0x49, 0xbd, 0x8e, 0x6d, 0x51, 0x28, 0x0a, 0x8b, 0xc9, + 0x4d, 0xf1, 0xcb, 0xc7, 0xe5, 0xac, 0x27, 0x60, 0x43, 0xd7, 0x6d, 0x4c, 0xe9, 0x0b, 0x66, 0x9b, + 0x96, 0xa1, 0x84, 0x6a, 0x91, 0x08, 0xe3, 0xb4, 0x75, 0xf0, 0x1a, 0x6b, 0x4c, 0x1c, 0xe1, 0x6d, + 0x8a, 0x1f, 0xa2, 0x59, 0x48, 0xaa, 0x94, 0x62, 0x9b, 0x2f, 0x20, 0xc6, 0x1d, 0xac, 0x9b, 0x40, + 0xf3, 0x90, 0xd6, 0x6c, 0xac, 0x73, 0x0d, 0x6a, 0xbd, 0x6a, 0xea, 0xe2, 0x68, 0x51, 0x58, 0x4c, + 0x29, 0xa9, 0x6e, 0x72, 0x47, 0x47, 0x0b, 0x30, 0xd5, 0x50, 0x35, 0xd5, 0x26, 0xc4, 0xaa, 0x32, + 0x72, 0x88, 0x2d, 0x71, 0xcc, 0xe1, 0x49, 0xfb, 0xd9, 0x3d, 0x9e, 0x5c, 0xcf, 0xbc, 0xbd, 0x38, + 0x5e, 0x0a, 0x89, 0x92, 0x77, 0x61, 0x6e, 0xe0, 0x9c, 0x0a, 0xa6, 0x4d, 0x62, 0x51, 0xec, 0xaa, + 0xd6, 0x34, 0x4c, 0xa9, 0x33, 0xec, 0x84, 0xe2, 0x87, 0x68, 0x1a, 0xe2, 0xba, 0xa9, 0x7b, 0xb3, + 0xf0, 0x47, 0xf9, 0xb3, 0x00, 0xd3, 0x3e, 0x5b, 0x20, 0xff, 0xef, 0x1b, 0xd6, 0xef, 0xc5, 0xe8, + 0x95, 0xbc, 0x78, 0x02, 0x62, 0xaf, 0xfa, 0x6b, 0xd9, 0xf0, 0x4b, 0x80, 0x54, 0x85, 0x1a, 0x5b, + 0x6d, 0xac, 0xb5, 0x18, 0xde, 0x6b, 0xdf, 0xc0, 0x82, 0x87, 0x30, 0xd1, 0xc0, 0x94, 0xaa, 0x06, + 0xa6, 0xe2, 0x48, 0x31, 0xbe, 0x38, 0xb9, 0x2a, 0x97, 0xdc, 0x73, 0x51, 0x0a, 0xaf, 0x50, 0xaa, + 0x78, 0x45, 0x5b, 0x16, 0xb3, 0x3b, 0x4a, 0xd0, 0x33, 0xc0, 0x8a, 0xf8, 0x00, 0x2b, 0xa4, 0xfb, + 0x90, 0x8e, 0x30, 0xf0, 0xa1, 0x0e, 0x71, 0xc7, 0x95, 0xaa, 0xf0, 0x47, 0x94, 0x85, 0xb1, 0x23, + 0xb5, 0xde, 0xc2, 0xce, 0xa0, 0x29, 0xc5, 0x0d, 0xd6, 0x47, 0xd6, 0x84, 0x7e, 0x1f, 0x77, 0x20, + 0x1b, 0x16, 0x77, 0x05, 0x0f, 0x73, 0x30, 0xce, 0xda, 0xd5, 0x9a, 0x4a, 0x6b, 0x9e, 0x8f, 0x09, + 0xd6, 0xde, 0x56, 0x69, 0x4d, 0xfe, 0x20, 0x00, 0xaa, 0x50, 0xe3, 0xa5, 0x55, 0xbf, 0xa5, 0x3d, + 0x35, 0x0f, 0xe9, 0x60, 0xa3, 0x54, 0xbb, 0xef, 0x2d, 0x15, 0x24, 0x1f, 0x9b, 0xfa, 0x15, 0x5d, + 0xeb, 0x1f, 0x7c, 0x1b, 0xa4, 0x7e, 0xb1, 0xd7, 0xda, 0x42, 0x9f, 0x04, 0xc8, 0x75, 0xa9, 0x6e, + 0xeb, 0x06, 0x5a, 0x06, 0xa4, 0x46, 0xb8, 0x42, 0x0e, 0xfc, 0x13, 0x45, 0x6e, 0x62, 0x43, 0x05, + 0x0a, 0x43, 0xb4, 0x5f, 0xcb, 0x8b, 0xf7, 0x02, 0x64, 0x38, 0x5f, 0x53, 0x57, 0x19, 0x7e, 0xe6, + 0xdc, 0xdd, 0xe8, 0x1e, 0x24, 0xb9, 0x5e, 0x62, 0x9b, 0xac, 0x73, 0xa9, 0x05, 0xdd, 0x52, 0x74, + 0x07, 0x12, 0xee, 0xed, 0xef, 0x2c, 0x30, 0xb9, 0x3a, 0xe5, 0x9f, 0x26, 0x97, 0x77, 0x73, 0xf4, + 0xe4, 0x5b, 0x21, 0xa6, 0x78, 0x35, 0x7c, 0xcf, 0x87, 0xe7, 0x76, 0x83, 0xf5, 0x29, 0x3e, 0x6f, + 0x97, 0x53, 0x9e, 0x71, 0x5f, 0x55, 0x48, 0x9e, 0x3f, 0xe6, 0xea, 0xcf, 0x38, 0xc4, 0x2b, 0xd4, + 0x40, 0x8f, 0x20, 0xd9, 0xbd, 0x0d, 0xb2, 0x83, 0x4e, 0xb0, 0x34, 0x3b, 0x28, 0x1b, 0xf8, 0xb5, + 0x0b, 0xe9, 0xe8, 0xad, 0x2a, 0x86, 0xca, 0x23, 0x88, 0x54, 0x1c, 0x86, 0x04, 0x64, 0xfb, 0x80, + 0x06, 0xfc, 0xb1, 0xcd, 0xf5, 0xf6, 0x45, 0x60, 0x69, 0xe1, 0x8f, 0x70, 0xc0, 0xfd, 0x1c, 0x32, + 0xbd, 0x87, 0x55, 0x0a, 0x75, 0xf6, 0x60, 0x92, 0x3c, 0x1c, 0x0b, 0x28, 0x5f, 0x41, 0x76, 0xe0, + 0x39, 0x28, 0xf4, 0xf7, 0x46, 0x25, 0xff, 0x7f, 0x49, 0x41, 0xb0, 0xc2, 0x36, 0xa4, 0x22, 0xbb, + 0x2b, 0x17, 0x6e, 0x0c, 0x01, 0x52, 0x61, 0x08, 0xe0, 0x33, 0x49, 0x63, 0x6f, 0x2e, 0x8e, 0x97, + 0x84, 0xcd, 0x07, 0x27, 0x67, 0x79, 0xe1, 0xf4, 0x2c, 0x2f, 0x7c, 0x3f, 0xcb, 0x0b, 0xef, 0xce, + 0xf3, 0xb1, 0xd3, 0xf3, 0x7c, 0xec, 0xeb, 0x79, 0x3e, 0xb6, 0x2f, 0x1b, 0x26, 0xab, 0xb5, 0x0e, + 0x4a, 0x1a, 0x69, 0x94, 0x89, 0x45, 0x89, 0x65, 0x97, 0x9d, 0x9f, 0x76, 0x99, 0x7f, 0x9c, 0xb0, + 0x4e, 0x13, 0xd3, 0x83, 0x84, 0xf3, 0x0d, 0x72, 0xf7, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x35, + 0x86, 0x16, 0x4d, 0x13, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/service/types/state.pb.go b/x/service/types/state.pb.go index a1286d820..339055f3a 100644 --- a/x/service/types/state.pb.go +++ b/x/service/types/state.pb.go @@ -23,38 +23,13 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type URI_Protocol int32 - -const ( - URI_HTTPS URI_Protocol = 0 - URI_IPFS URI_Protocol = 1 -) - -var URI_Protocol_name = map[int32]string{ - 0: "HTTPS", - 1: "IPFS", -} - -var URI_Protocol_value = map[string]int32{ - "HTTPS": 0, - "IPFS": 1, -} - -func (x URI_Protocol) String() string { - return proto.EnumName(URI_Protocol_name, int32(x)) -} - -func (URI_Protocol) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ab6e3654a2974847, []int{2, 0} -} - type Metadata struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` Category string `protobuf:"bytes,5,opt,name=category,proto3" json:"category,omitempty"` - Icon *URI `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"` + Icon string `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"` Tags []string `protobuf:"bytes,7,rep,name=tags,proto3" json:"tags,omitempty"` } @@ -126,11 +101,11 @@ func (m *Metadata) GetCategory() string { return "" } -func (m *Metadata) GetIcon() *URI { +func (m *Metadata) GetIcon() string { if m != nil { return m.Icon } - return nil + return "" } func (m *Metadata) GetTags() []string { @@ -213,96 +188,37 @@ func (m *Profile) GetController() string { return "" } -type URI struct { - Protocol URI_Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=service.v1.URI_Protocol" json:"protocol,omitempty"` - Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"` -} - -func (m *URI) Reset() { *m = URI{} } -func (m *URI) String() string { return proto.CompactTextString(m) } -func (*URI) ProtoMessage() {} -func (*URI) Descriptor() ([]byte, []int) { - return fileDescriptor_ab6e3654a2974847, []int{2} -} -func (m *URI) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *URI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_URI.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 *URI) XXX_Merge(src proto.Message) { - xxx_messageInfo_URI.Merge(m, src) -} -func (m *URI) XXX_Size() int { - return m.Size() -} -func (m *URI) XXX_DiscardUnknown() { - xxx_messageInfo_URI.DiscardUnknown(m) -} - -var xxx_messageInfo_URI proto.InternalMessageInfo - -func (m *URI) GetProtocol() URI_Protocol { - if m != nil { - return m.Protocol - } - return URI_HTTPS -} - -func (m *URI) GetUri() string { - if m != nil { - return m.Uri - } - return "" -} - func init() { - proto.RegisterEnum("service.v1.URI_Protocol", URI_Protocol_name, URI_Protocol_value) proto.RegisterType((*Metadata)(nil), "service.v1.Metadata") proto.RegisterType((*Profile)(nil), "service.v1.Profile") - proto.RegisterType((*URI)(nil), "service.v1.URI") } func init() { proto.RegisterFile("service/v1/state.proto", fileDescriptor_ab6e3654a2974847) } var fileDescriptor_ab6e3654a2974847 = []byte{ - // 422 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x52, 0xc1, 0x8e, 0xd3, 0x30, - 0x14, 0xac, 0x9b, 0x6c, 0x9b, 0xbe, 0x45, 0x25, 0xb2, 0xd0, 0x62, 0xed, 0xc1, 0x44, 0x05, 0xa1, - 0x1e, 0x50, 0xa2, 0x5d, 0x38, 0xed, 0x09, 0x71, 0x40, 0xf4, 0x80, 0x54, 0x65, 0x77, 0x2f, 0xdc, - 0x52, 0xd7, 0x14, 0xa3, 0xc4, 0xaf, 0xb2, 0xdd, 0x8a, 0xfd, 0x09, 0x04, 0x3f, 0xc0, 0xf7, 0x70, - 0x5c, 0x89, 0x0b, 0x17, 0x24, 0xd4, 0xfe, 0x01, 0x5f, 0x80, 0x62, 0x92, 0x12, 0xb8, 0x58, 0xef, - 0xcd, 0x8c, 0x3c, 0x33, 0xb2, 0xe1, 0xc4, 0x4a, 0xb3, 0x55, 0x42, 0x66, 0xdb, 0xb3, 0xcc, 0xba, - 0xc2, 0xc9, 0x74, 0x6d, 0xd0, 0x21, 0x85, 0x06, 0x4f, 0xb7, 0x67, 0xa7, 0xf7, 0x05, 0xda, 0x0a, - 0x6d, 0x86, 0xa6, 0xaa, 0x65, 0x68, 0xaa, 0x3f, 0xa2, 0xc9, 0x0f, 0x02, 0xd1, 0x6b, 0xe9, 0x8a, - 0x65, 0xe1, 0x0a, 0x3a, 0x86, 0xbe, 0x5a, 0x32, 0x92, 0x90, 0x69, 0x98, 0xf7, 0xd5, 0x92, 0x9e, - 0xc0, 0x00, 0x8d, 0x5a, 0x29, 0xcd, 0xfa, 0x09, 0x99, 0x8e, 0xf2, 0x66, 0xa3, 0x14, 0x42, 0x5d, - 0x54, 0x92, 0x05, 0x1e, 0xf5, 0x33, 0x4d, 0xe0, 0x78, 0x29, 0xad, 0x30, 0x6a, 0xed, 0x14, 0x6a, - 0x16, 0x7a, 0xaa, 0x0b, 0xd1, 0x53, 0x88, 0x44, 0xe1, 0xe4, 0x0a, 0xcd, 0x0d, 0x3b, 0xf2, 0xf4, - 0x61, 0xa7, 0x0f, 0x21, 0x54, 0x02, 0x35, 0x1b, 0x24, 0x64, 0x7a, 0x7c, 0x7e, 0x37, 0xfd, 0x1b, - 0x3d, 0xbd, 0xce, 0x67, 0xb9, 0x27, 0x6b, 0x5b, 0x57, 0xac, 0x2c, 0x1b, 0x26, 0x41, 0x6d, 0x5b, - 0xcf, 0x17, 0xfc, 0xd7, 0x97, 0x6f, 0x1f, 0x03, 0x06, 0x83, 0x3a, 0x7a, 0x4c, 0xe8, 0x9d, 0x36, - 0x72, 0x4c, 0x18, 0x61, 0x64, 0xf2, 0x99, 0xc0, 0x70, 0x6e, 0xf0, 0xad, 0x2a, 0x65, 0xa7, 0xde, - 0xc8, 0xd7, 0x63, 0x30, 0xb4, 0x9b, 0xc5, 0x7b, 0x29, 0x5c, 0xd3, 0xaf, 0x5d, 0x3b, 0xc5, 0x83, - 0x7f, 0x8a, 0x73, 0x00, 0x81, 0xda, 0x19, 0x2c, 0x4b, 0x69, 0x9a, 0x8e, 0x1d, 0xe4, 0xe2, 0x91, - 0x4f, 0xc3, 0x21, 0xac, 0x9d, 0xe8, 0x3d, 0x18, 0x37, 0x17, 0x3e, 0xe9, 0x64, 0xea, 0x4f, 0x34, - 0x04, 0xd7, 0xf9, 0x8c, 0x3e, 0x83, 0xc8, 0xbf, 0x81, 0xc0, 0xd2, 0x87, 0x1a, 0x9f, 0xb3, 0xff, - 0x7a, 0xa7, 0xf3, 0x86, 0xcf, 0x0f, 0x4a, 0x1a, 0x43, 0xb0, 0x31, 0xaa, 0x09, 0x5c, 0x8f, 0x93, - 0x07, 0x10, 0xb5, 0x3a, 0x3a, 0x82, 0xa3, 0x57, 0x57, 0x57, 0xf3, 0xcb, 0xb8, 0x47, 0x23, 0x08, - 0x67, 0xf3, 0x97, 0x97, 0x31, 0x79, 0xf1, 0xfc, 0xeb, 0x8e, 0x93, 0xdb, 0x1d, 0x27, 0x3f, 0x77, - 0x9c, 0x7c, 0xda, 0xf3, 0xde, 0xed, 0x9e, 0xf7, 0xbe, 0xef, 0x79, 0xef, 0xcd, 0xe3, 0x95, 0x72, - 0xef, 0x36, 0x8b, 0x54, 0x60, 0x95, 0xa1, 0xb6, 0xa8, 0x4d, 0xe6, 0x8f, 0x0f, 0x59, 0xfb, 0xa7, - 0xdc, 0xcd, 0x5a, 0xda, 0xc5, 0xc0, 0xdb, 0x3f, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xf1, 0xad, - 0x51, 0x19, 0x6b, 0x02, 0x00, 0x00, + // 348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x6a, 0xe3, 0x30, + 0x10, 0x86, 0x23, 0xdb, 0xeb, 0x24, 0xb3, 0x4b, 0x08, 0x62, 0xc9, 0x8a, 0x1c, 0x84, 0x09, 0xcb, + 0x92, 0xc3, 0x12, 0x13, 0xf6, 0x96, 0xd3, 0xd2, 0x7b, 0xa1, 0xe4, 0xd8, 0x9b, 0x23, 0xab, 0xae, + 0x4a, 0xec, 0x09, 0x92, 0x12, 0x9a, 0x97, 0x28, 0xed, 0x0b, 0xf4, 0x79, 0x7a, 0xe8, 0x21, 0xd0, + 0x4b, 0x8f, 0x25, 0x79, 0x83, 0x3e, 0x41, 0x91, 0xe2, 0x14, 0xf7, 0x22, 0x66, 0xfe, 0x19, 0x7e, + 0xfd, 0x1f, 0x03, 0x03, 0x23, 0xf5, 0x46, 0x09, 0x99, 0x6e, 0xa6, 0xa9, 0xb1, 0x99, 0x95, 0x93, + 0x95, 0x46, 0x8b, 0x14, 0x6a, 0x7d, 0xb2, 0x99, 0x0e, 0x7f, 0x09, 0x34, 0x25, 0x9a, 0x14, 0x75, + 0xe9, 0xd6, 0x50, 0x97, 0xc7, 0xa5, 0xd1, 0x33, 0x81, 0xce, 0xb9, 0xb4, 0x59, 0x9e, 0xd9, 0x8c, + 0xf6, 0x20, 0x50, 0x39, 0x23, 0x09, 0x19, 0x47, 0xf3, 0x40, 0xe5, 0x74, 0x00, 0x31, 0x6a, 0x55, + 0xa8, 0x8a, 0x05, 0x09, 0x19, 0x77, 0xe7, 0x75, 0x47, 0x29, 0x44, 0x55, 0x56, 0x4a, 0x16, 0x7a, + 0xd5, 0xd7, 0x34, 0x81, 0xef, 0xb9, 0x34, 0x42, 0xab, 0x95, 0x55, 0x58, 0xb1, 0xc8, 0x8f, 0x9a, + 0x12, 0x1d, 0x42, 0x47, 0x64, 0x56, 0x16, 0xa8, 0xb7, 0xec, 0x9b, 0x1f, 0x7f, 0xf6, 0xce, 0x51, + 0x09, 0xac, 0x58, 0x7c, 0x74, 0x74, 0xb5, 0xd3, 0x6c, 0x56, 0x18, 0xd6, 0x4e, 0x42, 0xa7, 0xb9, + 0x7a, 0xc6, 0xdf, 0x1f, 0x5f, 0xee, 0x42, 0x06, 0xb1, 0x4b, 0xda, 0x27, 0xf4, 0xc7, 0x29, 0x61, + 0x9f, 0x30, 0xc2, 0xc8, 0xe8, 0x81, 0x40, 0xfb, 0x42, 0xe3, 0x95, 0x5a, 0xca, 0x06, 0x4d, 0xd7, + 0xd3, 0x30, 0x68, 0x9b, 0xf5, 0xe2, 0x46, 0x0a, 0x5b, 0xe3, 0x9c, 0xda, 0x06, 0x67, 0xf8, 0x85, + 0x93, 0x03, 0x08, 0xac, 0xac, 0xc6, 0xe5, 0x52, 0xea, 0x1a, 0xa9, 0xa1, 0xcc, 0x7e, 0xfb, 0x34, + 0x1c, 0x22, 0xf7, 0x13, 0xfd, 0x09, 0xbd, 0xda, 0xf0, 0x6f, 0x23, 0x53, 0x70, 0xf6, 0xff, 0x69, + 0xcf, 0xc9, 0x6e, 0xcf, 0xc9, 0xdb, 0x9e, 0x93, 0xfb, 0x03, 0x6f, 0xed, 0x0e, 0xbc, 0xf5, 0x7a, + 0xe0, 0xad, 0xcb, 0x3f, 0x85, 0xb2, 0xd7, 0xeb, 0xc5, 0x44, 0x60, 0x99, 0x62, 0x65, 0xb0, 0xd2, + 0xa9, 0x7f, 0x6e, 0xd3, 0xd3, 0x49, 0xed, 0x76, 0x25, 0xcd, 0x22, 0xf6, 0xb7, 0xfa, 0xf7, 0x11, + 0x00, 0x00, 0xff, 0xff, 0x81, 0xa0, 0xdf, 0xce, 0xea, 0x01, 0x00, 0x00, } func (m *Metadata) Marshal() (dAtA []byte, err error) { @@ -334,15 +250,10 @@ func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x3a } } - if m.Icon != nil { - { - size, err := m.Icon.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } + if len(m.Icon) > 0 { + i -= len(m.Icon) + copy(dAtA[i:], m.Icon) + i = encodeVarintState(dAtA, i, uint64(len(m.Icon))) i-- dAtA[i] = 0x32 } @@ -433,41 +344,6 @@ func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *URI) 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 *URI) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *URI) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Uri) > 0 { - i -= len(m.Uri) - copy(dAtA[i:], m.Uri) - i = encodeVarintState(dAtA, i, uint64(len(m.Uri))) - i-- - dAtA[i] = 0x12 - } - if m.Protocol != 0 { - i = encodeVarintState(dAtA, i, uint64(m.Protocol)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintState(dAtA []byte, offset int, v uint64) int { offset -= sovState(v) base := offset @@ -504,8 +380,8 @@ func (m *Metadata) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.Icon != nil { - l = m.Icon.Size() + l = len(m.Icon) + if l > 0 { n += 1 + l + sovState(uint64(l)) } if len(m.Tags) > 0 { @@ -542,22 +418,6 @@ func (m *Profile) Size() (n int) { return n } -func (m *URI) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Protocol != 0 { - n += 1 + sovState(uint64(m.Protocol)) - } - l = len(m.Uri) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - return n -} - func sovState(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -744,7 +604,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -754,27 +614,23 @@ func (m *Metadata) 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 ErrInvalidLengthState } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Icon == nil { - m.Icon = &URI{} - } - if err := m.Icon.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Icon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { @@ -1007,107 +863,6 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } return nil } -func (m *URI) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: URI: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: URI: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - m.Protocol = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Protocol |= URI_Protocol(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uri = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipState(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipState(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/vault/keeper/keeper.go b/x/vault/keeper/keeper.go index 99ed90406..9732c576e 100644 --- a/x/vault/keeper/keeper.go +++ b/x/vault/keeper/keeper.go @@ -15,7 +15,7 @@ import ( "github.com/ipfs/kubo/client/rpc" apiv1 "github.com/onsonr/sonr/api/vault/v1" - dwngen "github.com/onsonr/sonr/internal/dwn/gen" + dwngen "github.com/onsonr/sonr/pkg/motr/config" didkeeper "github.com/onsonr/sonr/x/did/keeper" "github.com/onsonr/sonr/x/vault/types" ) diff --git a/x/vault/keeper/querier.go b/x/vault/keeper/querier.go index 304603244..906f275ce 100644 --- a/x/vault/keeper/querier.go +++ b/x/vault/keeper/querier.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/onsonr/crypto/mpc" - didtypes "github.com/onsonr/sonr/x/did/types" + "github.com/onsonr/sonr/x/did/controller" "github.com/onsonr/sonr/x/vault/types" ) @@ -72,7 +72,7 @@ func (k Querier) Allocate(goCtx context.Context, req *types.QueryAllocateRequest } // 3. Create Controller from Keyshares - con, err := didtypes.NewController(shares) + con, err := controller.New(shares) if err != nil { ctx.Logger().Error(fmt.Sprintf("Error creating controller: %s", err.Error())) return nil, types.ErrControllerCreation.Wrap(err.Error()) diff --git a/x/vault/types/params.go b/x/vault/types/params.go index c7961d7e1..e8e1abedd 100644 --- a/x/vault/types/params.go +++ b/x/vault/types/params.go @@ -3,7 +3,7 @@ package types import ( "encoding/json" - "github.com/onsonr/sonr/internal/orm" + "github.com/onsonr/sonr/pkg/motr/types/orm" ) // DefaultParams returns default module parameters. diff --git a/x/vault/types/vault.go b/x/vault/types/vault.go index 5c5182471..6507a6ce5 100644 --- a/x/vault/types/vault.go +++ b/x/vault/types/vault.go @@ -3,16 +3,16 @@ package types import ( "github.com/ipfs/boxo/files" - "github.com/onsonr/sonr/internal/dwn" - dwngen "github.com/onsonr/sonr/internal/dwn/gen" + "github.com/onsonr/sonr/pkg/motr" + "github.com/onsonr/sonr/pkg/motr/config" ) type Vault struct { FS files.Node } -func NewVault(keyshareJSON string, adddress string, chainID string, schema *dwngen.Schema) (*Vault, error) { - dwnCfg := &dwngen.Config{ +func NewVault(keyshareJSON string, adddress string, chainID string, schema *config.Schema) (*Vault, error) { + dwnCfg := &config.Config{ MotrKeyshare: keyshareJSON, MotrAddress: adddress, IpfsGatewayUrl: "https://ipfs.sonr.land", @@ -21,7 +21,7 @@ func NewVault(keyshareJSON string, adddress string, chainID string, schema *dwng SonrChainId: chainID, VaultSchema: schema, } - fileMap, err := dwn.NewVaultDirectory(dwnCfg) + fileMap, err := motr.NewVaultDirectory(dwnCfg) if err != nil { return nil, err }