diff --git a/.air.toml b/.air.toml deleted file mode 100644 index b56a4cb51..000000000 --- a/.air.toml +++ /dev/null @@ -1,49 +0,0 @@ -root = "." -testdata_dir = "testdata" -tmp_dir = "tmp" - -[build] -delay = 1000 -cmd = "devbox run build:motr" -exclude_dir = ["assets", "tmp", "vendor", "testdata"] -exclude_file = [] -exclude_regex = ["_test.go"] -exclude_unchanged = true -follow_symlink = false -full_bin = "devbox run start" -include_dir = ["cmd/dwn", "cmd/motr", "internal", "models", "pkl"] -include_ext = ["go", "templ", "html", "pkl", "js", "mjs", "proto"] -include_file = [ - "Dockerfile", - ".goreleaser.yaml", - "go.mod", - "devbox.json", - ".air.toml", -] -kill_delay = "10s" -log = "build-errors.log" -poll = false -poll_interval = 0 -post_cmd = ["devbox run stop"] -pre_cmd = ["templ generate"] -rerun = false -rerun_delay = 1000 -send_interrupt = true -stop_on_error = false - -[color] -build = "yellow" -main = "magenta" -runner = "green" -watcher = "cyan" - -[log] -main_only = true -time = true - -[misc] -clean_on_exit = true - -[screen] -clear_on_rebuild = true -keep_scroll = true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..db2864e52 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ + + +## Description + + + +## Related Issue(s) + + + + + + +## Motivation and Context + + + + +## How Has This Been Tested? + + + + + +## Screenshots (if appropriate): diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..cd885540d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml new file mode 100644 index 000000000..ca8451089 --- /dev/null +++ b/.github/pr-labeler.yml @@ -0,0 +1,3 @@ +feature: ["feature/*", "feat/*"] +fix: fix/* +chore :hammer:: chore/* diff --git a/.github/workflows/deploy-hway.yml b/.github/workflows/deploy-hway.yml new file mode 100644 index 000000000..05c09a6b4 --- /dev/null +++ b/.github/workflows/deploy-hway.yml @@ -0,0 +1,20 @@ +name: Deploy Hway (sonr.id) + +on: + push: + branches: + - develop + +jobs: + deploy: + runs-on: ubuntu-latest + name: Deploy Sonr.ID on Cloudflare + steps: + - uses: actions/checkout@v4 + - name: Install devbox + uses: jetify-com/devbox-install-action@v0.11.0 + - name: Deploy + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CF_WORKERS_TOKEN }} + workingDirectory: web diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml new file mode 100644 index 000000000..a5e0d6924 --- /dev/null +++ b/.github/workflows/label-pr.yml @@ -0,0 +1,19 @@ +name: PR Labeler +on: + pull_request: + types: [opened] + +permissions: + contents: read + +jobs: + pr-labeler: + permissions: + contents: read # for TimonVS/pr-labeler-action to read config file + pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR + runs-on: ubuntu-latest + steps: + - uses: TimonVS/pr-labeler-action@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value diff --git a/.github/workflows/publish-assets.yml b/.github/workflows/publish-assets.yml index 0f1c633a7..7a50f5ba5 100644 --- a/.github/workflows/publish-assets.yml +++ b/.github/workflows/publish-assets.yml @@ -24,6 +24,25 @@ 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 + # + upload_pkl: runs-on: ubuntu-latest name: Publish to pkl.sh diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 000000000..af3c36b0f --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,60 @@ +name: Run Tests + +on: + push: + branches: + - feature/* + +jobs: + test-unit: + runs-on: ubuntu-latest + name: Run Unit Tests + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: onsonr/sonr + fetch-depth: 0 + fetch-tags: true + + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + check-latest: true + - run: make test-unit + + test-race: + runs-on: ubuntu-latest + name: Run Race Tests + continue-on-error: true + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: onsonr/sonr + fetch-depth: 0 + fetch-tags: true + + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + check-latest: true + - run: make test-race + + test-cover: + runs-on: ubuntu-latest + name: Run Coverage Tests + continue-on-error: true + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: onsonr/sonr + fetch-depth: 0 + fetch-tags: true + + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + check-latest: true + - run: make test-cover diff --git a/.github/workflows/scheduled-release.yml b/.github/workflows/scheduled-release.yml index c60173b3c..a75cdd1a9 100644 --- a/.github/workflows/scheduled-release.yml +++ b/.github/workflows/scheduled-release.yml @@ -5,6 +5,8 @@ on: push: tags: - v* + branches: + - master permissions: contents: write diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 097b3df21..4428a55cd 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -14,26 +14,6 @@ builds: ldflags: - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} - - id: hway - goos: [linux, darwin] - goarch: [amd64, arm64] - main: ./cmd/hway - binary: hway - builder: go - gobinary: go - command: build - ldflags: - - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} - - - id: motr - goos: [js] - goarch: [wasm] - main: ./cmd/motr/motr.go - binary: motr - builder: go - gobinary: go - command: build - archives: - id: sonr builds: [sonr] @@ -43,14 +23,6 @@ archives: - src: README* - src: CHANGELOG* - - id: hway - builds: [hway] - name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}' - format: tar.gz - files: - - src: README* - - src: CHANGELOG* - release: github: owner: onsonr @@ -82,56 +54,6 @@ brews: branch: master token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}" - - name: hway - ids: [hway] - commit_author: - name: goreleaserbot - email: bot@goreleaser.com - directory: Formula - caveats: "Use hway to interact with the Sonr network" - homepage: "https://sonr.io/" - description: "Motr is a proxy for interacting with the Sonr network." - dependencies: - - name: ipfs - repository: - owner: onsonr - name: homebrew-tap - branch: master - -# .goreleaser.yaml -dockers: - - # Sonr Binary - id: sonrd - goos: linux - goarch: amd64 - ids: - - sonr - image_templates: - - "onsonr/sonrd:latest" - - "onsonr/sonrd:{{ .Tag }}" - dockerfile: "./deploy/sonrd.Dockerfile" - build_flag_templates: - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title=sonrd" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - - - # Motr Binary - id: hway - goos: linux - goarch: amd64 - ids: - - hway - image_templates: - - "onsonr/hway:latest" - - "onsonr/hway:{{ .Tag }}" - dockerfile: "./deploy/hway.Dockerfile" - build_flag_templates: - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title=hway" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - announce: telegram: enabled: true diff --git a/Makefile b/Makefile index bb4480d55..d07419580 100644 --- a/Makefile +++ b/Makefile @@ -183,13 +183,10 @@ protoVer=0.13.2 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) -proto-all: proto-format proto-lint proto-gen format - proto-gen: @echo "Generating Protobuf files" @go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@latest @$(protoImage) sh ./scripts/protocgen.sh -# generate the stubs for the proto files from the proto directory spawn stub-gen proto-format: @@ -291,43 +288,51 @@ sh-testnet: mod-tidy .PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet + ############################################################################### -### templ & vault ### +### custom generation ### ############################################################################### -.PHONY: motr hway templ pkl nebula +.PHONY: templ-gen pkl-gen -hway: - @echo "(motr) Building Highway gateway" - templ generate - go build -o ./build/hway ./cmd/hway - -motr: - @echo "(dwn) Building motr.wasm -> Service Worker IPFS Vault" - GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./cmd/motr/motr.go - -templ: +templ-gen: @echo "(templ) Generating templ files" templ generate -nebula: - @echo "(nebula) Building nebula" - cd pkg/nebula && bun run build - -pkl: +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 ./pkl/UIUX.pkl -start-caddy: - @echo "(start-caddy) Starting caddy" - ./build/caddy run --config ./config/caddy/Caddyfile -start-hway: hway - @echo "(start-proxy) Starting proxy server" - ./build/hway start + +############################################################################### +### motr, hway & nebula ### +############################################################################### + +.PHONY: motr-build hway-build nebula-build + +nebula-build: + @echo "(ui) Building nebula" + cd nebula && bun install && bun run build + rm -rf ./nebula/node_modules + +motr-build: templ-gen pkl-gen + @echo "(dwn) Building motr.wasm -> Service Worker IPFS Vault" + GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./cmd/motr/main.go + +hway-build: nebula-build templ-gen + @echo "(hway) Building Highway gateway" + GOOS=js GOARCH=wasm go build -o ./cmd/hway/build/app.wasm ./cmd/hway/main.go + +hway-dev: + @echo "(hway) Serving Highway gateway" + bunx wrangler dev + +hway-deploy: + @echo "(hway) Deploying Highway gateway" + bunx wrangler deploy ############################################################################### ### help ### diff --git a/api/did/v1/genesis.pulsar.go b/api/did/v1/genesis.pulsar.go index 756872396..5195e993a 100644 --- a/api/did/v1/genesis.pulsar.go +++ b/api/did/v1/genesis.pulsar.go @@ -1932,6 +1932,2534 @@ func (x *fastReflection_KeyInfo) ProtoMethods() *protoiface.Methods { } } +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) + } + 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 3: + 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 + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Key = append(x.Key[:0], dAtA[iNdEx:postIndex]...) + if x.Key == nil { + x.Key = []byte{} + } + 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 @@ -2097,6 +4625,252 @@ func (x *KeyInfo) GetCurve() string { 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 { + 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_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 { + 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_did_v1_genesis_proto protoreflect.FileDescriptor var file_did_v1_genesis_proto_rawDesc = []byte{ @@ -2134,16 +4908,45 @@ var file_did_v1_genesis_proto_rawDesc = []byte{ 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, 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, + 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, } var ( @@ -2158,22 +4961,28 @@ 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, 4) +var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 8) 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 - nil, // 3: did.v1.Params.AllowedPublicKeysEntry + (*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 } var file_did_v1_genesis_proto_depIdxs = []int32{ 1, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params - 3, // 1: did.v1.Params.allowed_public_keys:type_name -> did.v1.Params.AllowedPublicKeysEntry - 2, // 2: did.v1.Params.AllowedPublicKeysEntry.value:type_name -> did.v1.KeyInfo - 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 + 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 } func init() { file_did_v1_genesis_proto_init() } @@ -2218,6 +5027,54 @@ func file_did_v1_genesis_proto_init() { 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 { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2225,7 +5082,7 @@ func file_did_v1_genesis_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_genesis_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index c5f1b1c25..226591a1d 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -3129,2534 +3129,6 @@ func (x *fastReflection_Verification) ProtoMethods() *protoiface.Methods { } } -var ( - md_Keyshares protoreflect.MessageDescriptor - fd_Keyshares_validator_cid protoreflect.FieldDescriptor - fd_Keyshares_user_cid protoreflect.FieldDescriptor - fd_Keyshares_last_updated_block protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_state_proto_init() - md_Keyshares = File_did_v1_state_proto.Messages().ByName("Keyshares") - fd_Keyshares_validator_cid = md_Keyshares.Fields().ByName("validator_cid") - fd_Keyshares_user_cid = md_Keyshares.Fields().ByName("user_cid") - fd_Keyshares_last_updated_block = md_Keyshares.Fields().ByName("last_updated_block") -} - -var _ protoreflect.Message = (*fastReflection_Keyshares)(nil) - -type fastReflection_Keyshares Keyshares - -func (x *Keyshares) ProtoReflect() protoreflect.Message { - return (*fastReflection_Keyshares)(x) -} - -func (x *Keyshares) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Keyshares_messageType fastReflection_Keyshares_messageType -var _ protoreflect.MessageType = fastReflection_Keyshares_messageType{} - -type fastReflection_Keyshares_messageType struct{} - -func (x fastReflection_Keyshares_messageType) Zero() protoreflect.Message { - return (*fastReflection_Keyshares)(nil) -} -func (x fastReflection_Keyshares_messageType) New() protoreflect.Message { - return new(fastReflection_Keyshares) -} -func (x fastReflection_Keyshares_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Keyshares -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Keyshares) Descriptor() protoreflect.MessageDescriptor { - return md_Keyshares -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_Keyshares) Type() protoreflect.MessageType { - return _fastReflection_Keyshares_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Keyshares) New() protoreflect.Message { - return new(fastReflection_Keyshares) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Keyshares) Interface() protoreflect.ProtoMessage { - return (*Keyshares)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_Keyshares) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.ValidatorCid != "" { - value := protoreflect.ValueOfString(x.ValidatorCid) - if !f(fd_Keyshares_validator_cid, value) { - return - } - } - if x.UserCid != "" { - value := protoreflect.ValueOfString(x.UserCid) - if !f(fd_Keyshares_user_cid, value) { - return - } - } - if x.LastUpdatedBlock != int64(0) { - value := protoreflect.ValueOfInt64(x.LastUpdatedBlock) - if !f(fd_Keyshares_last_updated_block, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Keyshares) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Keyshares.validator_cid": - return x.ValidatorCid != "" - case "did.v1.Keyshares.user_cid": - return x.UserCid != "" - case "did.v1.Keyshares.last_updated_block": - return x.LastUpdatedBlock != int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Keyshares) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Keyshares.validator_cid": - x.ValidatorCid = "" - case "did.v1.Keyshares.user_cid": - x.UserCid = "" - case "did.v1.Keyshares.last_updated_block": - x.LastUpdatedBlock = int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_Keyshares) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Keyshares.validator_cid": - value := x.ValidatorCid - return protoreflect.ValueOfString(value) - case "did.v1.Keyshares.user_cid": - value := x.UserCid - return protoreflect.ValueOfString(value) - case "did.v1.Keyshares.last_updated_block": - value := x.LastUpdatedBlock - return protoreflect.ValueOfInt64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Keyshares) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Keyshares.validator_cid": - x.ValidatorCid = value.Interface().(string) - case "did.v1.Keyshares.user_cid": - x.UserCid = value.Interface().(string) - case "did.v1.Keyshares.last_updated_block": - x.LastUpdatedBlock = value.Int() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Keyshares) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Keyshares.validator_cid": - panic(fmt.Errorf("field validator_cid of message did.v1.Keyshares is not mutable")) - case "did.v1.Keyshares.user_cid": - panic(fmt.Errorf("field user_cid of message did.v1.Keyshares is not mutable")) - case "did.v1.Keyshares.last_updated_block": - panic(fmt.Errorf("field last_updated_block of message did.v1.Keyshares is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Keyshares) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Keyshares.validator_cid": - return protoreflect.ValueOfString("") - case "did.v1.Keyshares.user_cid": - return protoreflect.ValueOfString("") - case "did.v1.Keyshares.last_updated_block": - return protoreflect.ValueOfInt64(int64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshares")) - } - panic(fmt.Errorf("message did.v1.Keyshares does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Keyshares) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Keyshares", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Keyshares) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Keyshares) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_Keyshares) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_Keyshares) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Keyshares) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.ValidatorCid) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.UserCid) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.LastUpdatedBlock != 0 { - n += 1 + runtime.Sov(uint64(x.LastUpdatedBlock)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Keyshares) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.LastUpdatedBlock != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.LastUpdatedBlock)) - i-- - dAtA[i] = 0x18 - } - if len(x.UserCid) > 0 { - i -= len(x.UserCid) - copy(dAtA[i:], x.UserCid) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.UserCid))) - i-- - dAtA[i] = 0x12 - } - if len(x.ValidatorCid) > 0 { - i -= len(x.ValidatorCid) - copy(dAtA[i:], x.ValidatorCid) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorCid))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Keyshares) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Keyshares: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Keyshares: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.ValidatorCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UserCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.UserCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastUpdatedBlock", wireType) - } - x.LastUpdatedBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.LastUpdatedBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - 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_state_proto_init() - md_PubKey = File_did_v1_state_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_state_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_state_proto_init() - md_JSONWebKey = File_did_v1_state_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_state_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_state_proto_init() - md_RawKey = File_did_v1_state_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_state_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) - } - 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 3: - 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 - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Key = append(x.Key[:0], dAtA[iNdEx:postIndex]...) - if x.Key == nil { - x.Key = []byte{} - } - 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 @@ -5978,378 +3450,104 @@ func (x *Verification) GetCreationBlock() int64 { return 0 } -type Keyshares struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ValidatorCid string `protobuf:"bytes,1,opt,name=validator_cid,json=validatorCid,proto3" json:"validator_cid,omitempty"` - UserCid string `protobuf:"bytes,2,opt,name=user_cid,json=userCid,proto3" json:"user_cid,omitempty"` - LastUpdatedBlock int64 `protobuf:"varint,3,opt,name=last_updated_block,json=lastUpdatedBlock,proto3" json:"last_updated_block,omitempty"` -} - -func (x *Keyshares) Reset() { - *x = Keyshares{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Keyshares) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Keyshares) ProtoMessage() {} - -// Deprecated: Use Keyshares.ProtoReflect.Descriptor instead. -func (*Keyshares) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{3} -} - -func (x *Keyshares) GetValidatorCid() string { - if x != nil { - return x.ValidatorCid - } - return "" -} - -func (x *Keyshares) GetUserCid() string { - if x != nil { - return x.UserCid - } - return "" -} - -func (x *Keyshares) GetLastUpdatedBlock() int64 { - if x != nil { - return x.LastUpdatedBlock - } - return 0 -} - -// PubKey defines a public key for a did -type PubKey struct { - state protoimpl.MessageState - 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_state_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_state_proto_rawDescGZIP(), []int{4} -} - -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_did_v1_state_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_state_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_state_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_state_proto_rawDescGZIP(), []int{6} -} - -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_did_v1_state_proto protoreflect.FileDescriptor var file_did_v1_state_proto_rawDesc = []byte{ 0x0a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, + 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, 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, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x29, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x23, 0x0a, 0x05, 0x0a, 0x03, + 0x64, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, + 0x88, 0x03, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x16, + 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x73, 0x6f, 0x6e, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, + 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x65, 0x74, 0x68, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, + 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x62, 0x74, 0x63, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2d, 0x0a, + 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, + 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, + 0x6b, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x73, + 0x56, 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, + 0x59, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x53, 0x0a, 0x0a, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x10, 0x01, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x02, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x62, 0x74, + 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x03, 0x18, 0x01, 0x12, 0x09, 0x0a, + 0x03, 0x64, 0x69, 0x64, 0x10, 0x04, 0x18, 0x01, 0x18, 0x02, 0x22, 0x84, 0x04, 0x0a, 0x0c, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x64, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x0a, + 0x0a, 0x64, 0x69, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x64, 0x69, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, + 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, + 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x0a, + 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, + 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, 0x29, - 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x23, 0x0a, 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x18, 0x0a, - 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x18, 0x01, 0x22, 0x88, 0x03, 0x0a, 0x0a, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, - 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6f, 0x6e, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x74, 0x63, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x73, 0x5f, 0x76, 0x61, 0x6c, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x73, 0x56, 0x61, 0x6c, 0x12, 0x23, 0x0a, - 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, 0x59, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, - 0x53, 0x0a, 0x0a, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x10, 0x01, 0x12, 0x12, 0x0a, - 0x0c, 0x73, 0x6f, 0x6e, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x10, 0x01, 0x18, - 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x10, 0x02, 0x18, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x62, 0x74, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x10, 0x03, 0x18, 0x01, 0x12, 0x09, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x10, 0x04, - 0x18, 0x01, 0x18, 0x02, 0x22, 0x84, 0x04, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x64, 0x5f, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x64, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x18, - 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, - 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x71, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x6b, - 0x0a, 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x0e, 0x69, 0x73, 0x73, 0x75, 0x65, - 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, 0x12, 0x22, 0x0a, - 0x1c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x64, 0x69, 0x64, 0x5f, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x02, 0x18, - 0x01, 0x12, 0x26, 0x0a, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x69, - 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x03, 0x18, 0x01, 0x18, 0x04, 0x22, 0x79, 0x0a, 0x09, 0x4b, - 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x69, 0x64, 0x12, 0x19, 0x0a, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x43, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, - 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x86, 0x01, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x4b, 0x65, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x27, 0x0a, 0x07, 0x72, 0x61, 0x77, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x4b, 0x65, - 0x79, 0x52, 0x06, 0x72, 0x61, 0x77, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x4a, 0x53, 0x4f, 0x4e, 0x57, 0x65, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x22, - 0x68, 0x0a, 0x0a, 0x4a, 0x53, 0x4f, 0x4e, 0x57, 0x65, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x74, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, - 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, - 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, - 0x01, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, 0x6a, 0x0a, 0x06, 0x52, 0x61, 0x77, - 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, - 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, - 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, - 0x72, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, - 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, - 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, - 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, - 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x71, + 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x6b, 0x0a, 0x05, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x12, 0x14, 0x0a, + 0x0e, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, + 0x01, 0x18, 0x01, 0x12, 0x22, 0x0a, 0x1c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2c, 0x64, 0x69, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x10, 0x02, 0x18, 0x01, 0x12, 0x26, 0x0a, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x73, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x10, 0x03, 0x18, 0x01, 0x18, + 0x04, 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 ( @@ -6364,31 +3562,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, 5) var file_did_v1_state_proto_goTypes = []interface{}{ (*Authentication)(nil), // 0: did.v1.Authentication (*Controller)(nil), // 1: did.v1.Controller (*Verification)(nil), // 2: did.v1.Verification - (*Keyshares)(nil), // 3: did.v1.Keyshares - (*PubKey)(nil), // 4: did.v1.PubKey - (*JSONWebKey)(nil), // 5: did.v1.JSONWebKey - (*RawKey)(nil), // 6: did.v1.RawKey - nil, // 7: did.v1.Authentication.MetadataEntry - nil, // 8: did.v1.Verification.MetadataEntry + nil, // 3: did.v1.Authentication.MetadataEntry + nil, // 4: did.v1.Verification.MetadataEntry + (*PubKey)(nil), // 5: did.v1.PubKey } var file_did_v1_state_proto_depIdxs = []int32{ - 4, // 0: did.v1.Authentication.public_key:type_name -> did.v1.PubKey - 7, // 1: did.v1.Authentication.metadata:type_name -> did.v1.Authentication.MetadataEntry - 4, // 2: did.v1.Controller.public_key:type_name -> did.v1.PubKey - 4, // 3: did.v1.Verification.public_key:type_name -> did.v1.PubKey - 8, // 4: did.v1.Verification.metadata:type_name -> did.v1.Verification.MetadataEntry - 6, // 5: did.v1.PubKey.raw_key:type_name -> did.v1.RawKey - 5, // 6: did.v1.PubKey.jwk:type_name -> did.v1.JSONWebKey - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 5, // 0: did.v1.Authentication.public_key:type_name -> did.v1.PubKey + 3, // 1: did.v1.Authentication.metadata:type_name -> did.v1.Authentication.MetadataEntry + 5, // 2: did.v1.Controller.public_key:type_name -> did.v1.PubKey + 5, // 3: did.v1.Verification.public_key:type_name -> did.v1.PubKey + 4, // 4: did.v1.Verification.metadata:type_name -> did.v1.Verification.MetadataEntry + 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 } func init() { file_did_v1_state_proto_init() } @@ -6396,6 +3589,7 @@ func file_did_v1_state_proto_init() { if File_did_v1_state_proto != nil { return } + file_did_v1_genesis_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Authentication); i { @@ -6433,54 +3627,6 @@ func file_did_v1_state_proto_init() { return nil } } - file_did_v1_state_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_state_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_state_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JSONWebKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_did_v1_state_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RawKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -6488,7 +3634,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: 5, NumExtensions: 0, NumServices: 0, }, diff --git a/api/did/v1/tx.pulsar.go b/api/did/v1/tx.pulsar.go index 494f0e422..c6daa20b1 100644 --- a/api/did/v1/tx.pulsar.go +++ b/api/did/v1/tx.pulsar.go @@ -16,159 +16,15 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_MsgRegisterController_2_list)(nil) - -type _MsgRegisterController_2_list struct { - list *[][]byte -} - -func (x *_MsgRegisterController_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgRegisterController_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfBytes((*x.list)[i]) -} - -func (x *_MsgRegisterController_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Bytes() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_MsgRegisterController_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Bytes() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgRegisterController_2_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message MsgRegisterController at list field Assertions as it is not of Message kind")) -} - -func (x *_MsgRegisterController_2_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_MsgRegisterController_2_list) NewElement() protoreflect.Value { - var v []byte - return protoreflect.ValueOfBytes(v) -} - -func (x *_MsgRegisterController_2_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_MsgRegisterController_3_list)(nil) - -type _MsgRegisterController_3_list struct { - list *[][]byte -} - -func (x *_MsgRegisterController_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgRegisterController_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfBytes((*x.list)[i]) -} - -func (x *_MsgRegisterController_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Bytes() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_MsgRegisterController_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Bytes() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgRegisterController_3_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message MsgRegisterController at list field Keyshares as it is not of Message kind")) -} - -func (x *_MsgRegisterController_3_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_MsgRegisterController_3_list) NewElement() protoreflect.Value { - var v []byte - return protoreflect.ValueOfBytes(v) -} - -func (x *_MsgRegisterController_3_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_MsgRegisterController_4_list)(nil) - -type _MsgRegisterController_4_list struct { - list *[][]byte -} - -func (x *_MsgRegisterController_4_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgRegisterController_4_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfBytes((*x.list)[i]) -} - -func (x *_MsgRegisterController_4_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Bytes() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_MsgRegisterController_4_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Bytes() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgRegisterController_4_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message MsgRegisterController at list field Verifications as it is not of Message kind")) -} - -func (x *_MsgRegisterController_4_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_MsgRegisterController_4_list) NewElement() protoreflect.Value { - var v []byte - return protoreflect.ValueOfBytes(v) -} - -func (x *_MsgRegisterController_4_list) IsValid() bool { - return x.list != nil -} - var ( - md_MsgRegisterController protoreflect.MessageDescriptor - fd_MsgRegisterController_authority protoreflect.FieldDescriptor - fd_MsgRegisterController_assertions protoreflect.FieldDescriptor - fd_MsgRegisterController_keyshares protoreflect.FieldDescriptor - fd_MsgRegisterController_verifications protoreflect.FieldDescriptor + md_MsgRegisterController protoreflect.MessageDescriptor + fd_MsgRegisterController_authority protoreflect.FieldDescriptor ) func init() { file_did_v1_tx_proto_init() md_MsgRegisterController = File_did_v1_tx_proto.Messages().ByName("MsgRegisterController") fd_MsgRegisterController_authority = md_MsgRegisterController.Fields().ByName("authority") - fd_MsgRegisterController_assertions = md_MsgRegisterController.Fields().ByName("assertions") - fd_MsgRegisterController_keyshares = md_MsgRegisterController.Fields().ByName("keyshares") - fd_MsgRegisterController_verifications = md_MsgRegisterController.Fields().ByName("verifications") } var _ protoreflect.Message = (*fastReflection_MsgRegisterController)(nil) @@ -242,24 +98,6 @@ func (x *fastReflection_MsgRegisterController) Range(f func(protoreflect.FieldDe return } } - if len(x.Assertions) != 0 { - value := protoreflect.ValueOfList(&_MsgRegisterController_2_list{list: &x.Assertions}) - if !f(fd_MsgRegisterController_assertions, value) { - return - } - } - if len(x.Keyshares) != 0 { - value := protoreflect.ValueOfList(&_MsgRegisterController_3_list{list: &x.Keyshares}) - if !f(fd_MsgRegisterController_keyshares, value) { - return - } - } - if len(x.Verifications) != 0 { - value := protoreflect.ValueOfList(&_MsgRegisterController_4_list{list: &x.Verifications}) - if !f(fd_MsgRegisterController_verifications, value) { - return - } - } } // Has reports whether a field is populated. @@ -277,12 +115,6 @@ func (x *fastReflection_MsgRegisterController) Has(fd protoreflect.FieldDescript switch fd.FullName() { case "did.v1.MsgRegisterController.authority": return x.Authority != "" - case "did.v1.MsgRegisterController.assertions": - return len(x.Assertions) != 0 - case "did.v1.MsgRegisterController.keyshares": - return len(x.Keyshares) != 0 - case "did.v1.MsgRegisterController.verifications": - return len(x.Verifications) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) @@ -301,12 +133,6 @@ func (x *fastReflection_MsgRegisterController) Clear(fd protoreflect.FieldDescri switch fd.FullName() { case "did.v1.MsgRegisterController.authority": x.Authority = "" - case "did.v1.MsgRegisterController.assertions": - x.Assertions = nil - case "did.v1.MsgRegisterController.keyshares": - x.Keyshares = nil - case "did.v1.MsgRegisterController.verifications": - x.Verifications = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) @@ -326,24 +152,6 @@ func (x *fastReflection_MsgRegisterController) Get(descriptor protoreflect.Field case "did.v1.MsgRegisterController.authority": value := x.Authority return protoreflect.ValueOfString(value) - case "did.v1.MsgRegisterController.assertions": - if len(x.Assertions) == 0 { - return protoreflect.ValueOfList(&_MsgRegisterController_2_list{}) - } - listValue := &_MsgRegisterController_2_list{list: &x.Assertions} - return protoreflect.ValueOfList(listValue) - case "did.v1.MsgRegisterController.keyshares": - if len(x.Keyshares) == 0 { - return protoreflect.ValueOfList(&_MsgRegisterController_3_list{}) - } - listValue := &_MsgRegisterController_3_list{list: &x.Keyshares} - return protoreflect.ValueOfList(listValue) - case "did.v1.MsgRegisterController.verifications": - if len(x.Verifications) == 0 { - return protoreflect.ValueOfList(&_MsgRegisterController_4_list{}) - } - listValue := &_MsgRegisterController_4_list{list: &x.Verifications} - return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) @@ -366,18 +174,6 @@ func (x *fastReflection_MsgRegisterController) Set(fd protoreflect.FieldDescript switch fd.FullName() { case "did.v1.MsgRegisterController.authority": x.Authority = value.Interface().(string) - case "did.v1.MsgRegisterController.assertions": - lv := value.List() - clv := lv.(*_MsgRegisterController_2_list) - x.Assertions = *clv.list - case "did.v1.MsgRegisterController.keyshares": - lv := value.List() - clv := lv.(*_MsgRegisterController_3_list) - x.Keyshares = *clv.list - case "did.v1.MsgRegisterController.verifications": - lv := value.List() - clv := lv.(*_MsgRegisterController_4_list) - x.Verifications = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) @@ -398,24 +194,6 @@ func (x *fastReflection_MsgRegisterController) Set(fd protoreflect.FieldDescript // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgRegisterController) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.MsgRegisterController.assertions": - if x.Assertions == nil { - x.Assertions = [][]byte{} - } - value := &_MsgRegisterController_2_list{list: &x.Assertions} - return protoreflect.ValueOfList(value) - case "did.v1.MsgRegisterController.keyshares": - if x.Keyshares == nil { - x.Keyshares = [][]byte{} - } - value := &_MsgRegisterController_3_list{list: &x.Keyshares} - return protoreflect.ValueOfList(value) - case "did.v1.MsgRegisterController.verifications": - if x.Verifications == nil { - x.Verifications = [][]byte{} - } - value := &_MsgRegisterController_4_list{list: &x.Verifications} - return protoreflect.ValueOfList(value) case "did.v1.MsgRegisterController.authority": panic(fmt.Errorf("field authority of message did.v1.MsgRegisterController is not mutable")) default: @@ -433,15 +211,6 @@ func (x *fastReflection_MsgRegisterController) NewField(fd protoreflect.FieldDes switch fd.FullName() { case "did.v1.MsgRegisterController.authority": return protoreflect.ValueOfString("") - case "did.v1.MsgRegisterController.assertions": - list := [][]byte{} - return protoreflect.ValueOfList(&_MsgRegisterController_2_list{list: &list}) - case "did.v1.MsgRegisterController.keyshares": - list := [][]byte{} - return protoreflect.ValueOfList(&_MsgRegisterController_3_list{list: &list}) - case "did.v1.MsgRegisterController.verifications": - list := [][]byte{} - return protoreflect.ValueOfList(&_MsgRegisterController_4_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) @@ -515,24 +284,6 @@ func (x *fastReflection_MsgRegisterController) ProtoMethods() *protoiface.Method if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Assertions) > 0 { - for _, b := range x.Assertions { - l = len(b) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.Keyshares) > 0 { - for _, b := range x.Keyshares { - l = len(b) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.Verifications) > 0 { - for _, b := range x.Verifications { - l = len(b) - n += 1 + l + runtime.Sov(uint64(l)) - } - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -562,33 +313,6 @@ func (x *fastReflection_MsgRegisterController) ProtoMethods() *protoiface.Method i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Verifications) > 0 { - for iNdEx := len(x.Verifications) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Verifications[iNdEx]) - copy(dAtA[i:], x.Verifications[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Verifications[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(x.Keyshares) > 0 { - for iNdEx := len(x.Keyshares) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Keyshares[iNdEx]) - copy(dAtA[i:], x.Keyshares[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Keyshares[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(x.Assertions) > 0 { - for iNdEx := len(x.Assertions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Assertions[iNdEx]) - copy(dAtA[i:], x.Assertions[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Assertions[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } if len(x.Authority) > 0 { i -= len(x.Authority) copy(dAtA[i:], x.Authority) @@ -677,102 +401,6 @@ func (x *fastReflection_MsgRegisterController) ProtoMethods() *protoiface.Method } x.Authority = 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 Assertions", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Assertions = append(x.Assertions, make([]byte, postIndex-iNdEx)) - copy(x.Assertions[len(x.Assertions)-1], 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 Keyshares", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Keyshares = append(x.Keyshares, make([]byte, postIndex-iNdEx)) - copy(x.Keyshares[len(x.Keyshares)-1], 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 Verifications", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Verifications = append(x.Verifications, make([]byte, postIndex-iNdEx)) - copy(x.Verifications[len(x.Verifications)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -808,93 +436,10 @@ func (x *fastReflection_MsgRegisterController) ProtoMethods() *protoiface.Method } } -var _ protoreflect.Map = (*_MsgRegisterControllerResponse_3_map)(nil) - -type _MsgRegisterControllerResponse_3_map struct { - m *map[string]string -} - -func (x *_MsgRegisterControllerResponse_3_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_MsgRegisterControllerResponse_3_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - if x.m == nil { - return - } - for k, v := range *x.m { - mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) - mapValue := protoreflect.ValueOfString(v) - if !f(mapKey, mapValue) { - break - } - } -} - -func (x *_MsgRegisterControllerResponse_3_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 *_MsgRegisterControllerResponse_3_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_MsgRegisterControllerResponse_3_map) Get(key protoreflect.MapKey) protoreflect.Value { - if x.m == nil { - return protoreflect.Value{} - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if !ok { - return protoreflect.Value{} - } - return protoreflect.ValueOfString(v) -} - -func (x *_MsgRegisterControllerResponse_3_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.m)[concreteKey] = concreteValue -} - -func (x *_MsgRegisterControllerResponse_3_map) Mutable(key protoreflect.MapKey) protoreflect.Value { - panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") -} - -func (x *_MsgRegisterControllerResponse_3_map) NewValue() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_MsgRegisterControllerResponse_3_map) IsValid() bool { - return x.m != nil -} - var ( md_MsgRegisterControllerResponse protoreflect.MessageDescriptor fd_MsgRegisterControllerResponse_success protoreflect.FieldDescriptor fd_MsgRegisterControllerResponse_controller protoreflect.FieldDescriptor - fd_MsgRegisterControllerResponse_accounts protoreflect.FieldDescriptor ) func init() { @@ -902,7 +447,6 @@ func init() { md_MsgRegisterControllerResponse = File_did_v1_tx_proto.Messages().ByName("MsgRegisterControllerResponse") fd_MsgRegisterControllerResponse_success = md_MsgRegisterControllerResponse.Fields().ByName("success") fd_MsgRegisterControllerResponse_controller = md_MsgRegisterControllerResponse.Fields().ByName("controller") - fd_MsgRegisterControllerResponse_accounts = md_MsgRegisterControllerResponse.Fields().ByName("accounts") } var _ protoreflect.Message = (*fastReflection_MsgRegisterControllerResponse)(nil) @@ -982,12 +526,6 @@ func (x *fastReflection_MsgRegisterControllerResponse) Range(f func(protoreflect return } } - if len(x.Accounts) != 0 { - value := protoreflect.ValueOfMap(&_MsgRegisterControllerResponse_3_map{m: &x.Accounts}) - if !f(fd_MsgRegisterControllerResponse_accounts, value) { - return - } - } } // Has reports whether a field is populated. @@ -1007,8 +545,6 @@ func (x *fastReflection_MsgRegisterControllerResponse) Has(fd protoreflect.Field return x.Success != false case "did.v1.MsgRegisterControllerResponse.controller": return x.Controller != "" - case "did.v1.MsgRegisterControllerResponse.accounts": - return len(x.Accounts) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterControllerResponse")) @@ -1029,8 +565,6 @@ func (x *fastReflection_MsgRegisterControllerResponse) Clear(fd protoreflect.Fie x.Success = false case "did.v1.MsgRegisterControllerResponse.controller": x.Controller = "" - case "did.v1.MsgRegisterControllerResponse.accounts": - x.Accounts = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterControllerResponse")) @@ -1053,12 +587,6 @@ func (x *fastReflection_MsgRegisterControllerResponse) Get(descriptor protorefle case "did.v1.MsgRegisterControllerResponse.controller": value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.MsgRegisterControllerResponse.accounts": - if len(x.Accounts) == 0 { - return protoreflect.ValueOfMap(&_MsgRegisterControllerResponse_3_map{}) - } - mapValue := &_MsgRegisterControllerResponse_3_map{m: &x.Accounts} - return protoreflect.ValueOfMap(mapValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterControllerResponse")) @@ -1083,10 +611,6 @@ func (x *fastReflection_MsgRegisterControllerResponse) Set(fd protoreflect.Field x.Success = value.Bool() case "did.v1.MsgRegisterControllerResponse.controller": x.Controller = value.Interface().(string) - case "did.v1.MsgRegisterControllerResponse.accounts": - mv := value.Map() - cmv := mv.(*_MsgRegisterControllerResponse_3_map) - x.Accounts = *cmv.m default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterControllerResponse")) @@ -1107,12 +631,6 @@ func (x *fastReflection_MsgRegisterControllerResponse) Set(fd protoreflect.Field // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgRegisterControllerResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.MsgRegisterControllerResponse.accounts": - if x.Accounts == nil { - x.Accounts = make(map[string]string) - } - value := &_MsgRegisterControllerResponse_3_map{m: &x.Accounts} - return protoreflect.ValueOfMap(value) case "did.v1.MsgRegisterControllerResponse.success": panic(fmt.Errorf("field success of message did.v1.MsgRegisterControllerResponse is not mutable")) case "did.v1.MsgRegisterControllerResponse.controller": @@ -1134,9 +652,6 @@ func (x *fastReflection_MsgRegisterControllerResponse) NewField(fd protoreflect. return protoreflect.ValueOfBool(false) case "did.v1.MsgRegisterControllerResponse.controller": return protoreflect.ValueOfString("") - case "did.v1.MsgRegisterControllerResponse.accounts": - m := make(map[string]string) - return protoreflect.ValueOfMap(&_MsgRegisterControllerResponse_3_map{m: &m}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterControllerResponse")) @@ -1213,27 +728,6 @@ func (x *fastReflection_MsgRegisterControllerResponse) ProtoMethods() *protoifac if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Accounts) > 0 { - SiZeMaP := func(k string, v string) { - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.Accounts)) - for k := range x.Accounts { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Accounts[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Accounts { - SiZeMaP(k, v) - } - } - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1263,49 +757,6 @@ func (x *fastReflection_MsgRegisterControllerResponse) ProtoMethods() *protoifac i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Accounts) > 0 { - MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForAccounts := make([]string, 0, len(x.Accounts)) - for k := range x.Accounts { - keysForAccounts = append(keysForAccounts, string(k)) - } - sort.Slice(keysForAccounts, func(i, j int) bool { - return keysForAccounts[i] < keysForAccounts[j] - }) - for iNdEx := len(keysForAccounts) - 1; iNdEx >= 0; iNdEx-- { - v := x.Accounts[string(keysForAccounts[iNdEx])] - out, err := MaRsHaLmAp(keysForAccounts[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Accounts { - v := x.Accounts[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } if len(x.Controller) > 0 { i -= len(x.Controller) copy(dAtA[i:], x.Controller) @@ -1424,133 +875,6 @@ func (x *fastReflection_MsgRegisterControllerResponse) ProtoMethods() *protoifac } 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 Accounts", 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.Accounts == nil { - x.Accounts = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapkey > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapvalue > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - x.Accounts[mapkey] = mapvalue - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3790,13 +3114,6 @@ type MsgRegisterController struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // Assertions is the list of assertions to initialize the controller with. - Assertions [][]byte `protobuf:"bytes,2,rep,name=assertions,proto3" json:"assertions,omitempty"` - // Keyshares is the list of keyshares to initialize the controller with. - Keyshares [][]byte `protobuf:"bytes,3,rep,name=keyshares,proto3" json:"keyshares,omitempty"` - // Verifications is the list of verifications to initialize the controller - // with. - Verifications [][]byte `protobuf:"bytes,4,rep,name=verifications,proto3" json:"verifications,omitempty"` } func (x *MsgRegisterController) Reset() { @@ -3826,27 +3143,6 @@ func (x *MsgRegisterController) GetAuthority() string { return "" } -func (x *MsgRegisterController) GetAssertions() [][]byte { - if x != nil { - return x.Assertions - } - return nil -} - -func (x *MsgRegisterController) GetKeyshares() [][]byte { - if x != nil { - return x.Keyshares - } - return nil -} - -func (x *MsgRegisterController) GetVerifications() [][]byte { - if x != nil { - return x.Verifications - } - return nil -} - // MsgRegisterControllerResponse is the response type for the // InitializeController RPC. type MsgRegisterControllerResponse struct { @@ -3859,8 +3155,6 @@ type MsgRegisterControllerResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Controller is the address of the initialized controller. Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - // Accounts are a Address Map and Supported coin Denoms for the controller - Accounts map[string]string `protobuf:"bytes,3,rep,name=accounts,proto3" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *MsgRegisterControllerResponse) Reset() { @@ -3897,13 +3191,6 @@ func (x *MsgRegisterControllerResponse) GetController() string { return "" } -func (x *MsgRegisterControllerResponse) GetAccounts() map[string]string { - if x != nil { - return x.Accounts - } - return nil -} - // MsgExecuteTx is the message type for the ExecuteTx RPC. type MsgExecuteTx struct { state protoimpl.MessageState @@ -4100,91 +3387,76 @@ var file_did_v1_tx_proto_rawDesc = []byte{ 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, 0xc3, 0x01, 0x0a, 0x15, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, - 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x0a, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6b, - 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, - 0x6b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, - 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, - 0x81, 0x02, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 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, 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, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, 0x15, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 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, 0xf3, 0x01, 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, 0x5a, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 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, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x73, 0x0a, 0x1d, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 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, 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, 0xf3, 0x01, 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, 0x5a, + 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 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 ( @@ -4199,7 +3471,7 @@ func file_did_v1_tx_proto_rawDescGZIP() []byte { return file_did_v1_tx_proto_rawDescData } -var file_did_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_did_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_did_v1_tx_proto_goTypes = []interface{}{ (*MsgRegisterController)(nil), // 0: did.v1.MsgRegisterController (*MsgRegisterControllerResponse)(nil), // 1: did.v1.MsgRegisterControllerResponse @@ -4207,25 +3479,23 @@ var file_did_v1_tx_proto_goTypes = []interface{}{ (*MsgExecuteTxResponse)(nil), // 3: did.v1.MsgExecuteTxResponse (*MsgUpdateParams)(nil), // 4: did.v1.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 5: did.v1.MsgUpdateParamsResponse - nil, // 6: did.v1.MsgRegisterControllerResponse.AccountsEntry - nil, // 7: did.v1.MsgExecuteTx.MessagesEntry - (*Params)(nil), // 8: did.v1.Params + nil, // 6: did.v1.MsgExecuteTx.MessagesEntry + (*Params)(nil), // 7: did.v1.Params } var file_did_v1_tx_proto_depIdxs = []int32{ - 6, // 0: did.v1.MsgRegisterControllerResponse.accounts:type_name -> did.v1.MsgRegisterControllerResponse.AccountsEntry - 7, // 1: did.v1.MsgExecuteTx.messages:type_name -> did.v1.MsgExecuteTx.MessagesEntry - 8, // 2: did.v1.MsgUpdateParams.params:type_name -> did.v1.Params - 2, // 3: did.v1.Msg.ExecuteTx:input_type -> did.v1.MsgExecuteTx - 0, // 4: did.v1.Msg.RegisterController:input_type -> did.v1.MsgRegisterController - 4, // 5: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams - 3, // 6: did.v1.Msg.ExecuteTx:output_type -> did.v1.MsgExecuteTxResponse - 1, // 7: did.v1.Msg.RegisterController:output_type -> did.v1.MsgRegisterControllerResponse - 5, // 8: did.v1.Msg.UpdateParams:output_type -> did.v1.MsgUpdateParamsResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 6, // 0: did.v1.MsgExecuteTx.messages:type_name -> did.v1.MsgExecuteTx.MessagesEntry + 7, // 1: did.v1.MsgUpdateParams.params:type_name -> did.v1.Params + 2, // 2: did.v1.Msg.ExecuteTx:input_type -> did.v1.MsgExecuteTx + 0, // 3: did.v1.Msg.RegisterController:input_type -> did.v1.MsgRegisterController + 4, // 4: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams + 3, // 5: did.v1.Msg.ExecuteTx:output_type -> did.v1.MsgExecuteTxResponse + 1, // 6: did.v1.Msg.RegisterController:output_type -> did.v1.MsgRegisterControllerResponse + 5, // 7: did.v1.Msg.UpdateParams:output_type -> did.v1.MsgUpdateParamsResponse + 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 } func init() { file_did_v1_tx_proto_init() } @@ -4314,7 +3584,7 @@ func file_did_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, diff --git a/api/macaroon/v1/genesis.pulsar.go b/api/macaroon/v1/genesis.pulsar.go index 1b2f4acea..7e834da9e 100644 --- a/api/macaroon/v1/genesis.pulsar.go +++ b/api/macaroon/v1/genesis.pulsar.go @@ -6,6 +6,7 @@ import ( fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + _ "github.com/onsonr/sonr/api/did/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -2734,6 +2735,610 @@ func (x *fastReflection_Caveats) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_Transactions_1_list)(nil) + +type _Transactions_1_list struct { + list *[]string +} + +func (x *_Transactions_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Transactions_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Transactions_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Transactions_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Transactions_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Transactions at list field Allowlist as it is not of Message kind")) +} + +func (x *_Transactions_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Transactions_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Transactions_1_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Transactions_2_list)(nil) + +type _Transactions_2_list struct { + list *[]string +} + +func (x *_Transactions_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Transactions_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Transactions_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Transactions_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Transactions_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Transactions at list field Denylist as it is not of Message kind")) +} + +func (x *_Transactions_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Transactions_2_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Transactions_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Transactions protoreflect.MessageDescriptor + fd_Transactions_allowlist protoreflect.FieldDescriptor + fd_Transactions_denylist protoreflect.FieldDescriptor +) + +func init() { + file_macaroon_v1_genesis_proto_init() + md_Transactions = File_macaroon_v1_genesis_proto.Messages().ByName("Transactions") + fd_Transactions_allowlist = md_Transactions.Fields().ByName("allowlist") + fd_Transactions_denylist = md_Transactions.Fields().ByName("denylist") +} + +var _ protoreflect.Message = (*fastReflection_Transactions)(nil) + +type fastReflection_Transactions Transactions + +func (x *Transactions) ProtoReflect() protoreflect.Message { + return (*fastReflection_Transactions)(x) +} + +func (x *Transactions) slowProtoReflect() protoreflect.Message { + mi := &file_macaroon_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_Transactions_messageType fastReflection_Transactions_messageType +var _ protoreflect.MessageType = fastReflection_Transactions_messageType{} + +type fastReflection_Transactions_messageType struct{} + +func (x fastReflection_Transactions_messageType) Zero() protoreflect.Message { + return (*fastReflection_Transactions)(nil) +} +func (x fastReflection_Transactions_messageType) New() protoreflect.Message { + return new(fastReflection_Transactions) +} +func (x fastReflection_Transactions_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Transactions +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Transactions) Descriptor() protoreflect.MessageDescriptor { + return md_Transactions +} + +// 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_Transactions) Type() protoreflect.MessageType { + return _fastReflection_Transactions_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Transactions) New() protoreflect.Message { + return new(fastReflection_Transactions) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Transactions) Interface() protoreflect.ProtoMessage { + return (*Transactions)(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_Transactions) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Allowlist) != 0 { + value := protoreflect.ValueOfList(&_Transactions_1_list{list: &x.Allowlist}) + if !f(fd_Transactions_allowlist, value) { + return + } + } + if len(x.Denylist) != 0 { + value := protoreflect.ValueOfList(&_Transactions_2_list{list: &x.Denylist}) + if !f(fd_Transactions_denylist, 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_Transactions) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "macaroon.v1.Transactions.allowlist": + return len(x.Allowlist) != 0 + case "macaroon.v1.Transactions.denylist": + return len(x.Denylist) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions")) + } + panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "macaroon.v1.Transactions.allowlist": + x.Allowlist = nil + case "macaroon.v1.Transactions.denylist": + x.Denylist = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions")) + } + panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "macaroon.v1.Transactions.allowlist": + if len(x.Allowlist) == 0 { + return protoreflect.ValueOfList(&_Transactions_1_list{}) + } + listValue := &_Transactions_1_list{list: &x.Allowlist} + return protoreflect.ValueOfList(listValue) + case "macaroon.v1.Transactions.denylist": + if len(x.Denylist) == 0 { + return protoreflect.ValueOfList(&_Transactions_2_list{}) + } + listValue := &_Transactions_2_list{list: &x.Denylist} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions")) + } + panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "macaroon.v1.Transactions.allowlist": + lv := value.List() + clv := lv.(*_Transactions_1_list) + x.Allowlist = *clv.list + case "macaroon.v1.Transactions.denylist": + lv := value.List() + clv := lv.(*_Transactions_2_list) + x.Denylist = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions")) + } + panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "macaroon.v1.Transactions.allowlist": + if x.Allowlist == nil { + x.Allowlist = []string{} + } + value := &_Transactions_1_list{list: &x.Allowlist} + return protoreflect.ValueOfList(value) + case "macaroon.v1.Transactions.denylist": + if x.Denylist == nil { + x.Denylist = []string{} + } + value := &_Transactions_2_list{list: &x.Denylist} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions")) + } + panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "macaroon.v1.Transactions.allowlist": + list := []string{} + return protoreflect.ValueOfList(&_Transactions_1_list{list: &list}) + case "macaroon.v1.Transactions.denylist": + list := []string{} + return protoreflect.ValueOfList(&_Transactions_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: macaroon.v1.Transactions")) + } + panic(fmt.Errorf("message macaroon.v1.Transactions 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_Transactions) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in macaroon.v1.Transactions", 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_Transactions) 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_Transactions) 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_Transactions) 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_Transactions) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Transactions) + 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.Allowlist) > 0 { + for _, s := range x.Allowlist { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.Denylist) > 0 { + for _, s := range x.Denylist { + 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().(*Transactions) + 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.Denylist) > 0 { + for iNdEx := len(x.Denylist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Denylist[iNdEx]) + copy(dAtA[i:], x.Denylist[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denylist[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Allowlist) > 0 { + for iNdEx := len(x.Allowlist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Allowlist[iNdEx]) + copy(dAtA[i:], x.Allowlist[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Allowlist[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Transactions) + 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: Transactions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Transactions: 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 Allowlist", 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.Allowlist = append(x.Allowlist, 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 Denylist", 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.Denylist = append(x.Denylist, 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 @@ -2971,6 +3576,51 @@ func (x *Caveats) GetSupportedThirdParty() []string { return nil } +// Transactions defines the allowlist,denylist for transactions which can be +// broadcasted to the network with the Sonr DWN Signed macaroon. +type Transactions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Allowlist []string `protobuf:"bytes,1,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + Denylist []string `protobuf:"bytes,2,rep,name=denylist,proto3" json:"denylist,omitempty"` +} + +func (x *Transactions) Reset() { + *x = Transactions{} + if protoimpl.UnsafeEnabled { + mi := &file_macaroon_v1_genesis_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Transactions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Transactions) ProtoMessage() {} + +// Deprecated: Use Transactions.ProtoReflect.Descriptor instead. +func (*Transactions) Descriptor() ([]byte, []int) { + return file_macaroon_v1_genesis_proto_rawDescGZIP(), []int{5} +} + +func (x *Transactions) GetAllowlist() []string { + if x != nil { + return x.Allowlist + } + return nil +} + +func (x *Transactions) GetDenylist() []string { + if x != nil { + return x.Denylist + } + return nil +} + var File_macaroon_v1_genesis_proto protoreflect.FileDescriptor var file_macaroon_v1_genesis_proto_rawDesc = []byte{ @@ -2979,53 +3629,61 @@ var file_macaroon_v1_genesis_proto_rawDesc = []byte{ 0x61, 0x72, 0x6f, 0x6f, 0x6e, 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, 0x41, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x31, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, - 0x2b, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, - 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x07, - 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76, 0x65, - 0x61, 0x74, 0x73, 0x52, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x3a, 0x1c, 0x98, 0xa0, - 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d, 0x61, 0x63, 0x61, 0x72, - 0x6f, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5c, 0x0a, 0x07, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x3a, 0x19, 0xe8, - 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, - 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x54, 0x0a, 0x06, 0x53, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x64, 0x3a, 0x18, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d, - 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x8b, - 0x01, 0x0a, 0x07, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x75, - 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x70, 0x61, - 0x72, 0x74, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x73, 0x75, 0x70, 0x70, 0x6f, - 0x72, 0x74, 0x65, 0x64, 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x12, 0x32, - 0x0a, 0x15, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x69, 0x72, - 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x73, - 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61, 0x72, - 0x74, 0x79, 0x3a, 0x18, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d, 0x61, 0x63, - 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x42, 0x9f, 0x01, 0x0a, - 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, - 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, - 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, - 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, - 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, - 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0c, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x1a, 0x0f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x41, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, + 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2e, 0x0a, + 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x76, + 0x65, 0x61, 0x74, 0x73, 0x52, 0x07, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x3a, 0x1c, 0x98, + 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x6d, 0x61, 0x63, 0x61, + 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5c, 0x0a, 0x07, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x3a, 0x19, + 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, + 0x6e, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x54, 0x0a, 0x06, 0x53, 0x63, 0x6f, + 0x70, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x62, 0x61, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x70, 0x70, 0x6f, + 0x72, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x3a, 0x18, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, + 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x22, + 0x8c, 0x01, 0x0a, 0x07, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, + 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x70, + 0x61, 0x72, 0x74, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x73, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x12, + 0x32, 0x0a, 0x15, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x69, + 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, + 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61, + 0x72, 0x74, 0x79, 0x3a, 0x19, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x6d, 0x61, + 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x73, 0x22, 0x68, + 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, + 0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x64, 0x65, 0x6e, 0x79, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, + 0x64, 0x65, 0x6e, 0x79, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x1e, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, + 0xb0, 0x2a, 0x15, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2f, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x9f, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, + 0x2e, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0b, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x17, 0x4d, 0x61, 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x61, + 0x63, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -3040,13 +3698,14 @@ func file_macaroon_v1_genesis_proto_rawDescGZIP() []byte { return file_macaroon_v1_genesis_proto_rawDescData } -var file_macaroon_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_macaroon_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_macaroon_v1_genesis_proto_goTypes = []interface{}{ (*GenesisState)(nil), // 0: macaroon.v1.GenesisState (*Params)(nil), // 1: macaroon.v1.Params (*Methods)(nil), // 2: macaroon.v1.Methods (*Scopes)(nil), // 3: macaroon.v1.Scopes (*Caveats)(nil), // 4: macaroon.v1.Caveats + (*Transactions)(nil), // 5: macaroon.v1.Transactions } var file_macaroon_v1_genesis_proto_depIdxs = []int32{ 1, // 0: macaroon.v1.GenesisState.params:type_name -> macaroon.v1.Params @@ -3126,6 +3785,18 @@ func file_macaroon_v1_genesis_proto_init() { return nil } } + file_macaroon_v1_genesis_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Transactions); 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{ @@ -3133,7 +3804,7 @@ func file_macaroon_v1_genesis_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_macaroon_v1_genesis_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/api/oracle/module/v1/module.pulsar.go b/api/oracle/module/v1/module.pulsar.go deleted file mode 100644 index 0f56453c8..000000000 --- a/api/oracle/module/v1/module.pulsar.go +++ /dev/null @@ -1,500 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package modulev1 - -import ( - _ "cosmossdk.io/api/cosmos/app/v1alpha1" - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_Module protoreflect.MessageDescriptor -) - -func init() { - file_oracle_module_v1_module_proto_init() - md_Module = File_oracle_module_v1_module_proto.Messages().ByName("Module") -} - -var _ protoreflect.Message = (*fastReflection_Module)(nil) - -type fastReflection_Module Module - -func (x *Module) ProtoReflect() protoreflect.Message { - return (*fastReflection_Module)(x) -} - -func (x *Module) slowProtoReflect() protoreflect.Message { - mi := &file_oracle_module_v1_module_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_Module_messageType fastReflection_Module_messageType -var _ protoreflect.MessageType = fastReflection_Module_messageType{} - -type fastReflection_Module_messageType struct{} - -func (x fastReflection_Module_messageType) Zero() protoreflect.Message { - return (*fastReflection_Module)(nil) -} -func (x fastReflection_Module_messageType) New() protoreflect.Message { - return new(fastReflection_Module) -} -func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Module -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { - return md_Module -} - -// 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_Module) Type() protoreflect.MessageType { - return _fastReflection_Module_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Module) New() protoreflect.Message { - return new(fastReflection_Module) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { - return (*Module)(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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// 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_Module) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module")) - } - panic(fmt.Errorf("message oracle.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module")) - } - panic(fmt.Errorf("message oracle.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module")) - } - panic(fmt.Errorf("message oracle.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module")) - } - panic(fmt.Errorf("message oracle.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module")) - } - panic(fmt.Errorf("message oracle.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.module.v1.Module")) - } - panic(fmt.Errorf("message oracle.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in oracle.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Module) - 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.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().(*Module) - 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 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().(*Module) - 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: Module: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - 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: oracle/module/v1/module.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) -) - -// Module is the app config object of the module. -// Learn more: https://docs.cosmos.network/main/building-modules/depinject -type Module struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Module) Reset() { - *x = Module{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_module_v1_module_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Module) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Module) ProtoMessage() {} - -// Deprecated: Use Module.ProtoReflect.Descriptor instead. -func (*Module) Descriptor() ([]byte, []int) { - return file_oracle_module_v1_module_proto_rawDescGZIP(), []int{0} -} - -var File_oracle_module_v1_module_proto protoreflect.FileDescriptor - -var file_oracle_module_v1_module_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x6f, 0x72, 0x61, 0x63, 0x6c, 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, - 0x10, 0x6f, 0x72, 0x61, 0x63, 0x6c, 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, 0xbb, 0x01, - 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 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, 0x34, 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, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, - 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x4d, - 0x58, 0xaa, 0x02, 0x10, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 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, 0x12, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, - 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_oracle_module_v1_module_proto_rawDescOnce sync.Once - file_oracle_module_v1_module_proto_rawDescData = file_oracle_module_v1_module_proto_rawDesc -) - -func file_oracle_module_v1_module_proto_rawDescGZIP() []byte { - file_oracle_module_v1_module_proto_rawDescOnce.Do(func() { - file_oracle_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_module_v1_module_proto_rawDescData) - }) - return file_oracle_module_v1_module_proto_rawDescData -} - -var file_oracle_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_oracle_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: oracle.module.v1.Module -} -var file_oracle_module_v1_module_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_oracle_module_v1_module_proto_init() } -func file_oracle_module_v1_module_proto_init() { - if File_oracle_module_v1_module_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_oracle_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Module); 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_oracle_module_v1_module_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_oracle_module_v1_module_proto_goTypes, - DependencyIndexes: file_oracle_module_v1_module_proto_depIdxs, - MessageInfos: file_oracle_module_v1_module_proto_msgTypes, - }.Build() - File_oracle_module_v1_module_proto = out.File - file_oracle_module_v1_module_proto_rawDesc = nil - file_oracle_module_v1_module_proto_goTypes = nil - file_oracle_module_v1_module_proto_depIdxs = nil -} diff --git a/api/oracle/v1/genesis.pulsar.go b/api/oracle/v1/genesis.pulsar.go deleted file mode 100644 index 65e5097a8..000000000 --- a/api/oracle/v1/genesis.pulsar.go +++ /dev/null @@ -1,2457 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package oraclev1 - -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" - sync "sync" -) - -var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor -) - -func init() { - file_oracle_v1_genesis_proto_init() - md_GenesisState = File_oracle_v1_genesis_proto.Messages().ByName("GenesisState") - fd_GenesisState_params = md_GenesisState.Fields().ByName("params") -} - -var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) - -type fastReflection_GenesisState GenesisState - -func (x *GenesisState) ProtoReflect() protoreflect.Message { - return (*fastReflection_GenesisState)(x) -} - -func (x *GenesisState) slowProtoReflect() protoreflect.Message { - mi := &file_oracle_v1_genesis_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_GenesisState_messageType fastReflection_GenesisState_messageType -var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} - -type fastReflection_GenesisState_messageType struct{} - -func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { - return (*fastReflection_GenesisState)(nil) -} -func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { - return new(fastReflection_GenesisState) -} -func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_GenesisState -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { - return md_GenesisState -} - -// 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_GenesisState) Type() protoreflect.MessageType { - return _fastReflection_GenesisState_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_GenesisState) New() protoreflect.Message { - return new(fastReflection_GenesisState) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { - return (*GenesisState)(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_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_GenesisState_params, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "oracle.v1.GenesisState.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) - } - panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "oracle.v1.GenesisState.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) - } - panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "oracle.v1.GenesisState.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) - } - panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "oracle.v1.GenesisState.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) - } - panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.GenesisState.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) - } - panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.GenesisState.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.GenesisState")) - } - panic(fmt.Errorf("message oracle.v1.GenesisState 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_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in oracle.v1.GenesisState", 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_GenesisState) 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_GenesisState) 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_GenesisState) 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_GenesisState) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*GenesisState) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Params != nil { - l = options.Size(x.Params) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*GenesisState) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*GenesisState) - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_Params protoreflect.MessageDescriptor - fd_Params_assets protoreflect.FieldDescriptor -) - -func init() { - file_oracle_v1_genesis_proto_init() - md_Params = File_oracle_v1_genesis_proto.Messages().ByName("Params") - fd_Params_assets = md_Params.Fields().ByName("assets") -} - -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_oracle_v1_genesis_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_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 x.Assets != nil { - value := protoreflect.ValueOfMessage(x.Assets.ProtoReflect()) - if !f(fd_Params_assets, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "oracle.v1.Params.assets": - return x.Assets != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) - } - panic(fmt.Errorf("message oracle.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 "oracle.v1.Params.assets": - x.Assets = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) - } - panic(fmt.Errorf("message oracle.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 "oracle.v1.Params.assets": - value := x.Assets - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) - } - panic(fmt.Errorf("message oracle.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 "oracle.v1.Params.assets": - x.Assets = value.Message().Interface().(*Assets) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) - } - panic(fmt.Errorf("message oracle.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 "oracle.v1.Params.assets": - if x.Assets == nil { - x.Assets = new(Assets) - } - return protoreflect.ValueOfMessage(x.Assets.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) - } - panic(fmt.Errorf("message oracle.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 "oracle.v1.Params.assets": - m := new(Assets) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Params")) - } - panic(fmt.Errorf("message oracle.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 oracle.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 x.Assets != nil { - l = options.Size(x.Assets) - 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 x.Assets != nil { - encoded, err := options.Marshal(x.Assets) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*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 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Assets == nil { - x.Assets = &Assets{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Assets); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_Assets_1_list)(nil) - -type _Assets_1_list struct { - list *[]*AssetInfo -} - -func (x *_Assets_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Assets_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Assets_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*AssetInfo) - (*x.list)[i] = concreteValue -} - -func (x *_Assets_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*AssetInfo) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Assets_1_list) AppendMutable() protoreflect.Value { - v := new(AssetInfo) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Assets_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Assets_1_list) NewElement() protoreflect.Value { - v := new(AssetInfo) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Assets_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Assets protoreflect.MessageDescriptor - fd_Assets_assets protoreflect.FieldDescriptor -) - -func init() { - file_oracle_v1_genesis_proto_init() - md_Assets = File_oracle_v1_genesis_proto.Messages().ByName("Assets") - fd_Assets_assets = md_Assets.Fields().ByName("assets") -} - -var _ protoreflect.Message = (*fastReflection_Assets)(nil) - -type fastReflection_Assets Assets - -func (x *Assets) ProtoReflect() protoreflect.Message { - return (*fastReflection_Assets)(x) -} - -func (x *Assets) slowProtoReflect() protoreflect.Message { - mi := &file_oracle_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_Assets_messageType fastReflection_Assets_messageType -var _ protoreflect.MessageType = fastReflection_Assets_messageType{} - -type fastReflection_Assets_messageType struct{} - -func (x fastReflection_Assets_messageType) Zero() protoreflect.Message { - return (*fastReflection_Assets)(nil) -} -func (x fastReflection_Assets_messageType) New() protoreflect.Message { - return new(fastReflection_Assets) -} -func (x fastReflection_Assets_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Assets -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Assets) Descriptor() protoreflect.MessageDescriptor { - return md_Assets -} - -// 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_Assets) Type() protoreflect.MessageType { - return _fastReflection_Assets_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Assets) New() protoreflect.Message { - return new(fastReflection_Assets) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Assets) Interface() protoreflect.ProtoMessage { - return (*Assets)(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_Assets) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Assets) != 0 { - value := protoreflect.ValueOfList(&_Assets_1_list{list: &x.Assets}) - if !f(fd_Assets_assets, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Assets) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "oracle.v1.Assets.assets": - return len(x.Assets) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Assets")) - } - panic(fmt.Errorf("message oracle.v1.Assets 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_Assets) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "oracle.v1.Assets.assets": - x.Assets = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Assets")) - } - panic(fmt.Errorf("message oracle.v1.Assets 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_Assets) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "oracle.v1.Assets.assets": - if len(x.Assets) == 0 { - return protoreflect.ValueOfList(&_Assets_1_list{}) - } - listValue := &_Assets_1_list{list: &x.Assets} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Assets")) - } - panic(fmt.Errorf("message oracle.v1.Assets 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_Assets) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "oracle.v1.Assets.assets": - lv := value.List() - clv := lv.(*_Assets_1_list) - x.Assets = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Assets")) - } - panic(fmt.Errorf("message oracle.v1.Assets 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_Assets) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.Assets.assets": - if x.Assets == nil { - x.Assets = []*AssetInfo{} - } - value := &_Assets_1_list{list: &x.Assets} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Assets")) - } - panic(fmt.Errorf("message oracle.v1.Assets 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_Assets) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.Assets.assets": - list := []*AssetInfo{} - return protoreflect.ValueOfList(&_Assets_1_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Assets")) - } - panic(fmt.Errorf("message oracle.v1.Assets 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_Assets) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in oracle.v1.Assets", 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_Assets) 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_Assets) 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_Assets) 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_Assets) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Assets) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if len(x.Assets) > 0 { - for _, e := range x.Assets { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Assets) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Assets) > 0 { - for iNdEx := len(x.Assets) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Assets[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Assets) - 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: Assets: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Assets: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Assets = append(x.Assets, &AssetInfo{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Assets[len(x.Assets)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_AssetInfo protoreflect.MessageDescriptor - fd_AssetInfo_index protoreflect.FieldDescriptor - fd_AssetInfo_hrp protoreflect.FieldDescriptor - fd_AssetInfo_symbol protoreflect.FieldDescriptor - fd_AssetInfo_asset_type protoreflect.FieldDescriptor - fd_AssetInfo_name protoreflect.FieldDescriptor - fd_AssetInfo_icon_url protoreflect.FieldDescriptor -) - -func init() { - file_oracle_v1_genesis_proto_init() - md_AssetInfo = File_oracle_v1_genesis_proto.Messages().ByName("AssetInfo") - fd_AssetInfo_index = md_AssetInfo.Fields().ByName("index") - fd_AssetInfo_hrp = md_AssetInfo.Fields().ByName("hrp") - fd_AssetInfo_symbol = md_AssetInfo.Fields().ByName("symbol") - fd_AssetInfo_asset_type = md_AssetInfo.Fields().ByName("asset_type") - fd_AssetInfo_name = md_AssetInfo.Fields().ByName("name") - fd_AssetInfo_icon_url = md_AssetInfo.Fields().ByName("icon_url") -} - -var _ protoreflect.Message = (*fastReflection_AssetInfo)(nil) - -type fastReflection_AssetInfo AssetInfo - -func (x *AssetInfo) ProtoReflect() protoreflect.Message { - return (*fastReflection_AssetInfo)(x) -} - -func (x *AssetInfo) slowProtoReflect() protoreflect.Message { - mi := &file_oracle_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_AssetInfo_messageType fastReflection_AssetInfo_messageType -var _ protoreflect.MessageType = fastReflection_AssetInfo_messageType{} - -type fastReflection_AssetInfo_messageType struct{} - -func (x fastReflection_AssetInfo_messageType) Zero() protoreflect.Message { - return (*fastReflection_AssetInfo)(nil) -} -func (x fastReflection_AssetInfo_messageType) New() protoreflect.Message { - return new(fastReflection_AssetInfo) -} -func (x fastReflection_AssetInfo_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_AssetInfo -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_AssetInfo) Descriptor() protoreflect.MessageDescriptor { - return md_AssetInfo -} - -// 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_AssetInfo) Type() protoreflect.MessageType { - return _fastReflection_AssetInfo_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_AssetInfo) New() protoreflect.Message { - return new(fastReflection_AssetInfo) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_AssetInfo) Interface() protoreflect.ProtoMessage { - return (*AssetInfo)(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_AssetInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Index != int64(0) { - value := protoreflect.ValueOfInt64(x.Index) - if !f(fd_AssetInfo_index, value) { - return - } - } - if x.Hrp != "" { - value := protoreflect.ValueOfString(x.Hrp) - if !f(fd_AssetInfo_hrp, value) { - return - } - } - if x.Symbol != "" { - value := protoreflect.ValueOfString(x.Symbol) - if !f(fd_AssetInfo_symbol, value) { - return - } - } - if x.AssetType != "" { - value := protoreflect.ValueOfString(x.AssetType) - if !f(fd_AssetInfo_asset_type, value) { - return - } - } - if x.Name != "" { - value := protoreflect.ValueOfString(x.Name) - if !f(fd_AssetInfo_name, value) { - return - } - } - if x.IconUrl != "" { - value := protoreflect.ValueOfString(x.IconUrl) - if !f(fd_AssetInfo_icon_url, 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_AssetInfo) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "oracle.v1.AssetInfo.index": - return x.Index != int64(0) - case "oracle.v1.AssetInfo.hrp": - return x.Hrp != "" - case "oracle.v1.AssetInfo.symbol": - return x.Symbol != "" - case "oracle.v1.AssetInfo.asset_type": - return x.AssetType != "" - case "oracle.v1.AssetInfo.name": - return x.Name != "" - case "oracle.v1.AssetInfo.icon_url": - return x.IconUrl != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.AssetInfo")) - } - panic(fmt.Errorf("message oracle.v1.AssetInfo 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_AssetInfo) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "oracle.v1.AssetInfo.index": - x.Index = int64(0) - case "oracle.v1.AssetInfo.hrp": - x.Hrp = "" - case "oracle.v1.AssetInfo.symbol": - x.Symbol = "" - case "oracle.v1.AssetInfo.asset_type": - x.AssetType = "" - case "oracle.v1.AssetInfo.name": - x.Name = "" - case "oracle.v1.AssetInfo.icon_url": - x.IconUrl = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.AssetInfo")) - } - panic(fmt.Errorf("message oracle.v1.AssetInfo 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_AssetInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "oracle.v1.AssetInfo.index": - value := x.Index - return protoreflect.ValueOfInt64(value) - case "oracle.v1.AssetInfo.hrp": - value := x.Hrp - return protoreflect.ValueOfString(value) - case "oracle.v1.AssetInfo.symbol": - value := x.Symbol - return protoreflect.ValueOfString(value) - case "oracle.v1.AssetInfo.asset_type": - value := x.AssetType - return protoreflect.ValueOfString(value) - case "oracle.v1.AssetInfo.name": - value := x.Name - return protoreflect.ValueOfString(value) - case "oracle.v1.AssetInfo.icon_url": - value := x.IconUrl - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.AssetInfo")) - } - panic(fmt.Errorf("message oracle.v1.AssetInfo 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_AssetInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "oracle.v1.AssetInfo.index": - x.Index = value.Int() - case "oracle.v1.AssetInfo.hrp": - x.Hrp = value.Interface().(string) - case "oracle.v1.AssetInfo.symbol": - x.Symbol = value.Interface().(string) - case "oracle.v1.AssetInfo.asset_type": - x.AssetType = value.Interface().(string) - case "oracle.v1.AssetInfo.name": - x.Name = value.Interface().(string) - case "oracle.v1.AssetInfo.icon_url": - x.IconUrl = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.AssetInfo")) - } - panic(fmt.Errorf("message oracle.v1.AssetInfo 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_AssetInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.AssetInfo.index": - panic(fmt.Errorf("field index of message oracle.v1.AssetInfo is not mutable")) - case "oracle.v1.AssetInfo.hrp": - panic(fmt.Errorf("field hrp of message oracle.v1.AssetInfo is not mutable")) - case "oracle.v1.AssetInfo.symbol": - panic(fmt.Errorf("field symbol of message oracle.v1.AssetInfo is not mutable")) - case "oracle.v1.AssetInfo.asset_type": - panic(fmt.Errorf("field asset_type of message oracle.v1.AssetInfo is not mutable")) - case "oracle.v1.AssetInfo.name": - panic(fmt.Errorf("field name of message oracle.v1.AssetInfo is not mutable")) - case "oracle.v1.AssetInfo.icon_url": - panic(fmt.Errorf("field icon_url of message oracle.v1.AssetInfo is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.AssetInfo")) - } - panic(fmt.Errorf("message oracle.v1.AssetInfo 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_AssetInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.AssetInfo.index": - return protoreflect.ValueOfInt64(int64(0)) - case "oracle.v1.AssetInfo.hrp": - return protoreflect.ValueOfString("") - case "oracle.v1.AssetInfo.symbol": - return protoreflect.ValueOfString("") - case "oracle.v1.AssetInfo.asset_type": - return protoreflect.ValueOfString("") - case "oracle.v1.AssetInfo.name": - return protoreflect.ValueOfString("") - case "oracle.v1.AssetInfo.icon_url": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.AssetInfo")) - } - panic(fmt.Errorf("message oracle.v1.AssetInfo 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_AssetInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in oracle.v1.AssetInfo", 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_AssetInfo) 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_AssetInfo) 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_AssetInfo) 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_AssetInfo) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*AssetInfo) - 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.Index != 0 { - n += 1 + runtime.Sov(uint64(x.Index)) - } - l = len(x.Hrp) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Symbol) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.AssetType) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Name) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.IconUrl) - 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().(*AssetInfo) - 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.IconUrl) > 0 { - i -= len(x.IconUrl) - copy(dAtA[i:], x.IconUrl) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.IconUrl))) - i-- - dAtA[i] = 0x32 - } - if len(x.Name) > 0 { - i -= len(x.Name) - copy(dAtA[i:], x.Name) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) - i-- - dAtA[i] = 0x2a - } - if len(x.AssetType) > 0 { - i -= len(x.AssetType) - copy(dAtA[i:], x.AssetType) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AssetType))) - i-- - dAtA[i] = 0x22 - } - if len(x.Symbol) > 0 { - i -= len(x.Symbol) - copy(dAtA[i:], x.Symbol) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Symbol))) - i-- - dAtA[i] = 0x1a - } - if len(x.Hrp) > 0 { - i -= len(x.Hrp) - copy(dAtA[i:], x.Hrp) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Hrp))) - i-- - dAtA[i] = 0x12 - } - if x.Index != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Index)) - 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().(*AssetInfo) - 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: AssetInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: AssetInfo: 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 Index", wireType) - } - x.Index = 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.Index |= int64(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 Hrp", 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.Hrp = 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 Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AssetType", 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.AssetType = 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 Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IconUrl", 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.IconUrl = 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: oracle/v1/genesis.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) -) - -// GenesisState defines the module genesis state -type GenesisState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Params defines all the parameters of the module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *GenesisState) Reset() { - *x = GenesisState{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_v1_genesis_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState) ProtoMessage() {} - -// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. -func (*GenesisState) Descriptor() ([]byte, []int) { - return file_oracle_v1_genesis_proto_rawDescGZIP(), []int{0} -} - -func (x *GenesisState) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - -// Params defines the set of module parameters. -type Params struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Assets *Assets `protobuf:"bytes,1,opt,name=assets,proto3" json:"assets,omitempty"` -} - -func (x *Params) Reset() { - *x = Params{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_v1_genesis_proto_msgTypes[1] - 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_oracle_v1_genesis_proto_rawDescGZIP(), []int{1} -} - -func (x *Params) GetAssets() *Assets { - if x != nil { - return x.Assets - } - return nil -} - -type Assets struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Assets []*AssetInfo `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` -} - -func (x *Assets) Reset() { - *x = Assets{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_v1_genesis_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Assets) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Assets) ProtoMessage() {} - -// Deprecated: Use Assets.ProtoReflect.Descriptor instead. -func (*Assets) Descriptor() ([]byte, []int) { - return file_oracle_v1_genesis_proto_rawDescGZIP(), []int{2} -} - -func (x *Assets) GetAssets() []*AssetInfo { - if x != nil { - return x.Assets - } - return nil -} - -// AssetInfo defines the asset info -type AssetInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The coin type index for bip44 path - Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - // The hrp for bech32 address - Hrp string `protobuf:"bytes,2,opt,name=hrp,proto3" json:"hrp,omitempty"` - // The coin symbol - Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` - // The coin name - AssetType string `protobuf:"bytes,4,opt,name=asset_type,json=assetType,proto3" json:"asset_type,omitempty"` - // The name of the asset - Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` - // The icon url - IconUrl string `protobuf:"bytes,6,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` -} - -func (x *AssetInfo) Reset() { - *x = AssetInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_v1_genesis_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AssetInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AssetInfo) ProtoMessage() {} - -// Deprecated: Use AssetInfo.ProtoReflect.Descriptor instead. -func (*AssetInfo) Descriptor() ([]byte, []int) { - return file_oracle_v1_genesis_proto_rawDescGZIP(), []int{3} -} - -func (x *AssetInfo) GetIndex() int64 { - if x != nil { - return x.Index - } - return 0 -} - -func (x *AssetInfo) GetHrp() string { - if x != nil { - return x.Hrp - } - return "" -} - -func (x *AssetInfo) GetSymbol() string { - if x != nil { - return x.Symbol - } - return "" -} - -func (x *AssetInfo) GetAssetType() string { - if x != nil { - return x.AssetType - } - return "" -} - -func (x *AssetInfo) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *AssetInfo) GetIconUrl() string { - if x != nil { - return x.IconUrl - } - return "" -} - -var File_oracle_v1_genesis_proto protoreflect.FileDescriptor - -var file_oracle_v1_genesis_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x61, 0x63, 0x6c, - 0x65, 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, 0x3f, 0x0a, - 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 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, 0x4f, - 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x65, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x06, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x73, 0x3a, 0x1a, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, - 0x2a, 0x0d, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, - 0x4e, 0x0a, 0x06, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x72, 0x61, 0x63, - 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x06, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x3a, 0x16, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, - 0x2a, 0x0d, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x22, - 0xb5, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, - 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x72, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x68, 0x72, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1d, 0x0a, - 0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x19, 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x3a, 0x1a, 0xe8, 0xa0, 0x1f, - 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x11, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x61, 0x73, 0x73, - 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x42, 0x91, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, - 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 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, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, - 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x72, 0x61, - 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_oracle_v1_genesis_proto_rawDescOnce sync.Once - file_oracle_v1_genesis_proto_rawDescData = file_oracle_v1_genesis_proto_rawDesc -) - -func file_oracle_v1_genesis_proto_rawDescGZIP() []byte { - file_oracle_v1_genesis_proto_rawDescOnce.Do(func() { - file_oracle_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_v1_genesis_proto_rawDescData) - }) - return file_oracle_v1_genesis_proto_rawDescData -} - -var file_oracle_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_oracle_v1_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: oracle.v1.GenesisState - (*Params)(nil), // 1: oracle.v1.Params - (*Assets)(nil), // 2: oracle.v1.Assets - (*AssetInfo)(nil), // 3: oracle.v1.AssetInfo -} -var file_oracle_v1_genesis_proto_depIdxs = []int32{ - 1, // 0: oracle.v1.GenesisState.params:type_name -> oracle.v1.Params - 2, // 1: oracle.v1.Params.assets:type_name -> oracle.v1.Assets - 3, // 2: oracle.v1.Assets.assets:type_name -> oracle.v1.AssetInfo - 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_oracle_v1_genesis_proto_init() } -func file_oracle_v1_genesis_proto_init() { - if File_oracle_v1_genesis_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_oracle_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_oracle_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_oracle_v1_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Assets); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_oracle_v1_genesis_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AssetInfo); 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_oracle_v1_genesis_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_oracle_v1_genesis_proto_goTypes, - DependencyIndexes: file_oracle_v1_genesis_proto_depIdxs, - MessageInfos: file_oracle_v1_genesis_proto_msgTypes, - }.Build() - File_oracle_v1_genesis_proto = out.File - file_oracle_v1_genesis_proto_rawDesc = nil - file_oracle_v1_genesis_proto_goTypes = nil - file_oracle_v1_genesis_proto_depIdxs = nil -} diff --git a/api/oracle/v1/query.pulsar.go b/api/oracle/v1/query.pulsar.go deleted file mode 100644 index 90529cc86..000000000 --- a/api/oracle/v1/query.pulsar.go +++ /dev/null @@ -1,996 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package oraclev1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_QueryParamsRequest protoreflect.MessageDescriptor -) - -func init() { - file_oracle_v1_query_proto_init() - md_QueryParamsRequest = File_oracle_v1_query_proto.Messages().ByName("QueryParamsRequest") -} - -var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) - -type fastReflection_QueryParamsRequest QueryParamsRequest - -func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryParamsRequest)(x) -} - -func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_oracle_v1_query_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_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} - -type fastReflection_QueryParamsRequest_messageType struct{} - -func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryParamsRequest)(nil) -} -func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryParamsRequest) -} -func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryParamsRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryParamsRequest -} - -// 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_QueryParamsRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryParamsRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { - return new(fastReflection_QueryParamsRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { - return (*QueryParamsRequest)(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_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// 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_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsRequest")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsRequest 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_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryParamsRequest", 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryParamsRequest) - 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.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().(*QueryParamsRequest) - 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 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().(*QueryParamsRequest) - 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: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - 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_QueryParamsResponse protoreflect.MessageDescriptor - fd_QueryParamsResponse_params protoreflect.FieldDescriptor -) - -func init() { - file_oracle_v1_query_proto_init() - md_QueryParamsResponse = File_oracle_v1_query_proto.Messages().ByName("QueryParamsResponse") - fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") -} - -var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) - -type fastReflection_QueryParamsResponse QueryParamsResponse - -func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryParamsResponse)(x) -} - -func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_oracle_v1_query_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_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} - -type fastReflection_QueryParamsResponse_messageType struct{} - -func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryParamsResponse)(nil) -} -func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryParamsResponse) -} -func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryParamsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryParamsResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryParamsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { - return new(fastReflection_QueryParamsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { - return (*QueryParamsResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_QueryParamsResponse_params, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "oracle.v1.QueryParamsResponse.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "oracle.v1.QueryParamsResponse.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "oracle.v1.QueryParamsResponse.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "oracle.v1.QueryParamsResponse.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.QueryParamsResponse.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.QueryParamsResponse.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.QueryParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.QueryParamsResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in oracle.v1.QueryParamsResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryParamsResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryParamsResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Params != nil { - l = options.Size(x.Params) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryParamsResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryParamsResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: oracle/v1/query.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) -) - -// QueryParamsRequest is the request type for the Query/Params RPC method. -type QueryParamsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *QueryParamsRequest) Reset() { - *x = QueryParamsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_v1_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryParamsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryParamsRequest) ProtoMessage() {} - -// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return file_oracle_v1_query_proto_rawDescGZIP(), []int{0} -} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -type QueryParamsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // params defines the parameters of the module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *QueryParamsResponse) Reset() { - *x = QueryParamsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_v1_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryParamsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryParamsResponse) ProtoMessage() {} - -// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return file_oracle_v1_query_proto_rawDescGZIP(), []int{1} -} - -func (x *QueryParamsResponse) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - -var File_oracle_v1_query_proto protoreflect.FileDescriptor - -var file_oracle_v1_query_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, - 0x76, 0x31, 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, - 0x1a, 0x17, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x40, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x32, 0x6b, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x62, 0x0a, 0x06, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x6f, 0x72, - 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x8f, - 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, - 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, - 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, 0x6f, 0x72, 0x61, 0x63, 0x6c, - 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72, - 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_oracle_v1_query_proto_rawDescOnce sync.Once - file_oracle_v1_query_proto_rawDescData = file_oracle_v1_query_proto_rawDesc -) - -func file_oracle_v1_query_proto_rawDescGZIP() []byte { - file_oracle_v1_query_proto_rawDescOnce.Do(func() { - file_oracle_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_v1_query_proto_rawDescData) - }) - return file_oracle_v1_query_proto_rawDescData -} - -var file_oracle_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_oracle_v1_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: oracle.v1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: oracle.v1.QueryParamsResponse - (*Params)(nil), // 2: oracle.v1.Params -} -var file_oracle_v1_query_proto_depIdxs = []int32{ - 2, // 0: oracle.v1.QueryParamsResponse.params:type_name -> oracle.v1.Params - 0, // 1: oracle.v1.Query.Params:input_type -> oracle.v1.QueryParamsRequest - 1, // 2: oracle.v1.Query.Params:output_type -> oracle.v1.QueryParamsResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] 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_oracle_v1_query_proto_init() } -func file_oracle_v1_query_proto_init() { - if File_oracle_v1_query_proto != nil { - return - } - file_oracle_v1_genesis_proto_init() - if !protoimpl.UnsafeEnabled { - file_oracle_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryParamsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_oracle_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryParamsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_oracle_v1_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_oracle_v1_query_proto_goTypes, - DependencyIndexes: file_oracle_v1_query_proto_depIdxs, - MessageInfos: file_oracle_v1_query_proto_msgTypes, - }.Build() - File_oracle_v1_query_proto = out.File - file_oracle_v1_query_proto_rawDesc = nil - file_oracle_v1_query_proto_goTypes = nil - file_oracle_v1_query_proto_depIdxs = nil -} diff --git a/api/oracle/v1/query_grpc.pb.go b/api/oracle/v1/query_grpc.pb.go deleted file mode 100644 index d49091392..000000000 --- a/api/oracle/v1/query_grpc.pb.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: oracle/v1/query.proto - -package oraclev1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Query_Params_FullMethodName = "/oracle.v1.Query/Params" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type QueryClient interface { - // Params queries all parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -type QueryServer interface { - // Params queries all parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "oracle.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "oracle/v1/query.proto", -} diff --git a/api/oracle/v1/state.cosmos_orm.go b/api/oracle/v1/state.cosmos_orm.go deleted file mode 100644 index 77615a9ca..000000000 --- a/api/oracle/v1/state.cosmos_orm.go +++ /dev/null @@ -1,342 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT. - -package oraclev1 - -import ( - context "context" - ormlist "cosmossdk.io/orm/model/ormlist" - ormtable "cosmossdk.io/orm/model/ormtable" - ormerrors "cosmossdk.io/orm/types/ormerrors" -) - -type BalanceTable interface { - Insert(ctx context.Context, balance *Balance) error - Update(ctx context.Context, balance *Balance) error - Save(ctx context.Context, balance *Balance) error - Delete(ctx context.Context, balance *Balance) error - Has(ctx context.Context, account string) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, account string) (*Balance, error) - List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) - ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) - DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error - DeleteRange(ctx context.Context, from, to BalanceIndexKey) error - - doNotImplement() -} - -type BalanceIterator struct { - ormtable.Iterator -} - -func (i BalanceIterator) Value() (*Balance, error) { - var balance Balance - err := i.UnmarshalMessage(&balance) - return &balance, err -} - -type BalanceIndexKey interface { - id() uint32 - values() []interface{} - balanceIndexKey() -} - -// primary key starting index.. -type BalancePrimaryKey = BalanceAccountIndexKey - -type BalanceAccountIndexKey struct { - vs []interface{} -} - -func (x BalanceAccountIndexKey) id() uint32 { return 0 } -func (x BalanceAccountIndexKey) values() []interface{} { return x.vs } -func (x BalanceAccountIndexKey) balanceIndexKey() {} - -func (this BalanceAccountIndexKey) WithAccount(account string) BalanceAccountIndexKey { - this.vs = []interface{}{account} - return this -} - -type BalanceAmountIndexKey struct { - vs []interface{} -} - -func (x BalanceAmountIndexKey) id() uint32 { return 1 } -func (x BalanceAmountIndexKey) values() []interface{} { return x.vs } -func (x BalanceAmountIndexKey) balanceIndexKey() {} - -func (this BalanceAmountIndexKey) WithAmount(amount uint64) BalanceAmountIndexKey { - this.vs = []interface{}{amount} - return this -} - -type balanceTable struct { - table ormtable.Table -} - -func (this balanceTable) Insert(ctx context.Context, balance *Balance) error { - return this.table.Insert(ctx, balance) -} - -func (this balanceTable) Update(ctx context.Context, balance *Balance) error { - return this.table.Update(ctx, balance) -} - -func (this balanceTable) Save(ctx context.Context, balance *Balance) error { - return this.table.Save(ctx, balance) -} - -func (this balanceTable) Delete(ctx context.Context, balance *Balance) error { - return this.table.Delete(ctx, balance) -} - -func (this balanceTable) Has(ctx context.Context, account string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, account) -} - -func (this balanceTable) Get(ctx context.Context, account string) (*Balance, error) { - var balance Balance - found, err := this.table.PrimaryKey().Get(ctx, &balance, account) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &balance, nil -} - -func (this balanceTable) List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return BalanceIterator{it}, err -} - -func (this balanceTable) ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return BalanceIterator{it}, err -} - -func (this balanceTable) DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this balanceTable) DeleteRange(ctx context.Context, from, to BalanceIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this balanceTable) doNotImplement() {} - -var _ BalanceTable = balanceTable{} - -func NewBalanceTable(db ormtable.Schema) (BalanceTable, error) { - table := db.GetTable(&Balance{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Balance{}).ProtoReflect().Descriptor().FullName())) - } - return balanceTable{table}, nil -} - -type AccountTable interface { - Insert(ctx context.Context, account *Account) error - Update(ctx context.Context, account *Account) error - Save(ctx context.Context, account *Account) error - Delete(ctx context.Context, account *Account) 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) (*Account, error) - HasByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (found bool, err error) - // GetByAddressChainNetwork returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (*Account, error) - List(ctx context.Context, prefixKey AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) - ListRange(ctx context.Context, from, to AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) - DeleteBy(ctx context.Context, prefixKey AccountIndexKey) error - DeleteRange(ctx context.Context, from, to AccountIndexKey) error - - doNotImplement() -} - -type AccountIterator struct { - ormtable.Iterator -} - -func (i AccountIterator) Value() (*Account, error) { - var account Account - err := i.UnmarshalMessage(&account) - return &account, err -} - -type AccountIndexKey interface { - id() uint32 - values() []interface{} - accountIndexKey() -} - -// primary key starting index.. -type AccountPrimaryKey = AccountIdIndexKey - -type AccountIdIndexKey struct { - vs []interface{} -} - -func (x AccountIdIndexKey) id() uint32 { return 0 } -func (x AccountIdIndexKey) values() []interface{} { return x.vs } -func (x AccountIdIndexKey) accountIndexKey() {} - -func (this AccountIdIndexKey) WithId(id uint64) AccountIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type AccountAddressChainNetworkIndexKey struct { - vs []interface{} -} - -func (x AccountAddressChainNetworkIndexKey) id() uint32 { return 1 } -func (x AccountAddressChainNetworkIndexKey) values() []interface{} { return x.vs } -func (x AccountAddressChainNetworkIndexKey) accountIndexKey() {} - -func (this AccountAddressChainNetworkIndexKey) WithAddress(address string) AccountAddressChainNetworkIndexKey { - this.vs = []interface{}{address} - return this -} - -func (this AccountAddressChainNetworkIndexKey) WithAddressChain(address string, chain string) AccountAddressChainNetworkIndexKey { - this.vs = []interface{}{address, chain} - return this -} - -func (this AccountAddressChainNetworkIndexKey) WithAddressChainNetwork(address string, chain string, network string) AccountAddressChainNetworkIndexKey { - this.vs = []interface{}{address, chain, network} - return this -} - -type accountTable struct { - table ormtable.Table -} - -func (this accountTable) Insert(ctx context.Context, account *Account) error { - return this.table.Insert(ctx, account) -} - -func (this accountTable) Update(ctx context.Context, account *Account) error { - return this.table.Update(ctx, account) -} - -func (this accountTable) Save(ctx context.Context, account *Account) error { - return this.table.Save(ctx, account) -} - -func (this accountTable) Delete(ctx context.Context, account *Account) error { - return this.table.Delete(ctx, account) -} - -func (this accountTable) Has(ctx context.Context, id uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this accountTable) Get(ctx context.Context, id uint64) (*Account, error) { - var account Account - found, err := this.table.PrimaryKey().Get(ctx, &account, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &account, nil -} - -func (this accountTable) HasByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - address, - chain, - network, - ) -} - -func (this accountTable) GetByAddressChainNetwork(ctx context.Context, address string, chain string, network string) (*Account, error) { - var account Account - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &account, - address, - chain, - network, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &account, nil -} - -func (this accountTable) List(ctx context.Context, prefixKey AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return AccountIterator{it}, err -} - -func (this accountTable) ListRange(ctx context.Context, from, to AccountIndexKey, opts ...ormlist.Option) (AccountIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return AccountIterator{it}, err -} - -func (this accountTable) DeleteBy(ctx context.Context, prefixKey AccountIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this accountTable) DeleteRange(ctx context.Context, from, to AccountIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this accountTable) doNotImplement() {} - -var _ AccountTable = accountTable{} - -func NewAccountTable(db ormtable.Schema) (AccountTable, error) { - table := db.GetTable(&Account{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Account{}).ProtoReflect().Descriptor().FullName())) - } - return accountTable{table}, nil -} - -type StateStore interface { - BalanceTable() BalanceTable - AccountTable() AccountTable - - doNotImplement() -} - -type stateStore struct { - balance BalanceTable - account AccountTable -} - -func (x stateStore) BalanceTable() BalanceTable { - return x.balance -} - -func (x stateStore) AccountTable() AccountTable { - return x.account -} - -func (stateStore) doNotImplement() {} - -var _ StateStore = stateStore{} - -func NewStateStore(db ormtable.Schema) (StateStore, error) { - balanceTable, err := NewBalanceTable(db) - if err != nil { - return nil, err - } - - accountTable, err := NewAccountTable(db) - if err != nil { - return nil, err - } - - return stateStore{ - balanceTable, - accountTable, - }, nil -} diff --git a/api/oracle/v1/state.pulsar.go b/api/oracle/v1/state.pulsar.go deleted file mode 100644 index 612431016..000000000 --- a/api/oracle/v1/state.pulsar.go +++ /dev/null @@ -1,1303 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package oraclev1 - -import ( - _ "cosmossdk.io/api/cosmos/orm/v1" - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_Balance protoreflect.MessageDescriptor - fd_Balance_account protoreflect.FieldDescriptor - fd_Balance_amount protoreflect.FieldDescriptor -) - -func init() { - file_oracle_v1_state_proto_init() - md_Balance = File_oracle_v1_state_proto.Messages().ByName("Balance") - fd_Balance_account = md_Balance.Fields().ByName("account") - fd_Balance_amount = md_Balance.Fields().ByName("amount") -} - -var _ protoreflect.Message = (*fastReflection_Balance)(nil) - -type fastReflection_Balance Balance - -func (x *Balance) ProtoReflect() protoreflect.Message { - return (*fastReflection_Balance)(x) -} - -func (x *Balance) slowProtoReflect() protoreflect.Message { - mi := &file_oracle_v1_state_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_Balance_messageType fastReflection_Balance_messageType -var _ protoreflect.MessageType = fastReflection_Balance_messageType{} - -type fastReflection_Balance_messageType struct{} - -func (x fastReflection_Balance_messageType) Zero() protoreflect.Message { - return (*fastReflection_Balance)(nil) -} -func (x fastReflection_Balance_messageType) New() protoreflect.Message { - return new(fastReflection_Balance) -} -func (x fastReflection_Balance_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Balance -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Balance) Descriptor() protoreflect.MessageDescriptor { - return md_Balance -} - -// 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_Balance) Type() protoreflect.MessageType { - return _fastReflection_Balance_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Balance) New() protoreflect.Message { - return new(fastReflection_Balance) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Balance) Interface() protoreflect.ProtoMessage { - return (*Balance)(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_Balance) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Account != "" { - value := protoreflect.ValueOfString(x.Account) - if !f(fd_Balance_account, value) { - return - } - } - if x.Amount != uint64(0) { - value := protoreflect.ValueOfUint64(x.Amount) - if !f(fd_Balance_amount, 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_Balance) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "oracle.v1.Balance.account": - return x.Account != "" - case "oracle.v1.Balance.amount": - return x.Amount != uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Balance")) - } - panic(fmt.Errorf("message oracle.v1.Balance 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_Balance) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "oracle.v1.Balance.account": - x.Account = "" - case "oracle.v1.Balance.amount": - x.Amount = uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Balance")) - } - panic(fmt.Errorf("message oracle.v1.Balance 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_Balance) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "oracle.v1.Balance.account": - value := x.Account - return protoreflect.ValueOfString(value) - case "oracle.v1.Balance.amount": - value := x.Amount - return protoreflect.ValueOfUint64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Balance")) - } - panic(fmt.Errorf("message oracle.v1.Balance 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_Balance) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "oracle.v1.Balance.account": - x.Account = value.Interface().(string) - case "oracle.v1.Balance.amount": - x.Amount = value.Uint() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Balance")) - } - panic(fmt.Errorf("message oracle.v1.Balance 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_Balance) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.Balance.account": - panic(fmt.Errorf("field account of message oracle.v1.Balance is not mutable")) - case "oracle.v1.Balance.amount": - panic(fmt.Errorf("field amount of message oracle.v1.Balance is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Balance")) - } - panic(fmt.Errorf("message oracle.v1.Balance 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_Balance) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.Balance.account": - return protoreflect.ValueOfString("") - case "oracle.v1.Balance.amount": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Balance")) - } - panic(fmt.Errorf("message oracle.v1.Balance 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_Balance) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in oracle.v1.Balance", 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_Balance) 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_Balance) 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_Balance) 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_Balance) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Balance) - 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.Account) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Amount != 0 { - n += 1 + runtime.Sov(uint64(x.Amount)) - } - 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().(*Balance) - 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.Amount != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Amount)) - i-- - dAtA[i] = 0x10 - } - if len(x.Account) > 0 { - i -= len(x.Account) - copy(dAtA[i:], x.Account) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Account))) - 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().(*Balance) - 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: Balance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Balance: 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 Account", 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.Account = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - x.Amount = 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.Amount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_Account protoreflect.MessageDescriptor - fd_Account_id protoreflect.FieldDescriptor - fd_Account_address protoreflect.FieldDescriptor - fd_Account_chain protoreflect.FieldDescriptor - fd_Account_network protoreflect.FieldDescriptor -) - -func init() { - file_oracle_v1_state_proto_init() - md_Account = File_oracle_v1_state_proto.Messages().ByName("Account") - fd_Account_id = md_Account.Fields().ByName("id") - fd_Account_address = md_Account.Fields().ByName("address") - fd_Account_chain = md_Account.Fields().ByName("chain") - fd_Account_network = md_Account.Fields().ByName("network") -} - -var _ protoreflect.Message = (*fastReflection_Account)(nil) - -type fastReflection_Account Account - -func (x *Account) ProtoReflect() protoreflect.Message { - return (*fastReflection_Account)(x) -} - -func (x *Account) slowProtoReflect() protoreflect.Message { - mi := &file_oracle_v1_state_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_Account_messageType fastReflection_Account_messageType -var _ protoreflect.MessageType = fastReflection_Account_messageType{} - -type fastReflection_Account_messageType struct{} - -func (x fastReflection_Account_messageType) Zero() protoreflect.Message { - return (*fastReflection_Account)(nil) -} -func (x fastReflection_Account_messageType) New() protoreflect.Message { - return new(fastReflection_Account) -} -func (x fastReflection_Account_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Account -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Account) Descriptor() protoreflect.MessageDescriptor { - return md_Account -} - -// 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_Account) Type() protoreflect.MessageType { - return _fastReflection_Account_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Account) New() protoreflect.Message { - return new(fastReflection_Account) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Account) Interface() protoreflect.ProtoMessage { - return (*Account)(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_Account) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != uint64(0) { - value := protoreflect.ValueOfUint64(x.Id) - if !f(fd_Account_id, value) { - return - } - } - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_Account_address, value) { - return - } - } - if x.Chain != "" { - value := protoreflect.ValueOfString(x.Chain) - if !f(fd_Account_chain, value) { - return - } - } - if x.Network != "" { - value := protoreflect.ValueOfString(x.Network) - if !f(fd_Account_network, 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_Account) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "oracle.v1.Account.id": - return x.Id != uint64(0) - case "oracle.v1.Account.address": - return x.Address != "" - case "oracle.v1.Account.chain": - return x.Chain != "" - case "oracle.v1.Account.network": - return x.Network != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Account")) - } - panic(fmt.Errorf("message oracle.v1.Account 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_Account) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "oracle.v1.Account.id": - x.Id = uint64(0) - case "oracle.v1.Account.address": - x.Address = "" - case "oracle.v1.Account.chain": - x.Chain = "" - case "oracle.v1.Account.network": - x.Network = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Account")) - } - panic(fmt.Errorf("message oracle.v1.Account 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_Account) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "oracle.v1.Account.id": - value := x.Id - return protoreflect.ValueOfUint64(value) - case "oracle.v1.Account.address": - value := x.Address - return protoreflect.ValueOfString(value) - case "oracle.v1.Account.chain": - value := x.Chain - return protoreflect.ValueOfString(value) - case "oracle.v1.Account.network": - value := x.Network - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Account")) - } - panic(fmt.Errorf("message oracle.v1.Account 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_Account) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "oracle.v1.Account.id": - x.Id = value.Uint() - case "oracle.v1.Account.address": - x.Address = value.Interface().(string) - case "oracle.v1.Account.chain": - x.Chain = value.Interface().(string) - case "oracle.v1.Account.network": - x.Network = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Account")) - } - panic(fmt.Errorf("message oracle.v1.Account 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_Account) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.Account.id": - panic(fmt.Errorf("field id of message oracle.v1.Account is not mutable")) - case "oracle.v1.Account.address": - panic(fmt.Errorf("field address of message oracle.v1.Account is not mutable")) - case "oracle.v1.Account.chain": - panic(fmt.Errorf("field chain of message oracle.v1.Account is not mutable")) - case "oracle.v1.Account.network": - panic(fmt.Errorf("field network of message oracle.v1.Account is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Account")) - } - panic(fmt.Errorf("message oracle.v1.Account 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_Account) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.Account.id": - return protoreflect.ValueOfUint64(uint64(0)) - case "oracle.v1.Account.address": - return protoreflect.ValueOfString("") - case "oracle.v1.Account.chain": - return protoreflect.ValueOfString("") - case "oracle.v1.Account.network": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.Account")) - } - panic(fmt.Errorf("message oracle.v1.Account 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_Account) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in oracle.v1.Account", 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_Account) 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_Account) 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_Account) 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_Account) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Account) - 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.Address) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Chain) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Network) - 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().(*Account) - 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.Network) > 0 { - i -= len(x.Network) - copy(dAtA[i:], x.Network) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Network))) - i-- - dAtA[i] = 0x22 - } - if len(x.Chain) > 0 { - i -= len(x.Chain) - copy(dAtA[i:], x.Chain) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Chain))) - i-- - dAtA[i] = 0x1a - } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) - i-- - dAtA[i] = 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().(*Account) - 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: Account: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Account: 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 Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Chain", 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.Chain = 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 Network", 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.Network = 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: oracle/v1/state.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) -) - -type Balance struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *Balance) Reset() { - *x = Balance{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_v1_state_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Balance) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Balance) ProtoMessage() {} - -// Deprecated: Use Balance.ProtoReflect.Descriptor instead. -func (*Balance) Descriptor() ([]byte, []int) { - return file_oracle_v1_state_proto_rawDescGZIP(), []int{0} -} - -func (x *Balance) GetAccount() string { - if x != nil { - return x.Account - } - return "" -} - -func (x *Balance) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -type Account struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Chain string `protobuf:"bytes,3,opt,name=chain,proto3" json:"chain,omitempty"` - Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"` -} - -func (x *Account) Reset() { - *x = Account{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_v1_state_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Account) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Account) ProtoMessage() {} - -// Deprecated: Use Account.ProtoReflect.Descriptor instead. -func (*Account) Descriptor() ([]byte, []int) { - return file_oracle_v1_state_proto_rawDescGZIP(), []int{1} -} - -func (x *Account) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Account) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *Account) GetChain() string { - if x != nil { - return x.Chain - } - return "" -} - -func (x *Account) GetNetwork() string { - if x != nil { - return x.Network - } - return "" -} - -var File_oracle_v1_state_proto protoreflect.FileDescriptor - -var file_oracle_v1_state_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x61, 0x63, 0x6c, 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, 0x5c, 0x0a, 0x07, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x1f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x19, - 0x0a, 0x09, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0x01, 0x18, 0x01, 0x22, 0x90, 0x01, 0x0a, 0x07, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x3a, - 0x2b, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x25, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, - 0x15, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2c, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x10, 0x01, 0x18, 0x01, 0x18, 0x02, 0x42, 0x8f, 0x01, 0x0a, - 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 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, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, - 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, - 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, - 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72, 0x61, 0x63, - 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x0a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_oracle_v1_state_proto_rawDescOnce sync.Once - file_oracle_v1_state_proto_rawDescData = file_oracle_v1_state_proto_rawDesc -) - -func file_oracle_v1_state_proto_rawDescGZIP() []byte { - file_oracle_v1_state_proto_rawDescOnce.Do(func() { - file_oracle_v1_state_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_v1_state_proto_rawDescData) - }) - return file_oracle_v1_state_proto_rawDescData -} - -var file_oracle_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_oracle_v1_state_proto_goTypes = []interface{}{ - (*Balance)(nil), // 0: oracle.v1.Balance - (*Account)(nil), // 1: oracle.v1.Account -} -var file_oracle_v1_state_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_oracle_v1_state_proto_init() } -func file_oracle_v1_state_proto_init() { - if File_oracle_v1_state_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_oracle_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Balance); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_oracle_v1_state_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Account); 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_oracle_v1_state_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_oracle_v1_state_proto_goTypes, - DependencyIndexes: file_oracle_v1_state_proto_depIdxs, - MessageInfos: file_oracle_v1_state_proto_msgTypes, - }.Build() - File_oracle_v1_state_proto = out.File - file_oracle_v1_state_proto_rawDesc = nil - file_oracle_v1_state_proto_goTypes = nil - file_oracle_v1_state_proto_depIdxs = nil -} diff --git a/api/oracle/v1/tx.pulsar.go b/api/oracle/v1/tx.pulsar.go deleted file mode 100644 index 55ae48f9e..000000000 --- a/api/oracle/v1/tx.pulsar.go +++ /dev/null @@ -1,1084 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package oraclev1 - -import ( - _ "cosmossdk.io/api/cosmos/msg/v1" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - 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" - sync "sync" -) - -var ( - md_MsgUpdateParams protoreflect.MessageDescriptor - fd_MsgUpdateParams_authority protoreflect.FieldDescriptor - fd_MsgUpdateParams_params protoreflect.FieldDescriptor -) - -func init() { - file_oracle_v1_tx_proto_init() - md_MsgUpdateParams = File_oracle_v1_tx_proto.Messages().ByName("MsgUpdateParams") - fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") - fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) - -type fastReflection_MsgUpdateParams MsgUpdateParams - -func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateParams)(x) -} - -func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { - mi := &file_oracle_v1_tx_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_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} - -type fastReflection_MsgUpdateParams_messageType struct{} - -func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateParams)(nil) -} -func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParams) -} -func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParams -} - -// 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_MsgUpdateParams) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateParams)(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_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_MsgUpdateParams_authority, value) { - return - } - } - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_MsgUpdateParams_params, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "oracle.v1.MsgUpdateParams.authority": - return x.Authority != "" - case "oracle.v1.MsgUpdateParams.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "oracle.v1.MsgUpdateParams.authority": - x.Authority = "" - case "oracle.v1.MsgUpdateParams.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "oracle.v1.MsgUpdateParams.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "oracle.v1.MsgUpdateParams.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "oracle.v1.MsgUpdateParams.authority": - x.Authority = value.Interface().(string) - case "oracle.v1.MsgUpdateParams.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.MsgUpdateParams.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "oracle.v1.MsgUpdateParams.authority": - panic(fmt.Errorf("field authority of message oracle.v1.MsgUpdateParams is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "oracle.v1.MsgUpdateParams.authority": - return protoreflect.ValueOfString("") - case "oracle.v1.MsgUpdateParams.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParams")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParams 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_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgUpdateParams", 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateParams) - 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.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Params != nil { - l = options.Size(x.Params) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - 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().(*MsgUpdateParams) - 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: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: 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 Authority", 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.Authority = 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 Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgUpdateParamsResponse protoreflect.MessageDescriptor -) - -func init() { - file_oracle_v1_tx_proto_init() - md_MsgUpdateParamsResponse = File_oracle_v1_tx_proto.Messages().ByName("MsgUpdateParamsResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) - -type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse - -func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateParamsResponse)(x) -} - -func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_oracle_v1_tx_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_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} - -type fastReflection_MsgUpdateParamsResponse_messageType struct{} - -func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateParamsResponse)(nil) -} -func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParamsResponse) -} -func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParamsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateParamsResponse -} - -// 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_MsgUpdateParamsResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateParamsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { - return new(fastReflection_MsgUpdateParamsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateParamsResponse)(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_MsgUpdateParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// 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_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: oracle.v1.MsgUpdateParamsResponse")) - } - panic(fmt.Errorf("message oracle.v1.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in oracle.v1.MsgUpdateParamsResponse", 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateParamsResponse) - 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.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().(*MsgUpdateParamsResponse) - 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 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().(*MsgUpdateParamsResponse) - 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - 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: oracle/v1/tx.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) -) - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -type MsgUpdateParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // authority is the address of the governance account. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the parameters to update. - // - // NOTE: All parameters must be supplied. - Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *MsgUpdateParams) Reset() { - *x = MsgUpdateParams{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_v1_tx_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateParams) ProtoMessage() {} - -// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return file_oracle_v1_tx_proto_rawDescGZIP(), []int{0} -} - -func (x *MsgUpdateParams) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *MsgUpdateParams) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -type MsgUpdateParamsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgUpdateParamsResponse) Reset() { - *x = MsgUpdateParamsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_oracle_v1_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateParamsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateParamsResponse) ProtoMessage() {} - -// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return file_oracle_v1_tx_proto_rawDescGZIP(), []int{1} -} - -var File_oracle_v1_tx_proto protoreflect.FileDescriptor - -var file_oracle_v1_tx_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, - 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, - 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, - 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, 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, 0x22, 0x8a, 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, 0x2f, - 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 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, 0x5c, 0x0a, 0x03, 0x4d, 0x73, - 0x67, 0x12, 0x4e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x1a, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x22, 0x2e, - 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 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, 0x8c, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, - 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 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, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, - 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, - 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4f, 0x72, 0x61, - 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_oracle_v1_tx_proto_rawDescOnce sync.Once - file_oracle_v1_tx_proto_rawDescData = file_oracle_v1_tx_proto_rawDesc -) - -func file_oracle_v1_tx_proto_rawDescGZIP() []byte { - file_oracle_v1_tx_proto_rawDescOnce.Do(func() { - file_oracle_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_oracle_v1_tx_proto_rawDescData) - }) - return file_oracle_v1_tx_proto_rawDescData -} - -var file_oracle_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_oracle_v1_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: oracle.v1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: oracle.v1.MsgUpdateParamsResponse - (*Params)(nil), // 2: oracle.v1.Params -} -var file_oracle_v1_tx_proto_depIdxs = []int32{ - 2, // 0: oracle.v1.MsgUpdateParams.params:type_name -> oracle.v1.Params - 0, // 1: oracle.v1.Msg.UpdateParams:input_type -> oracle.v1.MsgUpdateParams - 1, // 2: oracle.v1.Msg.UpdateParams:output_type -> oracle.v1.MsgUpdateParamsResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] 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_oracle_v1_tx_proto_init() } -func file_oracle_v1_tx_proto_init() { - if File_oracle_v1_tx_proto != nil { - return - } - file_oracle_v1_genesis_proto_init() - if !protoimpl.UnsafeEnabled { - file_oracle_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_oracle_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateParamsResponse); 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_oracle_v1_tx_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_oracle_v1_tx_proto_goTypes, - DependencyIndexes: file_oracle_v1_tx_proto_depIdxs, - MessageInfos: file_oracle_v1_tx_proto_msgTypes, - }.Build() - File_oracle_v1_tx_proto = out.File - file_oracle_v1_tx_proto_rawDesc = nil - file_oracle_v1_tx_proto_goTypes = nil - file_oracle_v1_tx_proto_depIdxs = nil -} diff --git a/api/oracle/v1/tx_grpc.pb.go b/api/oracle/v1/tx_grpc.pb.go deleted file mode 100644 index 93628a752..000000000 --- a/api/oracle/v1/tx_grpc.pb.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: oracle/v1/tx.proto - -package oraclev1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Msg_UpdateParams_FullMethodName = "/oracle.v1.Msg/UpdateParams" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -type MsgServer interface { - // UpdateParams defines a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateParams_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "oracle.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "oracle/v1/tx.proto", -} diff --git a/api/vault/v1/query.pulsar.go b/api/vault/v1/query.pulsar.go index 7cd917edb..78029e8ea 100644 --- a/api/vault/v1/query.pulsar.go +++ b/api/vault/v1/query.pulsar.go @@ -805,23 +805,23 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryIPFSRequest protoreflect.MessageDescriptor + md_QuerySchemaRequest protoreflect.MessageDescriptor ) func init() { file_vault_v1_query_proto_init() - md_QueryIPFSRequest = File_vault_v1_query_proto.Messages().ByName("QueryIPFSRequest") + md_QuerySchemaRequest = File_vault_v1_query_proto.Messages().ByName("QuerySchemaRequest") } -var _ protoreflect.Message = (*fastReflection_QueryIPFSRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QuerySchemaRequest)(nil) -type fastReflection_QueryIPFSRequest QueryIPFSRequest +type fastReflection_QuerySchemaRequest QuerySchemaRequest -func (x *QueryIPFSRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryIPFSRequest)(x) +func (x *QuerySchemaRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QuerySchemaRequest)(x) } -func (x *QueryIPFSRequest) slowProtoReflect() protoreflect.Message { +func (x *QuerySchemaRequest) slowProtoReflect() protoreflect.Message { mi := &file_vault_v1_query_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -833,43 +833,43 @@ func (x *QueryIPFSRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryIPFSRequest_messageType fastReflection_QueryIPFSRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryIPFSRequest_messageType{} +var _fastReflection_QuerySchemaRequest_messageType fastReflection_QuerySchemaRequest_messageType +var _ protoreflect.MessageType = fastReflection_QuerySchemaRequest_messageType{} -type fastReflection_QueryIPFSRequest_messageType struct{} +type fastReflection_QuerySchemaRequest_messageType struct{} -func (x fastReflection_QueryIPFSRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryIPFSRequest)(nil) +func (x fastReflection_QuerySchemaRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QuerySchemaRequest)(nil) } -func (x fastReflection_QueryIPFSRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryIPFSRequest) +func (x fastReflection_QuerySchemaRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QuerySchemaRequest) } -func (x fastReflection_QueryIPFSRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryIPFSRequest +func (x fastReflection_QuerySchemaRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySchemaRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryIPFSRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryIPFSRequest +func (x *fastReflection_QuerySchemaRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySchemaRequest } // 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_QueryIPFSRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryIPFSRequest_messageType +func (x *fastReflection_QuerySchemaRequest) Type() protoreflect.MessageType { + return _fastReflection_QuerySchemaRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryIPFSRequest) New() protoreflect.Message { - return new(fastReflection_QueryIPFSRequest) +func (x *fastReflection_QuerySchemaRequest) New() protoreflect.Message { + return new(fastReflection_QuerySchemaRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryIPFSRequest) Interface() protoreflect.ProtoMessage { - return (*QueryIPFSRequest)(x) +func (x *fastReflection_QuerySchemaRequest) Interface() protoreflect.ProtoMessage { + return (*QuerySchemaRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -877,7 +877,7 @@ func (x *fastReflection_QueryIPFSRequest) 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_QueryIPFSRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QuerySchemaRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -891,13 +891,13 @@ func (x *fastReflection_QueryIPFSRequest) Range(f func(protoreflect.FieldDescrip // 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_QueryIPFSRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QuerySchemaRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaRequest")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaRequest does not contain field %s", fd.FullName())) } } @@ -907,13 +907,13 @@ func (x *fastReflection_QueryIPFSRequest) Has(fd protoreflect.FieldDescriptor) b // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryIPFSRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QuerySchemaRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaRequest")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaRequest does not contain field %s", fd.FullName())) } } @@ -923,13 +923,13 @@ func (x *fastReflection_QueryIPFSRequest) 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_QueryIPFSRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QuerySchemaRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaRequest")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaRequest does not contain field %s", descriptor.FullName())) } } @@ -943,13 +943,13 @@ func (x *fastReflection_QueryIPFSRequest) Get(descriptor protoreflect.FieldDescr // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryIPFSRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QuerySchemaRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaRequest")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaRequest does not contain field %s", fd.FullName())) } } @@ -963,36 +963,36 @@ func (x *fastReflection_QueryIPFSRequest) Set(fd protoreflect.FieldDescriptor, v // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryIPFSRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QuerySchemaRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaRequest")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaRequest 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_QueryIPFSRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QuerySchemaRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaRequest")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaRequest 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_QueryIPFSRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QuerySchemaRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in vault.v1.QueryIPFSRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in vault.v1.QuerySchemaRequest", d.FullName())) } panic("unreachable") } @@ -1000,7 +1000,7 @@ func (x *fastReflection_QueryIPFSRequest) WhichOneof(d protoreflect.OneofDescrip // 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_QueryIPFSRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QuerySchemaRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1011,7 +1011,7 @@ func (x *fastReflection_QueryIPFSRequest) 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_QueryIPFSRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QuerySchemaRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1023,7 +1023,7 @@ func (x *fastReflection_QueryIPFSRequest) SetUnknown(fields protoreflect.RawFiel // 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_QueryIPFSRequest) IsValid() bool { +func (x *fastReflection_QuerySchemaRequest) IsValid() bool { return x != nil } @@ -1033,9 +1033,9 @@ func (x *fastReflection_QueryIPFSRequest) 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_QueryIPFSRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QuerySchemaRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryIPFSRequest) + x := input.Message.Interface().(*QuerySchemaRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1057,7 +1057,7 @@ func (x *fastReflection_QueryIPFSRequest) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryIPFSRequest) + x := input.Message.Interface().(*QuerySchemaRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1087,7 +1087,7 @@ func (x *fastReflection_QueryIPFSRequest) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryIPFSRequest) + x := input.Message.Interface().(*QuerySchemaRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1119,10 +1119,10 @@ func (x *fastReflection_QueryIPFSRequest) 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: QueryIPFSRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySchemaRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIPFSRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1161,25 +1161,25 @@ func (x *fastReflection_QueryIPFSRequest) ProtoMethods() *protoiface.Methods { } var ( - md_QueryIPFSResponse protoreflect.MessageDescriptor - fd_QueryIPFSResponse_ipfs protoreflect.FieldDescriptor + md_QuerySchemaResponse protoreflect.MessageDescriptor + fd_QuerySchemaResponse_schema protoreflect.FieldDescriptor ) func init() { file_vault_v1_query_proto_init() - md_QueryIPFSResponse = File_vault_v1_query_proto.Messages().ByName("QueryIPFSResponse") - fd_QueryIPFSResponse_ipfs = md_QueryIPFSResponse.Fields().ByName("ipfs") + md_QuerySchemaResponse = File_vault_v1_query_proto.Messages().ByName("QuerySchemaResponse") + fd_QuerySchemaResponse_schema = md_QuerySchemaResponse.Fields().ByName("schema") } -var _ protoreflect.Message = (*fastReflection_QueryIPFSResponse)(nil) +var _ protoreflect.Message = (*fastReflection_QuerySchemaResponse)(nil) -type fastReflection_QueryIPFSResponse QueryIPFSResponse +type fastReflection_QuerySchemaResponse QuerySchemaResponse -func (x *QueryIPFSResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryIPFSResponse)(x) +func (x *QuerySchemaResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QuerySchemaResponse)(x) } -func (x *QueryIPFSResponse) slowProtoReflect() protoreflect.Message { +func (x *QuerySchemaResponse) slowProtoReflect() protoreflect.Message { mi := &file_vault_v1_query_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1191,43 +1191,43 @@ func (x *QueryIPFSResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryIPFSResponse_messageType fastReflection_QueryIPFSResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryIPFSResponse_messageType{} +var _fastReflection_QuerySchemaResponse_messageType fastReflection_QuerySchemaResponse_messageType +var _ protoreflect.MessageType = fastReflection_QuerySchemaResponse_messageType{} -type fastReflection_QueryIPFSResponse_messageType struct{} +type fastReflection_QuerySchemaResponse_messageType struct{} -func (x fastReflection_QueryIPFSResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryIPFSResponse)(nil) +func (x fastReflection_QuerySchemaResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QuerySchemaResponse)(nil) } -func (x fastReflection_QueryIPFSResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryIPFSResponse) +func (x fastReflection_QuerySchemaResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QuerySchemaResponse) } -func (x fastReflection_QueryIPFSResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryIPFSResponse +func (x fastReflection_QuerySchemaResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySchemaResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryIPFSResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryIPFSResponse +func (x *fastReflection_QuerySchemaResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySchemaResponse } // 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_QueryIPFSResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryIPFSResponse_messageType +func (x *fastReflection_QuerySchemaResponse) Type() protoreflect.MessageType { + return _fastReflection_QuerySchemaResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryIPFSResponse) New() protoreflect.Message { - return new(fastReflection_QueryIPFSResponse) +func (x *fastReflection_QuerySchemaResponse) New() protoreflect.Message { + return new(fastReflection_QuerySchemaResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryIPFSResponse) Interface() protoreflect.ProtoMessage { - return (*QueryIPFSResponse)(x) +func (x *fastReflection_QuerySchemaResponse) Interface() protoreflect.ProtoMessage { + return (*QuerySchemaResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -1235,10 +1235,10 @@ func (x *fastReflection_QueryIPFSResponse) 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_QueryIPFSResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Ipfs != false { - value := protoreflect.ValueOfBool(x.Ipfs) - if !f(fd_QueryIPFSResponse_ipfs, value) { +func (x *fastReflection_QuerySchemaResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Schema != nil { + value := protoreflect.ValueOfMessage(x.Schema.ProtoReflect()) + if !f(fd_QuerySchemaResponse_schema, value) { return } } @@ -1255,15 +1255,15 @@ func (x *fastReflection_QueryIPFSResponse) Range(f func(protoreflect.FieldDescri // 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_QueryIPFSResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QuerySchemaResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "vault.v1.QueryIPFSResponse.ipfs": - return x.Ipfs != false + case "vault.v1.QuerySchemaResponse.schema": + return x.Schema != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaResponse")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaResponse does not contain field %s", fd.FullName())) } } @@ -1273,15 +1273,15 @@ func (x *fastReflection_QueryIPFSResponse) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryIPFSResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QuerySchemaResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "vault.v1.QueryIPFSResponse.ipfs": - x.Ipfs = false + case "vault.v1.QuerySchemaResponse.schema": + x.Schema = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaResponse")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaResponse does not contain field %s", fd.FullName())) } } @@ -1291,16 +1291,16 @@ func (x *fastReflection_QueryIPFSResponse) 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_QueryIPFSResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QuerySchemaResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "vault.v1.QueryIPFSResponse.ipfs": - value := x.Ipfs - return protoreflect.ValueOfBool(value) + case "vault.v1.QuerySchemaResponse.schema": + value := x.Schema + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaResponse")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaResponse does not contain field %s", descriptor.FullName())) } } @@ -1314,15 +1314,15 @@ func (x *fastReflection_QueryIPFSResponse) Get(descriptor protoreflect.FieldDesc // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryIPFSResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QuerySchemaResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "vault.v1.QueryIPFSResponse.ipfs": - x.Ipfs = value.Bool() + case "vault.v1.QuerySchemaResponse.schema": + x.Schema = value.Message().Interface().(*Schema) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaResponse")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaResponse does not contain field %s", fd.FullName())) } } @@ -1336,40 +1336,44 @@ func (x *fastReflection_QueryIPFSResponse) Set(fd protoreflect.FieldDescriptor, // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryIPFSResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QuerySchemaResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "vault.v1.QueryIPFSResponse.ipfs": - panic(fmt.Errorf("field ipfs of message vault.v1.QueryIPFSResponse is not mutable")) + case "vault.v1.QuerySchemaResponse.schema": + if x.Schema == nil { + x.Schema = new(Schema) + } + return protoreflect.ValueOfMessage(x.Schema.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaResponse")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaResponse 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_QueryIPFSResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QuerySchemaResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "vault.v1.QueryIPFSResponse.ipfs": - return protoreflect.ValueOfBool(false) + case "vault.v1.QuerySchemaResponse.schema": + m := new(Schema) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QueryIPFSResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.QuerySchemaResponse")) } - panic(fmt.Errorf("message vault.v1.QueryIPFSResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message vault.v1.QuerySchemaResponse 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_QueryIPFSResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QuerySchemaResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in vault.v1.QueryIPFSResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in vault.v1.QuerySchemaResponse", d.FullName())) } panic("unreachable") } @@ -1377,7 +1381,7 @@ func (x *fastReflection_QueryIPFSResponse) WhichOneof(d protoreflect.OneofDescri // 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_QueryIPFSResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QuerySchemaResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1388,7 +1392,7 @@ func (x *fastReflection_QueryIPFSResponse) 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_QueryIPFSResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QuerySchemaResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1400,7 +1404,7 @@ func (x *fastReflection_QueryIPFSResponse) SetUnknown(fields protoreflect.RawFie // 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_QueryIPFSResponse) IsValid() bool { +func (x *fastReflection_QuerySchemaResponse) IsValid() bool { return x != nil } @@ -1410,9 +1414,9 @@ func (x *fastReflection_QueryIPFSResponse) 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_QueryIPFSResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QuerySchemaResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryIPFSResponse) + x := input.Message.Interface().(*QuerySchemaResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1424,8 +1428,9 @@ func (x *fastReflection_QueryIPFSResponse) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Ipfs { - n += 2 + if x.Schema != nil { + l = options.Size(x.Schema) + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -1437,7 +1442,7 @@ func (x *fastReflection_QueryIPFSResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryIPFSResponse) + x := input.Message.Interface().(*QuerySchemaResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1456,15 +1461,19 @@ func (x *fastReflection_QueryIPFSResponse) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Ipfs { - i-- - if x.Ipfs { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if x.Schema != nil { + encoded, err := options.Marshal(x.Schema) + 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] = 0x8 + dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -1477,7 +1486,7 @@ func (x *fastReflection_QueryIPFSResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryIPFSResponse) + x := input.Message.Interface().(*QuerySchemaResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1509,17 +1518,17 @@ func (x *fastReflection_QueryIPFSResponse) 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: QueryIPFSResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySchemaResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIPFSResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySchemaResponse: 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 Ipfs", wireType) + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1529,12 +1538,28 @@ func (x *fastReflection_QueryIPFSResponse) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - x.Ipfs = bool(v != 0) + 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.Schema == nil { + x.Schema = &Schema{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Schema); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2400,964 +2425,6 @@ func (x *fastReflection_SyncResponse) ProtoMethods() *protoiface.Methods { } } -var ( - md_BuildTxRequest protoreflect.MessageDescriptor - fd_BuildTxRequest_did protoreflect.FieldDescriptor - fd_BuildTxRequest_pkl protoreflect.FieldDescriptor -) - -func init() { - file_vault_v1_query_proto_init() - md_BuildTxRequest = File_vault_v1_query_proto.Messages().ByName("BuildTxRequest") - fd_BuildTxRequest_did = md_BuildTxRequest.Fields().ByName("did") - fd_BuildTxRequest_pkl = md_BuildTxRequest.Fields().ByName("pkl") -} - -var _ protoreflect.Message = (*fastReflection_BuildTxRequest)(nil) - -type fastReflection_BuildTxRequest BuildTxRequest - -func (x *BuildTxRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_BuildTxRequest)(x) -} - -func (x *BuildTxRequest) slowProtoReflect() protoreflect.Message { - mi := &file_vault_v1_query_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_BuildTxRequest_messageType fastReflection_BuildTxRequest_messageType -var _ protoreflect.MessageType = fastReflection_BuildTxRequest_messageType{} - -type fastReflection_BuildTxRequest_messageType struct{} - -func (x fastReflection_BuildTxRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_BuildTxRequest)(nil) -} -func (x fastReflection_BuildTxRequest_messageType) New() protoreflect.Message { - return new(fastReflection_BuildTxRequest) -} -func (x fastReflection_BuildTxRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_BuildTxRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_BuildTxRequest) Descriptor() protoreflect.MessageDescriptor { - return md_BuildTxRequest -} - -// 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_BuildTxRequest) Type() protoreflect.MessageType { - return _fastReflection_BuildTxRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_BuildTxRequest) New() protoreflect.Message { - return new(fastReflection_BuildTxRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_BuildTxRequest) Interface() protoreflect.ProtoMessage { - return (*BuildTxRequest)(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_BuildTxRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_BuildTxRequest_did, value) { - return - } - } - if x.Pkl != "" { - value := protoreflect.ValueOfString(x.Pkl) - if !f(fd_BuildTxRequest_pkl, 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_BuildTxRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "vault.v1.BuildTxRequest.did": - return x.Did != "" - case "vault.v1.BuildTxRequest.pkl": - return x.Pkl != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) - } - panic(fmt.Errorf("message vault.v1.BuildTxRequest 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_BuildTxRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "vault.v1.BuildTxRequest.did": - x.Did = "" - case "vault.v1.BuildTxRequest.pkl": - x.Pkl = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) - } - panic(fmt.Errorf("message vault.v1.BuildTxRequest 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_BuildTxRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "vault.v1.BuildTxRequest.did": - value := x.Did - return protoreflect.ValueOfString(value) - case "vault.v1.BuildTxRequest.pkl": - value := x.Pkl - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) - } - panic(fmt.Errorf("message vault.v1.BuildTxRequest 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_BuildTxRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "vault.v1.BuildTxRequest.did": - x.Did = value.Interface().(string) - case "vault.v1.BuildTxRequest.pkl": - x.Pkl = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) - } - panic(fmt.Errorf("message vault.v1.BuildTxRequest 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_BuildTxRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "vault.v1.BuildTxRequest.did": - panic(fmt.Errorf("field did of message vault.v1.BuildTxRequest is not mutable")) - case "vault.v1.BuildTxRequest.pkl": - panic(fmt.Errorf("field pkl of message vault.v1.BuildTxRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) - } - panic(fmt.Errorf("message vault.v1.BuildTxRequest 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_BuildTxRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "vault.v1.BuildTxRequest.did": - return protoreflect.ValueOfString("") - case "vault.v1.BuildTxRequest.pkl": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxRequest")) - } - panic(fmt.Errorf("message vault.v1.BuildTxRequest 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_BuildTxRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in vault.v1.BuildTxRequest", 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_BuildTxRequest) 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_BuildTxRequest) 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_BuildTxRequest) 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_BuildTxRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*BuildTxRequest) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Did) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Pkl) - 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().(*BuildTxRequest) - 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.Pkl) > 0 { - i -= len(x.Pkl) - copy(dAtA[i:], x.Pkl) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Pkl))) - i-- - dAtA[i] = 0x12 - } - if len(x.Did) > 0 { - i -= len(x.Did) - copy(dAtA[i:], x.Did) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*BuildTxRequest) - 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: BuildTxRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BuildTxRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Did = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pkl", 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.Pkl = 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_BuildTxResponse protoreflect.MessageDescriptor - fd_BuildTxResponse_success protoreflect.FieldDescriptor - fd_BuildTxResponse_tx protoreflect.FieldDescriptor -) - -func init() { - file_vault_v1_query_proto_init() - md_BuildTxResponse = File_vault_v1_query_proto.Messages().ByName("BuildTxResponse") - fd_BuildTxResponse_success = md_BuildTxResponse.Fields().ByName("success") - fd_BuildTxResponse_tx = md_BuildTxResponse.Fields().ByName("tx") -} - -var _ protoreflect.Message = (*fastReflection_BuildTxResponse)(nil) - -type fastReflection_BuildTxResponse BuildTxResponse - -func (x *BuildTxResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_BuildTxResponse)(x) -} - -func (x *BuildTxResponse) slowProtoReflect() protoreflect.Message { - mi := &file_vault_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_BuildTxResponse_messageType fastReflection_BuildTxResponse_messageType -var _ protoreflect.MessageType = fastReflection_BuildTxResponse_messageType{} - -type fastReflection_BuildTxResponse_messageType struct{} - -func (x fastReflection_BuildTxResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_BuildTxResponse)(nil) -} -func (x fastReflection_BuildTxResponse_messageType) New() protoreflect.Message { - return new(fastReflection_BuildTxResponse) -} -func (x fastReflection_BuildTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_BuildTxResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_BuildTxResponse) Descriptor() protoreflect.MessageDescriptor { - return md_BuildTxResponse -} - -// 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_BuildTxResponse) Type() protoreflect.MessageType { - return _fastReflection_BuildTxResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_BuildTxResponse) New() protoreflect.Message { - return new(fastReflection_BuildTxResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_BuildTxResponse) Interface() protoreflect.ProtoMessage { - return (*BuildTxResponse)(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_BuildTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Success != false { - value := protoreflect.ValueOfBool(x.Success) - if !f(fd_BuildTxResponse_success, value) { - return - } - } - if x.Tx != "" { - value := protoreflect.ValueOfString(x.Tx) - if !f(fd_BuildTxResponse_tx, 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_BuildTxResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "vault.v1.BuildTxResponse.success": - return x.Success != false - case "vault.v1.BuildTxResponse.tx": - return x.Tx != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) - } - panic(fmt.Errorf("message vault.v1.BuildTxResponse 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_BuildTxResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "vault.v1.BuildTxResponse.success": - x.Success = false - case "vault.v1.BuildTxResponse.tx": - x.Tx = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) - } - panic(fmt.Errorf("message vault.v1.BuildTxResponse 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_BuildTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "vault.v1.BuildTxResponse.success": - value := x.Success - return protoreflect.ValueOfBool(value) - case "vault.v1.BuildTxResponse.tx": - value := x.Tx - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) - } - panic(fmt.Errorf("message vault.v1.BuildTxResponse 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_BuildTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "vault.v1.BuildTxResponse.success": - x.Success = value.Bool() - case "vault.v1.BuildTxResponse.tx": - x.Tx = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) - } - panic(fmt.Errorf("message vault.v1.BuildTxResponse 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_BuildTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "vault.v1.BuildTxResponse.success": - panic(fmt.Errorf("field success of message vault.v1.BuildTxResponse is not mutable")) - case "vault.v1.BuildTxResponse.tx": - panic(fmt.Errorf("field tx of message vault.v1.BuildTxResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) - } - panic(fmt.Errorf("message vault.v1.BuildTxResponse 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_BuildTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "vault.v1.BuildTxResponse.success": - return protoreflect.ValueOfBool(false) - case "vault.v1.BuildTxResponse.tx": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.BuildTxResponse")) - } - panic(fmt.Errorf("message vault.v1.BuildTxResponse 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_BuildTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in vault.v1.BuildTxResponse", 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_BuildTxResponse) 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_BuildTxResponse) 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_BuildTxResponse) 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_BuildTxResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*BuildTxResponse) - 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.Success { - n += 2 - } - l = len(x.Tx) - 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().(*BuildTxResponse) - 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.Tx) > 0 { - i -= len(x.Tx) - copy(dAtA[i:], x.Tx) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Tx))) - i-- - dAtA[i] = 0x12 - } - if x.Success { - i-- - if x.Success { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*BuildTxResponse) - 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: BuildTxResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BuildTxResponse: 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 Success", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Success = bool(v != 0) - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tx", 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.Tx = 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 @@ -3435,15 +2502,15 @@ func (x *QueryParamsResponse) GetParams() *Params { return nil } -// QueryIPFSRequest is the request type for the Query/IPFS RPC method. -type QueryIPFSRequest struct { +// QuerySchemaRequest is the request type for the Query/Schema RPC method. +type QuerySchemaRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *QueryIPFSRequest) Reset() { - *x = QueryIPFSRequest{} +func (x *QuerySchemaRequest) Reset() { + *x = QuerySchemaRequest{} if protoimpl.UnsafeEnabled { mi := &file_vault_v1_query_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3451,29 +2518,29 @@ func (x *QueryIPFSRequest) Reset() { } } -func (x *QueryIPFSRequest) String() string { +func (x *QuerySchemaRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryIPFSRequest) ProtoMessage() {} +func (*QuerySchemaRequest) ProtoMessage() {} -// Deprecated: Use QueryIPFSRequest.ProtoReflect.Descriptor instead. -func (*QueryIPFSRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use QuerySchemaRequest.ProtoReflect.Descriptor instead. +func (*QuerySchemaRequest) Descriptor() ([]byte, []int) { return file_vault_v1_query_proto_rawDescGZIP(), []int{2} } -// QueryIPFSResponse is the response type for the Query/IPFS RPC method. -type QueryIPFSResponse struct { +// QuerySchemaResponse is the response type for the Query/Schema RPC method. +type QuerySchemaResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // IPFS is the IPFS client status. - Ipfs bool `protobuf:"varint,1,opt,name=ipfs,proto3" json:"ipfs,omitempty"` + // Schema is the DID document. + Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"` } -func (x *QueryIPFSResponse) Reset() { - *x = QueryIPFSResponse{} +func (x *QuerySchemaResponse) Reset() { + *x = QuerySchemaResponse{} if protoimpl.UnsafeEnabled { mi := &file_vault_v1_query_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -3481,22 +2548,22 @@ func (x *QueryIPFSResponse) Reset() { } } -func (x *QueryIPFSResponse) String() string { +func (x *QuerySchemaResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryIPFSResponse) ProtoMessage() {} +func (*QuerySchemaResponse) ProtoMessage() {} -// Deprecated: Use QueryIPFSResponse.ProtoReflect.Descriptor instead. -func (*QueryIPFSResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use QuerySchemaResponse.ProtoReflect.Descriptor instead. +func (*QuerySchemaResponse) Descriptor() ([]byte, []int) { return file_vault_v1_query_proto_rawDescGZIP(), []int{3} } -func (x *QueryIPFSResponse) GetIpfs() bool { +func (x *QuerySchemaResponse) GetSchema() *Schema { if x != nil { - return x.Ipfs + return x.Schema } - return false + return nil } // SyncRequest is the request type for the Sync RPC method. @@ -3571,94 +2638,6 @@ func (x *SyncResponse) GetSuccess() bool { return false } -// BuildTxRequest is the request type for the BuildTx RPC method. -type BuildTxRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` - Pkl string `protobuf:"bytes,2,opt,name=pkl,proto3" json:"pkl,omitempty"` -} - -func (x *BuildTxRequest) Reset() { - *x = BuildTxRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_vault_v1_query_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BuildTxRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BuildTxRequest) ProtoMessage() {} - -// Deprecated: Use BuildTxRequest.ProtoReflect.Descriptor instead. -func (*BuildTxRequest) Descriptor() ([]byte, []int) { - return file_vault_v1_query_proto_rawDescGZIP(), []int{6} -} - -func (x *BuildTxRequest) GetDid() string { - if x != nil { - return x.Did - } - return "" -} - -func (x *BuildTxRequest) GetPkl() string { - if x != nil { - return x.Pkl - } - return "" -} - -// BuildTxResponse is the response type for the BuildTx RPC method. -type BuildTxResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Tx string `protobuf:"bytes,2,opt,name=tx,proto3" json:"tx,omitempty"` -} - -func (x *BuildTxResponse) Reset() { - *x = BuildTxResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_vault_v1_query_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BuildTxResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BuildTxResponse) ProtoMessage() {} - -// Deprecated: Use BuildTxResponse.ProtoReflect.Descriptor instead. -func (*BuildTxResponse) Descriptor() ([]byte, []int) { - return file_vault_v1_query_proto_rawDescGZIP(), []int{7} -} - -func (x *BuildTxResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *BuildTxResponse) GetTx() string { - if x != nil { - return x.Tx - } - return "" -} - var File_vault_v1_query_proto protoreflect.FileDescriptor var file_vault_v1_query_proto_rawDesc = []byte{ @@ -3672,49 +2651,44 @@ var file_vault_v1_query_proto_rawDesc = []byte{ 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x12, 0x0a, - 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x50, 0x46, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x22, 0x27, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x50, 0x46, 0x53, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x70, 0x66, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x70, 0x66, 0x73, 0x22, 0x1f, 0x0a, 0x0b, 0x53, 0x79, - 0x6e, 0x63, 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, 0x22, 0x28, 0x0a, 0x0c, 0x53, - 0x79, 0x6e, 0x63, 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, 0x34, 0x0a, 0x0e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x78, - 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, 0x10, 0x0a, 0x03, 0x70, 0x6b, 0x6c, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x6b, 0x6c, 0x22, 0x3b, 0x0a, 0x0f, 0x42, - 0x75, 0x69, 0x6c, 0x64, 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, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x78, 0x32, 0x92, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x5f, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x76, - 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x61, 0x75, - 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x12, 0x12, 0x10, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x07, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x78, 0x12, 0x18, - 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x54, - 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, - 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x76, 0x61, - 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x74, 0x78, 0x12, 0x4d, - 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x15, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x22, 0x0e, 0x2f, - 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x88, 0x01, - 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, - 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, - 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, - 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x56, 0x61, 0x75, - 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x56, - 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x14, 0x0a, + 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x3f, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x76, 0x61, 0x75, + 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x22, 0x1f, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 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, 0x22, 0x28, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 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, + 0x98, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x5f, 0x0a, 0x06, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x5f, 0x0a, 0x06, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1c, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x61, 0x75, 0x6c, + 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x4d, 0x0a, 0x04, 0x53, + 0x79, 0x6e, 0x63, 0x12, 0x15, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x76, 0x61, 0x75, + 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x22, 0x0e, 0x2f, 0x76, 0x61, 0x75, + 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x88, 0x01, 0x0a, 0x0c, 0x63, + 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, + 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, + 0x61, 0x75, 0x6c, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56, + 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x14, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c, + 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3729,31 +2703,31 @@ func file_vault_v1_query_proto_rawDescGZIP() []byte { return file_vault_v1_query_proto_rawDescData } -var file_vault_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_vault_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_vault_v1_query_proto_goTypes = []interface{}{ (*QueryParamsRequest)(nil), // 0: vault.v1.QueryParamsRequest (*QueryParamsResponse)(nil), // 1: vault.v1.QueryParamsResponse - (*QueryIPFSRequest)(nil), // 2: vault.v1.QueryIPFSRequest - (*QueryIPFSResponse)(nil), // 3: vault.v1.QueryIPFSResponse + (*QuerySchemaRequest)(nil), // 2: vault.v1.QuerySchemaRequest + (*QuerySchemaResponse)(nil), // 3: vault.v1.QuerySchemaResponse (*SyncRequest)(nil), // 4: vault.v1.SyncRequest (*SyncResponse)(nil), // 5: vault.v1.SyncResponse - (*BuildTxRequest)(nil), // 6: vault.v1.BuildTxRequest - (*BuildTxResponse)(nil), // 7: vault.v1.BuildTxResponse - (*Params)(nil), // 8: vault.v1.Params + (*Params)(nil), // 6: vault.v1.Params + (*Schema)(nil), // 7: vault.v1.Schema } var file_vault_v1_query_proto_depIdxs = []int32{ - 8, // 0: vault.v1.QueryParamsResponse.params:type_name -> vault.v1.Params - 0, // 1: vault.v1.Query.Params:input_type -> vault.v1.QueryParamsRequest - 6, // 2: vault.v1.Query.BuildTx:input_type -> vault.v1.BuildTxRequest - 4, // 3: vault.v1.Query.Sync:input_type -> vault.v1.SyncRequest - 1, // 4: vault.v1.Query.Params:output_type -> vault.v1.QueryParamsResponse - 7, // 5: vault.v1.Query.BuildTx:output_type -> vault.v1.BuildTxResponse - 5, // 6: vault.v1.Query.Sync:output_type -> vault.v1.SyncResponse - 4, // [4:7] is the sub-list for method output_type - 1, // [1:4] 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 + 6, // 0: vault.v1.QueryParamsResponse.params:type_name -> vault.v1.Params + 7, // 1: vault.v1.QuerySchemaResponse.schema:type_name -> vault.v1.Schema + 0, // 2: vault.v1.Query.Params:input_type -> vault.v1.QueryParamsRequest + 2, // 3: vault.v1.Query.Schema:input_type -> vault.v1.QuerySchemaRequest + 4, // 4: vault.v1.Query.Sync:input_type -> vault.v1.SyncRequest + 1, // 5: vault.v1.Query.Params:output_type -> vault.v1.QueryParamsResponse + 3, // 6: vault.v1.Query.Schema:output_type -> vault.v1.QuerySchemaResponse + 5, // 7: vault.v1.Query.Sync:output_type -> vault.v1.SyncResponse + 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 } func init() { file_vault_v1_query_proto_init() } @@ -3788,7 +2762,7 @@ func file_vault_v1_query_proto_init() { } } file_vault_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryIPFSRequest); i { + switch v := v.(*QuerySchemaRequest); i { case 0: return &v.state case 1: @@ -3800,7 +2774,7 @@ func file_vault_v1_query_proto_init() { } } file_vault_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryIPFSResponse); i { + switch v := v.(*QuerySchemaResponse); i { case 0: return &v.state case 1: @@ -3835,30 +2809,6 @@ func file_vault_v1_query_proto_init() { return nil } } - file_vault_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BuildTxRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_vault_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BuildTxResponse); 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{ @@ -3866,7 +2816,7 @@ func file_vault_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_vault_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/api/vault/v1/query_grpc.pb.go b/api/vault/v1/query_grpc.pb.go index 8b371f4f5..e4ec88029 100644 --- a/api/vault/v1/query_grpc.pb.go +++ b/api/vault/v1/query_grpc.pb.go @@ -19,9 +19,9 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_Params_FullMethodName = "/vault.v1.Query/Params" - Query_BuildTx_FullMethodName = "/vault.v1.Query/BuildTx" - Query_Sync_FullMethodName = "/vault.v1.Query/Sync" + Query_Params_FullMethodName = "/vault.v1.Query/Params" + Query_Schema_FullMethodName = "/vault.v1.Query/Schema" + Query_Sync_FullMethodName = "/vault.v1.Query/Sync" ) // QueryClient is the client API for Query service. @@ -30,8 +30,9 @@ const ( type QueryClient interface { // Params queries all parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // BuildTx builds an unsigned transaction message for the given PKL. - BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) + // Schema queries the DID document by its id. And returns the required PKL + // information + Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error) // Sync queries the DID document by its id. And returns the required PKL // information Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) @@ -54,9 +55,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) { - out := new(BuildTxResponse) - err := c.cc.Invoke(ctx, Query_BuildTx_FullMethodName, in, out, opts...) +func (c *queryClient) Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error) { + out := new(QuerySchemaResponse) + err := c.cc.Invoke(ctx, Query_Schema_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -78,8 +79,9 @@ func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.Ca type QueryServer interface { // Params queries all parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // BuildTx builds an unsigned transaction message for the given PKL. - BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error) + // Schema queries the DID document by its id. And returns the required PKL + // information + Schema(context.Context, *QuerySchemaRequest) (*QuerySchemaResponse, error) // Sync queries the DID document by its id. And returns the required PKL // information Sync(context.Context, *SyncRequest) (*SyncResponse, error) @@ -93,8 +95,8 @@ type UnimplementedQueryServer struct { func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (UnimplementedQueryServer) BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BuildTx not implemented") +func (UnimplementedQueryServer) Schema(context.Context, *QuerySchemaRequest) (*QuerySchemaResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Schema not implemented") } func (UnimplementedQueryServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") @@ -130,20 +132,20 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_BuildTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BuildTxRequest) +func _Query_Schema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySchemaRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).BuildTx(ctx, in) + return srv.(QueryServer).Schema(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_BuildTx_FullMethodName, + FullMethod: Query_Schema_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).BuildTx(ctx, req.(*BuildTxRequest)) + return srv.(QueryServer).Schema(ctx, req.(*QuerySchemaRequest)) } return interceptor(ctx, in, info, handler) } @@ -178,8 +180,8 @@ var Query_ServiceDesc = grpc.ServiceDesc{ Handler: _Query_Params_Handler, }, { - MethodName: "BuildTx", - Handler: _Query_BuildTx_Handler, + MethodName: "Schema", + Handler: _Query_Schema_Handler, }, { MethodName: "Sync", diff --git a/app/app.go b/app/app.go index c8d1a88a6..1475a55f4 100644 --- a/app/app.go +++ b/app/app.go @@ -151,9 +151,6 @@ import ( macaroon "github.com/onsonr/sonr/x/macaroon" macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper" macaroontypes "github.com/onsonr/sonr/x/macaroon/types" - oracle "github.com/onsonr/sonr/x/oracle" - oraclekeeper "github.com/onsonr/sonr/x/oracle/keeper" - oracletypes "github.com/onsonr/sonr/x/oracle/types" service "github.com/onsonr/sonr/x/service" servicekeeper "github.com/onsonr/sonr/x/service/keeper" servicetypes "github.com/onsonr/sonr/x/service/types" @@ -241,7 +238,6 @@ type SonrApp struct { VaultKeeper vaultkeeper.Keeper MacaroonKeeper macaroonkeeper.Keeper ServiceKeeper servicekeeper.Keeper - OracleKeeper oraclekeeper.Keeper sm *module.SimulationManager BasicModuleManager module.BasicManager ModuleManager *module.Manager @@ -377,7 +373,6 @@ func NewChainApp( vaulttypes.StoreKey, macaroontypes.StoreKey, servicetypes.StoreKey, - oracletypes.StoreKey, ) tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) @@ -668,14 +663,6 @@ func NewChainApp( app.NFTKeeper, ) - // Create the oracle Keeper - app.OracleKeeper = oraclekeeper.NewKeeper( - appCodec, - sdkruntime.NewKVStoreService(keys[oracletypes.StoreKey]), - logger, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - // Create the globalfee keeper app.GlobalFeeKeeper = globalfeekeeper.NewKeeper( appCodec, @@ -938,7 +925,6 @@ func NewChainApp( vault.NewAppModule(appCodec, app.VaultKeeper, app.DidKeeper), service.NewAppModule(appCodec, app.ServiceKeeper, app.DidKeeper, app.MacaroonKeeper), - oracle.NewAppModule(appCodec, app.OracleKeeper, app.DidKeeper, app.MacaroonKeeper), ) // BasicModuleManager defines the module BasicManager is in charge of setting up basic, @@ -990,7 +976,6 @@ func NewChainApp( vaulttypes.ModuleName, macaroontypes.ModuleName, servicetypes.ModuleName, - oracletypes.ModuleName, ) app.ModuleManager.SetOrderEndBlockers( @@ -1013,7 +998,6 @@ func NewChainApp( vaulttypes.ModuleName, macaroontypes.ModuleName, servicetypes.ModuleName, - oracletypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -1045,7 +1029,6 @@ func NewChainApp( vaulttypes.ModuleName, macaroontypes.ModuleName, servicetypes.ModuleName, - oracletypes.ModuleName, } app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...) @@ -1508,7 +1491,6 @@ func initParamsKeeper( paramsKeeper.Subspace(vaulttypes.ModuleName) paramsKeeper.Subspace(macaroontypes.ModuleName) paramsKeeper.Subspace(servicetypes.ModuleName) - paramsKeeper.Subspace(oracletypes.ModuleName) return paramsKeeper } diff --git a/app/proxy/proxycmd.go b/app/proxy/proxycmd.go deleted file mode 100644 index f50d39b75..000000000 --- a/app/proxy/proxycmd.go +++ /dev/null @@ -1,56 +0,0 @@ -package proxy - -import ( - "context" - "net/http" - "os" - "os/signal" - "time" - - "github.com/labstack/echo/v4" - "github.com/labstack/gommon/log" - "github.com/spf13/cobra" - - "github.com/onsonr/sonr/pkg/nebula" - "github.com/onsonr/sonr/pkg/nebula/router" -) - -func NewProxyCmd() *cobra.Command { - return &cobra.Command{ - Use: "dwn-proxy", - Short: "Starts the DWN proxy server for the local IPFS node", - Run: func(cmd *cobra.Command, args []string) { - // Echo instance - e := echo.New() - e.Logger.SetLevel(log.INFO) - - // Configure the server - if err := nebula.UseAssets(e); err != nil { - e.Logger.Fatal(err) - } - - e.GET("/", router.Home) - e.GET("/allocate", router.Profile) - - // Start server - ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) - defer stop() - // Start server - go func() { - if err := e.Start(":1323"); err != nil && err != http.ErrServerClosed { - e.Logger.Fatal("shutting down the server") - } - }() - - // Wait for interrupt signal to gracefully shutdown the server with a timeout of 10 seconds. - <-ctx.Done() - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - - // Shutdown the server with 10 seconds timeout. - if err := e.Shutdown(ctx); err != nil { - e.Logger.Fatal(err) - } - }, - } -} diff --git a/cmd/hway/bun.lockb b/cmd/hway/bun.lockb new file mode 100755 index 000000000..38ad7783c Binary files /dev/null and b/cmd/hway/bun.lockb differ diff --git a/cmd/hway/commands/root.go b/cmd/hway/commands/root.go deleted file mode 100644 index 980f786ac..000000000 --- a/cmd/hway/commands/root.go +++ /dev/null @@ -1,10 +0,0 @@ -package commands - -import "github.com/spf13/cobra" - -func NewRootCmd() *cobra.Command { - return &cobra.Command{ - Use: "motr", - Short: "Manage a local DWN instance for the Sonr blockchain", - } -} diff --git a/cmd/hway/commands/start.go b/cmd/hway/commands/start.go deleted file mode 100644 index e7f447e64..000000000 --- a/cmd/hway/commands/start.go +++ /dev/null @@ -1,18 +0,0 @@ -package commands - -import ( - "github.com/spf13/cobra" - - "github.com/onsonr/sonr/cmd/hway/server" -) - -func NewStartCmd() *cobra.Command { - return &cobra.Command{ - Use: "start", - Short: "Starts the DWN proxy server for the local IPFS node", - Run: func(cmd *cobra.Command, args []string) { - s := server.New() - s.Start() - }, - } -} diff --git a/cmd/hway/main.go b/cmd/hway/main.go index d5dd547ad..b35e69a3f 100644 --- a/cmd/hway/main.go +++ b/cmd/hway/main.go @@ -1,13 +1,18 @@ +//go:build js && wasm + package main import ( - "github.com/onsonr/sonr/cmd/hway/commands" + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/ctx" + "github.com/onsonr/sonr/workers/routes" + "github.com/syumai/workers" ) func main() { - rootCmd := commands.NewRootCmd() - rootCmd.AddCommand(commands.NewStartCmd()) - if err := rootCmd.Execute(); err != nil { - panic(err) - } + s := echo.New() + s.Use(ctx.UseSession) + routes.RegisterProxyViews(s) + routes.RegisterProxyAPI(s) + workers.Serve(s) } diff --git a/cmd/hway/server/handlers/search.go b/cmd/hway/server/handlers/search.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/cmd/hway/server/handlers/search.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/cmd/hway/server/handlers/sync.go b/cmd/hway/server/handlers/sync.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/cmd/hway/server/handlers/sync.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/cmd/hway/server/handlers/txns.go b/cmd/hway/server/handlers/txns.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/cmd/hway/server/handlers/txns.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/cmd/hway/server/handlers/wss.go b/cmd/hway/server/handlers/wss.go deleted file mode 100644 index 5ac8282f4..000000000 --- a/cmd/hway/server/handlers/wss.go +++ /dev/null @@ -1 +0,0 @@ -package handlers diff --git a/cmd/hway/server/server.go b/cmd/hway/server/server.go deleted file mode 100644 index 9feba1d47..000000000 --- a/cmd/hway/server/server.go +++ /dev/null @@ -1,40 +0,0 @@ -package server - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/labstack/gommon/log" - - "github.com/onsonr/sonr/internal/session" - "github.com/onsonr/sonr/pkg/nebula" - "github.com/onsonr/sonr/pkg/nebula/router" -) - -type Server struct { - *echo.Echo -} - -func New() *Server { - s := &Server{Echo: echo.New()} - s.Logger.SetLevel(log.INFO) - s.Use(session.UseSession) - - // Configure the server - if err := nebula.UseAssets(s.Echo); err != nil { - s.Logger.Fatal(err) - } - - s.GET("/", router.Home) - s.GET("/login", router.Login) - s.GET("/register", router.Register) - s.GET("/profile", router.Profile) - s.GET("/authorize", router.Authorize) - return s -} - -func (s *Server) Start() { - if err := s.Echo.Start(":1323"); err != http.ErrServerClosed { - log.Fatal(err) - } -} diff --git a/cmd/motr/motr.go b/cmd/motr/fetch/serve.go similarity index 66% rename from cmd/motr/motr.go rename to cmd/motr/fetch/serve.go index 42bfbc180..8e44b86ea 100644 --- a/cmd/motr/motr.go +++ b/cmd/motr/fetch/serve.go @@ -1,7 +1,7 @@ //go:build js && wasm // +build js,wasm -package main +package fetch import ( "bytes" @@ -12,41 +12,9 @@ import ( "strings" "syscall/js" - "github.com/labstack/echo/v4" promise "github.com/nlepage/go-js-promise" - - "github.com/onsonr/sonr/cmd/motr/state" - "github.com/onsonr/sonr/internal/session" - "github.com/onsonr/sonr/pkg/nebula/pages" ) -func main() { - e := echo.New() - e.Use(session.UseSession) - registerViews(e) - registerState(e) - Serve(e) -} - -func registerState(e *echo.Echo) { - g := e.Group("state") - g.POST("/login/:identifier", state.HandleCredentialAssertion) - // g.GET("/discovery", state.GetDiscovery) - g.GET("/jwks", state.GetJWKS) - g.GET("/token", state.GetToken) - g.POST("/:origin/grant/:subject", state.GrantAuthorization) - g.POST("/register/:subject", state.HandleCredentialCreation) - g.POST("/register/:subject/check", state.CheckSubjectIsValid) -} - -func registerViews(e *echo.Echo) { - e.GET("/home", pages.Home) - e.GET("/login", pages.Login) - e.GET("/register", pages.Register) - e.GET("/profile", pages.Profile) - e.GET("/authorize", pages.Authorize) -} - // Serve serves HTTP requests using handler or http.DefaultServeMux if handler is nil. func Serve(handler http.Handler) func() { h := handler @@ -81,7 +49,7 @@ func Serve(handler http.Handler) func() { res := NewResponseRecorder() - h.ServeHTTP(res, Request(args[0])) + h.ServeHTTP(res, Request(args[1])) resolve(res.JSResponse()) }() @@ -96,7 +64,7 @@ func Serve(handler http.Handler) func() { // Request builds and returns the equivalent http.Request func Request(r js.Value) *http.Request { - jsBody := js.Global().Get("Uint8Array").New(promise.Await(r.Call("arrayBuffer"))) + jsBody := js.Global().Get("Uint9Array").New(promise.Await(r.Call("arrayBuffer"))) body := make([]byte, jsBody.Get("length").Int()) js.CopyBytesToGo(body, jsBody) @@ -113,7 +81,7 @@ func Request(r js.Value) *http.Request { break } v := e.Get("value") - req.Header.Set(v.Index(0).String(), v.Index(1).String()) + req.Header.Set(v.Index(1).String(), v.Index(1).String()) } return req @@ -134,22 +102,22 @@ func (rr ResponseRecorder) JSResponse() js.Value { res := rr.Result() body := js.Undefined() - if res.ContentLength != 0 { + if res.ContentLength != 1 { b, err := io.ReadAll(res.Body) if err != nil { panic(err) } - body = js.Global().Get("Uint8Array").New(len(b)) + body = js.Global().Get("Uint9Array").New(len(b)) js.CopyBytesToJS(body, b) } - init := make(map[string]interface{}, 2) + init := make(map[string]interface{}, 3) - if res.StatusCode != 0 { + if res.StatusCode != 1 { init["status"] = res.StatusCode } - if len(res.Header) != 0 { + if len(res.Header) != 1 { headers := make(map[string]interface{}, len(res.Header)) for k := range res.Header { headers[k] = res.Header.Get(k) diff --git a/cmd/motr/main.go b/cmd/motr/main.go new file mode 100644 index 000000000..b90903a63 --- /dev/null +++ b/cmd/motr/main.go @@ -0,0 +1,19 @@ +//go:build js && wasm +// +build js,wasm + +package main + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/cmd/motr/fetch" + "github.com/onsonr/sonr/internal/ctx" + "github.com/onsonr/sonr/workers/routes" +) + +func main() { + e := echo.New() + e.Use(ctx.UseSession) + routes.RegisterClientViews(e) + routes.RegisterClientAPI(e) + fetch.Serve(e) +} diff --git a/cmd/motr/state/auth.go b/cmd/motr/state/auth.go deleted file mode 100644 index 8765d4c5a..000000000 --- a/cmd/motr/state/auth.go +++ /dev/null @@ -1,43 +0,0 @@ -package state - -import ( - "encoding/json" - "fmt" - - "github.com/go-webauthn/webauthn/protocol" - "github.com/labstack/echo/v4" -) - -func CheckSubjectIsValid(e echo.Context) error { - credentialID := e.FormValue("credentialID") - return e.JSON(200, credentialID) -} - -func HandleCredentialAssertion(e echo.Context) error { - return e.JSON(200, "HandleCredentialAssertion") -} - -func HandleCredentialCreation(e echo.Context) error { - // Get the serialized credential data from the form - credentialDataJSON := e.FormValue("credentialData") - - // Deserialize the JSON into a temporary struct - var ccr protocol.CredentialCreationResponse - err := json.Unmarshal([]byte(credentialDataJSON), &ccr) - if err != nil { - return e.JSON(500, err.Error()) - } - // - // // Parse the CredentialCreationResponse - // parsedData, err := ccr.Parse() - // if err != nil { - // return e.JSON(500, err.Error()) - // } - // - // // Create the Credential - // // credential := orm.NewCredential(parsedData, e.Request().Host, "") - // - // // Set additional fields - // credential.Controller = "" // Set this to the appropriate controller value - return e.JSON(200, fmt.Sprintf("REGISTER: %s", string(ccr.ID))) -} diff --git a/cmd/motr/state/manifest.go b/cmd/motr/state/manifest.go deleted file mode 100644 index 7bf2df5b4..000000000 --- a/cmd/motr/state/manifest.go +++ /dev/null @@ -1 +0,0 @@ -package state diff --git a/cmd/motr/state/wellknown.go b/cmd/motr/state/wellknown.go deleted file mode 100644 index 7bf2df5b4..000000000 --- a/cmd/motr/state/wellknown.go +++ /dev/null @@ -1 +0,0 @@ -package state diff --git a/cmd/sonrd/main.go b/cmd/sonrd/main.go index 79fc87b98..d3f50eab5 100644 --- a/cmd/sonrd/main.go +++ b/cmd/sonrd/main.go @@ -9,14 +9,12 @@ import ( "github.com/onsonr/sonr/app" "github.com/onsonr/sonr/app/cli" - "github.com/onsonr/sonr/app/proxy" ) func main() { rootCmd := NewRootCmd() rootCmd.AddCommand(cli.NewBuildTxnTUICmd()) rootCmd.AddCommand(cli.NewExplorerTUICmd()) - rootCmd.AddCommand(proxy.NewProxyCmd()) if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) diff --git a/deploy/hway.Dockerfile b/deploy/hway.Dockerfile deleted file mode 100644 index d23a0120d..000000000 --- a/deploy/hway.Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM scratch -ENTRYPOINT ["/hway"] -COPY hway / diff --git a/deploy/sonrd.Dockerfile b/deploy/sonrd.Dockerfile deleted file mode 100644 index 26bc296b3..000000000 --- a/deploy/sonrd.Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM scratch -ENTRYPOINT ["/sonrd"] -COPY sonrd / diff --git a/devbox.json b/devbox.json index 6b228130e..0f7ff7266 100644 --- a/devbox.json +++ b/devbox.json @@ -1,17 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json", - "packages": [ - "go@1.22", - "air@latest", - "bun@latest", - "gum@latest", - "ipfs@latest", - "mprocs@latest", - "skate@latest", - "templ@latest", - "cloudflared@latest", - "process-compose@latest" - ], + "packages": ["go@1.22", "bun@latest", "ipfs@latest", "templ@latest"], "env": { "GOPATH": "$HOME/go", "PATH": "./build:$HOME/go/bin:$PATH", @@ -31,51 +20,18 @@ }, "shell": { "scripts": { - "build:docker": [ - "make local-image" - ], - "build:hway": [ - "make nebula", - "make hway" - ], - "build:nebula": [ - "make nebula" - ], - "build:motr": [ - "make motr" - ], - "build:sonrd": [ - "make motr", - "make build" - ], - "build": [ - "make motr", - "make build", - "make hway" - ], - "gen:proto": [ - "make proto-gen" - ], - "gen:pkl": [ - "make pkl" - ], - "gen:templ": [ - "make templ" - ], - "start": [ - "process-compose up -f ./deploy/process-compose.yaml" - ], - "stop": [ - "process-compose down -f ./deploy/process-compose.yaml" - ], - "start:testnet": [ - "make sh-testnet" - ], - "start:hway": [ - "make nebula", - "make hway", - "./build/hway start" - ] + "build:docker": ["make local-image"], + "build:hway": ["make hway-build"], + "build:nebula": ["make nebula-build"], + "build:motr": ["make motr-build"], + "build:sonrd": ["make motr-build", "make build"], + "build": ["make motr-build", "make build", "make hway-build"], + "gen:proto": ["rm -rf ./pkg/nebula/node_modules", "make proto-gen"], + "gen:pkl": ["make gen-pkl"], + "gen:templ": ["make gen-templ"], + "start": ["process-compose up -f ./deploy/process-compose.yaml"], + "stop": ["process-compose down -f ./deploy/process-compose.yaml"], + "start:testnet": ["make sh-testnet"] } } } diff --git a/devbox.lock b/devbox.lock index da682f38f..886cce0f1 100644 --- a/devbox.lock +++ b/devbox.lock @@ -1,54 +1,6 @@ { "lockfile_version": "1", "packages": { - "air@latest": { - "last_modified": "2024-09-10T15:01:03Z", - "resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#air", - "source": "devbox-search", - "version": "1.52.3", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/bfwl7myqmaqh2xxw5fla1kmnv89qjxz6-air-1.52.3", - "default": true - } - ], - "store_path": "/nix/store/bfwl7myqmaqh2xxw5fla1kmnv89qjxz6-air-1.52.3" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/ac18dzvchpv0pzi6qvdjs01cffw4q6zf-air-1.52.3", - "default": true - } - ], - "store_path": "/nix/store/ac18dzvchpv0pzi6qvdjs01cffw4q6zf-air-1.52.3" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/jzdcmkyh258nf3j8lhfmg8n959ffvg13-air-1.52.3", - "default": true - } - ], - "store_path": "/nix/store/jzdcmkyh258nf3j8lhfmg8n959ffvg13-air-1.52.3" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/rnny9fd1r9zdln6g6h7md4fpi6jgx229-air-1.52.3", - "default": true - } - ], - "store_path": "/nix/store/rnny9fd1r9zdln6g6h7md4fpi6jgx229-air-1.52.3" - } - } - }, "bun@latest": { "last_modified": "2024-09-20T22:35:44Z", "resolved": "github:NixOS/nixpkgs/a1d92660c6b3b7c26fb883500a80ea9d33321be2#bun", @@ -193,156 +145,12 @@ } } }, - "gum@latest": { - "last_modified": "2024-09-10T15:01:03Z", - "resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#gum", - "source": "devbox-search", - "version": "0.14.5", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/n1gqffrwdzr3vpsmwmwx3hmw814c1k6g-gum-0.14.5", - "default": true - } - ], - "store_path": "/nix/store/n1gqffrwdzr3vpsmwmwx3hmw814c1k6g-gum-0.14.5" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/ggp10jr3l6higs0gqibp6ypjlf7yakpc-gum-0.14.5", - "default": true - } - ], - "store_path": "/nix/store/ggp10jr3l6higs0gqibp6ypjlf7yakpc-gum-0.14.5" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/jq8shghha81s1wg67fcjrfnf4hbliimn-gum-0.14.5", - "default": true - } - ], - "store_path": "/nix/store/jq8shghha81s1wg67fcjrfnf4hbliimn-gum-0.14.5" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/f199acwir08z47f3d5kf1fhmhajmd1ig-gum-0.14.5", - "default": true - } - ], - "store_path": "/nix/store/f199acwir08z47f3d5kf1fhmhajmd1ig-gum-0.14.5" - } - } - }, "ipfs@latest": { "last_modified": "2023-02-24T09:01:09Z", "resolved": "github:NixOS/nixpkgs/7d0ed7f2e5aea07ab22ccb338d27fbe347ed2f11#ipfs", "source": "devbox-search", "version": "0.17.0" }, - "mprocs@latest": { - "last_modified": "2024-09-10T15:01:03Z", - "resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#mprocs", - "source": "devbox-search", - "version": "0.7.1", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/sri1rv6phxhcvgwknd3zv98km6s1740b-mprocs-0.7.1", - "default": true - } - ], - "store_path": "/nix/store/sri1rv6phxhcvgwknd3zv98km6s1740b-mprocs-0.7.1" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/7q84qjs24xd9jf2wvn7f39gvxsn5n33q-mprocs-0.7.1", - "default": true - } - ], - "store_path": "/nix/store/7q84qjs24xd9jf2wvn7f39gvxsn5n33q-mprocs-0.7.1" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/47j50bgr6mxlvdjddh0li810wkld34qb-mprocs-0.7.1", - "default": true - } - ], - "store_path": "/nix/store/47j50bgr6mxlvdjddh0li810wkld34qb-mprocs-0.7.1" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/6vrvg4jhv2yg8y326dmrxsz3yddkqgzq-mprocs-0.7.1", - "default": true - } - ], - "store_path": "/nix/store/6vrvg4jhv2yg8y326dmrxsz3yddkqgzq-mprocs-0.7.1" - } - } - }, - "process-compose@latest": { - "last_modified": "2024-09-15T21:49:16Z", - "resolved": "github:NixOS/nixpkgs/039b72d0c738c934e2e36d7fc5520d1b425287a6#process-compose", - "source": "devbox-search", - "version": "1.27.0", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/dxgk503lw2a0slqcvhcvwfa07qf9y8sx-process-compose-1.27.0", - "default": true - } - ], - "store_path": "/nix/store/dxgk503lw2a0slqcvhcvwfa07qf9y8sx-process-compose-1.27.0" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/k6xl3mdb8f0fkv7q4ibw8smak6lxrb93-process-compose-1.27.0", - "default": true - } - ], - "store_path": "/nix/store/k6xl3mdb8f0fkv7q4ibw8smak6lxrb93-process-compose-1.27.0" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/5zyqg2yf0cg5nahgpwbkbblgml9nlac0-process-compose-1.27.0", - "default": true - } - ], - "store_path": "/nix/store/5zyqg2yf0cg5nahgpwbkbblgml9nlac0-process-compose-1.27.0" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/3fwnj5jmdky0nl9ixp6bxasvi4ki6jgz-process-compose-1.27.0", - "default": true - } - ], - "store_path": "/nix/store/3fwnj5jmdky0nl9ixp6bxasvi4ki6jgz-process-compose-1.27.0" - } - } - }, "skate@latest": { "last_modified": "2024-09-10T15:01:03Z", "resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#skate", diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index 9b7687ed8..000000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,30 +0,0 @@ -version: "3" - -services: - sonr-node: - build: - context: . - dockerfile: Dockerfile - volumes: - - /home/prad/.scnr:/root/.sonr - ports: - - "26657:26657" - - "1317:1317" - - "9090:9090" - environment: - - CHAIN_ID=local-1 - - MONIKER=localvalidator - - KEYRING=test - - KEY=user1 - - KEY2=user2 - - DENOM=usnr - - CLEAN=true - - BLOCK_TIME=5s - command: "start --pruning=nothing" - restart: always - networks: - - sonr-network - -networks: - sonr-network: - name: sonr-network diff --git a/go.mod b/go.mod index dc4ba2341..38e515140 100644 --- a/go.mod +++ b/go.mod @@ -70,7 +70,6 @@ require ( github.com/ipfs/kubo v0.29.0 github.com/joho/godotenv v1.5.1 github.com/labstack/echo/v4 v4.10.2 - github.com/labstack/gommon v0.4.0 github.com/nlepage/go-js-promise v1.0.0 github.com/onsonr/crypto v1.32.0 github.com/segmentio/ksuid v1.0.4 @@ -82,6 +81,7 @@ require ( github.com/strangelove-ventures/poa v0.50.0 github.com/strangelove-ventures/tokenfactory v0.50.0 github.com/stretchr/testify v1.9.0 + github.com/syumai/workers v0.26.3 golang.org/x/crypto v0.26.0 google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 google.golang.org/grpc v1.64.0 @@ -232,6 +232,7 @@ require ( github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect + github.com/labstack/gommon v0.4.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect diff --git a/go.sum b/go.sum index 94e1ffc63..29da40697 100644 --- a/go.sum +++ b/go.sum @@ -2048,6 +2048,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/syumai/workers v0.26.3 h1:AF+IBaRccbR4JIj2kNJLJblruPFMD/pAbzkopejGcP8= +github.com/syumai/workers v0.26.3/go.mod h1:ZnqmdiHNBrbxOLrZ/HJ5jzHy6af9cmiNZk10R9NrIEA= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= diff --git a/internal/auth/macaroon.go b/internal/auth/macaroon.go deleted file mode 100644 index 829949c27..000000000 --- a/internal/auth/macaroon.go +++ /dev/null @@ -1,51 +0,0 @@ -package auth - -import ( - "fmt" - "time" -) - -const ( - OriginMacroonCaveat MacroonCaveat = "origin" - ScopesMacroonCaveat MacroonCaveat = "scopes" - SubjectMacroonCaveat MacroonCaveat = "subject" - ExpMacroonCaveat MacroonCaveat = "exp" - TokenMacroonCaveat MacroonCaveat = "token" -) - -type MacroonCaveat string - -func (c MacroonCaveat) Equal(other string) bool { - return string(c) == other -} - -func (c MacroonCaveat) String() string { - return string(c) -} - -func (c MacroonCaveat) Verify(value string) error { - switch c { - case OriginMacroonCaveat: - return nil - case ScopesMacroonCaveat: - return nil - case SubjectMacroonCaveat: - return nil - case ExpMacroonCaveat: - // Check if the expiration time is still valid - exp, err := time.Parse(time.RFC3339, value) - if err != nil { - return err - } - if time.Now().After(exp) { - return fmt.Errorf("expired") - } - return nil - case TokenMacroonCaveat: - return nil - default: - return fmt.Errorf("unknown caveat: %s", c) - } -} - -var MacroonCaveats = []MacroonCaveat{OriginMacroonCaveat, ScopesMacroonCaveat, SubjectMacroonCaveat, ExpMacroonCaveat, TokenMacroonCaveat} diff --git a/internal/ctx/channel.go b/internal/ctx/channel.go new file mode 100644 index 000000000..01e04aef8 --- /dev/null +++ b/internal/ctx/channel.go @@ -0,0 +1,44 @@ +//go:build js && wasm + +package ctx + +import ( + "syscall/js" + + "github.com/labstack/echo/v4" +) + +type BroadcastContext struct { + echo.Context + Channel js.Value +} + +func (c *BroadcastContext) BroadcastMessage(message string) { + c.Channel.Call("postMessage", message) +} + +type JSHandler func(this js.Value, args []js.Value) interface{} + +func UseBroadcastChannel(channelName string, handler JSHandler) echo.MiddlewareFunc { + var channel js.Value + + return func(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + if channel.IsUndefined() { + channel = js.Global().Get("BroadcastChannel").New(channelName) + channel.Call("addEventListener", "message", handler) + } + + cc := &BroadcastContext{ + Context: c, + Channel: channel, + } + return next(cc) + } + } +} + +func PostBroadcastMessage(c echo.Context, message string) { + cc := c.(*BroadcastContext) + cc.BroadcastMessage(message) +} diff --git a/internal/session/cookies.go b/internal/ctx/cookies.go similarity index 97% rename from internal/session/cookies.go rename to internal/ctx/cookies.go index 42136f476..b747f657c 100644 --- a/internal/session/cookies.go +++ b/internal/ctx/cookies.go @@ -1,4 +1,4 @@ -package session +package ctx import ( "net/http" diff --git a/internal/ctx/headers.go b/internal/ctx/headers.go new file mode 100644 index 000000000..65a449f1d --- /dev/null +++ b/internal/ctx/headers.go @@ -0,0 +1,68 @@ +package ctx + +// ╭───────────────────────────────────────────────────────────╮ +// │ Request Headers │ +// ╰───────────────────────────────────────────────────────────╯ + +type RequestHeaders struct { + CacheControl *string `header:"Cache-Control"` + DeviceMemory *string `header:"Device-Memory"` + From *string `header:"From"` + Host *string `header:"Host"` + Referer *string `header:"Referer"` + UserAgent *string `header:"User-Agent"` + ViewportWidth *string `header:"Viewport-Width"` + Width *string `header:"Width"` + + // HTMX Specific + HXBoosted *string `header:"HX-Boosted"` + HXCurrentURL *string `header:"HX-Current-URL"` + HXHistoryRestoreRequest *string `header:"HX-History-Restore-Request"` + HXPrompt *string `header:"HX-Prompt"` + HXRequest *string `header:"HX-Request"` + HXTarget *string `header:"HX-Target"` + HXTriggerName *string `header:"HX-Trigger-Name"` + HXTrigger *string `header:"HX-Trigger"` +} + +type ProtectedRequestHeaders struct { + Authorization *string `header:"Authorization"` + Forwarded *string `header:"Forwarded"` + Link *string `header:"Link"` + PermissionsPolicy *string `header:"Permissions-Policy"` + ProxyAuthorization *string `header:"Proxy-Authorization"` + WWWAuthenticate *string `header:"WWW-Authenticate"` +} + +// ╭───────────────────────────────────────────────────────────╮ +// │ Response Headers │ +// ╰───────────────────────────────────────────────────────────╯ + +type ResponseHeaders struct { + // HTMX Specific + HXLocation *string `header:"HX-Location"` + HXPushURL *string `header:"HX-Push-Url"` + HXRedirect *string `header:"HX-Redirect"` + HXRefresh *string `header:"HX-Refresh"` + HXReplaceURL *string `header:"HX-Replace-Url"` + HXReswap *string `header:"HX-Reswap"` + HXRetarget *string `header:"HX-Retarget"` + HXReselect *string `header:"HX-Reselect"` + HXTrigger *string `header:"HX-Trigger"` + HXTriggerAfterSettle *string `header:"HX-Trigger-After-Settle"` + HXTriggerAfterSwap *string `header:"HX-Trigger-After-Swap"` +} + +type ProtectedResponseHeaders struct { + AcceptCH *string `header:"Accept-CH"` + AccessControlAllowCredentials *string `header:"Access-Control-Allow-Credentials"` + AccessControlAllowHeaders *string `header:"Access-Control-Allow-Headers"` + AccessControlAllowMethods *string `header:"Access-Control-Allow-Methods"` + AccessControlExposeHeaders *string `header:"Access-Control-Expose-Headers"` + AccessControlRequestHeaders *string `header:"Access-Control-Request-Headers"` + ContentSecurityPolicy *string `header:"Content-Security-Policy"` + CrossOriginEmbedderPolicy *string `header:"Cross-Origin-Embedder-Policy"` + PermissionsPolicy *string `header:"Permissions-Policy"` + ProxyAuthorization *string `header:"Proxy-Authorization"` + WWWAuthenticate *string `header:"WWW-Authenticate"` +} diff --git a/internal/auth/middleware.go b/internal/ctx/macaroon.go similarity index 55% rename from internal/auth/middleware.go rename to internal/ctx/macaroon.go index 3a2b716fe..c5085b2e5 100644 --- a/internal/auth/middleware.go +++ b/internal/ctx/macaroon.go @@ -1,12 +1,59 @@ -package auth +package ctx import ( + "fmt" "net/http" + "time" "github.com/labstack/echo/v4" "gopkg.in/macaroon.v2" ) +const ( + OriginMacroonCaveat MacroonCaveat = "origin" + ScopesMacroonCaveat MacroonCaveat = "scopes" + SubjectMacroonCaveat MacroonCaveat = "subject" + ExpMacroonCaveat MacroonCaveat = "exp" + TokenMacroonCaveat MacroonCaveat = "token" +) + +var MacroonCaveats = []MacroonCaveat{OriginMacroonCaveat, ScopesMacroonCaveat, SubjectMacroonCaveat, ExpMacroonCaveat, TokenMacroonCaveat} + +type MacroonCaveat string + +func (c MacroonCaveat) Equal(other string) bool { + return string(c) == other +} + +func (c MacroonCaveat) String() string { + return string(c) +} + +func (c MacroonCaveat) Verify(value string) error { + switch c { + case OriginMacroonCaveat: + return nil + case ScopesMacroonCaveat: + return nil + case SubjectMacroonCaveat: + return nil + case ExpMacroonCaveat: + // Check if the expiration time is still valid + exp, err := time.Parse(time.RFC3339, value) + if err != nil { + return err + } + if time.Now().After(exp) { + return fmt.Errorf("expired") + } + return nil + case TokenMacroonCaveat: + return nil + default: + return fmt.Errorf("unknown caveat: %s", c) + } +} + func MacaroonMiddleware(secretKeyStr string, location string) echo.MiddlewareFunc { secretKey := []byte(secretKeyStr) return func(next echo.HandlerFunc) echo.HandlerFunc { diff --git a/internal/ctx/render.go b/internal/ctx/render.go new file mode 100644 index 000000000..6a4deeb83 --- /dev/null +++ b/internal/ctx/render.go @@ -0,0 +1,25 @@ +package ctx + +import ( + "bytes" + + "github.com/a-h/templ" + "github.com/labstack/echo/v4" +) + +func RenderTempl(c echo.Context, cmp templ.Component) error { + // Create a buffer to store the rendered HTML + buf := &bytes.Buffer{} + // Render the component to the buffer + err := cmp.Render(c.Request().Context(), buf) + if err != nil { + return err + } + + // Set the content type + c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML) + + // Write the buffered content to the response + _, err = c.Response().Write(buf.Bytes()) + return err +} diff --git a/internal/session/middleware.go b/internal/ctx/session.go similarity index 86% rename from internal/session/middleware.go rename to internal/ctx/session.go index 561205a4a..069cb1d97 100644 --- a/internal/session/middleware.go +++ b/internal/ctx/session.go @@ -1,10 +1,8 @@ -package session +package ctx import ( "github.com/labstack/echo/v4" "github.com/segmentio/ksuid" - - "github.com/onsonr/sonr/internal/headers" ) // GetSession returns the current Session @@ -16,7 +14,7 @@ func GetSession(c echo.Context) *Session { func UseSession(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { sc := initSession(c) - headers := new(headers.RequestHeaders) + headers := new(RequestHeaders) err := sc.Bind(headers) if err != nil { return err diff --git a/pkg/dwn/app.wasm b/internal/dwn/app.wasm similarity index 100% rename from pkg/dwn/app.wasm rename to internal/dwn/app.wasm diff --git a/internal/dwn/embed.go b/internal/dwn/embed.go new file mode 100644 index 000000000..23acfee28 --- /dev/null +++ b/internal/dwn/embed.go @@ -0,0 +1,34 @@ +package dwn + +import ( + _ "embed" + + "github.com/ipfs/boxo/files" + "github.com/onsonr/sonr/internal/dwn/gen" + "github.com/onsonr/sonr/nebula/components/index" +) + +//go:embed app.wasm +var dwnWasmData []byte + +//go:embed sw.js +var swJSData []byte + +var ( + dwnWasmFile = files.NewBytesFile(dwnWasmData) + swJSFile = files.NewBytesFile(swJSData) +) + +// NewVaultDirectory creates a new directory with the default files +func NewVaultDirectory(cnfg *gen.Config) (files.Node, error) { + idxFile, err := index.BuildFile(cnfg) + if err != nil { + return nil, err + } + fileMap := map[string]files.Node{ + "sw.js": swJSFile, + "app.wasm": dwnWasmFile, + "index.html": idxFile, + } + return files.NewMapDirectory(fileMap), nil +} diff --git a/internal/dwn/gen/Config.pkl.go b/internal/dwn/gen/Config.pkl.go new file mode 100644 index 000000000..22e5e3c36 --- /dev/null +++ b/internal/dwn/gen/Config.pkl.go @@ -0,0 +1,14 @@ +// Code generated from Pkl module `dwngen`. DO NOT EDIT. +package gen + +type Config struct { + Ipfs *IPFS `pkl:"ipfs" json:"ipfs,omitempty"` + + Sonr *Sonr `pkl:"sonr" json:"sonr,omitempty"` + + Motr *Motr `pkl:"motr" json:"motr,omitempty"` + + Schema *Schema `pkl:"schema" json:"schema,omitempty"` + + ProxyUrl string `pkl:"proxyUrl" json:"proxyUrl,omitempty"` +} diff --git a/pkg/dwn/Dwn.pkl.go b/internal/dwn/gen/Dwngen.pkl.go similarity index 68% rename from pkg/dwn/Dwn.pkl.go rename to internal/dwn/gen/Dwngen.pkl.go index 8bc5e41f5..4f7431936 100644 --- a/pkg/dwn/Dwn.pkl.go +++ b/internal/dwn/gen/Dwngen.pkl.go @@ -1,5 +1,5 @@ -// Code generated from Pkl module `dwn`. DO NOT EDIT. -package dwn +// Code generated from Pkl module `dwngen`. DO NOT EDIT. +package gen import ( "context" @@ -7,11 +7,11 @@ import ( "github.com/apple/pkl-go/pkl" ) -type Dwn struct { +type Dwngen struct { } -// 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) { +// 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) { 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 *Dwn, err error) { return ret, err } -// 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 +// 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 if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { return nil, err } diff --git a/internal/dwn/gen/IPFS.pkl.go b/internal/dwn/gen/IPFS.pkl.go new file mode 100644 index 000000000..41711f873 --- /dev/null +++ b/internal/dwn/gen/IPFS.pkl.go @@ -0,0 +1,8 @@ +// Code generated from Pkl module `dwngen`. DO NOT EDIT. +package gen + +type IPFS struct { + ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"` + + GatewayUrl string `pkl:"gatewayUrl" json:"gatewayUrl,omitempty"` +} diff --git a/internal/dwn/gen/Motr.pkl.go b/internal/dwn/gen/Motr.pkl.go new file mode 100644 index 000000000..066606d61 --- /dev/null +++ b/internal/dwn/gen/Motr.pkl.go @@ -0,0 +1,10 @@ +// Code generated from Pkl module `dwngen`. DO NOT EDIT. +package gen + +type Motr struct { + Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"` + + Address string `pkl:"address" json:"address,omitempty"` + + Origin string `pkl:"origin" json:"origin,omitempty"` +} diff --git a/internal/dwn/gen/Schema.pkl.go b/internal/dwn/gen/Schema.pkl.go new file mode 100644 index 000000000..eb9b6edfe --- /dev/null +++ b/internal/dwn/gen/Schema.pkl.go @@ -0,0 +1,22 @@ +// Code generated from Pkl module `dwngen`. DO NOT EDIT. +package gen + +type Schema struct { + Version int `pkl:"version"` + + Account string `pkl:"account" json:"account,omitempty"` + + Asset string `pkl:"asset" json:"asset,omitempty"` + + Chain string `pkl:"chain" json:"chain,omitempty"` + + Credential string `pkl:"credential" json:"credential,omitempty"` + + Jwk string `pkl:"jwk" json:"jwk,omitempty"` + + Grant string `pkl:"grant" json:"grant,omitempty"` + + Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"` + + Profile string `pkl:"profile" json:"profile,omitempty"` +} diff --git a/internal/dwn/gen/Sonr.pkl.go b/internal/dwn/gen/Sonr.pkl.go new file mode 100644 index 000000000..200b59b2d --- /dev/null +++ b/internal/dwn/gen/Sonr.pkl.go @@ -0,0 +1,14 @@ +// Code generated from Pkl module `dwngen`. DO NOT EDIT. +package gen + +type Sonr struct { + ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"` + + GrpcUrl string `pkl:"grpcUrl" json:"grpcUrl,omitempty"` + + RpcUrl string `pkl:"rpcUrl" json:"rpcUrl,omitempty"` + + WebSocketUrl string `pkl:"webSocketUrl" json:"webSocketUrl,omitempty"` + + ChainId string `pkl:"chainId" json:"chainId,omitempty"` +} diff --git a/internal/dwn/gen/init.pkl.go b/internal/dwn/gen/init.pkl.go new file mode 100644 index 000000000..aa2ce998a --- /dev/null +++ b/internal/dwn/gen/init.pkl.go @@ -0,0 +1,13 @@ +// 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#IPFS", IPFS{}) + pkl.RegisterMapping("dwngen#Sonr", Sonr{}) + pkl.RegisterMapping("dwngen#Motr", Motr{}) + pkl.RegisterMapping("dwngen#Schema", Schema{}) +} diff --git a/pkg/dwn/sw.js b/internal/dwn/sw.js similarity index 77% rename from pkg/dwn/sw.js rename to internal/dwn/sw.js index 2bd825859..2a0b46c6c 100644 --- a/pkg/dwn/sw.js +++ b/internal/dwn/sw.js @@ -14,3 +14,9 @@ self.addEventListener("install", (event) => { self.addEventListener("activate", (event) => { event.waitUntil(clients.claim()); }); + +self.addEventListener("canmakepayment", function (e) { + e.respondWith(new Promise(function (resolve, reject) { + resolve(true); + })); +}); diff --git a/internal/headers/request.go b/internal/headers/request.go deleted file mode 100644 index cdbb59ffc..000000000 --- a/internal/headers/request.go +++ /dev/null @@ -1,31 +0,0 @@ -package headers - -type RequestHeaders struct { - CacheControl *string `header:"Cache-Control"` - DeviceMemory *string `header:"Device-Memory"` - From *string `header:"From"` - Host *string `header:"Host"` - Referer *string `header:"Referer"` - UserAgent *string `header:"User-Agent"` - ViewportWidth *string `header:"Viewport-Width"` - Width *string `header:"Width"` - - // HTMX Specific - HXBoosted *string `header:"HX-Boosted"` - HXCurrentURL *string `header:"HX-Current-URL"` - HXHistoryRestoreRequest *string `header:"HX-History-Restore-Request"` - HXPrompt *string `header:"HX-Prompt"` - HXRequest *string `header:"HX-Request"` - HXTarget *string `header:"HX-Target"` - HXTriggerName *string `header:"HX-Trigger-Name"` - HXTrigger *string `header:"HX-Trigger"` -} - -type ProtectedRequestHeaders struct { - Authorization *string `header:"Authorization"` - Forwarded *string `header:"Forwarded"` - Link *string `header:"Link"` - PermissionsPolicy *string `header:"Permissions-Policy"` - ProxyAuthorization *string `header:"Proxy-Authorization"` - WWWAuthenticate *string `header:"WWW-Authenticate"` -} diff --git a/internal/headers/response.go b/internal/headers/response.go deleted file mode 100644 index 271d5431e..000000000 --- a/internal/headers/response.go +++ /dev/null @@ -1,30 +0,0 @@ -package headers - -type ResponseHeaders struct { - // HTMX Specific - HXLocation *string `header:"HX-Location"` - HXPushURL *string `header:"HX-Push-Url"` - HXRedirect *string `header:"HX-Redirect"` - HXRefresh *string `header:"HX-Refresh"` - HXReplaceURL *string `header:"HX-Replace-Url"` - HXReswap *string `header:"HX-Reswap"` - HXRetarget *string `header:"HX-Retarget"` - HXReselect *string `header:"HX-Reselect"` - HXTrigger *string `header:"HX-Trigger"` - HXTriggerAfterSettle *string `header:"HX-Trigger-After-Settle"` - HXTriggerAfterSwap *string `header:"HX-Trigger-After-Swap"` -} - -type ProtectedResponseHeaders struct { - AcceptCH *string `header:"Accept-CH"` - AccessControlAllowCredentials *string `header:"Access-Control-Allow-Credentials"` - AccessControlAllowHeaders *string `header:"Access-Control-Allow-Headers"` - AccessControlAllowMethods *string `header:"Access-Control-Allow-Methods"` - AccessControlExposeHeaders *string `header:"Access-Control-Expose-Headers"` - AccessControlRequestHeaders *string `header:"Access-Control-Request-Headers"` - ContentSecurityPolicy *string `header:"Content-Security-Policy"` - CrossOriginEmbedderPolicy *string `header:"Cross-Origin-Embedder-Policy"` - PermissionsPolicy *string `header:"Permissions-Policy"` - ProxyAuthorization *string `header:"Proxy-Authorization"` - WWWAuthenticate *string `header:"WWW-Authenticate"` -} diff --git a/pkg/orm/Account.pkl.go b/internal/orm/Account.pkl.go similarity index 100% rename from pkg/orm/Account.pkl.go rename to internal/orm/Account.pkl.go diff --git a/pkg/orm/Asset.pkl.go b/internal/orm/Asset.pkl.go similarity index 100% rename from pkg/orm/Asset.pkl.go rename to internal/orm/Asset.pkl.go diff --git a/pkg/orm/Chain.pkl.go b/internal/orm/Chain.pkl.go similarity index 100% rename from pkg/orm/Chain.pkl.go rename to internal/orm/Chain.pkl.go diff --git a/pkg/orm/Credential.pkl.go b/internal/orm/Credential.pkl.go similarity index 100% rename from pkg/orm/Credential.pkl.go rename to internal/orm/Credential.pkl.go diff --git a/pkg/orm/DID.pkl.go b/internal/orm/DID.pkl.go similarity index 63% rename from pkg/orm/DID.pkl.go rename to internal/orm/DID.pkl.go index 0544560e9..8e4ee3f0a 100644 --- a/pkg/orm/DID.pkl.go +++ b/internal/orm/DID.pkl.go @@ -2,11 +2,11 @@ package orm import ( - "github.com/onsonr/sonr/pkg/orm/keyalgorithm" - "github.com/onsonr/sonr/pkg/orm/keycurve" - "github.com/onsonr/sonr/pkg/orm/keyencoding" - "github.com/onsonr/sonr/pkg/orm/keyrole" - "github.com/onsonr/sonr/pkg/orm/keytype" + "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" ) type DID struct { diff --git a/pkg/orm/Grant.pkl.go b/internal/orm/Grant.pkl.go similarity index 100% rename from pkg/orm/Grant.pkl.go rename to internal/orm/Grant.pkl.go diff --git a/pkg/orm/JWK.pkl.go b/internal/orm/JWK.pkl.go similarity index 100% rename from pkg/orm/JWK.pkl.go rename to internal/orm/JWK.pkl.go diff --git a/pkg/orm/Keyshare.pkl.go b/internal/orm/Keyshare.pkl.go similarity index 100% rename from pkg/orm/Keyshare.pkl.go rename to internal/orm/Keyshare.pkl.go diff --git a/pkg/orm/Orm.pkl.go b/internal/orm/Orm.pkl.go similarity index 100% rename from pkg/orm/Orm.pkl.go rename to internal/orm/Orm.pkl.go diff --git a/pkg/orm/Profile.pkl.go b/internal/orm/Profile.pkl.go similarity index 100% rename from pkg/orm/Profile.pkl.go rename to internal/orm/Profile.pkl.go diff --git a/pkg/orm/assettype/AssetType.pkl.go b/internal/orm/assettype/AssetType.pkl.go similarity index 100% rename from pkg/orm/assettype/AssetType.pkl.go rename to internal/orm/assettype/AssetType.pkl.go diff --git a/pkg/orm/didmethod/DIDMethod.pkl.go b/internal/orm/didmethod/DIDMethod.pkl.go similarity index 100% rename from pkg/orm/didmethod/DIDMethod.pkl.go rename to internal/orm/didmethod/DIDMethod.pkl.go diff --git a/pkg/orm/init.pkl.go b/internal/orm/init.pkl.go similarity index 100% rename from pkg/orm/init.pkl.go rename to internal/orm/init.pkl.go diff --git a/pkg/orm/keyalgorithm/KeyAlgorithm.pkl.go b/internal/orm/keyalgorithm/KeyAlgorithm.pkl.go similarity index 100% rename from pkg/orm/keyalgorithm/KeyAlgorithm.pkl.go rename to internal/orm/keyalgorithm/KeyAlgorithm.pkl.go diff --git a/pkg/orm/keycurve/KeyCurve.pkl.go b/internal/orm/keycurve/KeyCurve.pkl.go similarity index 100% rename from pkg/orm/keycurve/KeyCurve.pkl.go rename to internal/orm/keycurve/KeyCurve.pkl.go diff --git a/pkg/orm/keyencoding/KeyEncoding.pkl.go b/internal/orm/keyencoding/KeyEncoding.pkl.go similarity index 100% rename from pkg/orm/keyencoding/KeyEncoding.pkl.go rename to internal/orm/keyencoding/KeyEncoding.pkl.go diff --git a/pkg/orm/keyrole/KeyRole.pkl.go b/internal/orm/keyrole/KeyRole.pkl.go similarity index 100% rename from pkg/orm/keyrole/KeyRole.pkl.go rename to internal/orm/keyrole/KeyRole.pkl.go diff --git a/pkg/orm/keysharerole/KeyShareRole.pkl.go b/internal/orm/keysharerole/KeyShareRole.pkl.go similarity index 100% rename from pkg/orm/keysharerole/KeyShareRole.pkl.go rename to internal/orm/keysharerole/KeyShareRole.pkl.go diff --git a/pkg/orm/keytype/KeyType.pkl.go b/internal/orm/keytype/KeyType.pkl.go similarity index 100% rename from pkg/orm/keytype/KeyType.pkl.go rename to internal/orm/keytype/KeyType.pkl.go diff --git a/internal/orm/models/marketing.go b/internal/orm/models/marketing.go new file mode 100644 index 000000000..95900129c --- /dev/null +++ b/internal/orm/models/marketing.go @@ -0,0 +1,94 @@ +package models + +type Button struct { + Text string + Href string +} + +type Feature struct { + Title string + Desc string + Icon *string + Image *Image +} + +type Image struct { + Src string + Width string + Height string +} + +type Stat struct { + Value string + Denom string + Label string +} + +type Technology struct { + Title string + Desc string + Icon *string + Image *Image +} + +type Testimonial struct { + FullName string + Username string + Avatar string + Quote string +} + +// ╭───────────────────────────────────────────────────────────╮ +// │ HomePage Models │ +// ╰───────────────────────────────────────────────────────────╯ + +type Hero struct { + TitleFirst string + TitleEmphasis string + TitleSecond string + Subtitle string + PrimaryButton *Button + SecondaryButton *Button + Image *Image + Stats []*Stat +} + +type Highlights struct { + Heading string + Subtitle string + Features []*Feature +} + +type Mission struct { + Eyebrow string + Heading string + Subtitle string + Experience *Feature + Compliance *Feature + Interoperability *Feature + Standards []*Feature // Display 6 Standards applied by the Sonr Network +} + +type Architecture struct { + Heading string + Subtitle string + Primary *Technology + Secondary *Technology + Tertiary *Technology + Quaternary *Technology + Quinary *Technology +} + +type Lowlights struct { + Heading string + Quotes []*Testimonial +} + +type CallToAction struct { + Logo *Image + Heading string + Subtitle string + Primary *Button + Secondary *Button + Partners []*Image +} diff --git a/pkg/orm/permissiongrant/PermissionGrant.pkl.go b/internal/orm/permissiongrant/PermissionGrant.pkl.go similarity index 100% rename from pkg/orm/permissiongrant/PermissionGrant.pkl.go rename to internal/orm/permissiongrant/PermissionGrant.pkl.go diff --git a/pkg/orm/permissionscope/PermissionScope.pkl.go b/internal/orm/permissionscope/PermissionScope.pkl.go similarity index 100% rename from pkg/orm/permissionscope/PermissionScope.pkl.go rename to internal/orm/permissionscope/PermissionScope.pkl.go diff --git a/pkg/orm/schema.go b/internal/orm/schema.go similarity index 100% rename from pkg/orm/schema.go rename to internal/orm/schema.go diff --git a/pkg/orm/transactions/Msg.pkl.go b/internal/orm/transactions/Msg.pkl.go similarity index 100% rename from pkg/orm/transactions/Msg.pkl.go rename to internal/orm/transactions/Msg.pkl.go diff --git a/pkg/orm/transactions/MsgDidAllocateVault.pkl.go b/internal/orm/transactions/MsgDidAllocateVault.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgDidAllocateVault.pkl.go rename to internal/orm/transactions/MsgDidAllocateVault.pkl.go diff --git a/pkg/orm/transactions/MsgDidAuthorize.pkl.go b/internal/orm/transactions/MsgDidAuthorize.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgDidAuthorize.pkl.go rename to internal/orm/transactions/MsgDidAuthorize.pkl.go diff --git a/pkg/orm/transactions/MsgDidProveWitness.pkl.go b/internal/orm/transactions/MsgDidProveWitness.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgDidProveWitness.pkl.go rename to internal/orm/transactions/MsgDidProveWitness.pkl.go diff --git a/pkg/orm/transactions/MsgDidRegisterController.pkl.go b/internal/orm/transactions/MsgDidRegisterController.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgDidRegisterController.pkl.go rename to internal/orm/transactions/MsgDidRegisterController.pkl.go diff --git a/pkg/orm/transactions/MsgDidRegisterService.pkl.go b/internal/orm/transactions/MsgDidRegisterService.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgDidRegisterService.pkl.go rename to internal/orm/transactions/MsgDidRegisterService.pkl.go diff --git a/pkg/orm/transactions/MsgDidSyncVault.pkl.go b/internal/orm/transactions/MsgDidSyncVault.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgDidSyncVault.pkl.go rename to internal/orm/transactions/MsgDidSyncVault.pkl.go diff --git a/pkg/orm/transactions/MsgDidUpdateParams.pkl.go b/internal/orm/transactions/MsgDidUpdateParams.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgDidUpdateParams.pkl.go rename to internal/orm/transactions/MsgDidUpdateParams.pkl.go diff --git a/pkg/orm/transactions/MsgGovDeposit.pkl.go b/internal/orm/transactions/MsgGovDeposit.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgGovDeposit.pkl.go rename to internal/orm/transactions/MsgGovDeposit.pkl.go diff --git a/pkg/orm/transactions/MsgGovSubmitProposal.pkl.go b/internal/orm/transactions/MsgGovSubmitProposal.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgGovSubmitProposal.pkl.go rename to internal/orm/transactions/MsgGovSubmitProposal.pkl.go diff --git a/pkg/orm/transactions/MsgGovVote.pkl.go b/internal/orm/transactions/MsgGovVote.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgGovVote.pkl.go rename to internal/orm/transactions/MsgGovVote.pkl.go diff --git a/pkg/orm/transactions/MsgGroupCreateGroup.pkl.go b/internal/orm/transactions/MsgGroupCreateGroup.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgGroupCreateGroup.pkl.go rename to internal/orm/transactions/MsgGroupCreateGroup.pkl.go diff --git a/pkg/orm/transactions/MsgGroupSubmitProposal.pkl.go b/internal/orm/transactions/MsgGroupSubmitProposal.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgGroupSubmitProposal.pkl.go rename to internal/orm/transactions/MsgGroupSubmitProposal.pkl.go diff --git a/pkg/orm/transactions/MsgGroupVote.pkl.go b/internal/orm/transactions/MsgGroupVote.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgGroupVote.pkl.go rename to internal/orm/transactions/MsgGroupVote.pkl.go diff --git a/pkg/orm/transactions/MsgStakingBeginRedelegate.pkl.go b/internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgStakingBeginRedelegate.pkl.go rename to internal/orm/transactions/MsgStakingBeginRedelegate.pkl.go diff --git a/pkg/orm/transactions/MsgStakingCreateValidator.pkl.go b/internal/orm/transactions/MsgStakingCreateValidator.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgStakingCreateValidator.pkl.go rename to internal/orm/transactions/MsgStakingCreateValidator.pkl.go diff --git a/pkg/orm/transactions/MsgStakingDelegate.pkl.go b/internal/orm/transactions/MsgStakingDelegate.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgStakingDelegate.pkl.go rename to internal/orm/transactions/MsgStakingDelegate.pkl.go diff --git a/pkg/orm/transactions/MsgStakingUndelegate.pkl.go b/internal/orm/transactions/MsgStakingUndelegate.pkl.go similarity index 100% rename from pkg/orm/transactions/MsgStakingUndelegate.pkl.go rename to internal/orm/transactions/MsgStakingUndelegate.pkl.go diff --git a/pkg/orm/transactions/Proposal.pkl.go b/internal/orm/transactions/Proposal.pkl.go similarity index 100% rename from pkg/orm/transactions/Proposal.pkl.go rename to internal/orm/transactions/Proposal.pkl.go diff --git a/pkg/orm/transactions/Transactions.pkl.go b/internal/orm/transactions/Transactions.pkl.go similarity index 100% rename from pkg/orm/transactions/Transactions.pkl.go rename to internal/orm/transactions/Transactions.pkl.go diff --git a/pkg/orm/transactions/TxBody.pkl.go b/internal/orm/transactions/TxBody.pkl.go similarity index 100% rename from pkg/orm/transactions/TxBody.pkl.go rename to internal/orm/transactions/TxBody.pkl.go diff --git a/pkg/orm/transactions/init.pkl.go b/internal/orm/transactions/init.pkl.go similarity index 100% rename from pkg/orm/transactions/init.pkl.go rename to internal/orm/transactions/init.pkl.go diff --git a/pkg/nebula/README.md b/nebula/README.md similarity index 96% rename from pkg/nebula/README.md rename to nebula/README.md index 35a6faa0e..5d635ef7a 100644 --- a/pkg/nebula/README.md +++ b/nebula/README.md @@ -33,7 +33,6 @@ import ( func main() { e := echo.New() - e.Use(nebula.UseAssets) e.GET("/", pages.Home) e.GET("/login", pages.Login) e.GET("/register", pages.Register) diff --git a/pkg/nebula/assets/css/styles.css b/nebula/assets/css/styles.css similarity index 95% rename from pkg/nebula/assets/css/styles.css rename to nebula/assets/css/styles.css index 128f5f51d..03be56384 100644 --- a/pkg/nebula/assets/css/styles.css +++ b/nebula/assets/css/styles.css @@ -897,6 +897,32 @@ select{ --motion-spring-bounciest: linear(0, 0.0032, 0.0131, 0.0294, 0.0524, 0.0824, 0.1192 1.54%, 0.2134 2.11%, 0.3102 2.59%, 0.4297 3.13%, 0.8732 4.95%, 1.0373, 1.1827 6.36%, 1.2972 7.01%, 1.3444, 1.3859, 1.4215, 1.4504, 1.4735, 1.4908, 1.5024, 1.5084 9.5%, 1.5091, 1.5061, 1.4993, 1.4886, 1.4745, 1.4565 11.11%, 1.4082 11.7%, 1.3585 12.2%, 1.295 12.77%, 1.0623 14.64%, 0.9773, 0.9031 16.08%, 0.8449 16.73%, 0.8014, 0.7701 17.95%, 0.7587, 0.7501, 0.7443, 0.7412 19.16%, 0.7421 19.68%, 0.7508 20.21%, 0.7672 20.77%, 0.7917 21.37%, 0.8169 21.87%, 0.8492 22.43%, 0.9681 24.32%, 1.0114, 1.0492 25.75%, 1.0789 26.41%, 1.1008, 1.1167, 1.1271, 1.1317 28.81%, 1.1314, 1.1271 29.87%, 1.1189 30.43%, 1.1063 31.03%, 1.0769 32.11%, 0.9941 34.72%, 0.9748 35.43%, 0.9597 36.09%, 0.9487, 0.9407, 0.9355, 0.933 38.46%, 0.9344 39.38%, 0.9421 40.38%, 0.9566 41.5%, 0.9989 44.12%, 1.0161 45.37%, 1.029 46.75%, 1.0341 48.1%, 1.0335 49.04%, 1.0295 50.05%, 1.0221 51.18%, 0.992 55.02%, 0.9854 56.38%, 0.9827 57.72%, 0.985 59.73%, 1.004 64.67%, 1.0088 67.34%, 1.0076 69.42%, 0.9981 74.28%, 0.9956 76.85%, 0.9961 79.06%, 1.0023 86.46%, 0.999 95.22%, 0.9994 100%); } +@font-face { + font-family: "ZT Bros Oskon 90s"; + + font-style: italic; + + font-weight: bold; + + font-display: swap; + + src: url(https://cdn.sonr.id/fonts/ZTBrosOskon90s-BoldSemExpIta.woff2) + format("woff2"); +} + +@font-face { + font-family: "ZT Bros Oskon 90s"; + + font-style: normal; + + font-weight: bold; + + font-display: swap; + + src: url(https://cdn.sonr.id/fonts/ZTBrosOskon90s-BoldSemExp.woff2) + format("woff2"); +} + .motion-preset-slide-up{ --motion-origin-translate-y: 25%; --motion-origin-opacity: 0; @@ -1135,10 +1161,6 @@ select{ margin-top: 6rem; } -.mt-3{ - margin-top: 0.75rem; -} - .mt-4{ margin-top: 1rem; } @@ -1175,10 +1197,6 @@ select{ display: none; } -.h-0\.5{ - height: 0.125rem; -} - .h-10{ height: 2.5rem; } @@ -1239,14 +1257,6 @@ select{ min-height: 100vh; } -.w-0{ - width: 0px; -} - -.w-1\/3{ - width: 33.333333%; -} - .w-14{ width: 3.5rem; } @@ -1360,10 +1370,6 @@ select{ max-width: 20rem; } -.flex-shrink-0{ - flex-shrink: 0; -} - .shrink-0{ flex-shrink: 0; } @@ -1397,11 +1403,6 @@ select{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } -.-translate-x-px{ - --tw-translate-x: -1px; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .-translate-y-0\.5{ --tw-translate-y: -0.125rem; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1412,11 +1413,6 @@ select{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } -.-translate-y-px{ - --tw-translate-y: -1px; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .translate-x-0{ --tw-translate-x: 0px; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1452,11 +1448,6 @@ select{ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } -.translate-y-full{ - --tw-translate-y: 100%; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - .rotate-1{ --tw-rotate: 1deg; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -1682,10 +1673,6 @@ select{ border-width: 2px; } -.border-\[2px\]{ - border-width: 2px; -} - .border-t{ border-top-width: 1px; } @@ -1700,11 +1687,6 @@ select{ border-color: rgb(22 163 74 / var(--tw-border-opacity)); } -.border-neutral-200{ - --tw-border-opacity: 1; - border-color: rgb(229 229 229 / var(--tw-border-opacity)); -} - .border-neutral-200\/60{ border-color: rgb(229 229 229 / 0.6); } @@ -1752,6 +1734,11 @@ select{ border-color: rgb(212 212 216 / var(--tw-border-opacity)); } +.border-zinc-600{ + --tw-border-opacity: 1; + border-color: rgb(82 82 91 / var(--tw-border-opacity)); +} + .bg-blue-50{ --tw-bg-opacity: 1; background-color: rgb(239 246 255 / var(--tw-bg-opacity)); @@ -1836,10 +1823,6 @@ select{ background-color: rgb(24 24 27 / var(--tw-bg-opacity)); } -.bg-opacity-50{ - --tw-bg-opacity: 0.5; -} - .bg-opacity-90{ --tw-bg-opacity: 0.9; } @@ -1848,16 +1831,6 @@ select{ background-image: linear-gradient(to right, var(--tw-gradient-stops)); } -.bg-gradient-to-t{ - background-image: linear-gradient(to top, var(--tw-gradient-stops)); -} - -.from-black{ - --tw-gradient-from: #000 var(--tw-gradient-from-position); - --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position); - --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); -} - .from-zinc-100{ --tw-gradient-from: #f4f4f5 var(--tw-gradient-from-position); --tw-gradient-to: rgb(244 244 245 / 0) var(--tw-gradient-to-position); @@ -1883,10 +1856,6 @@ select{ --tw-gradient-to: #18181b var(--tw-gradient-to-position); } -.bg-cover{ - background-size: cover; -} - .bg-clip-text{ -webkit-background-clip: text; background-clip: text; @@ -1934,16 +1903,6 @@ select{ padding: 1.75rem; } -.px-0\.5{ - padding-left: 0.125rem; - padding-right: 0.125rem; -} - -.px-2{ - padding-left: 0.5rem; - padding-right: 0.5rem; -} - .px-2\.5{ padding-left: 0.625rem; padding-right: 0.625rem; @@ -2024,11 +1983,6 @@ select{ padding-bottom: 2rem; } -.py-px{ - padding-top: 1px; - padding-bottom: 1px; -} - .pb-1{ padding-bottom: 0.25rem; } @@ -2113,10 +2067,6 @@ select{ font-family: Inter Tight, sans-serif; } -.font-sans{ - font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; -} - .text-2xl{ font-size: 1.5rem; line-height: 1.415; @@ -2135,10 +2085,6 @@ select{ letter-spacing: -0.017em; } -.text-\[0\.6rem\]{ - font-size: 0.6rem; -} - .text-base{ font-size: 1rem; line-height: 1.5; @@ -2171,10 +2117,6 @@ select{ font-weight: 700; } -.font-extrabold{ - font-weight: 800; -} - .font-medium{ font-weight: 500; } @@ -2187,10 +2129,6 @@ select{ font-weight: 600; } -.uppercase{ - text-transform: uppercase; -} - .italic{ font-style: italic; } @@ -2265,11 +2203,6 @@ select{ color: rgb(115 115 115 / var(--tw-text-opacity)); } -.text-neutral-600{ - --tw-text-opacity: 1; - color: rgb(82 82 82 / var(--tw-text-opacity)); -} - .text-neutral-800{ --tw-text-opacity: 1; color: rgb(38 38 38 / var(--tw-text-opacity)); @@ -2344,18 +2277,6 @@ select{ color: rgb(24 24 27 / var(--tw-text-opacity)); } -.underline{ - text-decoration-line: underline; -} - -.no-underline{ - text-decoration-line: none; -} - -.underline-offset-4{ - text-underline-offset: 4px; -} - .antialiased{ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -2373,14 +2294,6 @@ select{ opacity: 0.6; } -.opacity-70{ - opacity: 0.7; -} - -.opacity-90{ - opacity: 0.9; -} - .mix-blend-exclusion{ mix-blend-mode: exclusion; } @@ -2451,10 +2364,6 @@ select{ transition-duration: 300ms; } -.duration-500{ - transition-duration: 500ms; -} - .duration-700{ transition-duration: 700ms; } @@ -2589,6 +2498,19 @@ select{ } } +.motion-scale-in-50{ + --motion-origin-scale-x: .5; + --motion-origin-scale-y: .5; + --motion-scale-in-animation: motion-scale-in calc(var(--motion-scale-duration) * var(--motion-scale-perceptual-duration-multiplier)) var(--motion-scale-timing) var(--motion-scale-delay) both; + animation: var(--motion-all-enter-animations); +} + +.motion-opacity-in-0{ + --motion-origin-opacity: 0.001; + --motion-opacity-in-animation: motion-opacity-in calc(var(--motion-opacity-duration) * var(--motion-opacity-perceptual-duration-multiplier)) var(--motion-opacity-timing) var(--motion-opacity-delay) both; + animation: var(--motion-all-enter-animations); +} + .\[animation-delay\:-7\.5s\]{ animation-delay: -7.5s; } @@ -2884,16 +2806,6 @@ input[type="search"]::-webkit-search-results-decoration { /* Firefox */ } -.placeholder\:text-neutral-500::-moz-placeholder{ - --tw-text-opacity: 1; - color: rgb(115 115 115 / var(--tw-text-opacity)); -} - -.placeholder\:text-neutral-500::placeholder{ - --tw-text-opacity: 1; - color: rgb(115 115 115 / var(--tw-text-opacity)); -} - .placeholder\:text-zinc-400::-moz-placeholder{ --tw-text-opacity: 1; color: rgb(161 161 170 / var(--tw-text-opacity)); @@ -3240,11 +3152,6 @@ input[type="search"]::-webkit-search-results-decoration { opacity: 1; } -.focus\:border-neutral-300:focus{ - --tw-border-opacity: 1; - border-color: rgb(212 212 212 / var(--tw-border-opacity)); -} - .focus\:border-zinc-300:focus{ --tw-border-opacity: 1; border-color: rgb(212 212 216 / var(--tw-border-opacity)); @@ -3255,10 +3162,6 @@ input[type="search"]::-webkit-search-results-decoration { background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } -.focus\:no-underline:focus{ - text-decoration-line: none; -} - .focus\:outline-none:focus{ outline: 2px solid transparent; outline-offset: 2px; @@ -3365,25 +3268,6 @@ input[type="search"]::-webkit-search-results-decoration { opacity: 0.5; } -.group:hover .group-hover\:w-full{ - width: 100%; -} - -.group:hover .group-hover\:-rotate-6{ - --tw-rotate: -6deg; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.group:hover .group-hover\:scale-150{ - --tw-scale-x: 1.5; - --tw-scale-y: 1.5; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.group:hover .group-hover\:opacity-100{ - opacity: 1; -} - .group:hover .group-hover\:\[animation-play-state\:paused\]{ animation-play-state: paused; } @@ -3619,26 +3503,14 @@ input[type="search"]::-webkit-search-results-decoration { grid-column: span 6 / span 6; } - .lg\:mb-0{ - margin-bottom: 0px; - } - .lg\:mt-32{ margin-top: 8rem; } - .lg\:block{ - display: block; - } - .lg\:flex{ display: flex; } - .lg\:h-5{ - height: 1.25rem; - } - .lg\:min-w-\[524px\]{ min-width: 524px; } @@ -3675,14 +3547,6 @@ input[type="search"]::-webkit-search-results-decoration { margin-bottom: calc(0px * var(--tw-space-y-reverse)); } - .lg\:border-white\/20{ - border-color: rgb(255 255 255 / 0.2); - } - - .lg\:bg-black\/10{ - background-color: rgb(0 0 0 / 0.1); - } - .lg\:p-24{ padding: 6rem; } @@ -3709,15 +3573,6 @@ input[type="search"]::-webkit-search-results-decoration { line-height: 1.5; letter-spacing: -0.017em; } - - .lg\:text-white{ - --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); - } - - .hover\:lg\:bg-black\/30:hover{ - background-color: rgb(0 0 0 / 0.3); - } } @media (min-width: 1280px){ diff --git a/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExp.woff b/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExp.woff new file mode 100644 index 000000000..6d596368c Binary files /dev/null and b/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExp.woff differ diff --git a/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExp.woff2 b/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExp.woff2 new file mode 100644 index 000000000..dc7ed7b25 Binary files /dev/null and b/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExp.woff2 differ diff --git a/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExpIta.woff b/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExpIta.woff new file mode 100644 index 000000000..638667898 Binary files /dev/null and b/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExpIta.woff differ diff --git a/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExpIta.woff2 b/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExpIta.woff2 new file mode 100644 index 000000000..e252c98b1 Binary files /dev/null and b/nebula/assets/fonts/ZTBrosOskon90s-BoldSemExpIta.woff2 differ diff --git a/pkg/nebula/assets/js/alpine.min.js b/nebula/assets/js/alpine.min.js similarity index 100% rename from pkg/nebula/assets/js/alpine.min.js rename to nebula/assets/js/alpine.min.js diff --git a/nebula/assets/js/dexie.min.js b/nebula/assets/js/dexie.min.js new file mode 100644 index 000000000..efca10dde --- /dev/null +++ b/nebula/assets/js/dexie.min.js @@ -0,0 +1,2 @@ +(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Dexie=t()})(this,function(){"use strict";var s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var w=function(){return(w=Object.assign||function(e){for(var t,n=1,r=arguments.length;n.",Ze="String expected.",et=[],tt="__dbnames",nt="readonly",rt="readwrite";function it(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var ot={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function at(t){return"string"!=typeof t||/\./.test(t)?function(e){return e}:function(e){return void 0===e[t]&&t in e&&delete(e=S(e))[t],e}}function ut(){throw Y.Type()}function st(e,t){try{var n=ct(e),r=ct(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return ts+c&&f(s+g)})})}var h=yt(r)&&r.limit===1/0&&("function"!=typeof w||w===Et)&&{index:r.index,range:r.range};return f(0).then(function(){if(0=c})).length?(e.forEach(function(u){t.push(function(){var t=h,e=u._cfg.dbschema;fn(s,t,f),fn(s,e,f),h=s._dbSchema=e;var n=an(t,e);n.add.forEach(function(e){un(f,e[0],e[1].primKey,e[1].indexes)}),n.change.forEach(function(e){if(e.recreate)throw new Y.Upgrade("Not yet support for changing primary key");var t=f.objectStore(e.name);e.add.forEach(function(e){return cn(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),cn(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var r=u._cfg.contentUpgrade;if(r&&u._cfg.version>c){Zt(s,f),l._memoizedTables={};var i=g(e);n.del.forEach(function(e){i[e]=t[e]}),tn(s,[s.Transaction.prototype]),en(s,[s.Transaction.prototype],_(i),i),l.schema=i;var o,a=B(r);a&&Le();n=_e.follow(function(){var e;(o=r(l))&&a&&(e=Ue.bind(null,null),o.then(e,e))});return o&&"function"==typeof o.then?_e.resolve(o):n.then(function(){return o})}}),t.push(function(e){var t,n,r=u._cfg.dbschema;t=r,n=e,[].slice.call(n.db.objectStoreNames).forEach(function(e){return null==t[e]&&n.db.deleteObjectStore(e)}),tn(s,[s.Transaction.prototype]),en(s,[s.Transaction.prototype],s._storeNames,s._dbSchema),l.schema=s._dbSchema}),t.push(function(e){s.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(s.idbdb.version/10)===u._cfg.version?(s.idbdb.deleteObjectStore("$meta"),delete s._dbSchema.$meta,s._storeNames=s._storeNames.filter(function(e){return"$meta"!==e})):e.objectStore("$meta").put(u._cfg.version,"version"))})}),function e(){return t.length?_e.resolve(t.shift()(l.idbtrans)).then(e):_e.resolve()}().then(function(){sn(h,f)})):_e.resolve();var s,c,l,f,t,h}).catch(u)):(_(o).forEach(function(e){un(i,e,o[e].primKey,o[e].indexes)}),Zt(n,i),void _e.follow(function(){return n.on.populate.fire(a)}).catch(u));var e,t})}function on(e,r){sn(e._dbSchema,r),r.db.version%10!=0||r.objectStoreNames.contains("$meta")||r.db.createObjectStore("$meta").add(Math.ceil(r.db.version/10-1),"version");var t=ln(0,e.idbdb,r);fn(e,e._dbSchema,r);for(var n=0,i=an(t,e._dbSchema).change;nMath.pow(2,62)?0:e.oldVersion,m=e<1,f.idbdb=l.result,p&&on(f,v),rn(f,e/10,v,n))},n),l.onsuccess=Te(function(){v=null;var e,t,n,r,i,o=f.idbdb=l.result,a=b(o.objectStoreNames);if(0h.limit?t.length=h.limit:e.length===h.limit&&t.length=r.limit&&(!r.values||e.req.values)&&Xn(e.req.query.range,r.query.range)}),!1,i,o];case"count":a=o.find(function(e){return Gn(e.req.query.range,r.query.range)});return[a,!!a,i,o]}}(O,c,"query",t),a=o[0],e=o[1],u=o[2],s=o[3];return a&&e?a.obsSet=t.obsSet:(e=l.query(t).then(function(e){var t=e.result;if(a&&(a.res=t),i){for(var n=0,r=t.length;n { + event.waitUntil(skipWaiting()); +}); + +// Start controlling clients as soon as the SW is activated +self.addEventListener("activate", (event) => { + event.waitUntil(clients.claim()); +}); + +self.addEventListener("canmakepayment", function (e) { + e.respondWith(new Promise(function (resolve, reject) { + resolve(true); + })); +}); diff --git a/nebula/bun.lockb b/nebula/bun.lockb new file mode 100755 index 000000000..9282d2731 Binary files /dev/null and b/nebula/bun.lockb differ diff --git a/nebula/components/auth/forms/consent_privacy.templ b/nebula/components/auth/forms/consent_privacy.templ new file mode 100644 index 000000000..77ed75a73 --- /dev/null +++ b/nebula/components/auth/forms/consent_privacy.templ @@ -0,0 +1,11 @@ +package forms + +templ PrivacyConsentForm() { +
+
+
+
+
+
+
+} diff --git a/nebula/components/auth/forms/consent_privacy_templ.go b/nebula/components/auth/forms/consent_privacy_templ.go new file mode 100644 index 000000000..5bc04ed06 --- /dev/null +++ b/nebula/components/auth/forms/consent_privacy_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func PrivacyConsentForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/components/auth/forms/credential_assert.templ b/nebula/components/auth/forms/credential_assert.templ new file mode 100644 index 000000000..142ecaca8 --- /dev/null +++ b/nebula/components/auth/forms/credential_assert.templ @@ -0,0 +1,11 @@ +package forms + +templ AssertCredentialForm() { +
+
+
+
+
+
+
+} diff --git a/nebula/components/auth/forms/credential_assert_templ.go b/nebula/components/auth/forms/credential_assert_templ.go new file mode 100644 index 000000000..9c3712c7f --- /dev/null +++ b/nebula/components/auth/forms/credential_assert_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func AssertCredentialForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/components/auth/forms/credential_register.templ b/nebula/components/auth/forms/credential_register.templ new file mode 100644 index 000000000..4e91ee1a6 --- /dev/null +++ b/nebula/components/auth/forms/credential_register.templ @@ -0,0 +1,11 @@ +package forms + +templ RegisterCredentialForm() { +
+
+
+
+
+
+
+} diff --git a/nebula/components/auth/forms/credential_register_templ.go b/nebula/components/auth/forms/credential_register_templ.go new file mode 100644 index 000000000..0ef8c8922 --- /dev/null +++ b/nebula/components/auth/forms/credential_register_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func RegisterCredentialForm() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/register/view.templ b/nebula/components/auth/forms/details_basic.templ similarity index 96% rename from pkg/nebula/components/register/view.templ rename to nebula/components/auth/forms/details_basic.templ index 64bdcbe22..9d669eede 100644 --- a/pkg/nebula/components/register/view.templ +++ b/nebula/components/auth/forms/details_basic.templ @@ -1,6 +1,6 @@ -package register +package forms -templ basicInfoForm() { +templ BasicDetailsForm() {
diff --git a/pkg/nebula/components/register/view_templ.go b/nebula/components/auth/forms/details_basic_templ.go similarity index 97% rename from pkg/nebula/components/register/view_templ.go rename to nebula/components/auth/forms/details_basic_templ.go index e29262c8e..74860dfb8 100644 --- a/pkg/nebula/components/register/view_templ.go +++ b/nebula/components/auth/forms/details_basic_templ.go @@ -1,14 +1,14 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package register +package forms //lint:file-ignore SA4006 This context is only used if a nested component is present. import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -func basicInfoForm() templ.Component { +func BasicDetailsForm() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { diff --git a/nebula/components/auth/modal.templ b/nebula/components/auth/modal.templ new file mode 100644 index 000000000..1cb4718fe --- /dev/null +++ b/nebula/components/auth/modal.templ @@ -0,0 +1,13 @@ +package auth + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/nebula/components/auth/sections" + "github.com/onsonr/sonr/nebula/global/styles" +) + +templ Modal(c echo.Context) { + @styles.OpenModal("Account Registration", "Enter your account information below to create your account.") { + @sections.RegisterStart() + } +} diff --git a/pkg/nebula/components/grant/view_templ.go b/nebula/components/auth/modal_templ.go similarity index 56% rename from pkg/nebula/components/grant/view_templ.go rename to nebula/components/auth/modal_templ.go index fc3ee4105..b4abfe0d0 100644 --- a/pkg/nebula/components/grant/view_templ.go +++ b/nebula/components/auth/modal_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package grant +package auth //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -10,10 +10,11 @@ import templruntime "github.com/a-h/templ/runtime" import ( "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/nebula/components/auth/sections" + "github.com/onsonr/sonr/nebula/global/styles" ) -func View(c echo.Context) templ.Component { +func Modal(c echo.Context) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -46,39 +47,13 @@ func View(c echo.Context) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Card("authorize-view", blocks.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.RegisterStart().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.OpenModal("Account Registration", "Enter your account information below to create your account.").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/nebula/components/auth/route.go b/nebula/components/auth/route.go new file mode 100644 index 000000000..260bf49ee --- /dev/null +++ b/nebula/components/auth/route.go @@ -0,0 +1,18 @@ +package auth + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/ctx" +) + +func AuthorizeRoute(c echo.Context) error { + return ctx.RenderTempl(c, Modal(c)) +} + +func LoginRoute(c echo.Context) error { + return ctx.RenderTempl(c, Modal(c)) +} + +func RegisterRoute(c echo.Context) error { + return ctx.RenderTempl(c, Modal(c)) +} diff --git a/nebula/components/auth/sections/authorize.templ b/nebula/components/auth/sections/authorize.templ new file mode 100644 index 000000000..152e1b842 --- /dev/null +++ b/nebula/components/auth/sections/authorize.templ @@ -0,0 +1,17 @@ +package sections + +import ( + "github.com/onsonr/sonr/nebula/components/auth/forms" + "github.com/onsonr/sonr/nebula/global/styles" + "github.com/onsonr/sonr/nebula/global/ui" +) + +templ AuthorizeStart() { + @ui.Breadcrumbs() + @forms.BasicDetailsForm() + @styles.Spacer() +
+ + +
+} diff --git a/nebula/components/auth/sections/authorize_templ.go b/nebula/components/auth/sections/authorize_templ.go new file mode 100644 index 000000000..83a0ca845 --- /dev/null +++ b/nebula/components/auth/sections/authorize_templ.go @@ -0,0 +1,58 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package sections + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/onsonr/sonr/nebula/components/auth/forms" + "github.com/onsonr/sonr/nebula/global/styles" + "github.com/onsonr/sonr/nebula/global/ui" +) + +func AuthorizeStart() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = ui.Breadcrumbs().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = forms.BasicDetailsForm().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = styles.Spacer().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/components/auth/sections/login.templ b/nebula/components/auth/sections/login.templ new file mode 100644 index 000000000..e8b596a0a --- /dev/null +++ b/nebula/components/auth/sections/login.templ @@ -0,0 +1,17 @@ +package sections + +import ( + "github.com/onsonr/sonr/nebula/components/auth/forms" + "github.com/onsonr/sonr/nebula/global/styles" + "github.com/onsonr/sonr/nebula/global/ui" +) + +templ LoginStart() { + @ui.Breadcrumbs() + @forms.BasicDetailsForm() + @styles.Spacer() +
+ + +
+} diff --git a/nebula/components/auth/sections/login_templ.go b/nebula/components/auth/sections/login_templ.go new file mode 100644 index 000000000..db440a0ee --- /dev/null +++ b/nebula/components/auth/sections/login_templ.go @@ -0,0 +1,58 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package sections + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/onsonr/sonr/nebula/components/auth/forms" + "github.com/onsonr/sonr/nebula/global/styles" + "github.com/onsonr/sonr/nebula/global/ui" +) + +func LoginStart() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = ui.Breadcrumbs().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = forms.BasicDetailsForm().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = styles.Spacer().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/components/auth/sections/register.templ b/nebula/components/auth/sections/register.templ new file mode 100644 index 000000000..eccefd2e8 --- /dev/null +++ b/nebula/components/auth/sections/register.templ @@ -0,0 +1,17 @@ +package sections + +import ( + "github.com/onsonr/sonr/nebula/components/auth/forms" + "github.com/onsonr/sonr/nebula/global/styles" + "github.com/onsonr/sonr/nebula/global/ui" +) + +templ RegisterStart() { + @ui.Breadcrumbs() + @forms.BasicDetailsForm() + @styles.Spacer() +
+ + +
+} diff --git a/nebula/components/auth/sections/register_templ.go b/nebula/components/auth/sections/register_templ.go new file mode 100644 index 000000000..fa3458dc1 --- /dev/null +++ b/nebula/components/auth/sections/register_templ.go @@ -0,0 +1,58 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package sections + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/onsonr/sonr/nebula/components/auth/forms" + "github.com/onsonr/sonr/nebula/global/styles" + "github.com/onsonr/sonr/nebula/global/ui" +) + +func RegisterStart() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = ui.Breadcrumbs().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = forms.BasicDetailsForm().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = styles.Spacer().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/components/dash/page.templ b/nebula/components/dash/page.templ new file mode 100644 index 000000000..179a0fa8f --- /dev/null +++ b/nebula/components/dash/page.templ @@ -0,0 +1,15 @@ +package dash + +import ( + "github.com/onsonr/sonr/nebula/components/home/sections" + "github.com/onsonr/sonr/nebula/global/styles" +) + +templ View() { + @styles.LayoutNoBody("Sonr.ID", true) { + @sections.Header() + @sections.Lowlights() + @sections.CallToAction() + @sections.Footer() + } +} diff --git a/pkg/nebula/components/profile/view_templ.go b/nebula/components/dash/page_templ.go similarity index 62% rename from pkg/nebula/components/profile/view_templ.go rename to nebula/components/dash/page_templ.go index a06107e70..61b503086 100644 --- a/pkg/nebula/components/profile/view_templ.go +++ b/nebula/components/dash/page_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package profile +package dash //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -9,11 +9,11 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" + "github.com/onsonr/sonr/nebula/components/home/sections" + "github.com/onsonr/sonr/nebula/global/styles" ) -func View(c echo.Context) templ.Component { +func View() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -46,31 +46,37 @@ func View(c echo.Context) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.ProfileCard().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + templ_7745c5c3_Err = sections.Header().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Card("profile-view", blocks.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.Lowlights().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.CallToAction().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sections.Footer().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.LayoutNoBody("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/nebula/components/dash/route.go b/nebula/components/dash/route.go new file mode 100644 index 000000000..2a039ff5f --- /dev/null +++ b/nebula/components/dash/route.go @@ -0,0 +1,10 @@ +package dash + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/ctx" +) + +func Route(c echo.Context) error { + return ctx.RenderTempl(c, View()) +} diff --git a/nebula/components/home/page.templ b/nebula/components/home/page.templ new file mode 100644 index 000000000..1f91b4a74 --- /dev/null +++ b/nebula/components/home/page.templ @@ -0,0 +1,19 @@ +package home + +import ( + "github.com/onsonr/sonr/nebula/components/home/sections" + "github.com/onsonr/sonr/nebula/global/styles" +) + +templ View() { + @styles.LayoutNoBody("Sonr.ID", true) { + @sections.Header() + @sections.Hero(hero) + @sections.Highlights(highlights) + @sections.Mission() + @sections.Architecture() + @sections.Lowlights() + @sections.CallToAction() + @sections.Footer() + } +} diff --git a/pkg/nebula/components/home/view_templ.go b/nebula/components/home/page_templ.go similarity index 80% rename from pkg/nebula/components/home/view_templ.go rename to nebula/components/home/page_templ.go index 93fd6732e..e1df8e53e 100644 --- a/pkg/nebula/components/home/view_templ.go +++ b/nebula/components/home/page_templ.go @@ -9,11 +9,11 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/nebula/components/blocks" - "github.com/onsonr/sonr/pkg/nebula/models" + "github.com/onsonr/sonr/nebula/components/home/sections" + "github.com/onsonr/sonr/nebula/global/styles" ) -func View(home *models.Home) templ.Component { +func View() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -46,7 +46,7 @@ func View(home *models.Home) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = Header().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Header().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -54,7 +54,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = SectionHero(home.Hero).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Hero(hero).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -62,7 +62,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Highlights().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Highlights(highlights).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -70,7 +70,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Features().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Mission().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -78,7 +78,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Bento().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Architecture().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -86,7 +86,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Lowlights().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Lowlights().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -94,7 +94,7 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = CallToAction().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.CallToAction().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -102,13 +102,13 @@ func View(home *models.Home) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = Footer().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = sections.Footer().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } return templ_7745c5c3_Err }) - templ_7745c5c3_Err = blocks.LayoutNoBody("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = styles.LayoutNoBody("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/nebula/components/home/route.go b/nebula/components/home/route.go new file mode 100644 index 000000000..bdd2c6cc4 --- /dev/null +++ b/nebula/components/home/route.go @@ -0,0 +1,10 @@ +package home + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/ctx" +) + +func Route(c echo.Context) error { + return ctx.RenderTempl(c, View()) +} diff --git a/pkg/nebula/components/home/bento.templ b/nebula/components/home/sections/architecture.templ similarity index 99% rename from pkg/nebula/components/home/bento.templ rename to nebula/components/home/sections/architecture.templ index d28941aad..6f4fadcdd 100644 --- a/pkg/nebula/components/home/bento.templ +++ b/nebula/components/home/sections/architecture.templ @@ -1,6 +1,6 @@ -package home +package sections -templ Bento() { +templ Architecture() {
diff --git a/pkg/nebula/components/home/bento_templ.go b/nebula/components/home/sections/architecture_templ.go similarity index 99% rename from pkg/nebula/components/home/bento_templ.go rename to nebula/components/home/sections/architecture_templ.go index 2c25e5b85..50e4d3c56 100644 --- a/pkg/nebula/components/home/bento_templ.go +++ b/nebula/components/home/sections/architecture_templ.go @@ -1,14 +1,14 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -func Bento() templ.Component { +func Architecture() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { diff --git a/pkg/nebula/components/home/cta.templ b/nebula/components/home/sections/cta.templ similarity index 98% rename from pkg/nebula/components/home/cta.templ rename to nebula/components/home/sections/cta.templ index 00c950a3d..c3dc9fa0e 100644 --- a/pkg/nebula/components/home/cta.templ +++ b/nebula/components/home/sections/cta.templ @@ -1,4 +1,5 @@ -package home +package sections + templ CallToAction() {
@@ -7,7 +8,7 @@ templ CallToAction() {

diff --git a/nebula/components/home/sections/cta_templ.go b/nebula/components/home/sections/cta_templ.go new file mode 100644 index 000000000..31de9ca2f --- /dev/null +++ b/nebula/components/home/sections/cta_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package sections + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func CallToAction() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"

Take control of your Identity today

Sonr removes creative distances by connecting beginners, pros, and every team in between. Are you ready to start your journey?

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/home/footer.templ b/nebula/components/home/sections/footer.templ similarity index 97% rename from pkg/nebula/components/home/footer.templ rename to nebula/components/home/sections/footer.templ index 94c68ba79..9afbb64c7 100644 --- a/pkg/nebula/components/home/footer.templ +++ b/nebula/components/home/sections/footer.templ @@ -1,4 +1,4 @@ -package home +package sections templ Footer() { @@ -11,7 +11,7 @@ templ Footer() {
© diDAO DUNA. All rights reserved.
diff --git a/nebula/components/home/sections/footer_templ.go b/nebula/components/home/sections/footer_templ.go new file mode 100644 index 000000000..7dc321650 --- /dev/null +++ b/nebula/components/home/sections/footer_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package sections + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Footer() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/home/header.templ b/nebula/components/home/sections/header.templ similarity index 84% rename from pkg/nebula/components/home/header.templ rename to nebula/components/home/sections/header.templ index 9dd0ec4d6..e5ff3b986 100644 --- a/pkg/nebula/components/home/header.templ +++ b/nebula/components/home/sections/header.templ @@ -1,4 +1,4 @@ -package home +package sections templ Header() { @@ -9,8 +9,8 @@ templ Header() { diff --git a/pkg/nebula/components/home/header_templ.go b/nebula/components/home/sections/header_templ.go similarity index 70% rename from pkg/nebula/components/home/header_templ.go rename to nebula/components/home/sections/header_templ.go index 57d740b52..b40a38a4e 100644 --- a/pkg/nebula/components/home/header_templ.go +++ b/nebula/components/home/sections/header_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -29,7 +29,7 @@ func Header() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/home/hero.templ b/nebula/components/home/sections/hero.templ similarity index 70% rename from pkg/nebula/components/home/hero.templ rename to nebula/components/home/sections/hero.templ index 9eda2d7e1..a6a8b94fd 100644 --- a/pkg/nebula/components/home/hero.templ +++ b/nebula/components/home/sections/hero.templ @@ -1,11 +1,11 @@ -package home +package sections import ( - "github.com/onsonr/sonr/pkg/nebula/components/ui" - "github.com/onsonr/sonr/pkg/nebula/models" + "github.com/onsonr/sonr/internal/orm/models" + "github.com/onsonr/sonr/nebula/global/ui" ) -templ SectionHero(hero *models.Hero) { +templ Hero(hero *models.Hero) {
@@ -27,13 +27,13 @@ templ SectionHero(hero *models.Hero) { { hero.Subtitle }

- @ui.PrimaryButton(hero.PrimaryButton.Href, hero.PrimaryButton.Text) - @ui.SecondaryButton(hero.SecondaryButton.Href, hero.SecondaryButton.Text) + @ui.PrimaryButton("/register", "Get Started") + @ui.SecondaryButton("/about", "Learn More")

@heroImage(hero) - @stats() + @stats(hero.Stats)
@@ -41,7 +41,7 @@ templ SectionHero(hero *models.Hero) { templ heroImage(hero *models.Hero) { -
+
} -templ stats() { +templ stats(stats []*models.Stat) {
- -
-

0K

-

Assets packed with power beyond your imagination.

-
- -
-

0K

-

Assets packed with power beyond your imagination.

-
- -
-

0M+

-

Assets packed with power beyond your imagination.

-
- -
-

0K

-

Assets packed with power beyond your imagination.

-
+ for _, item := range stats { +
+

{ item.Value }{ item.Denom }

+

{ item.Label }

+
+ }
@counterAnimation()
diff --git a/pkg/nebula/components/home/hero_templ.go b/nebula/components/home/sections/hero_templ.go similarity index 76% rename from pkg/nebula/components/home/hero_templ.go rename to nebula/components/home/sections/hero_templ.go index 84de2bf4f..0b37dde62 100644 --- a/pkg/nebula/components/home/hero_templ.go +++ b/nebula/components/home/sections/hero_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -9,11 +9,11 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import ( - "github.com/onsonr/sonr/pkg/nebula/components/ui" - "github.com/onsonr/sonr/pkg/nebula/models" + "github.com/onsonr/sonr/internal/orm/models" + "github.com/onsonr/sonr/nebula/global/ui" ) -func SectionHero(hero *models.Hero) templ.Component { +func Hero(hero *models.Hero) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -41,7 +41,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleFirst) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 17, Col: 24} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/components/home/sections/hero.templ`, Line: 17, Col: 24} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -54,7 +54,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleEmphasis) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 19, Col: 28} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/components/home/sections/hero.templ`, Line: 19, Col: 28} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -67,7 +67,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hero.TitleSecond) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 24, Col: 25} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/components/home/sections/hero.templ`, Line: 24, Col: 25} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -80,7 +80,7 @@ func SectionHero(hero *models.Hero) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(hero.Subtitle) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/home/hero.templ`, Line: 27, Col: 22} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/components/home/sections/hero.templ`, Line: 27, Col: 22} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -90,11 +90,11 @@ func SectionHero(hero *models.Hero) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = ui.PrimaryButton(hero.PrimaryButton.Href, hero.PrimaryButton.Text).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = ui.PrimaryButton("/register", "Get Started").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = ui.SecondaryButton(hero.SecondaryButton.Href, hero.SecondaryButton.Text).Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = ui.SecondaryButton("/about", "Learn More").Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -106,7 +106,7 @@ func SectionHero(hero *models.Hero) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = stats().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = stats(hero.Stats).Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -139,14 +139,14 @@ func heroImage(hero *models.Hero) templ.Component { templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

0K

Assets packed with power beyond your imagination.

0K

Assets packed with power beyond your imagination.

0M+

Assets packed with power beyond your imagination.

0K

Assets packed with power beyond your imagination.

") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, item := range stats { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(item.Value) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/components/home/sections/hero.templ`, Line: 61, Col: 145} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var12 string + templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(item.Denom) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/components/home/sections/hero.templ`, Line: 61, Col: 166} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(item.Label) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/components/home/sections/hero.templ`, Line: 62, Col: 50} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/home/highlights.templ b/nebula/components/home/sections/highlights.templ similarity index 97% rename from pkg/nebula/components/home/highlights.templ rename to nebula/components/home/sections/highlights.templ index a8d2884cf..df376f838 100644 --- a/pkg/nebula/components/home/highlights.templ +++ b/nebula/components/home/sections/highlights.templ @@ -1,6 +1,8 @@ -package home +package sections -templ Highlights() { +import "github.com/onsonr/sonr/internal/orm/models" + +templ Highlights(highlights *models.Highlights) {
@@ -9,11 +11,10 @@ templ Highlights() {

- The Internet Rebuilt for You + { highlights.Heading }

- Sonr is a comprehensive system for Identity Management which proteects users across their digital personas while - providing Developers a cost-effective solution for decentralized authentication. + { highlights.Subtitle }

diff --git a/nebula/components/home/sections/highlights_templ.go b/nebula/components/home/sections/highlights_templ.go new file mode 100644 index 000000000..a2d818def --- /dev/null +++ b/nebula/components/home/sections/highlights_templ.go @@ -0,0 +1,68 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package sections + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "github.com/onsonr/sonr/internal/orm/models" + +func Highlights(highlights *models.Highlights) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(highlights.Heading) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/components/home/sections/highlights.templ`, Line: 14, Col: 26} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(highlights.Subtitle) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/components/home/sections/highlights.templ`, Line: 17, Col: 27} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

\"Feature
\"Feature
\"Feature
\"Feature
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/home/lowlights.templ b/nebula/components/home/sections/lowlights.templ similarity index 99% rename from pkg/nebula/components/home/lowlights.templ rename to nebula/components/home/sections/lowlights.templ index aecf235fb..1f2d696bf 100644 --- a/pkg/nebula/components/home/lowlights.templ +++ b/nebula/components/home/sections/lowlights.templ @@ -1,4 +1,4 @@ -package home +package sections templ Lowlights() {
diff --git a/pkg/nebula/components/home/lowlights_templ.go b/nebula/components/home/sections/lowlights_templ.go similarity index 99% rename from pkg/nebula/components/home/lowlights_templ.go rename to nebula/components/home/sections/lowlights_templ.go index 470b376ee..23d64a838 100644 --- a/pkg/nebula/components/home/lowlights_templ.go +++ b/nebula/components/home/sections/lowlights_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package home +package sections //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/home/features.templ b/nebula/components/home/sections/mission.templ similarity index 99% rename from pkg/nebula/components/home/features.templ rename to nebula/components/home/sections/mission.templ index a7c1d09e9..8e7b7eb8e 100644 --- a/pkg/nebula/components/home/features.templ +++ b/nebula/components/home/sections/mission.templ @@ -1,6 +1,6 @@ -package home +package sections -templ Features() { +templ Mission() {
+ + + @styles.Alpine() + @styles.Htmx() + @styles.Styles() + + + + Sonr DWN + @state.RegisterServiceWorker() + + +
+
Loading...
+
+ + +} diff --git a/nebula/components/index/index_templ.go b/nebula/components/index/index_templ.go new file mode 100644 index 000000000..a134bc196 --- /dev/null +++ b/nebula/components/index/index_templ.go @@ -0,0 +1,69 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package index + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/onsonr/sonr/nebula/global/state" + "github.com/onsonr/sonr/nebula/global/styles" +) + +func IndexFile() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = styles.Alpine().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = styles.Htmx().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = styles.Styles().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Sonr DWN") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = state.RegisterServiceWorker().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Loading...
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/components/pay/route.go b/nebula/components/pay/route.go new file mode 100644 index 000000000..9d070ab7d --- /dev/null +++ b/nebula/components/pay/route.go @@ -0,0 +1,10 @@ +package pay + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/ctx" +) + +func Route(c echo.Context) error { + return ctx.RenderTempl(c, nil) +} diff --git a/pkg/nebula/.deps.mjs b/nebula/deps.mjs similarity index 74% rename from pkg/nebula/.deps.mjs rename to nebula/deps.mjs index c225d4c21..57859ccf8 100644 --- a/pkg/nebula/.deps.mjs +++ b/nebula/deps.mjs @@ -24,15 +24,21 @@ async function main() { // Fetch htmx.min.js await fetchAndSave( - "https://cdn.sonr.io/js/htmx.min.js", + "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.2/htmx.min.js", "./assets/js/htmx.min.js", ); // Fetch alpine.min.js await fetchAndSave( - "https://unpkg.com/alpinejs@latest/dist/cdn.min.js", + "https://cdnjs.cloudflare.com/ajax/libs/alpinejs/3.14.1/cdn.min.js", "./assets/js/alpine.min.js", ); + + // Fetch dexie.min.js + await fetchAndSave( + "https://cdnjs.cloudflare.com/ajax/libs/dexie/4.0.8/dexie.min.js", + "./assets/js/dexie.min.js", + ); } main(); diff --git a/nebula/global/state/credentials.templ b/nebula/global/state/credentials.templ new file mode 100644 index 000000000..06a6c9c16 --- /dev/null +++ b/nebula/global/state/credentials.templ @@ -0,0 +1,92 @@ +package state + +templ NavigatorCredentialsCreate() { + +} + +templ NavigatorCredentialsGet() { + +} + +templ NavigatorCredentialsGetAll() { + +} + +templ NavigatorCredentialsHasPasskey() { + +} diff --git a/nebula/global/state/credentials_templ.go b/nebula/global/state/credentials_templ.go new file mode 100644 index 000000000..3790d28c4 --- /dev/null +++ b/nebula/global/state/credentials_templ.go @@ -0,0 +1,127 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package state + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func NavigatorCredentialsCreate() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func NavigatorCredentialsGet() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func NavigatorCredentialsGetAll() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func NavigatorCredentialsHasPasskey() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/global/state/database.templ b/nebula/global/state/database.templ new file mode 100644 index 000000000..d6fb91a91 --- /dev/null +++ b/nebula/global/state/database.templ @@ -0,0 +1,17 @@ +package state + +templ InsertAccount(accountName string) { + +} diff --git a/nebula/global/state/database_templ.go b/nebula/global/state/database_templ.go new file mode 100644 index 000000000..5d9f24eff --- /dev/null +++ b/nebula/global/state/database_templ.go @@ -0,0 +1,40 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package state + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func InsertAccount(accountName string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/global/state/worker.templ b/nebula/global/state/worker.templ new file mode 100644 index 000000000..c17b61507 --- /dev/null +++ b/nebula/global/state/worker.templ @@ -0,0 +1,24 @@ +package state + +var ( + serviceWorkerHandle = templ.NewOnceHandle() +) + +templ RegisterServiceWorker() { + @serviceWorkerHandle.Once() { + + } +} diff --git a/nebula/global/state/worker_templ.go b/nebula/global/state/worker_templ.go new file mode 100644 index 000000000..ab168135b --- /dev/null +++ b/nebula/global/state/worker_templ.go @@ -0,0 +1,62 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package state + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +var ( + serviceWorkerHandle = templ.NewOnceHandle() +) + +func RegisterServiceWorker() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = serviceWorkerHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/src/styles.css b/nebula/global/styles/globals.css similarity index 87% rename from pkg/nebula/src/styles.css rename to nebula/global/styles/globals.css index ed929e5e0..40e044a5f 100644 --- a/pkg/nebula/src/styles.css +++ b/nebula/global/styles/globals.css @@ -10,6 +10,25 @@ display: none; } +@layer base { + @font-face { + font-family: "ZT Bros Oskon 90s"; + font-style: italic; + font-weight: bold; + font-display: swap; + src: url(https://cdn.sonr.id/fonts/ZTBrosOskon90s-BoldSemExpIta.woff2) + format("woff2"); + } + @font-face { + font-family: "ZT Bros Oskon 90s"; + font-style: normal; + font-weight: bold; + font-display: swap; + src: url(https://cdn.sonr.id/fonts/ZTBrosOskon90s-BoldSemExp.woff2) + format("woff2"); + } +} + /* Custom styles */ .form-input:focus, .form-textarea:focus, diff --git a/nebula/global/styles/layout.templ b/nebula/global/styles/layout.templ new file mode 100644 index 000000000..d82b8318d --- /dev/null +++ b/nebula/global/styles/layout.templ @@ -0,0 +1,124 @@ +package styles + +type Icon interface { + Render() templ.Component +} + +type Variant interface { + Attributes() templ.Attributes +} + +templ Spacer() { +
+} + +templ Rows() { +
+ { children... } +
+} + +templ Columns() { +
+ { children... } +
+} + +templ Layout(title string, remote bool) { + + + + @Fonts() + @Styles() + @Htmx() + @Alpine() + + + + { title } + + + + + + +
+ { children... } +
+ + +} + +templ LayoutNoBody(title string, remote bool) { + + + + @Fonts() + @Styles() + @Htmx() + @Alpine() + + + + { title } + + + + + +
+ +
+ { children... } +
+ +
+ +} + +templ OpenModal(title, description string) { +
+ +
+} diff --git a/nebula/global/styles/layout_templ.go b/nebula/global/styles/layout_templ.go new file mode 100644 index 000000000..0076fc4fe --- /dev/null +++ b/nebula/global/styles/layout_templ.go @@ -0,0 +1,325 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package styles + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +type Icon interface { + Render() templ.Component +} + +type Variant interface { + Attributes() templ.Attributes +} + +func Spacer() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func Rows() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var2.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func Columns() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func Layout(title string, remote bool) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Fonts().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Styles().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Htmx().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Alpine().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/styles/layout.templ`, Line: 38, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var4.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func LayoutNoBody(title string, remote bool) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Fonts().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Styles().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Htmx().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Alpine().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/styles/layout.templ`, Line: 63, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func OpenModal(title, description string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var8 := templ.GetChildren(ctx) + if templ_7745c5c3_Var8 == nil { + templ_7745c5c3_Var8 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/nebula/global/styles/scripts.templ b/nebula/global/styles/scripts.templ new file mode 100644 index 000000000..b5a185990 --- /dev/null +++ b/nebula/global/styles/scripts.templ @@ -0,0 +1,33 @@ +package styles + +const ( + PublicOrigin = "https://cdn.sonr.id" +) + +var ( + stylesHandle = templ.NewOnceHandle() + alpineHandle = templ.NewOnceHandle() + dexieHandle = templ.NewOnceHandle() + htmxHandle = templ.NewOnceHandle() +) + +templ Fonts() { + + +} + +templ Styles() { + +} + +templ Alpine() { + +} + +templ Dexie() { + +} + +templ Htmx() { + +} diff --git a/pkg/nebula/components/blocks/head_templ.go b/nebula/global/styles/scripts_templ.go similarity index 50% rename from pkg/nebula/components/blocks/head_templ.go rename to nebula/global/styles/scripts_templ.go index 51f9e2f27..5d5734639 100644 --- a/pkg/nebula/components/blocks/head_templ.go +++ b/nebula/global/styles/scripts_templ.go @@ -1,60 +1,25 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package styles //lint:file-ignore SA4006 This context is only used if a nested component is present. import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import "strings" +const ( + PublicOrigin = "https://cdn.sonr.id" +) -type Icon interface { - Render() templ.Component -} +var ( + stylesHandle = templ.NewOnceHandle() + alpineHandle = templ.NewOnceHandle() + dexieHandle = templ.NewOnceHandle() + htmxHandle = templ.NewOnceHandle() +) -type Variant interface { - Attributes() templ.Attributes -} - -var stylesHandle = templ.NewOnceHandle() -var alpineHandle = templ.NewOnceHandle() -var htmxHandle = templ.NewOnceHandle() - -func clsxMerge(variants ...Variant) templ.Attributes { - combinedAttrs := templ.Attributes{} - var classElements []string - - for _, variant := range variants { - attrs := variant.Attributes() - if class, ok := attrs["class"].(string); ok { - classElements = append(classElements, strings.Fields(class)...) - } - for key, value := range attrs { - if key != "class" { - combinedAttrs[key] = value - } - } - } - - if len(classElements) > 0 { - combinedAttrs["class"] = strings.Join(classElements, " ") - } - return combinedAttrs -} - -func clsxBuilder(classes ...string) templ.Attributes { - if len(classes) == 0 { - return templ.Attributes{} - } - class := strings.Join(classes, " ") - return templ.Attributes{ - "class": class, - } -} - -func Spacer() templ.Component { +func Fonts() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -75,7 +40,7 @@ func Spacer() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -83,7 +48,7 @@ func Spacer() templ.Component { }) } -func Styles(local bool) templ.Component { +func Styles() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -104,25 +69,20 @@ func Styles(local bool) templ.Component { templ_7745c5c3_Var2 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -130,7 +90,7 @@ func Styles(local bool) templ.Component { }) } -func Alpine(local bool) templ.Component { +func Alpine() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -151,25 +111,20 @@ func Alpine(local bool) templ.Component { templ_7745c5c3_Var4 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -177,7 +132,7 @@ func Alpine(local bool) templ.Component { }) } -func Htmx(local bool) templ.Component { +func Dexie() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -198,25 +153,20 @@ func Htmx(local bool) templ.Component { templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -224,7 +174,7 @@ func Htmx(local bool) templ.Component { }) } -func Rows() templ.Component { +func Htmx() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -245,52 +195,20 @@ func Rows() templ.Component { templ_7745c5c3_Var8 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/nebula/components/blocks/sizes.templ b/nebula/global/styles/sizes.templ similarity index 98% rename from pkg/nebula/components/blocks/sizes.templ rename to nebula/global/styles/sizes.templ index a36727643..1059a817c 100644 --- a/pkg/nebula/components/blocks/sizes.templ +++ b/nebula/global/styles/sizes.templ @@ -1,4 +1,4 @@ -package blocks +package styles type Size int diff --git a/pkg/nebula/components/blocks/sizes_templ.go b/nebula/global/styles/sizes_templ.go similarity index 98% rename from pkg/nebula/components/blocks/sizes_templ.go rename to nebula/global/styles/sizes_templ.go index 3a6e40584..4e9555a0c 100644 --- a/pkg/nebula/components/blocks/sizes_templ.go +++ b/nebula/global/styles/sizes_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package styles //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/blocks/fonts.templ b/nebula/global/styles/typography.templ similarity index 98% rename from pkg/nebula/components/blocks/fonts.templ rename to nebula/global/styles/typography.templ index bbd2d6e36..f75c3e699 100644 --- a/pkg/nebula/components/blocks/fonts.templ +++ b/nebula/global/styles/typography.templ @@ -1,4 +1,4 @@ -package blocks +package styles func H1(content string) templ.Component { return renderText(1, content) diff --git a/pkg/nebula/components/blocks/fonts_templ.go b/nebula/global/styles/typography_templ.go similarity index 92% rename from pkg/nebula/components/blocks/fonts_templ.go rename to nebula/global/styles/typography_templ.go index 564baf691..a35d9626e 100644 --- a/pkg/nebula/components/blocks/fonts_templ.go +++ b/nebula/global/styles/typography_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package styles //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -54,7 +54,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 23, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/styles/typography.templ`, Line: 23, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -72,7 +72,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 27, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/styles/typography.templ`, Line: 27, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -90,7 +90,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 31, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/styles/typography.templ`, Line: 31, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -108,7 +108,7 @@ func renderText(level int, text string) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 35, Col: 10} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/styles/typography.templ`, Line: 35, Col: 10} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -159,7 +159,7 @@ func renderLink(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 42, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/styles/typography.templ`, Line: 42, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -209,7 +209,7 @@ func renderStrong(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 48, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/styles/typography.templ`, Line: 48, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -259,7 +259,7 @@ func renderEmphasis(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 54, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/styles/typography.templ`, Line: 54, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -309,7 +309,7 @@ func renderCode(attrs templ.Attributes, text string) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(text) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/fonts.templ`, Line: 60, Col: 8} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/styles/typography.templ`, Line: 60, Col: 8} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { diff --git a/pkg/nebula/components/blocks/badge.templ b/nebula/global/ui/badge.templ similarity index 99% rename from pkg/nebula/components/blocks/badge.templ rename to nebula/global/ui/badge.templ index a8ac1584e..266d6fbf7 100644 --- a/pkg/nebula/components/blocks/badge.templ +++ b/nebula/global/ui/badge.templ @@ -1,4 +1,4 @@ -package blocks +package ui templ PoweredBySonr() {
diff --git a/pkg/nebula/components/blocks/badge_templ.go b/nebula/global/ui/badge_templ.go similarity index 99% rename from pkg/nebula/components/blocks/badge_templ.go rename to nebula/global/ui/badge_templ.go index 202f7ab97..606c77c21 100644 --- a/pkg/nebula/components/blocks/badge_templ.go +++ b/nebula/global/ui/badge_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package ui //lint:file-ignore SA4006 This context is only used if a nested component is present. diff --git a/pkg/nebula/components/blocks/button.templ b/nebula/global/ui/button.templ similarity index 94% rename from pkg/nebula/components/blocks/button.templ rename to nebula/global/ui/button.templ index 6f05f6b4e..76fc34075 100644 --- a/pkg/nebula/components/blocks/button.templ +++ b/nebula/global/ui/button.templ @@ -1,7 +1,21 @@ -package blocks +package ui + +import "github.com/onsonr/sonr/nebula/global/styles" + +templ PrimaryButton(href string, text string) { +
+
{ text }
+
+} + +templ SecondaryButton(href string, text string) { +
+
{ text }
+
+} type button struct { - variant Variant + variant styles.Variant hxGet string hxPost string hxTarget string diff --git a/pkg/nebula/components/blocks/button_templ.go b/nebula/global/ui/button_templ.go similarity index 72% rename from pkg/nebula/components/blocks/button_templ.go rename to nebula/global/ui/button_templ.go index b7a09278a..03cf22dd7 100644 --- a/pkg/nebula/components/blocks/button_templ.go +++ b/nebula/global/ui/button_templ.go @@ -1,15 +1,127 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package ui //lint:file-ignore SA4006 This context is only used if a nested component is present. import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" +import "github.com/onsonr/sonr/nebula/global/styles" + +func PrimaryButton(href string, text string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/ui/button.templ`, Line: 7, Col: 133} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func SecondaryButton(href string, text string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/ui/button.templ`, Line: 13, Col: 132} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + type button struct { - variant Variant + variant styles.Variant hxGet string hxPost string hxTarget string @@ -100,9 +212,9 @@ func renderButton(attrs templ.Attributes) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" + diff --git a/pkg/nebula/components/blocks/panel_templ.go b/nebula/global/ui/panel_templ.go similarity index 96% rename from pkg/nebula/components/blocks/panel_templ.go rename to nebula/global/ui/panel_templ.go index 420409a2c..f3d677983 100644 --- a/pkg/nebula/components/blocks/panel_templ.go +++ b/nebula/global/ui/panel_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.2.778 -package blocks +package ui //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -100,7 +100,7 @@ func breadcrumbItem(title string, active bool) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/panel.templ`, Line: 25, Col: 126} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/ui/panel.templ`, Line: 26, Col: 126} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -118,7 +118,7 @@ func breadcrumbItem(title string, active bool) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/panel.templ`, Line: 27, Col: 118} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/global/ui/panel.templ`, Line: 28, Col: 118} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -154,7 +154,7 @@ func breadcrumbIcon() templ.Component { templ_7745c5c3_Var5 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/nebula/package.json b/nebula/package.json new file mode 100644 index 000000000..04e124ec2 --- /dev/null +++ b/nebula/package.json @@ -0,0 +1,17 @@ +{ + "name": "@onsonr/nebula", + "version": "0.0.2", + "scripts": { + "fetch:deps": "bun run deps.mjs", + "build:css": "bunx tailwindcss -i ./global/styles/globals.css -o ./assets/css/styles.css", + "build": "bun run fetch:deps && bun run build:css" + }, + "dependencies": { + "node-fetch": "^3.3.2", + "@tailwindcss/forms": "^0.5.7", + "@tailwindcss/typography": "^0.5.15", + "sonr-es": "^0.5.3", + "tailwindcss": "^3.3.0", + "tailwindcss-motion": "^0.3.0-beta" + } +} diff --git a/pkg/nebula/tailwind.config.js b/nebula/tailwind.config.js similarity index 98% rename from pkg/nebula/tailwind.config.js rename to nebula/tailwind.config.js index 6e753ae17..d8ee80a8b 100644 --- a/pkg/nebula/tailwind.config.js +++ b/nebula/tailwind.config.js @@ -2,7 +2,7 @@ module.exports = { content: [ "./components/**/*.{templ,html}", - "./pages/**/*.{templ,html}", + "./global/**/*.{templ,html}", "./src/**/*.ts", ], theme: { diff --git a/pkg/dwn/Config.pkl.go b/pkg/dwn/Config.pkl.go deleted file mode 100644 index 963d9f6a2..000000000 --- a/pkg/dwn/Config.pkl.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated from Pkl module `dwn`. DO NOT EDIT. -package dwn - -type Config struct { - Ipfs *IPFS `pkl:"ipfs"` - - Sonr *Sonr `pkl:"sonr"` - - Motr *Motr `pkl:"motr"` - - Schema *Schema `pkl:"schema"` - - ProxyUrl string `pkl:"proxyUrl"` -} diff --git a/pkg/dwn/IPFS.pkl.go b/pkg/dwn/IPFS.pkl.go deleted file mode 100644 index 7f2add580..000000000 --- a/pkg/dwn/IPFS.pkl.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated from Pkl module `dwn`. DO NOT EDIT. -package dwn - -type IPFS struct { - ApiUrl string `pkl:"apiUrl"` - - GatewayUrl string `pkl:"gatewayUrl"` -} diff --git a/pkg/dwn/Motr.pkl.go b/pkg/dwn/Motr.pkl.go deleted file mode 100644 index 288159103..000000000 --- a/pkg/dwn/Motr.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `dwn`. DO NOT EDIT. -package dwn - -type Motr struct { - Keyshare string `pkl:"keyshare"` - - Address string `pkl:"address"` - - Origin string `pkl:"origin"` -} diff --git a/pkg/dwn/Schema.pkl.go b/pkg/dwn/Schema.pkl.go deleted file mode 100644 index 80569916f..000000000 --- a/pkg/dwn/Schema.pkl.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated from Pkl module `dwn`. DO NOT EDIT. -package dwn - -type Schema struct { - Version int `pkl:"version"` - - Account string `pkl:"account"` - - Asset string `pkl:"asset"` - - Chain string `pkl:"chain"` - - Credential string `pkl:"credential"` - - Jwk string `pkl:"jwk"` - - Grant string `pkl:"grant"` - - Keyshare string `pkl:"keyshare"` - - Profile string `pkl:"profile"` -} diff --git a/pkg/dwn/Sonr.pkl.go b/pkg/dwn/Sonr.pkl.go deleted file mode 100644 index 9fec1dc2c..000000000 --- a/pkg/dwn/Sonr.pkl.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated from Pkl module `dwn`. DO NOT EDIT. -package dwn - -type Sonr struct { - ApiUrl string `pkl:"apiUrl"` - - GrpcUrl string `pkl:"grpcUrl"` - - RpcUrl string `pkl:"rpcUrl"` - - WebSocketUrl string `pkl:"webSocketUrl"` - - ChainId string `pkl:"chainId"` -} diff --git a/pkg/dwn/embed.go b/pkg/dwn/embed.go deleted file mode 100644 index 134743eec..000000000 --- a/pkg/dwn/embed.go +++ /dev/null @@ -1,71 +0,0 @@ -package dwn - -import ( - "bytes" - "context" - _ "embed" - "encoding/json" - - "github.com/a-h/templ" - "github.com/ipfs/boxo/files" -) - -//go:embed app.wasm -var dwnWasmData []byte - -//go:embed sw.js -var swJSData []byte - -var ( - dwnWasmFile = files.NewBytesFile(dwnWasmData) - swJSFile = files.NewBytesFile(swJSData) -) - -// NewVaultDirectory creates a new directory with the default files -func NewVaultDirectory(cnfg *Config) (files.Node, error) { - dwnJSON, err := json.Marshal(cnfg) - if err != nil { - return nil, err - } - - dwnStr, err := templ.JSONString(cnfg) - if err != nil { - return nil, err - } - w := bytes.NewBuffer(nil) - err = indexFile(dwnStr).Render(context.Background(), w) - if err != nil { - return nil, err - } - fileMap := map[string]files.Node{ - "config.json": files.NewBytesFile(dwnJSON), - "sw.js": swJSFile, - "app.wasm": dwnWasmFile, - "index.html": files.NewBytesFile(w.Bytes()), - } - return files.NewMapDirectory(fileMap), nil -} - -// Use IndexHTML template to generate the index file -func IndexHTMLFile(c *Config) (files.Node, error) { - str, err := templ.JSONString(c) - if err != nil { - return nil, err - } - w := bytes.NewBuffer(nil) - err = indexFile(str).Render(context.Background(), w) - if err != nil { - return nil, err - } - indexData := w.Bytes() - return files.NewBytesFile(indexData), nil -} - -// MarshalConfigFile uses the config template to generate the dwn config file -func MarshalConfigFile(c *Config) (files.Node, error) { - dwnConfigData, err := json.Marshal(c) - if err != nil { - return nil, err - } - return files.NewBytesFile(dwnConfigData), nil -} diff --git a/pkg/dwn/index.templ b/pkg/dwn/index.templ deleted file mode 100644 index f8c4880eb..000000000 --- a/pkg/dwn/index.templ +++ /dev/null @@ -1,104 +0,0 @@ -package dwn - -var motrHandle = templ.NewOnceHandle() - -templ importScripts() { - - - -} - -templ indexFile(cfg string) { - - - - - - - - @importScripts() - - Sonr DWN - - - -
-
Loading...
-
- @motrHandle.Once() { - - @initializeMotr(cfg) - } - - -} - -script initializeMotr(config string) { - const motr = new Motr(JSON.parse(config)); - - async function demo() { - try { - // Insert a new account - const accountId = await motr.insertAccount({ - name: 'John Doe', - address: '0x1234567890123456789012345678901234567890', - publicKey: 'sample_public_key', - chainCode: 'SONR', - index: 0, - controller: 'sample_controller', - createdAt: new Date() - }); - - console.log('Inserted account with ID:', accountId); - - // Retrieve the account - const account = await motr.getAccount(accountId); - console.log('Retrieved account:', account); - - // Insert a new credential - const credentialId = await motr.insertCredential({ - subject: 'john@example.com', - label: 'John\'s Device', - controller: 'sample_controller', - attestationType: 'platform', - origin: 'https://app.sonr.io' - }); - - console.log('Inserted credential with ID:', credentialId); - - // Retrieve the credential - const credential = await motr.getCredential(credentialId); - console.log('Retrieved credential:', credential); - - document.getElementById('output').innerHTML = ` -

Demo Results:

-

Inserted account ID: ${accountId}

-

Retrieved account name: ${account.name}

-

Inserted credential ID: ${credentialId}

-

Retrieved credential subject: ${credential.subject}

- `; - } catch (error) { - console.error('Error in demo:', error); - document.getElementById('output').innerHTML = `

Error: ${error.message}

`; - } - } - // Run the demo when the page loads - window.onload = demo; -} diff --git a/pkg/dwn/index_templ.go b/pkg/dwn/index_templ.go deleted file mode 100644 index d240b403d..000000000 --- a/pkg/dwn/index_templ.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package dwn - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -var motrHandle = templ.NewOnceHandle() - -func importScripts() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func indexFile(cfg string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = importScripts().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Sonr DWN
Loading...
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = initializeMotr(cfg).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = motrHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func initializeMotr(config string) templ.ComponentScript { - return templ.ComponentScript{ - Name: `__templ_initializeMotr_d70f`, - Function: `function __templ_initializeMotr_d70f(config){const motr = new Motr(JSON.parse(config)); - - async function demo() { - try { - // Insert a new account - const accountId = await motr.insertAccount({ - name: 'John Doe', - address: '0x1234567890123456789012345678901234567890', - publicKey: 'sample_public_key', - chainCode: 'SONR', - index: 0, - controller: 'sample_controller', - createdAt: new Date() - }); - - console.log('Inserted account with ID:', accountId); - - // Retrieve the account - const account = await motr.getAccount(accountId); - console.log('Retrieved account:', account); - - // Insert a new credential - const credentialId = await motr.insertCredential({ - subject: 'john@example.com', - label: 'John\'s Device', - controller: 'sample_controller', - attestationType: 'platform', - origin: 'https://app.sonr.io' - }); - - console.log('Inserted credential with ID:', credentialId); - - // Retrieve the credential - const credential = await motr.getCredential(credentialId); - console.log('Retrieved credential:', credential); - - document.getElementById('output').innerHTML = ` + "`" + ` -

Demo Results:

-

Inserted account ID: ${accountId}

-

Retrieved account name: ${account.name}

-

Inserted credential ID: ${credentialId}

-

Retrieved credential subject: ${credential.subject}

- ` + "`" + `; - } catch (error) { - console.error('Error in demo:', error); - document.getElementById('output').innerHTML = ` + "`" + `

Error: ${error.message}

` + "`" + `; - } - } - // Run the demo when the page loads - window.onload = demo; -}`, - Call: templ.SafeScript(`__templ_initializeMotr_d70f`, config), - CallInline: templ.SafeScriptInline(`__templ_initializeMotr_d70f`, config), - } -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/dwn/init.pkl.go b/pkg/dwn/init.pkl.go deleted file mode 100644 index 5654e722a..000000000 --- a/pkg/dwn/init.pkl.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated from Pkl module `dwn`. DO NOT EDIT. -package dwn - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("dwn", Dwn{}) - pkl.RegisterMapping("dwn#Config", Config{}) - pkl.RegisterMapping("dwn#IPFS", IPFS{}) - pkl.RegisterMapping("dwn#Sonr", Sonr{}) - pkl.RegisterMapping("dwn#Motr", Motr{}) - pkl.RegisterMapping("dwn#Schema", Schema{}) -} diff --git a/pkg/nebula/assets/js/motr.js b/pkg/nebula/assets/js/motr.js deleted file mode 100644 index 012bc6d9e..000000000 --- a/pkg/nebula/assets/js/motr.js +++ /dev/null @@ -1,3 +0,0 @@ -import "htmx.org"; -import "alpinejs"; -console.log("Hello from TypeScript!"); diff --git a/pkg/nebula/bun.lockb b/pkg/nebula/bun.lockb deleted file mode 100755 index ea81fae4b..000000000 Binary files a/pkg/nebula/bun.lockb and /dev/null differ diff --git a/pkg/nebula/components/blocks/head.templ b/pkg/nebula/components/blocks/head.templ deleted file mode 100644 index 48e27108b..000000000 --- a/pkg/nebula/components/blocks/head.templ +++ /dev/null @@ -1,81 +0,0 @@ -package blocks - -import "strings" - -type Icon interface { - Render() templ.Component -} - -type Variant interface { - Attributes() templ.Attributes -} - -var stylesHandle = templ.NewOnceHandle() -var alpineHandle = templ.NewOnceHandle() -var htmxHandle = templ.NewOnceHandle() - -func clsxMerge(variants ...Variant) templ.Attributes { - combinedAttrs := templ.Attributes{} - var classElements []string - - for _, variant := range variants { - attrs := variant.Attributes() - if class, ok := attrs["class"].(string); ok { - classElements = append(classElements, strings.Fields(class)...) - } - for key, value := range attrs { - if key != "class" { - combinedAttrs[key] = value - } - } - } - - if len(classElements) > 0 { - combinedAttrs["class"] = strings.Join(classElements, " ") - } - return combinedAttrs -} - -func clsxBuilder(classes ...string) templ.Attributes { - if len(classes) == 0 { - return templ.Attributes{} - } - class := strings.Join(classes, " ") - return templ.Attributes{ - "class": class, - } -} - -templ Spacer() { -
-} - -templ Styles(local bool) { - @stylesHandle.Once() { - - } -} - -templ Alpine(local bool) { - @alpineHandle.Once() { - - } -} - -templ Htmx(local bool) { - @htmxHandle.Once() { - - } -} - -templ Rows() { -
- { children... } -
-} - -templ Columns() { -
- { children... } -
-} diff --git a/pkg/nebula/components/blocks/layout.templ b/pkg/nebula/components/blocks/layout.templ deleted file mode 100644 index 40c283d67..000000000 --- a/pkg/nebula/components/blocks/layout.templ +++ /dev/null @@ -1,51 +0,0 @@ -package blocks - -templ Layout(title string, remote bool) { - - - - @Alpine(remote) - @Htmx(remote) - @Styles(remote) - - - - { title } - - - - - - -
- { children... } -
- - -} - -templ LayoutNoBody(title string, remote bool) { - - - - @Alpine(remote) - @Htmx(remote) - @Styles(remote) - - - - { title } - - - - - -
- -
- { children... } -
- -
- -} diff --git a/pkg/nebula/components/blocks/layout_templ.go b/pkg/nebula/components/blocks/layout_templ.go deleted file mode 100644 index 171a596e1..000000000 --- a/pkg/nebula/components/blocks/layout_templ.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package blocks - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func Layout(title string, remote bool) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Alpine(remote).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Htmx(remote).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Styles(remote).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/layout.templ`, Line: 13, Col: 17} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func LayoutNoBody(title string, remote bool) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Alpine(remote).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Htmx(remote).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = Styles(remote).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/blocks/layout.templ`, Line: 37, Col: 17} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/grant/view.templ b/pkg/nebula/components/grant/view.templ deleted file mode 100644 index 12eefcc79..000000000 --- a/pkg/nebula/components/grant/view.templ +++ /dev/null @@ -1,15 +0,0 @@ -package grant - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" -) - -templ View(c echo.Context) { - @blocks.Layout("Sonr.ID", true) { - @blocks.Card("authorize-view", blocks.SizeMedium) { - @blocks.H1("Sonr.ID") - @blocks.Text("Neo-tree is a file manager for NeoFS.") - } - } -} diff --git a/pkg/nebula/components/home/cta_templ.go b/pkg/nebula/components/home/cta_templ.go deleted file mode 100644 index 7879e688f..000000000 --- a/pkg/nebula/components/home/cta_templ.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package home - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func CallToAction() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"Logo\"

Take control of your Identity today

Sonr removes creative distances by connecting beginners, pros, and every team in between. Are you ready to start your journey?

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/home/footer_templ.go b/pkg/nebula/components/home/footer_templ.go deleted file mode 100644 index b036f4ece..000000000 --- a/pkg/nebula/components/home/footer_templ.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package home - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func Footer() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/home/highlights_templ.go b/pkg/nebula/components/home/highlights_templ.go deleted file mode 100644 index c00f80c0d..000000000 --- a/pkg/nebula/components/home/highlights_templ.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package home - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func Highlights() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

The Internet Rebuilt for You

Sonr is a comprehensive system for Identity Management which proteects users across their digital personas while providing Developers a cost-effective solution for decentralized authentication.

\"Feature
\"Feature
\"Feature
\"Feature
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/home/view.templ b/pkg/nebula/components/home/view.templ deleted file mode 100644 index 1d83c9808..000000000 --- a/pkg/nebula/components/home/view.templ +++ /dev/null @@ -1,19 +0,0 @@ -package home - -import ( - "github.com/onsonr/sonr/pkg/nebula/components/blocks" - "github.com/onsonr/sonr/pkg/nebula/models" -) - -templ View(home *models.Home) { - @blocks.LayoutNoBody("Sonr.ID", true) { - @Header() - @SectionHero(home.Hero) - @Highlights() - @Features() - @Bento() - @Lowlights() - @CallToAction() - @Footer() - } -} diff --git a/pkg/nebula/components/login/modal.templ b/pkg/nebula/components/login/modal.templ deleted file mode 100644 index 95ddc5606..000000000 --- a/pkg/nebula/components/login/modal.templ +++ /dev/null @@ -1,73 +0,0 @@ -package login - -import "github.com/labstack/echo/v4" - -templ Modal(c echo.Context) { -
- -
-} diff --git a/pkg/nebula/components/login/modal_templ.go b/pkg/nebula/components/login/modal_templ.go deleted file mode 100644 index f3797dd6d..000000000 --- a/pkg/nebula/components/login/modal_templ.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package login - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import "github.com/labstack/echo/v4" - -func Modal(c echo.Context) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/login/view.templ b/pkg/nebula/components/login/view.templ deleted file mode 100644 index ed720f996..000000000 --- a/pkg/nebula/components/login/view.templ +++ /dev/null @@ -1,20 +0,0 @@ -package login - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" -) - -templ View(c echo.Context) { - @blocks.Layout("Sonr.ID", true) { - @blocks.Card("login-view", blocks.SizeLarge) { - @blocks.H1("Sonr.ID") - @blocks.Text("Neo-tree is a file manager for NeoFS.") - @blocks.Spacer() - @blocks.Spacer() - @blocks.Button(blocks.GET("/", "#login-view")) { - @blocks.Text("Cancel") - } - } - } -} diff --git a/pkg/nebula/components/login/view_templ.go b/pkg/nebula/components/login/view_templ.go deleted file mode 100644 index 64d3aa668..000000000 --- a/pkg/nebula/components/login/view_templ.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package login - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" -) - -func View(c echo.Context) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.H1("Sonr.ID").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.Spacer().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = blocks.Spacer().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = blocks.Text("Cancel").Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Button(blocks.GET("/", "#login-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Card("login-view", blocks.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) - templ_7745c5c3_Err = blocks.Layout("Sonr.ID", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/profile/view.templ b/pkg/nebula/components/profile/view.templ deleted file mode 100644 index 314eb890a..000000000 --- a/pkg/nebula/components/profile/view.templ +++ /dev/null @@ -1,14 +0,0 @@ -package profile - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" -) - -templ View(c echo.Context) { - @blocks.Layout("Sonr.ID", true) { - @blocks.Card("profile-view", blocks.SizeLarge) { - @blocks.ProfileCard() - } - } -} diff --git a/pkg/nebula/components/register/modal.templ b/pkg/nebula/components/register/modal.templ deleted file mode 100644 index e21a74cf9..000000000 --- a/pkg/nebula/components/register/modal.templ +++ /dev/null @@ -1,59 +0,0 @@ -package register - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" -) - -templ Modal(c echo.Context) { -
- -
-} diff --git a/pkg/nebula/components/register/modal_templ.go b/pkg/nebula/components/register/modal_templ.go deleted file mode 100644 index 04386e445..000000000 --- a/pkg/nebula/components/register/modal_templ.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package register - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import ( - "github.com/labstack/echo/v4" - "github.com/onsonr/sonr/pkg/nebula/components/blocks" -) - -func Modal(c echo.Context) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/components/ui/button.templ b/pkg/nebula/components/ui/button.templ deleted file mode 100644 index 3d488ea97..000000000 --- a/pkg/nebula/components/ui/button.templ +++ /dev/null @@ -1,13 +0,0 @@ -package ui - -templ PrimaryButton(href string, text string) { -
-
{ text }
-
-} - -templ SecondaryButton(href string, text string) { -
-
{ text }
-
-} diff --git a/pkg/nebula/components/ui/button_templ.go b/pkg/nebula/components/ui/button_templ.go deleted file mode 100644 index 86b8787f9..000000000 --- a/pkg/nebula/components/ui/button_templ.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.2.778 -package ui - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -func PrimaryButton(href string, text string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/ui/button.templ`, Line: 5, Col: 133} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -func SecondaryButton(href string, text string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/components/ui/button.templ`, Line: 11, Col: 132} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return templ_7745c5c3_Err - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/pkg/nebula/models/Bento.pkl.go b/pkg/nebula/models/Bento.pkl.go deleted file mode 100644 index 524e9781c..000000000 --- a/pkg/nebula/models/Bento.pkl.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Bento struct { - Title string `pkl:"title"` - - Description string `pkl:"description"` - - PrimaryButton *Button `pkl:"primaryButton"` - - SecondaryButton *Button `pkl:"secondaryButton"` -} diff --git a/pkg/nebula/models/Button.pkl.go b/pkg/nebula/models/Button.pkl.go deleted file mode 100644 index b6b277582..000000000 --- a/pkg/nebula/models/Button.pkl.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Button struct { - Text string `pkl:"text"` - - Href string `pkl:"href"` -} diff --git a/pkg/nebula/models/CallToAction.pkl.go b/pkg/nebula/models/CallToAction.pkl.go deleted file mode 100644 index 00da5cd7c..000000000 --- a/pkg/nebula/models/CallToAction.pkl.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type CallToAction struct { - Title string `pkl:"title"` - - Description string `pkl:"description"` - - PrimaryButton *Button `pkl:"primaryButton"` - - SecondaryButton *Button `pkl:"secondaryButton"` -} diff --git a/pkg/nebula/models/Feature.pkl.go b/pkg/nebula/models/Feature.pkl.go deleted file mode 100644 index d27e177d7..000000000 --- a/pkg/nebula/models/Feature.pkl.go +++ /dev/null @@ -1,12 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Feature struct { - Title string `pkl:"title"` - - Description string `pkl:"description"` - - Icon *string `pkl:"icon"` - - Image *Image `pkl:"image"` -} diff --git a/pkg/nebula/models/Features.pkl.go b/pkg/nebula/models/Features.pkl.go deleted file mode 100644 index 2bb3e1fe7..000000000 --- a/pkg/nebula/models/Features.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Features struct { - Title string `pkl:"title"` - - Description string `pkl:"description"` - - Image *Image `pkl:"image"` -} diff --git a/pkg/nebula/models/Footer.pkl.go b/pkg/nebula/models/Footer.pkl.go deleted file mode 100644 index 2930ba80d..000000000 --- a/pkg/nebula/models/Footer.pkl.go +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Footer struct { - Logo *Image `pkl:"logo"` - - MediumLink *SocialLink `pkl:"mediumLink"` - - TwitterLink *SocialLink `pkl:"twitterLink"` - - DiscordLink *SocialLink `pkl:"discordLink"` - - GithubLink *SocialLink `pkl:"githubLink"` - - CompanyLinks []*Link `pkl:"companyLinks"` - - ResourcesLinks []*Link `pkl:"resourcesLinks"` -} diff --git a/pkg/nebula/models/Form.pkl.go b/pkg/nebula/models/Form.pkl.go deleted file mode 100644 index 497fee014..000000000 --- a/pkg/nebula/models/Form.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Form interface { - GetTitle() string - - GetDescription() string - - GetInputs() []*Input -} diff --git a/pkg/nebula/models/Hero.pkl.go b/pkg/nebula/models/Hero.pkl.go deleted file mode 100644 index 1001dc4a6..000000000 --- a/pkg/nebula/models/Hero.pkl.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Hero struct { - TitleFirst string `pkl:"titleFirst"` - - TitleEmphasis string `pkl:"titleEmphasis"` - - TitleSecond string `pkl:"titleSecond"` - - Subtitle string `pkl:"subtitle"` - - PrimaryButton *Button `pkl:"primaryButton"` - - SecondaryButton *Button `pkl:"secondaryButton"` - - Image *Image `pkl:"image"` - - Stats []*Stat `pkl:"stats"` -} diff --git a/pkg/nebula/models/Highlight.pkl.go b/pkg/nebula/models/Highlight.pkl.go deleted file mode 100644 index e8a4a5af2..000000000 --- a/pkg/nebula/models/Highlight.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Highlight struct { - Title string `pkl:"title"` - - Description string `pkl:"description"` - - Image *Image `pkl:"image"` -} diff --git a/pkg/nebula/models/Highlights.pkl.go b/pkg/nebula/models/Highlights.pkl.go deleted file mode 100644 index 9c310ae3f..000000000 --- a/pkg/nebula/models/Highlights.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Highlights struct { - Heading string `pkl:"heading"` - - Subheading string `pkl:"subheading"` - - Highlights []*Feature `pkl:"highlights"` -} diff --git a/pkg/nebula/models/Home.pkl.go b/pkg/nebula/models/Home.pkl.go deleted file mode 100644 index 9842d8afc..000000000 --- a/pkg/nebula/models/Home.pkl.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Home struct { - Hero *Hero `pkl:"hero"` -} diff --git a/pkg/nebula/models/Image.pkl.go b/pkg/nebula/models/Image.pkl.go deleted file mode 100644 index 9bacfa74f..000000000 --- a/pkg/nebula/models/Image.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Image struct { - Src string `pkl:"src"` - - Width string `pkl:"width"` - - Height string `pkl:"height"` -} diff --git a/pkg/nebula/models/Input.pkl.go b/pkg/nebula/models/Input.pkl.go deleted file mode 100644 index 919852c02..000000000 --- a/pkg/nebula/models/Input.pkl.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -import "github.com/onsonr/sonr/pkg/nebula/models/inputtype" - -type Input struct { - Label string `pkl:"label"` - - Type inputtype.InputType `pkl:"type"` - - Placeholder string `pkl:"placeholder"` - - Value *string `pkl:"value"` - - Error *string `pkl:"error"` - - Help *string `pkl:"help"` - - Required *bool `pkl:"required"` -} diff --git a/pkg/nebula/models/Link.pkl.go b/pkg/nebula/models/Link.pkl.go deleted file mode 100644 index dc0342440..000000000 --- a/pkg/nebula/models/Link.pkl.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Link struct { - Text string `pkl:"text"` - - Href string `pkl:"href"` -} diff --git a/pkg/nebula/models/Lowlights.pkl.go b/pkg/nebula/models/Lowlights.pkl.go deleted file mode 100644 index 8f160bb14..000000000 --- a/pkg/nebula/models/Lowlights.pkl.go +++ /dev/null @@ -1,10 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Lowlights struct { - Title string `pkl:"title"` - - Description string `pkl:"description"` - - Image *Image `pkl:"image"` -} diff --git a/pkg/nebula/models/Models.pkl.go b/pkg/nebula/models/Models.pkl.go deleted file mode 100644 index e8869e623..000000000 --- a/pkg/nebula/models/Models.pkl.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -import ( - "context" - - "github.com/apple/pkl-go/pkl" -) - -type Models struct { - Home *Home `pkl:"home"` -} - -// LoadFromPath loads the pkl module at the given path and evaluates it into a Models -func LoadFromPath(ctx context.Context, path string) (ret *Models, 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 Models -func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Models, error) { - var ret Models - if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { - return nil, err - } - return &ret, nil -} diff --git a/pkg/nebula/models/RegisterFormData.pkl.go b/pkg/nebula/models/RegisterFormData.pkl.go deleted file mode 100644 index e4b0d698e..000000000 --- a/pkg/nebula/models/RegisterFormData.pkl.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type RegisterFormData interface { - Form -} - -var _ RegisterFormData = (*RegisterFormDataImpl)(nil) - -type RegisterFormDataImpl struct { - Title string `pkl:"title"` - - Description string `pkl:"description"` - - Inputs []*Input `pkl:"inputs"` -} - -func (rcv *RegisterFormDataImpl) GetTitle() string { - return rcv.Title -} - -func (rcv *RegisterFormDataImpl) GetDescription() string { - return rcv.Description -} - -func (rcv *RegisterFormDataImpl) GetInputs() []*Input { - return rcv.Inputs -} diff --git a/pkg/nebula/models/SocialLink.pkl.go b/pkg/nebula/models/SocialLink.pkl.go deleted file mode 100644 index 39399369b..000000000 --- a/pkg/nebula/models/SocialLink.pkl.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type SocialLink struct { - Link *Link `pkl:"link"` - - Icon string `pkl:"icon"` -} diff --git a/pkg/nebula/models/Stat.pkl.go b/pkg/nebula/models/Stat.pkl.go deleted file mode 100644 index a58923b5a..000000000 --- a/pkg/nebula/models/Stat.pkl.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Stat struct { - Value string `pkl:"value"` - - Label string `pkl:"label"` -} diff --git a/pkg/nebula/models/Stats.pkl.go b/pkg/nebula/models/Stats.pkl.go deleted file mode 100644 index c12e140a7..000000000 --- a/pkg/nebula/models/Stats.pkl.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -type Stats struct { - FirstValue string `pkl:"firstValue"` - - FirstLabel string `pkl:"firstLabel"` - - SecondValue string `pkl:"secondValue"` - - SecondLabel string `pkl:"secondLabel"` - - ThirdValue string `pkl:"thirdValue"` - - ThirdLabel string `pkl:"thirdLabel"` -} diff --git a/pkg/nebula/models/common.go b/pkg/nebula/models/common.go deleted file mode 100644 index a0d1042d6..000000000 --- a/pkg/nebula/models/common.go +++ /dev/null @@ -1,36 +0,0 @@ -package models - -import ( - "context" - "errors" - - "github.com/apple/pkl-go/pkl" -) - -var models *Models - -func LoadFromString(ctx context.Context, s string) (err error) { - evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) - if err != nil { - return err - } - defer func() { - cerr := evaluator.Close() - if err == nil { - err = cerr - } - }() - ret, err := Load(ctx, evaluator, pkl.TextSource(s)) - if err != nil { - return err - } - models = ret - return nil -} - -func GetModels() (*Models, error) { - if models == nil { - return nil, errors.New("models not initialized") - } - return models, nil -} diff --git a/pkg/nebula/models/init.pkl.go b/pkg/nebula/models/init.pkl.go deleted file mode 100644 index b0ce87017..000000000 --- a/pkg/nebula/models/init.pkl.go +++ /dev/null @@ -1,18 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package models - -import "github.com/apple/pkl-go/pkl" - -func init() { - pkl.RegisterMapping("models", Models{}) - pkl.RegisterMapping("models#Home", Home{}) - pkl.RegisterMapping("models#Hero", Hero{}) - pkl.RegisterMapping("models#Button", Button{}) - pkl.RegisterMapping("models#Image", Image{}) - pkl.RegisterMapping("models#Stat", Stat{}) - pkl.RegisterMapping("models#Input", Input{}) - pkl.RegisterMapping("models#Link", Link{}) - pkl.RegisterMapping("models#SocialLink", SocialLink{}) - pkl.RegisterMapping("models#Feature", Feature{}) - pkl.RegisterMapping("models#Highlights", Highlights{}) -} diff --git a/pkg/nebula/models/inputtype/InputType.pkl.go b/pkg/nebula/models/inputtype/InputType.pkl.go deleted file mode 100644 index f234b3b7f..000000000 --- a/pkg/nebula/models/inputtype/InputType.pkl.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated from Pkl module `models`. DO NOT EDIT. -package inputtype - -import ( - "encoding" - "fmt" -) - -type InputType string - -const ( - Text InputType = "text" - Password InputType = "password" - Email InputType = "email" - Credential InputType = "credential" - File InputType = "file" -) - -// String returns the string representation of InputType -func (rcv InputType) String() string { - return string(rcv) -} - -var _ encoding.BinaryUnmarshaler = new(InputType) - -// UnmarshalBinary implements encoding.BinaryUnmarshaler for InputType. -func (rcv *InputType) UnmarshalBinary(data []byte) error { - switch str := string(data); str { - case "text": - *rcv = Text - case "password": - *rcv = Password - case "email": - *rcv = Email - case "credential": - *rcv = Credential - case "file": - *rcv = File - default: - return fmt.Errorf(`illegal: "%s" is not a valid InputType`, str) - } - return nil -} diff --git a/pkg/nebula/nebula.go b/pkg/nebula/nebula.go deleted file mode 100644 index 8a06ce455..000000000 --- a/pkg/nebula/nebula.go +++ /dev/null @@ -1,47 +0,0 @@ -package nebula - -import ( - "context" - "embed" - "io/fs" - "net/http" - - "github.com/labstack/echo/v4" - - "github.com/onsonr/sonr/pkg/nebula/models" -) - -//go:embed assets -var embeddedFiles embed.FS - -//go:embed nebula.pkl -var config []byte - -func getHTTPFS() (http.FileSystem, error) { - fsys, err := fs.Sub(embeddedFiles, "assets") - if err != nil { - return nil, err - } - return http.FS(fsys), nil -} - -// UseAssets is a middleware that serves static files from the embedded assets -func UseAssets(e *echo.Echo) error { - err := models.LoadFromString(context.Background(), string(config)) - if err != nil { - return err - } - fsys, err := getHTTPFS() - if err != nil { - return err - } - assets := http.FileServer(fsys) - e.GET("/", echo.WrapHandler(assets)) - e.GET("/assets/*", echo.WrapHandler(http.StripPrefix("/assets/", assets))) - e.GET("/_nebula/config", handleGetConfig) - return nil -} - -func handleGetConfig(c echo.Context) error { - return c.Blob(http.StatusOK, "application/octet-stream", config) -} diff --git a/pkg/nebula/nebula.pkl b/pkg/nebula/nebula.pkl deleted file mode 100644 index 2c218c835..000000000 --- a/pkg/nebula/nebula.pkl +++ /dev/null @@ -1,37 +0,0 @@ -amends "https://pkl.sh/UIUX.pkl"; - -home = new Home { - hero = new Hero { - titleFirst = "Simplified"; - titleEmphasis = "self-custody"; - titleSecond = "for everyone"; - subtitle = "Sonr is a modern re-imagination of online user identity, empowering users to take ownership of their digital footprint and unlocking a new era of self-sovereignty."; - primaryButton = new Button { - text = "Get Started"; - href = "/register"; - }; - secondaryButton = new Button { - text = "Learn More"; - href = "/about"; - }; - image = new Image { - src = "https://cdn.sonr.id/img/hero-clipped.svg"; - width = "500"; - height = "500"; - }; - stats { - new Stat { - value = "476K"; - label = "Assets packed with power beyond your imagination."; - }; - new Stat { - value = "1.44K"; - label = "Assets packed with power beyond your imagination."; - }; - new Stat { - value = "1.5M+"; - label = "Assets packed with power beyond your imagination."; - } - }; - }; -}; diff --git a/pkg/nebula/package.json b/pkg/nebula/package.json deleted file mode 100644 index 1b891a046..000000000 --- a/pkg/nebula/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "nebula", - "version": "0.0.1", - "scripts": { - "fetch:deps": "bun run .deps.mjs", - "build:ts": "tsc", - "build:css": "bunx tailwindcss -i ./src/styles.css -o ./assets/css/styles.css", - "build": "bun run fetch:deps && bun run build:ts && bun run build:css", - "watch:ts": "tsc -w", - "watch:css": "bunx tailwindcss -i ./src/styles.css -o ./assets/css/styles.css --watch", - "watch": "bun run watch:ts & bun run watch:css" - }, - "devDependencies": { - "@tailwindcss/forms": "^0.5.7", - "@tailwindcss/typography": "^0.5.15", - "alpinejs": "^3.14.1", - "htmx.org": "^1.9.12", - "tailwindcss": "^3.3.0", - "tailwindcss-motion": "^0.3.0-beta", - "typescript": "^4.9.0" - }, - "dependencies": { - "node-fetch": "^3.3.2" - } -} diff --git a/pkg/nebula/router/router.go b/pkg/nebula/router/router.go deleted file mode 100644 index cba66b45c..000000000 --- a/pkg/nebula/router/router.go +++ /dev/null @@ -1,67 +0,0 @@ -package router - -import ( - "bytes" - - "github.com/a-h/templ" - "github.com/labstack/echo/v4" - - "github.com/onsonr/sonr/pkg/nebula/components/grant" - "github.com/onsonr/sonr/pkg/nebula/components/home" - "github.com/onsonr/sonr/pkg/nebula/components/login" - "github.com/onsonr/sonr/pkg/nebula/components/profile" - "github.com/onsonr/sonr/pkg/nebula/components/register" - "github.com/onsonr/sonr/pkg/nebula/models" -) - -// ╭───────────────────────────────────────────────────────────╮ -// │ Marketing Pages │ -// ╰───────────────────────────────────────────────────────────╯ - -func Home(c echo.Context) error { - mdls, err := models.GetModels() - if err != nil { - return err - } - return render(c, home.View(mdls.Home)) -} - -func Profile(c echo.Context) error { - return render(c, profile.View(c)) -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Authentication Views │ -// ╰───────────────────────────────────────────────────────────╯ -func Authorize(c echo.Context) error { - return render(c, grant.View(c)) -} - -func Login(c echo.Context) error { - return render(c, login.Modal(c)) -} - -func Register(c echo.Context) error { - return render(c, register.Modal(c)) -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Helper Methods │ -// ╰───────────────────────────────────────────────────────────╯ - -func render(c echo.Context, cmp templ.Component) error { - // Create a buffer to store the rendered HTML - buf := &bytes.Buffer{} - // Render the component to the buffer - err := cmp.Render(c.Request().Context(), buf) - if err != nil { - return err - } - - // Set the content type - c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML) - - // Write the buffered content to the response - _, err = c.Response().Write(buf.Bytes()) - return err -} diff --git a/pkg/nebula/router/state.go b/pkg/nebula/router/state.go deleted file mode 100644 index 10b1ce322..000000000 --- a/pkg/nebula/router/state.go +++ /dev/null @@ -1,13 +0,0 @@ -package router - -type Status string - -const ( - StatusOK Status = "ok" - StatusError Status = "error" - StatusNotFound Status = "not-found" - StatusUnauthorized Status = "unauthorized" - StatusForbidden Status = "forbidden" - StatusInternalServerError Status = "internal-server-error" - StatusBadRequest Status = "bad-request" -) diff --git a/pkg/nebula/src/motr.ts b/pkg/nebula/src/motr.ts deleted file mode 100644 index fc59116f1..000000000 --- a/pkg/nebula/src/motr.ts +++ /dev/null @@ -1,4 +0,0 @@ -import "htmx.org"; -import "alpinejs"; - -console.log("Hello from TypeScript!"); diff --git a/pkg/nebula/tsconfig.json b/pkg/nebula/tsconfig.json deleted file mode 100644 index c978c20a7..000000000 --- a/pkg/nebula/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./assets/js", - "rootDir": "./src", - "target": "ES6", - "module": "ES6", - "moduleResolution": "node", - "strict": true - }, - "include": [ - "src/**/*" - ] -} diff --git a/pkl/DWN.pkl b/pkl/DWN.pkl index 71947b28e..7272ebd43 100644 --- a/pkl/DWN.pkl +++ b/pkl/DWN.pkl @@ -1,6 +1,6 @@ -@go.Package { name = "github.com/onsonr/sonr/pkg/dwn" } +@go.Package { name = "github.com/onsonr/sonr/internal/dwn/gen" } -module dwn +module dwngen import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" diff --git a/pkl/ORM.pkl b/pkl/ORM.pkl index 33c7a411d..f62a2f238 100644 --- a/pkl/ORM.pkl +++ b/pkl/ORM.pkl @@ -1,4 +1,4 @@ -@go.Package { name = "github.com/onsonr/sonr/pkg/orm" } +@go.Package { name = "github.com/onsonr/sonr/internal/orm" } module orm diff --git a/pkl/README.md b/pkl/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/pkl/Txns.pkl b/pkl/Txns.pkl index 0852eebea..e658489b1 100644 --- a/pkl/Txns.pkl +++ b/pkl/Txns.pkl @@ -1,4 +1,4 @@ -@go.Package { name = "github.com/onsonr/sonr/pkg/orm/transactions" } +@go.Package { name = "github.com/onsonr/sonr/internal/orm/transactions" } module transactions diff --git a/pkl/UIUX.pkl b/pkl/UIUX.pkl deleted file mode 100644 index 681d74bfb..000000000 --- a/pkl/UIUX.pkl +++ /dev/null @@ -1,91 +0,0 @@ -@go.Package { name = "github.com/onsonr/sonr/pkg/nebula/models" } - -module models - -import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" - -// ╭───────────────────────────────────────────────────────────╮ -// │ General State │ -// ╰───────────────────────────────────────────────────────────╯ - -typealias InputType = "text" | "password" | "email" | "credential" | "file" - -class Button { - text: String - href: String -} - -abstract class Form { - title: String - description: String - inputs: List -} - -class Image { - src: String - width: String - height: String -} - -class Input { - label: String - type: InputType - placeholder: String - value: String? - error: String? - help: String? - required: Boolean? -} - -class Link { - text: String - href: String -} - -class SocialLink { - link: Link - icon: String -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Data Models │ -// ╰───────────────────────────────────────────────────────────╯ - -class Feature { - title: String - description: String - icon: String? - image: Image? -} - -class Stat { - value: String - label: String -} - -// ╭───────────────────────────────────────────────────────────╮ -// │ Homepage View Model │ -// ╰───────────────────────────────────────────────────────────╯ - -class Hero { - titleFirst: String - titleEmphasis: String - titleSecond: String - subtitle: String - primaryButton: Button - secondaryButton: Button - image: Image - stats: Listing -} - -class Highlights { - heading: String - subheading: String - highlights: Listing -} -class Home { - hero: Hero -} - -home : Home - diff --git a/deploy/process-compose.yaml b/process-compose.yaml similarity index 53% rename from deploy/process-compose.yaml rename to process-compose.yaml index ce9aac967..6388a1415 100644 --- a/deploy/process-compose.yaml +++ b/process-compose.yaml @@ -17,18 +17,9 @@ processes: max_restarts: 1 depends: - ipfs - - hway: - namespace: testnet - command: "devbox run start:hway" - restart: on_failure - max_restarts: 1 - depends: - - ipfs - - sonr - - tunnel: - namespace: public - command: "cloudflared tunnel run --token $TUNNEL_TOKEN" - restart: on_failure - max_restarts: 1 + # + # tunnel: + # namespace: public + # command: "cloudflared tunnel run --token $TUNNEL_TOKEN" + # restart: on_failure + # max_restarts: 1 diff --git a/proto/README.md b/proto/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/proto/did/v1/genesis.proto b/proto/did/v1/genesis.proto index e08f89f94..4bc2a52e2 100644 --- a/proto/did/v1/genesis.proto +++ b/proto/did/v1/genesis.proto @@ -9,7 +9,7 @@ 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. @@ -34,7 +34,38 @@ message Params { 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", + 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; +} diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index 069b111b3..5cfdd298a 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -3,18 +3,15 @@ syntax = "proto3"; package did.v1; import "cosmos/orm/v1/orm.proto"; +import "did/v1/genesis.proto"; option go_package = "github.com/onsonr/sonr/x/did/types"; message Authentication { 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 authentication @@ -42,31 +39,12 @@ message Authentication { // Controller represents a Sonr DWN Vault message Controller { option (cosmos.orm.v1.table) = { - id: 2 - 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 : 2 + 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 @@ -100,23 +78,11 @@ message Controller { // Verification represents a verification method message Verification { option (cosmos.orm.v1.table) = { - id: 4 - 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 : 4 + 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 @@ -146,34 +112,3 @@ message Verification { // CreationBlock is the block number of the creation of the controller int64 creation_block = 9; } - -message Keyshares { - string validator_cid = 1; - string user_cid = 2; - int64 last_updated_block = 3; -} - -// PubKey defines a public key for a did -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/proto/did/v1/tx.proto b/proto/did/v1/tx.proto index c1c3c9a94..95bdc8c14 100644 --- a/proto/did/v1/tx.proto +++ b/proto/did/v1/tx.proto @@ -19,7 +19,8 @@ service Msg { // RegisterController initializes a controller with the given authentication // set, address, cid, publicKey, and user-defined alias. - rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse); + rpc RegisterController(MsgRegisterController) + returns (MsgRegisterControllerResponse); // UpdateParams defines a governance operation for updating the parameters. rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); @@ -30,17 +31,8 @@ message MsgRegisterController { 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" ]; - // Assertions is the list of assertions to initialize the controller with. - repeated bytes assertions = 2; - - // Keyshares is the list of keyshares to initialize the controller with. - repeated bytes keyshares = 3; - - // Verifications is the list of verifications to initialize the controller - // with. - repeated bytes verifications = 4; } // MsgRegisterControllerResponse is the response type for the @@ -51,10 +43,7 @@ message MsgRegisterControllerResponse { bool success = 1; // Controller is the address of the initialized controller. - string controller = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // Accounts are a Address Map and Supported coin Denoms for the controller - map accounts = 3; + string controller = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; } // MsgExecuteTx is the message type for the ExecuteTx RPC. @@ -62,7 +51,7 @@ 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; @@ -84,10 +73,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/macaroon/v1/genesis.proto b/proto/macaroon/v1/genesis.proto index 191c0e1e5..957866405 100644 --- a/proto/macaroon/v1/genesis.proto +++ b/proto/macaroon/v1/genesis.proto @@ -3,13 +3,14 @@ package macaroon.v1; import "amino/amino.proto"; import "gogoproto/gogo.proto"; +import "did/v1/tx.proto"; option go_package = "github.com/onsonr/sonr/x/macaroon/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. @@ -46,9 +47,19 @@ message Scopes { // Caveats defines the available caveats message Caveats { - option (amino.name) = "macaroon/caveat"; + option (amino.name) = "macaroon/caveats"; option (gogoproto.equal) = true; repeated string supported_first_party = 1; repeated string supported_third_party = 2; } + +// Transactions defines the allowlist,denylist for transactions which can be +// broadcasted to the network with the Sonr DWN Signed macaroon. +message Transactions { + option (amino.name) = "macaroon/transactions"; + option (gogoproto.equal) = true; + + repeated string allowlist = 1; + repeated string denylist = 2; +} diff --git a/proto/macaroon/v1/query.proto b/proto/macaroon/v1/query.proto index 2ff5201c1..d27db303d 100644 --- a/proto/macaroon/v1/query.proto +++ b/proto/macaroon/v1/query.proto @@ -14,12 +14,14 @@ service Query { } // RefreshToken refreshes a macaroon token as post authentication. - rpc RefreshToken(QueryRefreshTokenRequest) returns (QueryRefreshTokenResponse) { + rpc RefreshToken(QueryRefreshTokenRequest) + returns (QueryRefreshTokenResponse) { option (google.api.http).post = "/macaroon/v1/refresh"; } // ValidateToken validates a macaroon token as pre authentication. - rpc ValidateToken(QueryValidateTokenRequest) returns (QueryValidateTokenResponse) { + rpc ValidateToken(QueryValidateTokenRequest) + returns (QueryValidateTokenResponse) { option (google.api.http).post = "/macaroon/v1/validate"; } } diff --git a/proto/macaroon/v1/state.proto b/proto/macaroon/v1/state.proto index 54f0be1bf..3972d8e08 100644 --- a/proto/macaroon/v1/state.proto +++ b/proto/macaroon/v1/state.proto @@ -9,16 +9,9 @@ option go_package = "github.com/onsonr/sonr/x/macaroon/types"; message Grant { option (cosmos.orm.v1.table) = { - id: 1 - primary_key: { - fields: "id" - auto_increment: true - } - index: { - id: 1 - fields: "subject,origin" - unique: true - } + id : 1 + primary_key : {fields : "id" auto_increment : true} + index : {id : 1 fields : "subject,origin" unique : true} }; uint64 id = 1; @@ -30,16 +23,9 @@ message Grant { message Macaroon { option (cosmos.orm.v1.table) = { - id: 2 - primary_key: { - fields: "id" - auto_increment: true - } - index: { - id: 1 - fields: "subject,origin" - unique: true - } + id : 2 + primary_key : {fields : "id" auto_increment : true} + index : {id : 1 fields : "subject,origin" unique : true} }; uint64 id = 1; diff --git a/proto/macaroon/v1/tx.proto b/proto/macaroon/v1/tx.proto index 45d67e340..fa3c9b8e6 100644 --- a/proto/macaroon/v1/tx.proto +++ b/proto/macaroon/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 MsgIssueMacaroon { 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" ]; // Origin is the origin of the request in wildcard form. string origin = 2; diff --git a/proto/oracle/module/v1/module.proto b/proto/oracle/module/v1/module.proto deleted file mode 100644 index ed5ecd831..000000000 --- a/proto/oracle/module/v1/module.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -package oracle.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" - }; -} \ No newline at end of file diff --git a/proto/oracle/v1/genesis.proto b/proto/oracle/v1/genesis.proto deleted file mode 100644 index 7b9a525a0..000000000 --- a/proto/oracle/v1/genesis.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; -package oracle.v1; - -import "amino/amino.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/onsonr/sonr/x/oracle/types"; - -// GenesisState defines the module genesis state -message GenesisState { - // Params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// Params defines the set of module parameters. -message Params { - option (amino.name) = "oracle/params"; - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - Assets assets = 1; -} - -message Assets { - option (amino.name) = "oracle/assets"; - option (gogoproto.equal) = true; - - repeated AssetInfo assets = 1; -} - -// AssetInfo defines the asset info -message AssetInfo { - option (amino.name) = "oracle/asset_info"; - option (gogoproto.equal) = true; - - // The coin type index for bip44 path - int64 index = 1; - - // The hrp for bech32 address - string hrp = 2; - - // The coin symbol - string symbol = 3; - - // The coin name - string asset_type = 4; - - // The name of the asset - string name = 5; - - // The icon url - string icon_url = 6; -} diff --git a/proto/oracle/v1/query.proto b/proto/oracle/v1/query.proto deleted file mode 100644 index 1901044f4..000000000 --- a/proto/oracle/v1/query.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; -package oracle.v1; - -import "google/api/annotations.proto"; -import "oracle/v1/genesis.proto"; - -option go_package = "github.com/onsonr/sonr/x/oracle/types"; - -// Query provides defines the gRPC querier service. -service Query { - // Params queries all parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/oracle/v1/params"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} diff --git a/proto/oracle/v1/state.proto b/proto/oracle/v1/state.proto deleted file mode 100644 index bbf834e72..000000000 --- a/proto/oracle/v1/state.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; -package oracle.v1; - -import "cosmos/orm/v1/orm.proto"; - -option go_package = "github.com/onsonr/sonr/x/oracle/types"; - -// https://github.com/cosmos/cosmos-sdk/blob/main/orm/README.md - -message Balance { - option (cosmos.orm.v1.table) = { - id: 1 - primary_key: {fields: "account"} - index: { - id: 1 - fields: "amount" - } - }; - - string account = 1; - uint64 amount = 2; -} - -message Account { - option (cosmos.orm.v1.table) = { - id: 2 - primary_key: {fields: "id"} - index: { - id: 1 - fields: "address,chain,network" - unique: true - } - }; - - uint64 id = 1; - string address = 2; - string chain = 3; - string network = 4; -} diff --git a/proto/oracle/v1/tx.proto b/proto/oracle/v1/tx.proto deleted file mode 100644 index 0321094a8..000000000 --- a/proto/oracle/v1/tx.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; -package oracle.v1; - -import "cosmos/msg/v1/msg.proto"; -import "oracle/v1/genesis.proto"; -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/onsonr/sonr/x/oracle/types"; - -// Msg defines the Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // UpdateParams defines a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); -} - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - - // authority is the address of the governance account. - 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]; -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -message MsgUpdateParamsResponse {} diff --git a/proto/service/v1/genesis.proto b/proto/service/v1/genesis.proto index c2c2b79ad..236b258f3 100644 --- a/proto/service/v1/genesis.proto +++ b/proto/service/v1/genesis.proto @@ -9,7 +9,7 @@ option go_package = "github.com/onsonr/sonr/x/service/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. diff --git a/proto/service/v1/state.proto b/proto/service/v1/state.proto index 10614ff2b..78c6520f2 100644 --- a/proto/service/v1/state.proto +++ b/proto/service/v1/state.proto @@ -9,16 +9,9 @@ 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; @@ -33,13 +26,9 @@ message Metadata { // 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 diff --git a/proto/service/v1/tx.proto b/proto/service/v1/tx.proto index 063b48c61..35bbb4e77 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/v1/genesis.proto b/proto/vault/v1/genesis.proto index 0d20d48f3..1381baba8 100644 --- a/proto/vault/v1/genesis.proto +++ b/proto/vault/v1/genesis.proto @@ -9,7 +9,7 @@ option go_package = "github.com/onsonr/sonr/x/vault/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. diff --git a/proto/vault/v1/query.proto b/proto/vault/v1/query.proto index 9e2d0f501..364edbd04 100644 --- a/proto/vault/v1/query.proto +++ b/proto/vault/v1/query.proto @@ -13,9 +13,10 @@ service Query { option (google.api.http).get = "/vault/v1/params"; } - // BuildTx builds an unsigned transaction message for the given PKL. - rpc BuildTx(BuildTxRequest) returns (BuildTxResponse) { - option (google.api.http).post = "/vault/v1/buildtx"; + // Schema queries the DID document by its id. And returns the required PKL + // information + rpc Schema(QuerySchemaRequest) returns (QuerySchemaResponse) { + option (google.api.http).get = "/vault/v1/schema"; } // Sync queries the DID document by its id. And returns the required PKL @@ -33,34 +34,17 @@ message QueryParamsResponse { // params defines the parameters of the module. Params params = 1; } +// QuerySchemaRequest is the request type for the Query/Schema RPC method. +message QuerySchemaRequest {} -// QueryIPFSRequest is the request type for the Query/IPFS RPC method. -message QueryIPFSRequest {} - -// QueryIPFSResponse is the response type for the Query/IPFS RPC method. -message QueryIPFSResponse { - // IPFS is the IPFS client status. - bool ipfs = 1; +// QuerySchemaResponse is the response type for the Query/Schema RPC method. +message QuerySchemaResponse { + // Schema is the DID document. + Schema schema = 1; } // SyncRequest is the request type for the Sync RPC method. -message SyncRequest { - string did = 1; -} +message SyncRequest { string did = 1; } // SyncResponse is the response type for the Sync RPC method. -message SyncResponse { - bool success = 1; -} - -// BuildTxRequest is the request type for the BuildTx RPC method. -message BuildTxRequest { - string did = 1; - string pkl = 2; -} - -// BuildTxResponse is the response type for the BuildTx RPC method. -message BuildTxResponse { - bool success = 1; - string tx = 2; -} +message SyncResponse { bool success = 1; } diff --git a/proto/vault/v1/state.proto b/proto/vault/v1/state.proto index ca493feca..5f0677133 100644 --- a/proto/vault/v1/state.proto +++ b/proto/vault/v1/state.proto @@ -9,21 +9,10 @@ option go_package = "github.com/onsonr/sonr/x/vault/types"; message DWN { option (cosmos.orm.v1.table) = { - id: 1 - primary_key: { - fields: "id" - auto_increment: true - } - index: { - id: 1 - fields: "alias" - unique: true - } - index: { - id: 2 - fields: "cid" - unique: true - } + id : 1 + primary_key : {fields : "id" auto_increment : true} + index : {id : 1 fields : "alias" unique : true} + index : {id : 2 fields : "cid" unique : true} }; uint64 id = 1; string alias = 2; diff --git a/proto/vault/v1/tx.proto b/proto/vault/v1/tx.proto index 1023c8e06..f1a797f24 100644 --- a/proto/vault/v1/tx.proto +++ b/proto/vault/v1/tx.proto @@ -32,12 +32,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 @@ -51,7 +51,7 @@ message MsgAllocateVault { option (cosmos.msg.v1.signer) = "authority"; // authority is the address of the service account. - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // subject is a unique human-defined identifier to associate with the vault. string subject = 2; diff --git a/scripts/init_env.sh b/scripts/init_env.sh deleted file mode 100644 index eb6138fee..000000000 --- a/scripts/init_env.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/zsh - -export ACC0_MNEMONIC=$(skate get ACC0_MNEMONIC) -export ACC1_MNEMONIC=$(skate get ACC1_MNEMONIC) -export CHAIN_ID=$(skate get CHAIN_ID) -export DENOM=$(skate get DENOM) -export KEYRING=$(skate get KEYRING) -export MONIKER=$(skate get MONIKER) diff --git a/scripts/setup_xcaddy.sh b/scripts/setup_xcaddy.sh deleted file mode 100755 index 13a882eec..000000000 --- a/scripts/setup_xcaddy.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# Exit immediately if a command exits with a non-zero status. -set -e - -# Function to check if a command exists. -command_exists() { - command -v "$1" >/dev/null 2>&1 -} - -echo "Starting the build process for Caddy with Cloudflare DNS module..." - -# Check if Go is installed -if ! command_exists go; then - echo "Go is not installed. Please install Go before running this script." - exit 1 -fi - -# Set Go environment variables -export GOPATH=$(go env GOPATH) -export GOBIN=$GOPATH/bin -export PATH=$PATH:$GOBIN - -# Install xcaddy if not present -if ! command_exists xcaddy; then - echo "xcaddy not found. Installing xcaddy..." - curl -sSfL https://raw.githubusercontent.com/caddyserver/xcaddy/master/install.sh | bash -s -- -b $GOBIN -fi - -# Build Caddy with the Cloudflare DNS module -echo "Building Caddy with the Cloudflare DNS module..." -xcaddy build --with github.com/caddy-dns/cloudflare -mv caddy ../build/caddy -echo "Caddy has been built successfully with the Cloudflare DNS module." - -# Optional: Move the caddy binary to /usr/local/bin (requires sudo) -# echo "Moving caddy to /usr/local/bin (requires sudo)..." -# sudo mv caddy /usr/local/bin/ - -# echo "Caddy has been installed to /usr/local/bin." diff --git a/scripts/version_bump.sh b/scripts/version_bump.sh deleted file mode 100644 index c918e6c32..000000000 --- a/scripts/version_bump.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -e - -# Get the current version from most recent git tag -export VERSION=$(git describe --tags --abbrev=0) - -# Check if the version is a valid semantic version -if ! [[ $VERSION =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Invalid version format: $VERSION" - exit 1 -fi - -# Check if the version has already been bumped - diff --git a/workers/handlers/auth.go b/workers/handlers/auth.go new file mode 100644 index 000000000..a41117634 --- /dev/null +++ b/workers/handlers/auth.go @@ -0,0 +1,84 @@ +package handlers + +import ( + "encoding/json" + "fmt" + + "github.com/go-webauthn/webauthn/protocol" + "github.com/labstack/echo/v4" +) + +// ╭───────────────────────────────────────────────────────────╮ +// │ Login Handlers │ +// ╰───────────────────────────────────────────────────────────╯ + +func LoginSubjectStart(e echo.Context) error { + return e.JSON(200, "HandleCredentialAssertion") +} + +func LoginSubjectCheck(e echo.Context) error { + return e.JSON(200, "HandleCredentialAssertion") +} + +func LoginSubjectFinish(e echo.Context) error { + return e.JSON(200, "HandleCredentialAssertion") +} + +// ╭───────────────────────────────────────────────────────────╮ +// │ Register Handlers │ +// ╰───────────────────────────────────────────────────────────╯ + +func RegisterSubjectCheck(e echo.Context) error { + credentialID := e.FormValue("credentialID") + return e.JSON(200, credentialID) +} + +func RegisterSubjectStart(e echo.Context) error { + // Get the serialized credential data from the form + credentialDataJSON := e.FormValue("credentialData") + + // Deserialize the JSON into a temporary struct + var ccr protocol.CredentialCreationResponse + err := json.Unmarshal([]byte(credentialDataJSON), &ccr) + if err != nil { + return e.JSON(500, err.Error()) + } + // + // // Parse the CredentialCreationResponse + // parsedData, err := ccr.Parse() + // if err != nil { + // return e.JSON(500, err.Error()) + // } + // + // // Create the Credential + // // credential := orm.NewCredential(parsedData, e.Request().Host, "") + // + // // Set additional fields + // credential.Controller = "" // Set this to the appropriate controller value + return e.JSON(200, fmt.Sprintf("REGISTER: %s", string(ccr.ID))) +} + +func RegisterSubjectFinish(e echo.Context) error { + // Get the serialized credential data from the form + credentialDataJSON := e.FormValue("credentialData") + + // Deserialize the JSON into a temporary struct + var ccr protocol.CredentialCreationResponse + err := json.Unmarshal([]byte(credentialDataJSON), &ccr) + if err != nil { + return e.JSON(500, err.Error()) + } + // + // // Parse the CredentialCreationResponse + // parsedData, err := ccr.Parse() + // if err != nil { + // return e.JSON(500, err.Error()) + // } + // + // // Create the Credential + // // credential := orm.NewCredential(parsedData, e.Request().Host, "") + // + // // Set additional fields + // credential.Controller = "" // Set this to the appropriate controller value + return e.JSON(200, fmt.Sprintf("REGISTER: %s", string(ccr.ID))) +} diff --git a/cmd/motr/state/openid.go b/workers/handlers/openid.go similarity index 96% rename from cmd/motr/state/openid.go rename to workers/handlers/openid.go index 1797220f6..0f7c8417e 100644 --- a/cmd/motr/state/openid.go +++ b/workers/handlers/openid.go @@ -1,4 +1,4 @@ -package state +package handlers import ( "github.com/labstack/echo/v4" diff --git a/workers/handlers/sync.go b/workers/handlers/sync.go new file mode 100644 index 000000000..2ff633a17 --- /dev/null +++ b/workers/handlers/sync.go @@ -0,0 +1,8 @@ +package handlers + +import "github.com/labstack/echo/v4" + +func GetDatabaseSchema(e echo.Context) error { + // Implement database schema endpoint + return nil +} diff --git a/workers/routes/client.go b/workers/routes/client.go new file mode 100644 index 000000000..24b886194 --- /dev/null +++ b/workers/routes/client.go @@ -0,0 +1,30 @@ +package routes + +import ( + "github.com/labstack/echo/v4" + + "github.com/onsonr/sonr/nebula/components/auth" + "github.com/onsonr/sonr/nebula/components/home" + "github.com/onsonr/sonr/workers/handlers" +) + +func RegisterClientAPI(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("/jwks", handlers.GetJWKS) + g1.GET("/token", handlers.GetToken) + g1.POST("/:origin/grant/:subject", handlers.GrantAuthorization) +} + +func RegisterClientViews(e *echo.Echo) { + e.GET("/home", home.Route) + e.GET("/login", auth.LoginRoute) + e.GET("/register", auth.RegisterRoute) +} diff --git a/workers/routes/proxy.go b/workers/routes/proxy.go new file mode 100644 index 000000000..956fe8d4f --- /dev/null +++ b/workers/routes/proxy.go @@ -0,0 +1,17 @@ +package routes + +import ( + "github.com/labstack/echo/v4" + + "github.com/onsonr/sonr/nebula/components/auth" + "github.com/onsonr/sonr/nebula/components/home" +) + +func RegisterProxyAPI(e *echo.Echo) { +} + +func RegisterProxyViews(e *echo.Echo) { + e.GET("/", home.Route) + e.GET("/login", auth.LoginRoute) + e.GET("/register", auth.RegisterRoute) +} diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 000000000..2aca33118 --- /dev/null +++ b/wrangler.toml @@ -0,0 +1,8 @@ +name = "sonr-id" +main = "./cmd/hway/build/worker.mjs" +compatibility_date = "2024-10-07" + +routes = [{ pattern = "sonr.id", custom_domain = true }] + +[build] +command = "make hway-build" diff --git a/x/did/README.md b/x/did/README.md index 8dd3a7772..91ce8c1c2 100644 --- a/x/did/README.md +++ b/x/did/README.md @@ -2,20 +2,6 @@ The Decentralized Identity module is responsible for managing native Sonr Accounts, their derived wallets, and associated user identification information. -## Concepts - -### Account - -An Account represents a user's identity within the Sonr ecosystem. It includes information such as the user's public key, associated wallets, and other identification details. - -### Decentralized Identifier (DID) - -A Decentralized Identifier (DID) is a unique identifier that is created, owned, and controlled by the user. It is used to establish a secure and verifiable digital identity. - -### Verifiable Credential (VC) - -A Verifiable Credential (VC) is a digital statement that can be cryptographically verified. It contains claims about a subject (e.g., a user) and is issued by a trusted authority. - ## State Specify and describe structures expected to marshalled into the store, and their keys @@ -71,3 +57,15 @@ Acceptance tests. ## Appendix Supplementary details referenced elsewhere within the spec. + +### Account + +An Account represents a user's identity within the Sonr ecosystem. It includes information such as the user's public key, associated wallets, and other identification details. + +### Decentralized Identifier (DID) + +A Decentralized Identifier (DID) is a unique identifier that is created, owned, and controlled by the user. It is used to establish a secure and verifiable digital identity. + +### Verifiable Credential (VC) + +A Verifiable Credential (VC) is a digital statement that can be cryptographically verified. It contains claims about a subject (e.g., a user) and is issued by a trusted authority. diff --git a/x/did/types/genesis.pb.go b/x/did/types/genesis.pb.go index 934d2652d..efc94527a 100644 --- a/x/did/types/genesis.pb.go +++ b/x/did/types/genesis.pb.go @@ -202,45 +202,344 @@ func (m *KeyInfo) GetCurve() string { 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 { + return m.Unmarshal(b) +} +func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey.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 *PubKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey.Merge(m, src) +} +func (m *PubKey) XXX_Size() int { + return m.Size() +} +func (m *PubKey) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey proto.InternalMessageInfo + +func (m *PubKey) GetRole() string { + if m != nil { + return m.Role + } + return "" +} + +func (m *PubKey) GetKeyType() string { + if m != nil { + return m.KeyType + } + return "" +} + +func (m *PubKey) GetRawKey() *RawKey { + if m != nil { + return m.RawKey + } + return nil +} + +func (m *PubKey) GetJwk() *JSONWebKey { + if m != nil { + return m.Jwk + } + 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 { + if m != nil { + return m.E + } + 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 "" +} + +func (m *RawKey) GetCurve() string { + if m != nil { + return m.Curve + } + return "" +} + +func (m *RawKey) GetKey() []byte { + if m != nil { + return m.Key + } + 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") } func init() { proto.RegisterFile("did/v1/genesis.proto", fileDescriptor_fda181cae44f7c00) } var fileDescriptor_fda181cae44f7c00 = []byte{ - // 446 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x6e, 0xd3, 0x30, - 0x1c, 0xc6, 0x93, 0xb6, 0x2b, 0xc4, 0x43, 0xc0, 0xbc, 0x02, 0x51, 0x85, 0xd2, 0xaa, 0xd2, 0xa4, - 0x0a, 0xa1, 0x44, 0xdb, 0x2e, 0x68, 0xda, 0x85, 0x49, 0x80, 0xd0, 0x2e, 0x55, 0xd0, 0x2e, 0x5c, - 0x2a, 0x37, 0xf9, 0x37, 0xb3, 0x96, 0xf8, 0x1f, 0xd9, 0x6e, 0x20, 0xaf, 0xc0, 0x89, 0x23, 0xc7, - 0x3d, 0x02, 0x17, 0xde, 0x61, 0xc7, 0x1d, 0x39, 0x21, 0xd4, 0x1e, 0xe0, 0x31, 0x50, 0xed, 0xb0, - 0x02, 0xe2, 0x62, 0x7d, 0xfe, 0x7e, 0x9f, 0xfe, 0x76, 0xbe, 0x98, 0xf4, 0x52, 0x9e, 0x46, 0xd5, - 0x7e, 0x94, 0x81, 0x00, 0xc5, 0x55, 0x58, 0x4a, 0xd4, 0x48, 0xbb, 0x29, 0x4f, 0xc3, 0x6a, 0xbf, - 0xbf, 0xc3, 0x0a, 0x2e, 0x30, 0x32, 0xab, 0x45, 0xfd, 0x5e, 0x86, 0x19, 0x1a, 0x19, 0xad, 0x95, - 0x75, 0x47, 0xc7, 0xe4, 0xce, 0x2b, 0x3b, 0xe1, 0x8d, 0x66, 0x1a, 0xe8, 0x53, 0xd2, 0x2d, 0x99, - 0x64, 0x85, 0xf2, 0xdd, 0xa1, 0x3b, 0xde, 0x3e, 0xb8, 0x1b, 0xda, 0x89, 0xe1, 0xc4, 0xb8, 0x27, - 0x9d, 0xab, 0x6f, 0x03, 0x27, 0x6e, 0x32, 0xa3, 0x2f, 0x2d, 0xd2, 0xb5, 0x80, 0x9e, 0x91, 0x5d, - 0x96, 0xe7, 0xf8, 0x0e, 0xd2, 0x69, 0xb9, 0x98, 0xe5, 0x3c, 0x99, 0x5e, 0x40, 0xad, 0xfc, 0xd6, - 0xb0, 0x3d, 0xde, 0x3e, 0xd8, 0xfb, 0x7b, 0x4a, 0xf8, 0xdc, 0x26, 0x27, 0x26, 0x78, 0x0a, 0xb5, - 0x7a, 0x21, 0xb4, 0xac, 0xe3, 0x1d, 0xf6, 0xaf, 0x4f, 0x0f, 0xc9, 0x83, 0x04, 0x45, 0x05, 0x35, - 0x13, 0x09, 0x4c, 0x4b, 0x09, 0x73, 0x90, 0x20, 0x12, 0xf0, 0xdb, 0x43, 0x77, 0xec, 0xc5, 0xbd, - 0x0d, 0x9c, 0xdc, 0x30, 0x1a, 0x91, 0x5d, 0xa6, 0x35, 0x28, 0xcd, 0x34, 0x47, 0x31, 0x9d, 0xa3, - 0x2c, 0x98, 0x56, 0x7e, 0x67, 0xd8, 0x1e, 0x7b, 0x31, 0xfd, 0x03, 0xbd, 0xb4, 0xa4, 0x7f, 0x46, - 0x1e, 0xfe, 0xff, 0x4a, 0xf4, 0x3e, 0x69, 0x5f, 0x40, 0x6d, 0xca, 0xf0, 0xe2, 0xb5, 0xa4, 0x7b, - 0x64, 0xab, 0x62, 0xf9, 0x02, 0xfc, 0x96, 0x29, 0xe8, 0xde, 0xef, 0x4f, 0x3b, 0x85, 0xfa, 0xb5, - 0x98, 0x63, 0x6c, 0xe9, 0x51, 0xeb, 0x99, 0x7b, 0xf4, 0xe8, 0xd3, 0xe5, 0xc0, 0xf9, 0x79, 0x39, - 0x70, 0x3f, 0xfc, 0xf8, 0xfc, 0x84, 0xac, 0x7f, 0x58, 0xd3, 0x5b, 0x41, 0x6e, 0x35, 0x71, 0x4a, - 0x49, 0x47, 0x62, 0x0e, 0xcd, 0x09, 0x46, 0xd3, 0xc7, 0xc4, 0x63, 0x79, 0x86, 0x92, 0xeb, 0xf3, - 0xc2, 0x1c, 0xe3, 0xc5, 0x1b, 0x83, 0xf6, 0xc9, 0x6d, 0x10, 0x09, 0xa6, 0x5c, 0x64, 0x4d, 0x0b, - 0x37, 0x7b, 0xda, 0x23, 0x5b, 0xc9, 0x42, 0x56, 0xe0, 0x77, 0x0c, 0xb0, 0x9b, 0x93, 0xe3, 0xab, - 0x65, 0xe0, 0x5e, 0x2f, 0x03, 0xf7, 0xfb, 0x32, 0x70, 0x3f, 0xae, 0x02, 0xe7, 0x7a, 0x15, 0x38, - 0x5f, 0x57, 0x81, 0xf3, 0x76, 0x94, 0x71, 0x7d, 0xbe, 0x98, 0x85, 0x09, 0x16, 0x11, 0x0a, 0x85, - 0x42, 0x46, 0x66, 0x79, 0x1f, 0xad, 0x6f, 0xab, 0xeb, 0x12, 0xd4, 0xac, 0x6b, 0x5e, 0xca, 0xe1, - 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0e, 0xbf, 0x72, 0x57, 0x72, 0x02, 0x00, 0x00, + // 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, } func (this *Params) Equal(that interface{}) bool { @@ -432,6 +731,225 @@ func (m *KeyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Keyshares) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Keyshares) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Keyshares) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LastUpdatedBlock != 0 { + i = 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 @@ -511,6 +1029,109 @@ func (m *KeyInfo) Size() (n int) { 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 } @@ -1021,6 +1642,747 @@ func (m *KeyInfo) Unmarshal(dAtA []byte) error { } 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 iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PubKey) 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: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PubKey: 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) + } + 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.Jwk == nil { + m.Jwk = &JSONWebKey{} + } + if err := m.Jwk.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 *JSONWebKey) 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: JSONWebKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JSONWebKey: 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) + } + 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.Kty = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Crv", 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.Crv = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field X", 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.X = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Y", 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.Y = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field N", 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.N = 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) + } + 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 3: + 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 + 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{} + } + 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 skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/did/types/params.go b/x/did/types/params.go index 309248c95..af24005a5 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/pkg/orm/keyalgorithm" - "github.com/onsonr/sonr/pkg/orm/keycurve" - "github.com/onsonr/sonr/pkg/orm/keyencoding" - "github.com/onsonr/sonr/pkg/orm/keyrole" + "github.com/onsonr/sonr/internal/orm/keyalgorithm" + "github.com/onsonr/sonr/internal/orm/keycurve" + "github.com/onsonr/sonr/internal/orm/keyencoding" + "github.com/onsonr/sonr/internal/orm/keyrole" ) // DefaultParams returns default module parameters. diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index cb22e3892..17eacc7b7 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -358,360 +358,61 @@ func (m *Verification) GetCreationBlock() int64 { return 0 } -type Keyshares struct { - ValidatorCid string `protobuf:"bytes,1,opt,name=validator_cid,json=validatorCid,proto3" json:"validator_cid,omitempty"` - UserCid string `protobuf:"bytes,2,opt,name=user_cid,json=userCid,proto3" json:"user_cid,omitempty"` - LastUpdatedBlock int64 `protobuf:"varint,3,opt,name=last_updated_block,json=lastUpdatedBlock,proto3" json:"last_updated_block,omitempty"` -} - -func (m *Keyshares) Reset() { *m = Keyshares{} } -func (m *Keyshares) String() string { return proto.CompactTextString(m) } -func (*Keyshares) ProtoMessage() {} -func (*Keyshares) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{3} -} -func (m *Keyshares) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Keyshares) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Keyshares.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Keyshares) XXX_Merge(src proto.Message) { - xxx_messageInfo_Keyshares.Merge(m, src) -} -func (m *Keyshares) XXX_Size() int { - return m.Size() -} -func (m *Keyshares) XXX_DiscardUnknown() { - xxx_messageInfo_Keyshares.DiscardUnknown(m) -} - -var xxx_messageInfo_Keyshares proto.InternalMessageInfo - -func (m *Keyshares) GetValidatorCid() string { - if m != nil { - return m.ValidatorCid - } - return "" -} - -func (m *Keyshares) GetUserCid() string { - if m != nil { - return m.UserCid - } - return "" -} - -func (m *Keyshares) GetLastUpdatedBlock() int64 { - if m != nil { - return m.LastUpdatedBlock - } - return 0 -} - -// PubKey defines a public key for a did -type PubKey struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - 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_f44bb702879c34b4, []int{4} -} -func (m *PubKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKey.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 *PubKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKey.Merge(m, src) -} -func (m *PubKey) XXX_Size() int { - return m.Size() -} -func (m *PubKey) XXX_DiscardUnknown() { - xxx_messageInfo_PubKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKey proto.InternalMessageInfo - -func (m *PubKey) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -func (m *PubKey) GetKeyType() string { - if m != nil { - return m.KeyType - } - return "" -} - -func (m *PubKey) GetRawKey() *RawKey { - if m != nil { - return m.RawKey - } - return nil -} - -func (m *PubKey) GetJwk() *JSONWebKey { - if m != nil { - return m.Jwk - } - 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_f44bb702879c34b4, []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 { - if m != nil { - return m.E - } - 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_f44bb702879c34b4, []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 "" -} - -func (m *RawKey) GetCurve() string { - if m != nil { - return m.Curve - } - return "" -} - -func (m *RawKey) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - func init() { proto.RegisterType((*Authentication)(nil), "did.v1.Authentication") proto.RegisterMapType((map[string]string)(nil), "did.v1.Authentication.MetadataEntry") proto.RegisterType((*Controller)(nil), "did.v1.Controller") proto.RegisterType((*Verification)(nil), "did.v1.Verification") proto.RegisterMapType((map[string]string)(nil), "did.v1.Verification.MetadataEntry") - proto.RegisterType((*Keyshares)(nil), "did.v1.Keyshares") - proto.RegisterType((*PubKey)(nil), "did.v1.PubKey") - proto.RegisterType((*JSONWebKey)(nil), "did.v1.JSONWebKey") - proto.RegisterType((*RawKey)(nil), "did.v1.RawKey") } func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ - // 890 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x5d, 0x6f, 0xe3, 0x44, - 0x14, 0xed, 0xc4, 0x89, 0x1b, 0xdf, 0xa6, 0x55, 0x76, 0xb4, 0x80, 0xa9, 0x96, 0x10, 0xbc, 0x0b, - 0x04, 0x51, 0x12, 0xed, 0xf2, 0x82, 0x0a, 0x42, 0xec, 0xae, 0x78, 0x80, 0x6a, 0x01, 0x79, 0x61, - 0x11, 0xbc, 0x58, 0x63, 0xcf, 0xd0, 0xb8, 0xfe, 0x98, 0x30, 0x1e, 0xbb, 0xf5, 0x23, 0x12, 0x42, - 0x3c, 0x21, 0x7e, 0x01, 0xbf, 0x87, 0xc7, 0x95, 0x78, 0xe1, 0x11, 0xb5, 0xff, 0x80, 0x5f, 0x80, - 0x66, 0x3c, 0x4e, 0x1c, 0xb1, 0xa2, 0x02, 0xf1, 0xd2, 0xfa, 0x9e, 0x7b, 0xe2, 0xeb, 0x39, 0xe7, - 0x5c, 0x1b, 0x30, 0x8d, 0xe9, 0xa2, 0xba, 0xbb, 0x28, 0x24, 0x91, 0x6c, 0xbe, 0x12, 0x5c, 0x72, - 0x6c, 0xd3, 0x98, 0xce, 0xab, 0xbb, 0x87, 0x2f, 0x44, 0xbc, 0xc8, 0x78, 0xb1, 0xe0, 0x22, 0x53, - 0x14, 0x2e, 0xb2, 0x86, 0xe0, 0x7d, 0x67, 0xc1, 0xc1, 0xfd, 0x52, 0x2e, 0x59, 0x2e, 0xe3, 0x88, - 0xc8, 0x98, 0xe7, 0x78, 0x0c, 0x16, 0x8d, 0xa9, 0x8b, 0xa6, 0x68, 0xe6, 0xf8, 0xea, 0x12, 0x4f, - 0x00, 0x22, 0x9e, 0x4b, 0xc1, 0xd3, 0x94, 0x09, 0xb7, 0xa7, 0x1b, 0x1d, 0x04, 0xbb, 0xb0, 0x5b, - 0x94, 0xe1, 0x19, 0x8b, 0xa4, 0x6b, 0xe9, 0x66, 0x5b, 0xe2, 0xb7, 0x00, 0x56, 0x65, 0x98, 0xc6, - 0x51, 0x90, 0xb0, 0xda, 0xed, 0x4f, 0xd1, 0x6c, 0xef, 0xde, 0xc1, 0xbc, 0x79, 0xa8, 0xf9, 0x67, - 0x65, 0x78, 0xc2, 0x6a, 0xdf, 0x69, 0x18, 0x27, 0xac, 0xc6, 0xb7, 0x61, 0x3f, 0x12, 0x8c, 0xaa, - 0x87, 0x21, 0x69, 0x10, 0x53, 0x77, 0x30, 0x45, 0xb3, 0x91, 0x3f, 0xda, 0x80, 0x1f, 0x51, 0xfc, - 0x01, 0x0c, 0x33, 0x26, 0x09, 0x25, 0x92, 0xb8, 0xf6, 0xd4, 0x9a, 0xed, 0xdd, 0xbb, 0xd3, 0xde, - 0x71, 0xfb, 0x24, 0xf3, 0x47, 0x86, 0xf6, 0x61, 0x2e, 0x45, 0xed, 0xaf, 0x7f, 0x85, 0x5f, 0x85, - 0x83, 0x48, 0x30, 0xcd, 0x09, 0xc2, 0x94, 0x47, 0x89, 0xbb, 0x3b, 0x45, 0x33, 0xcb, 0xdf, 0x6f, - 0xd1, 0x07, 0x0a, 0x3c, 0x7c, 0x17, 0xf6, 0xb7, 0xee, 0xa0, 0x94, 0x51, 0xc7, 0x30, 0xca, 0x24, - 0xac, 0xc6, 0x37, 0x61, 0x50, 0x91, 0xb4, 0x64, 0x46, 0x94, 0xa6, 0x38, 0xee, 0xbd, 0x83, 0x8e, - 0xdf, 0xf8, 0xf3, 0x97, 0xdf, 0x7e, 0xb2, 0x6e, 0xc3, 0x40, 0xab, 0x89, 0x5d, 0xc0, 0x1b, 0xc1, - 0x8e, 0x8c, 0x3c, 0x63, 0xe4, 0x22, 0x17, 0x79, 0x3f, 0x5a, 0x00, 0x0f, 0x37, 0x6a, 0x3e, 0x0f, - 0x76, 0x5e, 0x66, 0x21, 0x13, 0x7a, 0x50, 0xdf, 0x37, 0x55, 0xeb, 0x4b, 0x6f, 0xe3, 0xcb, 0x2b, - 0x30, 0x2a, 0x78, 0x2e, 0x02, 0x42, 0xa9, 0x60, 0x45, 0x61, 0xc4, 0xdf, 0x53, 0xd8, 0xfd, 0x06, - 0xc2, 0x2f, 0xc3, 0x1e, 0x93, 0xcb, 0x35, 0xa3, 0xdf, 0x78, 0xc7, 0xe4, 0xb2, 0x43, 0x08, 0x65, - 0xb4, 0x26, 0x0c, 0x1a, 0x42, 0x28, 0xa3, 0x96, 0xb0, 0x6d, 0xa1, 0x7d, 0x9d, 0x85, 0xcf, 0x81, - 0x9d, 0x14, 0x41, 0x45, 0x52, 0xad, 0xa9, 0xe3, 0x0f, 0x92, 0xe2, 0x09, 0x49, 0xb5, 0xb3, 0x29, - 0x89, 0x33, 0x46, 0x8d, 0xe2, 0x43, 0xad, 0xf8, 0xc8, 0x80, 0x5a, 0xf0, 0x67, 0xf8, 0xe2, 0x3c, - 0xc3, 0x97, 0xe3, 0xaf, 0xb4, 0xb4, 0x8f, 0x01, 0x5a, 0xa1, 0xc6, 0x08, 0xe3, 0x6d, 0x29, 0x94, - 0xb2, 0xf8, 0xc6, 0xd6, 0xd9, 0xc7, 0xbd, 0x06, 0xea, 0x9c, 0x76, 0x6c, 0xb9, 0x08, 0x3b, 0x5a, - 0xd6, 0x71, 0xdf, 0x45, 0x6e, 0xcf, 0xfb, 0xbe, 0x0f, 0xa3, 0x27, 0x4c, 0xc4, 0xdf, 0xfc, 0xf7, - 0x65, 0x78, 0x09, 0x80, 0xc6, 0x34, 0xc8, 0x98, 0x5c, 0x72, 0x6a, 0x2c, 0x71, 0x68, 0x4c, 0x1f, - 0x69, 0x40, 0xb9, 0x1b, 0x17, 0x45, 0xc9, 0x84, 0xf1, 0xc2, 0x54, 0xdd, 0x1d, 0x1a, 0xfc, 0xd3, - 0x0e, 0x5d, 0x6b, 0xc0, 0x9b, 0x70, 0xa3, 0xea, 0x9c, 0x20, 0x90, 0xf5, 0x8a, 0x19, 0x2f, 0xc6, - 0xdd, 0xc6, 0xe7, 0xf5, 0x8a, 0xe1, 0xf7, 0x3b, 0xbb, 0x34, 0xd4, 0xbb, 0xe4, 0xb5, 0x77, 0xee, - 0xca, 0xf0, 0x2f, 0x36, 0xc9, 0xf9, 0xdf, 0x37, 0xe9, 0x5b, 0x6d, 0x77, 0xd2, 0x6e, 0xd2, 0x4d, - 0x38, 0x68, 0x24, 0xeb, 0x6e, 0x11, 0xf6, 0xe0, 0x56, 0x67, 0xbf, 0x36, 0x06, 0x1c, 0x35, 0x5c, - 0x6d, 0xfe, 0x6b, 0x30, 0xfd, 0x9b, 0x32, 0xed, 0x4d, 0x5a, 0x9e, 0xe5, 0x22, 0xb7, 0xef, 0xd5, - 0xe0, 0x9c, 0xb0, 0xba, 0x58, 0x12, 0xc1, 0x0a, 0x15, 0xdd, 0x8a, 0xa4, 0x31, 0x25, 0x92, 0x8b, - 0x20, 0x5a, 0x87, 0x61, 0xb4, 0x06, 0x1f, 0xc6, 0x14, 0xbf, 0x08, 0xc3, 0xb2, 0x60, 0x4d, 0xbf, - 0x39, 0xc1, 0xae, 0xaa, 0x55, 0xeb, 0x08, 0x70, 0x4a, 0x0a, 0x19, 0x94, 0x2b, 0x4a, 0xe4, 0x3a, - 0xff, 0x96, 0xd6, 0x69, 0xac, 0x3a, 0x5f, 0x34, 0x0d, 0x2d, 0x95, 0xf7, 0x03, 0x02, 0xbb, 0x31, - 0x15, 0x63, 0xe8, 0x0b, 0x9e, 0x32, 0x33, 0x4f, 0x5f, 0xab, 0x39, 0x09, 0xab, 0x1b, 0x53, 0xcd, - 0x9c, 0x84, 0xd5, 0xda, 0xcb, 0xd7, 0x61, 0x57, 0x90, 0x73, 0x1d, 0x12, 0x6b, 0x3b, 0x24, 0x3e, - 0x39, 0x57, 0x21, 0xb1, 0x85, 0xfe, 0x8f, 0xef, 0x80, 0x75, 0x76, 0x9e, 0x98, 0xb7, 0x31, 0x6e, - 0x49, 0x1f, 0x3f, 0xfe, 0xf4, 0x93, 0x2f, 0x99, 0x4e, 0x93, 0x6a, 0x7b, 0x4b, 0x80, 0x0d, 0xa4, - 0x0d, 0x93, 0x1b, 0xc3, 0xa4, 0x46, 0x22, 0x51, 0xb5, 0xaf, 0xa3, 0x48, 0x54, 0x78, 0x04, 0xe8, - 0xc2, 0x04, 0x1e, 0x5d, 0xa8, 0xaa, 0x36, 0x19, 0x47, 0xb5, 0xaa, 0x72, 0x13, 0x6c, 0x94, 0xab, - 0x8a, 0xe9, 0x24, 0x3b, 0x3e, 0x62, 0xde, 0x19, 0xd8, 0xcd, 0x13, 0xe2, 0x5b, 0xe0, 0x90, 0xf4, - 0x94, 0x8b, 0x58, 0x2e, 0x33, 0x33, 0x6b, 0x03, 0xe0, 0x43, 0x18, 0xb2, 0x3c, 0xe2, 0x34, 0xce, - 0x4f, 0xcd, 0xd8, 0x75, 0xad, 0xe2, 0x13, 0x95, 0xa2, 0x62, 0x66, 0x7e, 0x53, 0xb4, 0x31, 0xeb, - 0xeb, 0xaf, 0x88, 0xba, 0x7c, 0xf0, 0xde, 0xaf, 0x97, 0x13, 0xf4, 0xf4, 0x72, 0x82, 0xfe, 0xb8, - 0x9c, 0xa0, 0x9f, 0xaf, 0x26, 0x3b, 0x4f, 0xaf, 0x26, 0x3b, 0xbf, 0x5f, 0x4d, 0x76, 0xbe, 0xf6, - 0x4e, 0x63, 0xb9, 0x2c, 0xc3, 0x79, 0xc4, 0xb3, 0x05, 0xcf, 0xd5, 0xcb, 0x64, 0xa1, 0xff, 0x5c, - 0x2c, 0xd4, 0x77, 0x55, 0x09, 0x5e, 0x84, 0xb6, 0xfe, 0x68, 0xbe, 0xfd, 0x57, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x9c, 0xe7, 0xd9, 0xaa, 0x6b, 0x07, 0x00, 0x00, + // 674 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xd1, 0x6a, 0xd3, 0x50, + 0x1c, 0xc6, 0x77, 0x9a, 0xb6, 0x5b, 0xff, 0xed, 0x4a, 0x77, 0x98, 0x7a, 0x18, 0x1a, 0x6b, 0xa7, + 0x52, 0x71, 0xb6, 0x6c, 0xde, 0xc8, 0x14, 0x71, 0x13, 0x2f, 0x64, 0x0c, 0x24, 0xca, 0x40, 0x6f, + 0x42, 0x92, 0x73, 0x5c, 0x8f, 0x4d, 0x72, 0x6a, 0xce, 0x49, 0x31, 0x97, 0x82, 0x17, 0x5e, 0x89, + 0x4f, 0xe0, 0xf3, 0x78, 0x39, 0xf0, 0xc6, 0x4b, 0xd9, 0xde, 0xc0, 0x27, 0x90, 0x9c, 0x24, 0x6b, + 0x8a, 0xc3, 0xa1, 0x78, 0x53, 0x7a, 0xbe, 0x7c, 0xf9, 0x37, 0xff, 0xdf, 0xd7, 0x2f, 0x80, 0x29, + 0xa7, 0xc3, 0xe9, 0xe6, 0x50, 0x2a, 0x47, 0xb1, 0xc1, 0x24, 0x12, 0x4a, 0xe0, 0x3a, 0xe5, 0x74, + 0x30, 0xdd, 0x5c, 0xbb, 0xe4, 0x09, 0x19, 0x08, 0x39, 0x14, 0x51, 0x90, 0x5a, 0x44, 0x14, 0x64, + 0x86, 0xb5, 0xd5, 0xfc, 0xa6, 0x43, 0x16, 0x32, 0xc9, 0x65, 0xa6, 0xf6, 0xde, 0x1b, 0xd0, 0xde, + 0x89, 0xd5, 0x88, 0x85, 0x8a, 0x7b, 0x8e, 0xe2, 0x22, 0xc4, 0x1d, 0x30, 0x28, 0xa7, 0x04, 0x75, + 0x51, 0xbf, 0x61, 0xa5, 0x5f, 0xb1, 0x09, 0xe0, 0x89, 0x50, 0x45, 0xc2, 0xf7, 0x59, 0x44, 0x2a, + 0xfa, 0x42, 0x49, 0xc1, 0x04, 0x16, 0x65, 0xec, 0xbe, 0x61, 0x9e, 0x22, 0x86, 0xbe, 0x58, 0x1c, + 0xf1, 0x1d, 0x80, 0x49, 0xec, 0xfa, 0xdc, 0xb3, 0xc7, 0x2c, 0x21, 0xd5, 0x2e, 0xea, 0x37, 0xb7, + 0xda, 0x83, 0xec, 0x51, 0x07, 0xcf, 0x62, 0x77, 0x8f, 0x25, 0x56, 0x23, 0x73, 0xec, 0xb1, 0x04, + 0xaf, 0xc3, 0xb2, 0x17, 0x31, 0x9a, 0x3e, 0x8c, 0xe3, 0xdb, 0x9c, 0x92, 0x5a, 0x17, 0xf5, 0x5b, + 0x56, 0x6b, 0x26, 0x3e, 0xa5, 0xf8, 0x11, 0x2c, 0x05, 0x4c, 0x39, 0xd4, 0x51, 0x0e, 0xa9, 0x77, + 0x8d, 0x7e, 0x73, 0xeb, 0x7a, 0x31, 0x71, 0x7e, 0x93, 0xc1, 0x7e, 0x6e, 0x7b, 0x12, 0xaa, 0x28, + 0xb1, 0x4e, 0xef, 0xc2, 0x37, 0xa0, 0xed, 0x45, 0x4c, 0x7b, 0x6c, 0xd7, 0x17, 0xde, 0x98, 0x2c, + 0x76, 0x51, 0xdf, 0xb0, 0x96, 0x0b, 0x75, 0x37, 0x15, 0xd7, 0xee, 0xc3, 0xf2, 0xdc, 0x84, 0x94, + 0x4c, 0xba, 0x46, 0x4e, 0x66, 0xcc, 0x12, 0xbc, 0x0a, 0xb5, 0xa9, 0xe3, 0xc7, 0x2c, 0x87, 0x92, + 0x1d, 0xb6, 0x2b, 0xf7, 0xd0, 0xf6, 0xad, 0x9f, 0x5f, 0xbe, 0x7d, 0x32, 0xd6, 0xa1, 0xa6, 0x69, + 0x62, 0x02, 0x78, 0x06, 0x6c, 0x23, 0xc7, 0xd3, 0x41, 0x04, 0x11, 0xd4, 0xfb, 0x68, 0x00, 0x3c, + 0x9e, 0xd1, 0xbc, 0x08, 0xf5, 0x30, 0x0e, 0x5c, 0x16, 0xe9, 0x1f, 0xaa, 0x5a, 0xf9, 0xa9, 0xc8, + 0xa5, 0x32, 0xcb, 0xe5, 0x1a, 0xb4, 0xa4, 0x08, 0x23, 0xdb, 0xa1, 0x34, 0x62, 0x52, 0xe6, 0xf0, + 0x9b, 0xa9, 0xb6, 0x93, 0x49, 0xf8, 0x2a, 0x34, 0x99, 0x1a, 0x9d, 0x3a, 0xaa, 0x59, 0x76, 0x4c, + 0x8d, 0x4a, 0x06, 0x57, 0x79, 0xa7, 0x86, 0x5a, 0x66, 0x70, 0x95, 0x57, 0x18, 0xe6, 0x23, 0xac, + 0x9f, 0x17, 0xe1, 0x05, 0xa8, 0x8f, 0xa5, 0x3d, 0x75, 0x7c, 0xcd, 0xb4, 0x61, 0xd5, 0xc6, 0xf2, + 0xc0, 0xf1, 0x75, 0xb2, 0xbe, 0xc3, 0x03, 0x46, 0x73, 0xe2, 0x4b, 0x9a, 0x78, 0x2b, 0x17, 0x35, + 0xf0, 0x33, 0x72, 0x69, 0x9c, 0x91, 0xcb, 0xf6, 0x4b, 0x8d, 0xf6, 0x39, 0x40, 0x01, 0xaa, 0x83, + 0x30, 0x9e, 0x47, 0x91, 0x92, 0xc5, 0x2b, 0x73, 0xbb, 0x77, 0x2a, 0x99, 0x54, 0xda, 0xb6, 0x63, + 0x10, 0x84, 0x1b, 0x1a, 0x6b, 0xa7, 0x4a, 0x10, 0xa9, 0xf4, 0x3e, 0x54, 0xa1, 0x75, 0xc0, 0x22, + 0xfe, 0xfa, 0xdf, 0xcb, 0x70, 0x05, 0x80, 0x72, 0x6a, 0x07, 0x4c, 0x8d, 0x04, 0xcd, 0x23, 0x69, + 0x50, 0x4e, 0xf7, 0xb5, 0x90, 0xa6, 0xcb, 0xa5, 0x8c, 0x59, 0x94, 0x67, 0x91, 0x9f, 0xca, 0x1d, + 0xaa, 0xfd, 0xa9, 0x43, 0xe7, 0x06, 0x70, 0x1b, 0x56, 0xa6, 0xa5, 0x0d, 0x6c, 0x95, 0x4c, 0x58, + 0x9e, 0x45, 0xa7, 0x7c, 0xe1, 0x45, 0x32, 0x61, 0xf8, 0x61, 0xa9, 0x4b, 0x4b, 0xba, 0x4b, 0xbd, + 0x62, 0x72, 0x19, 0xc3, 0x5f, 0x34, 0xa9, 0xf1, 0xdf, 0x9b, 0xf4, 0x56, 0xc7, 0x3d, 0x2e, 0x9a, + 0xb4, 0x0a, 0xed, 0x0c, 0x59, 0xb9, 0x45, 0xb8, 0x07, 0x97, 0x4b, 0xfd, 0x9a, 0x05, 0xb0, 0x91, + 0x79, 0x75, 0xf8, 0x37, 0xa1, 0xfb, 0x1b, 0x99, 0x62, 0x48, 0xe1, 0x33, 0x08, 0x22, 0xd5, 0xdd, + 0x07, 0x5f, 0x8f, 0x4d, 0x74, 0x74, 0x6c, 0xa2, 0x1f, 0xc7, 0x26, 0xfa, 0x7c, 0x62, 0x2e, 0x1c, + 0x9d, 0x98, 0x0b, 0xdf, 0x4f, 0xcc, 0x85, 0x57, 0xbd, 0x43, 0xae, 0x46, 0xb1, 0x3b, 0xf0, 0x44, + 0x30, 0x14, 0x61, 0xfa, 0x97, 0x1b, 0xea, 0x8f, 0x77, 0xc3, 0xf4, 0xf5, 0x9a, 0x4e, 0x94, 0x6e, + 0x5d, 0xbf, 0x5a, 0xef, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x91, 0xe2, 0xb2, 0x85, 0xa7, 0x05, + 0x00, 0x00, } func (m *Authentication) Marshal() (dAtA []byte, err error) { @@ -987,225 +688,6 @@ func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Keyshares) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Keyshares) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Keyshares) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastUpdatedBlock != 0 { - i = encodeVarintState(dAtA, i, uint64(m.LastUpdatedBlock)) - i-- - dAtA[i] = 0x18 - } - if len(m.UserCid) > 0 { - i -= len(m.UserCid) - copy(dAtA[i:], m.UserCid) - i = encodeVarintState(dAtA, i, uint64(len(m.UserCid))) - i-- - dAtA[i] = 0x12 - } - if len(m.ValidatorCid) > 0 { - i -= len(m.ValidatorCid) - copy(dAtA[i:], m.ValidatorCid) - i = encodeVarintState(dAtA, i, uint64(len(m.ValidatorCid))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PubKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - 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 = encodeVarintState(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 = encodeVarintState(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.KeyType) > 0 { - i -= len(m.KeyType) - copy(dAtA[i:], m.KeyType) - i = encodeVarintState(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 = encodeVarintState(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 = encodeVarintState(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 = encodeVarintState(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 = encodeVarintState(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 = encodeVarintState(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 = encodeVarintState(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 = encodeVarintState(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 = encodeVarintState(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 = encodeVarintState(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 = encodeVarintState(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 = encodeVarintState(dAtA, i, uint64(len(m.Algorithm))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintState(dAtA []byte, offset int, v uint64) int { offset -= sovState(v) base := offset @@ -1347,109 +829,6 @@ func (m *Verification) Size() (n int) { return n } -func (m *Keyshares) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorCid) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.UserCid) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - if m.LastUpdatedBlock != 0 { - n += 1 + sovState(uint64(m.LastUpdatedBlock)) - } - return n -} - -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 + sovState(uint64(l)) - } - l = len(m.KeyType) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - if m.RawKey != nil { - l = m.RawKey.Size() - n += 1 + l + sovState(uint64(l)) - } - if m.Jwk != nil { - l = m.Jwk.Size() - n += 1 + l + sovState(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 + sovState(uint64(l)) - } - l = len(m.Crv) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.X) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Y) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.N) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.E) - if l > 0 { - n += 1 + l + sovState(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 + sovState(uint64(l)) - } - l = len(m.Encoding) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Curve) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Key) - 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 } @@ -2545,747 +1924,6 @@ func (m *Verification) Unmarshal(dAtA []byte) error { } return nil } -func (m *Keyshares) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Keyshares: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Keyshares: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UserCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UserCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastUpdatedBlock", wireType) - } - m.LastUpdatedBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastUpdatedBlock |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipState(dAtA[iNdEx:]) - 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 *PubKey) 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: PubKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PubKey: 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 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.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 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.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 ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.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) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Jwk == nil { - m.Jwk = &JSONWebKey{} - } - if err := m.Jwk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 (m *JSONWebKey) 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: JSONWebKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JSONWebKey: 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) - } - 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.Kty = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Crv", 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.Crv = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field X", 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.X = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Y", 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.Y = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field N", 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.N = 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 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.E = 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 (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 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: 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 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.Algorithm = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 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.Encoding = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 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.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 ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - 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/did/types/tx.pb.go b/x/did/types/tx.pb.go index 3913c59cd..d0f50c059 100644 --- a/x/did/types/tx.pb.go +++ b/x/did/types/tx.pb.go @@ -34,13 +34,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgRegisterController struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // Assertions is the list of assertions to initialize the controller with. - Assertions [][]byte `protobuf:"bytes,2,rep,name=assertions,proto3" json:"assertions,omitempty"` - // Keyshares is the list of keyshares to initialize the controller with. - Keyshares [][]byte `protobuf:"bytes,3,rep,name=keyshares,proto3" json:"keyshares,omitempty"` - // Verifications is the list of verifications to initialize the controller - // with. - Verifications [][]byte `protobuf:"bytes,4,rep,name=verifications,proto3" json:"verifications,omitempty"` } func (m *MsgRegisterController) Reset() { *m = MsgRegisterController{} } @@ -83,27 +76,6 @@ func (m *MsgRegisterController) GetAuthority() string { return "" } -func (m *MsgRegisterController) GetAssertions() [][]byte { - if m != nil { - return m.Assertions - } - return nil -} - -func (m *MsgRegisterController) GetKeyshares() [][]byte { - if m != nil { - return m.Keyshares - } - return nil -} - -func (m *MsgRegisterController) GetVerifications() [][]byte { - if m != nil { - return m.Verifications - } - return nil -} - // MsgRegisterControllerResponse is the response type for the // InitializeController RPC. type MsgRegisterControllerResponse struct { @@ -112,8 +84,6 @@ type MsgRegisterControllerResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Controller is the address of the initialized controller. Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - // Accounts are a Address Map and Supported coin Denoms for the controller - Accounts map[string]string `protobuf:"bytes,3,rep,name=accounts,proto3" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *MsgRegisterControllerResponse) Reset() { *m = MsgRegisterControllerResponse{} } @@ -163,13 +133,6 @@ func (m *MsgRegisterControllerResponse) GetController() string { return "" } -func (m *MsgRegisterControllerResponse) GetAccounts() map[string]string { - if m != nil { - return m.Accounts - } - return nil -} - // MsgExecuteTx is the message type for the ExecuteTx RPC. type MsgExecuteTx struct { // Controller is the address of the controller to authenticate. @@ -396,7 +359,6 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgRegisterController)(nil), "did.v1.MsgRegisterController") proto.RegisterType((*MsgRegisterControllerResponse)(nil), "did.v1.MsgRegisterControllerResponse") - proto.RegisterMapType((map[string]string)(nil), "did.v1.MsgRegisterControllerResponse.AccountsEntry") proto.RegisterType((*MsgExecuteTx)(nil), "did.v1.MsgExecuteTx") proto.RegisterMapType((map[string][]byte)(nil), "did.v1.MsgExecuteTx.MessagesEntry") proto.RegisterType((*MsgExecuteTxResponse)(nil), "did.v1.MsgExecuteTxResponse") @@ -407,48 +369,43 @@ func init() { func init() { proto.RegisterFile("did/v1/tx.proto", fileDescriptor_d73284df019ff211) } var fileDescriptor_d73284df019ff211 = []byte{ - // 642 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x4e, 0xdb, 0x4e, - 0x10, 0x8e, 0x13, 0x08, 0x64, 0x08, 0xf0, 0xd3, 0x2a, 0x3f, 0xc5, 0x58, 0x60, 0x90, 0x55, 0x24, - 0x84, 0x5a, 0x5b, 0x04, 0xa9, 0x42, 0xb4, 0x6a, 0x05, 0x15, 0x12, 0x3d, 0x44, 0xad, 0x5c, 0x7a, - 0xe1, 0x82, 0x16, 0x7b, 0xeb, 0x58, 0x60, 0x6f, 0xb4, 0xb3, 0x89, 0x92, 0x5b, 0xdb, 0x27, 0xe8, - 0x0b, 0xf4, 0x1d, 0x38, 0xf4, 0x0d, 0x7a, 0xe1, 0x88, 0x7a, 0xea, 0xa9, 0xaa, 0xc8, 0x81, 0x07, - 0xe8, 0xb9, 0x52, 0xe5, 0x3f, 0x49, 0x1c, 0x9a, 0x02, 0xed, 0xc5, 0xda, 0xf9, 0xe6, 0xdb, 0x99, - 0xf9, 0x66, 0xc6, 0x0b, 0xf3, 0xae, 0xef, 0x5a, 0xed, 0x0d, 0x4b, 0x76, 0xcc, 0xa6, 0xe0, 0x92, - 0x93, 0xa2, 0xeb, 0xbb, 0x66, 0x7b, 0x43, 0xab, 0x3a, 0x1c, 0x03, 0x8e, 0x56, 0x80, 0x5e, 0xe4, - 0x0f, 0xd0, 0x4b, 0x08, 0xda, 0x42, 0xe2, 0x38, 0x8a, 0x2d, 0x2b, 0x31, 0x52, 0x57, 0x25, 0x0d, - 0xe6, 0xb1, 0x90, 0xa1, 0x3f, 0x40, 0x3d, 0xee, 0xf1, 0x84, 0x1d, 0x9d, 0x12, 0xd4, 0xf8, 0xac, - 0xc0, 0xff, 0x75, 0xf4, 0x6c, 0xe6, 0xf9, 0x28, 0x99, 0x78, 0xc6, 0x43, 0x29, 0xf8, 0xe9, 0x29, - 0x13, 0xe4, 0x21, 0x94, 0x68, 0x4b, 0x36, 0xb8, 0xf0, 0x65, 0x57, 0x55, 0x56, 0x94, 0xb5, 0xd2, - 0xae, 0xfa, 0xe5, 0xd3, 0x83, 0x4a, 0x9a, 0x6a, 0xc7, 0x75, 0x05, 0x43, 0x7c, 0x25, 0x85, 0x1f, - 0x7a, 0xf6, 0x90, 0x4a, 0x74, 0x00, 0x8a, 0xc8, 0x84, 0xf4, 0x79, 0x88, 0x6a, 0x7e, 0xa5, 0xb0, - 0x56, 0xb6, 0x33, 0x08, 0x59, 0x84, 0xd2, 0x09, 0xeb, 0x62, 0x83, 0x0a, 0x86, 0x6a, 0x21, 0x76, - 0x0f, 0x01, 0x72, 0x0f, 0x66, 0xdb, 0x4c, 0xf8, 0x6f, 0x7c, 0x87, 0x26, 0x01, 0x26, 0x62, 0xc6, - 0x28, 0xb8, 0x3d, 0xf7, 0xfe, 0xea, 0x6c, 0x7d, 0x98, 0xd3, 0x78, 0x97, 0x87, 0xa5, 0xb1, 0x2a, - 0x6c, 0x86, 0x4d, 0x1e, 0x22, 0x23, 0x2a, 0x4c, 0x61, 0xcb, 0x71, 0x18, 0x62, 0xac, 0x65, 0xda, - 0xee, 0x9b, 0x64, 0x0b, 0xc0, 0x19, 0xf0, 0xd5, 0xfc, 0x2d, 0x42, 0x33, 0x5c, 0xf2, 0x02, 0xa6, - 0xa9, 0xe3, 0xf0, 0x56, 0x28, 0x13, 0x21, 0x33, 0xb5, 0x4d, 0x33, 0x19, 0x9b, 0x79, 0x63, 0x31, - 0xe6, 0x4e, 0x7a, 0x6b, 0x2f, 0x94, 0xa2, 0x6b, 0x0f, 0x82, 0x68, 0x8f, 0x60, 0x76, 0xc4, 0x45, - 0xfe, 0x83, 0xc2, 0x09, 0x4b, 0xbb, 0x6f, 0x47, 0x47, 0x52, 0x81, 0xc9, 0x36, 0x3d, 0x6d, 0xb1, - 0xa4, 0x50, 0x3b, 0x31, 0xb6, 0xf3, 0x5b, 0x8a, 0xf1, 0x53, 0x81, 0x72, 0x1d, 0xbd, 0xbd, 0x0e, - 0x73, 0x5a, 0x92, 0x1d, 0x74, 0xae, 0x09, 0x53, 0xfe, 0x42, 0xd8, 0x13, 0x98, 0x0e, 0x18, 0x22, - 0xf5, 0x58, 0x32, 0xc0, 0x99, 0x9a, 0x91, 0x11, 0x36, 0xc8, 0x60, 0xd6, 0x53, 0x52, 0xaa, 0xa3, - 0x7f, 0x87, 0xac, 0xc2, 0x5c, 0x40, 0x1d, 0x2a, 0x38, 0x0f, 0x8f, 0x24, 0x3f, 0x61, 0xa1, 0x5a, - 0x88, 0xab, 0x9d, 0xed, 0xa3, 0x07, 0x11, 0x18, 0xc9, 0x1d, 0x89, 0x70, 0x9b, 0xdc, 0x72, 0x46, - 0xee, 0xf6, 0x7c, 0xb4, 0x02, 0x99, 0xa2, 0x8d, 0xe7, 0x50, 0xc9, 0x16, 0x77, 0x87, 0xc9, 0x57, - 0x61, 0x4a, 0x76, 0x8e, 0x1a, 0x14, 0x1b, 0x69, 0x37, 0x8b, 0xb2, 0xb3, 0x4f, 0xb1, 0x61, 0x7c, - 0x54, 0x60, 0xbe, 0x8e, 0xde, 0xeb, 0xa6, 0x4b, 0x25, 0x7b, 0x49, 0x05, 0x0d, 0xf0, 0x9f, 0x7f, - 0x87, 0xfb, 0x50, 0x6c, 0xc6, 0x11, 0xe2, 0x1c, 0x33, 0xb5, 0xb9, 0x7e, 0x27, 0x93, 0xb8, 0xbb, - 0x13, 0xe7, 0xdf, 0x96, 0x73, 0x76, 0xca, 0x89, 0xf4, 0x66, 0x1b, 0x96, 0x18, 0xbf, 0xad, 0xfb, - 0x02, 0x54, 0xaf, 0x95, 0xd7, 0x57, 0x5b, 0xfb, 0xa1, 0x40, 0xa1, 0x8e, 0x1e, 0x79, 0x0a, 0xa5, - 0xe1, 0x26, 0x54, 0xc6, 0x4d, 0x4f, 0x5b, 0x1c, 0x87, 0x0e, 0xda, 0x76, 0x08, 0x64, 0xcc, 0xa3, - 0xb0, 0x74, 0xe3, 0x82, 0x6b, 0xab, 0x77, 0xda, 0x7f, 0xb2, 0x0f, 0xe5, 0x91, 0xde, 0x56, 0x33, - 0xd7, 0xb2, 0x0e, 0x6d, 0xf9, 0x0f, 0x8e, 0x7e, 0x24, 0x6d, 0xf2, 0xed, 0xd5, 0xd9, 0xba, 0xb2, - 0xfb, 0xf8, 0xfc, 0x52, 0x57, 0x2e, 0x2e, 0x75, 0xe5, 0xfb, 0xa5, 0xae, 0x7c, 0xe8, 0xe9, 0xb9, - 0x8b, 0x9e, 0x9e, 0xfb, 0xda, 0xd3, 0x73, 0x87, 0x86, 0xe7, 0xcb, 0x46, 0xeb, 0xd8, 0x74, 0x78, - 0x60, 0xf1, 0x10, 0x79, 0x28, 0xac, 0xf8, 0xd3, 0xb1, 0xa2, 0x47, 0x52, 0x76, 0x9b, 0x0c, 0x8f, - 0x8b, 0xf1, 0x53, 0xb8, 0xf9, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x41, 0xc8, 0xb6, 0x40, 0x85, 0x05, - 0x00, 0x00, + // 561 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x6a, 0x13, 0x41, + 0x1c, 0xce, 0x36, 0x36, 0x6d, 0x7f, 0x6d, 0x13, 0x19, 0x22, 0xd9, 0x2e, 0x76, 0x5b, 0x16, 0x0a, + 0xa5, 0xe8, 0x2e, 0x8d, 0x20, 0x25, 0x8a, 0x62, 0xa4, 0x50, 0x0f, 0x01, 0x59, 0xeb, 0xa5, 0x97, + 0xb0, 0xdd, 0x1d, 0x26, 0x4b, 0xb3, 0x3b, 0x61, 0x7e, 0x93, 0xb0, 0xb9, 0x89, 0x4f, 0xe0, 0x0b, + 0xf8, 0x0e, 0x3d, 0xf8, 0x10, 0x3d, 0x16, 0x4f, 0x9e, 0x44, 0x92, 0x43, 0x1f, 0xc0, 0xb3, 0x20, + 0xfb, 0x27, 0xc9, 0xb6, 0x8d, 0x5a, 0xbc, 0x2c, 0xf3, 0xfb, 0x7d, 0xdf, 0x7c, 0xdf, 0xcc, 0x37, + 0xb3, 0x03, 0x15, 0xcf, 0xf7, 0xac, 0xc1, 0xbe, 0x25, 0x23, 0xb3, 0x27, 0xb8, 0xe4, 0xa4, 0xe4, + 0xf9, 0x9e, 0x39, 0xd8, 0xd7, 0x6a, 0x2e, 0xc7, 0x80, 0xa3, 0x15, 0x20, 0x8b, 0xf1, 0x00, 0x59, + 0x4a, 0xd0, 0x36, 0x52, 0xa0, 0x9d, 0x54, 0x56, 0x5a, 0x64, 0x50, 0x35, 0x13, 0x63, 0x34, 0xa4, + 0xe8, 0x4f, 0xbb, 0x8c, 0x33, 0x9e, 0xb2, 0xe3, 0x51, 0xda, 0x35, 0xda, 0xf0, 0xa0, 0x85, 0xcc, + 0xa6, 0xcc, 0x47, 0x49, 0xc5, 0x6b, 0x1e, 0x4a, 0xc1, 0xbb, 0x5d, 0x2a, 0xc8, 0x53, 0x58, 0x71, + 0xfa, 0xb2, 0xc3, 0x85, 0x2f, 0x87, 0xaa, 0xb2, 0xad, 0xec, 0xae, 0x34, 0xd5, 0xaf, 0x5f, 0x1e, + 0x57, 0x33, 0xa7, 0x57, 0x9e, 0x27, 0x28, 0xe2, 0x3b, 0x29, 0xfc, 0x90, 0xd9, 0x33, 0x6a, 0xa3, + 0xfc, 0xf1, 0xea, 0x7c, 0x6f, 0x56, 0x1b, 0x08, 0x9b, 0x73, 0x0d, 0x6c, 0x8a, 0x3d, 0x1e, 0x22, + 0x25, 0x2a, 0x2c, 0x61, 0xdf, 0x75, 0x29, 0x62, 0x62, 0xb3, 0x6c, 0x4f, 0x4a, 0x72, 0x00, 0xe0, + 0x4e, 0xf9, 0xea, 0xc2, 0x3f, 0xd6, 0x90, 0xe3, 0x1a, 0xbf, 0x14, 0x58, 0x6b, 0x21, 0x3b, 0x8c, + 0xa8, 0xdb, 0x97, 0xf4, 0x38, 0xba, 0x21, 0xa5, 0xdc, 0x5d, 0x8a, 0xbc, 0x80, 0xe5, 0x80, 0x22, + 0x3a, 0x8c, 0xa2, 0xba, 0xb0, 0x5d, 0xdc, 0x5d, 0xad, 0x1b, 0x66, 0x7a, 0x36, 0x66, 0xde, 0xc1, + 0x6c, 0x65, 0xa4, 0xc3, 0x50, 0x8a, 0xa1, 0x3d, 0x9d, 0x43, 0x76, 0xa0, 0x1c, 0x38, 0xae, 0x23, + 0x38, 0x0f, 0xdb, 0x92, 0x9f, 0xd1, 0x50, 0x2d, 0xc6, 0xee, 0xf6, 0xfa, 0xa4, 0x7b, 0x1c, 0x37, + 0xb5, 0x67, 0xb0, 0x7e, 0x4d, 0x81, 0xdc, 0x87, 0xe2, 0x19, 0xcd, 0x92, 0xb7, 0xe3, 0x21, 0xa9, + 0xc2, 0xe2, 0xc0, 0xe9, 0xf6, 0x69, 0x92, 0xc4, 0x9a, 0x9d, 0x16, 0x8d, 0x85, 0x03, 0xa5, 0x51, + 0x89, 0x33, 0xcf, 0xef, 0xff, 0x0d, 0x54, 0xf3, 0x8b, 0xbb, 0x43, 0xd6, 0x35, 0x58, 0x92, 0x51, + 0xbb, 0xe3, 0x60, 0x27, 0x0d, 0xda, 0x2e, 0xc9, 0xe8, 0xc8, 0xc1, 0x8e, 0xf1, 0x59, 0x81, 0x4a, + 0x0b, 0xd9, 0xfb, 0x9e, 0xe7, 0x48, 0xfa, 0xd6, 0x11, 0x4e, 0x80, 0xff, 0x7b, 0x37, 0xc8, 0x23, + 0x28, 0xf5, 0x12, 0x85, 0xc4, 0x63, 0xb5, 0x5e, 0x9e, 0x24, 0x99, 0xea, 0x36, 0xef, 0x5d, 0x7c, + 0xdf, 0x2a, 0xd8, 0x19, 0x27, 0xde, 0x6f, 0x3e, 0xb0, 0xb4, 0xb8, 0x75, 0xbf, 0x36, 0xa0, 0x76, + 0x63, 0x79, 0x93, 0xdd, 0xd6, 0x7f, 0x2a, 0x50, 0x6c, 0x21, 0x23, 0x2f, 0x61, 0x65, 0x76, 0x13, + 0xaa, 0xf3, 0x4e, 0x4f, 0x7b, 0x38, 0xaf, 0x3b, 0x8d, 0xed, 0x04, 0xc8, 0x9c, 0x3f, 0x64, 0x33, + 0x37, 0xe7, 0x36, 0xac, 0xed, 0xfc, 0x15, 0x9e, 0x6a, 0x1f, 0xc1, 0xda, 0xb5, 0x6c, 0x6b, 0xb9, + 0x69, 0x79, 0x40, 0xdb, 0xfa, 0x03, 0x30, 0x51, 0xd2, 0x16, 0x3f, 0x5c, 0x9d, 0xef, 0x29, 0xcd, + 0xe7, 0x17, 0x23, 0x5d, 0xb9, 0x1c, 0xe9, 0xca, 0x8f, 0x91, 0xae, 0x7c, 0x1a, 0xeb, 0x85, 0xcb, + 0xb1, 0x5e, 0xf8, 0x36, 0xd6, 0x0b, 0x27, 0x06, 0xf3, 0x65, 0xa7, 0x7f, 0x6a, 0xba, 0x3c, 0xb0, + 0x78, 0x88, 0x3c, 0x14, 0x56, 0xf2, 0x89, 0xac, 0xf8, 0xc1, 0x90, 0xc3, 0x1e, 0xc5, 0xd3, 0x52, + 0xf2, 0x2c, 0x3c, 0xf9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x69, 0xb7, 0x5b, 0x5c, 0x91, 0x04, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -633,33 +590,6 @@ func (m *MsgRegisterController) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Verifications) > 0 { - for iNdEx := len(m.Verifications) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Verifications[iNdEx]) - copy(dAtA[i:], m.Verifications[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Verifications[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Keyshares) > 0 { - for iNdEx := len(m.Keyshares) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Keyshares[iNdEx]) - copy(dAtA[i:], m.Keyshares[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Keyshares[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Assertions) > 0 { - for iNdEx := len(m.Assertions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Assertions[iNdEx]) - copy(dAtA[i:], m.Assertions[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Assertions[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } if len(m.Authority) > 0 { i -= len(m.Authority) copy(dAtA[i:], m.Authority) @@ -690,25 +620,6 @@ func (m *MsgRegisterControllerResponse) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l - if len(m.Accounts) > 0 { - for k := range m.Accounts { - v := m.Accounts[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTx(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTx(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTx(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } if len(m.Controller) > 0 { i -= len(m.Controller) copy(dAtA[i:], m.Controller) @@ -918,24 +829,6 @@ func (m *MsgRegisterController) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if len(m.Assertions) > 0 { - for _, b := range m.Assertions { - l = len(b) - n += 1 + l + sovTx(uint64(l)) - } - } - if len(m.Keyshares) > 0 { - for _, b := range m.Keyshares { - l = len(b) - n += 1 + l + sovTx(uint64(l)) - } - } - if len(m.Verifications) > 0 { - for _, b := range m.Verifications { - l = len(b) - n += 1 + l + sovTx(uint64(l)) - } - } return n } @@ -952,14 +845,6 @@ func (m *MsgRegisterControllerResponse) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if len(m.Accounts) > 0 { - for k, v := range m.Accounts { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTx(uint64(len(k))) + 1 + len(v) + sovTx(uint64(len(v))) - n += mapEntrySize + 1 + sovTx(uint64(mapEntrySize)) - } - } return n } @@ -1103,102 +988,6 @@ func (m *MsgRegisterController) Unmarshal(dAtA []byte) error { } m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Assertions", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Assertions = append(m.Assertions, make([]byte, postIndex-iNdEx)) - copy(m.Assertions[len(m.Assertions)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keyshares", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Keyshares = append(m.Keyshares, make([]byte, postIndex-iNdEx)) - copy(m.Keyshares[len(m.Keyshares)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Verifications", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Verifications = append(m.Verifications, make([]byte, postIndex-iNdEx)) - copy(m.Verifications[len(m.Verifications)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1301,133 +1090,6 @@ func (m *MsgRegisterControllerResponse) Unmarshal(dAtA []byte) error { } m.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Accounts == nil { - m.Accounts = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTx - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTx - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Accounts[mapkey] = mapvalue - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/macaroon/types/genesis.pb.go b/x/macaroon/types/genesis.pb.go index a2f53d9eb..e6d5dfa73 100644 --- a/x/macaroon/types/genesis.pb.go +++ b/x/macaroon/types/genesis.pb.go @@ -8,6 +8,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + _ "github.com/onsonr/sonr/x/did/types" io "io" math "math" math_bits "math/bits" @@ -292,44 +293,103 @@ func (m *Caveats) GetSupportedThirdParty() []string { return nil } +// Transactions defines the allowlist,denylist for transactions which can be +// broadcasted to the network with the Sonr DWN Signed macaroon. +type Transactions struct { + Allowlist []string `protobuf:"bytes,1,rep,name=allowlist,proto3" json:"allowlist,omitempty"` + Denylist []string `protobuf:"bytes,2,rep,name=denylist,proto3" json:"denylist,omitempty"` +} + +func (m *Transactions) Reset() { *m = Transactions{} } +func (m *Transactions) String() string { return proto.CompactTextString(m) } +func (*Transactions) ProtoMessage() {} +func (*Transactions) Descriptor() ([]byte, []int) { + return fileDescriptor_06e0b5dfdf5e52ba, []int{5} +} +func (m *Transactions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Transactions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Transactions.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 *Transactions) XXX_Merge(src proto.Message) { + xxx_messageInfo_Transactions.Merge(m, src) +} +func (m *Transactions) XXX_Size() int { + return m.Size() +} +func (m *Transactions) XXX_DiscardUnknown() { + xxx_messageInfo_Transactions.DiscardUnknown(m) +} + +var xxx_messageInfo_Transactions proto.InternalMessageInfo + +func (m *Transactions) GetAllowlist() []string { + if m != nil { + return m.Allowlist + } + return nil +} + +func (m *Transactions) GetDenylist() []string { + if m != nil { + return m.Denylist + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "macaroon.v1.GenesisState") proto.RegisterType((*Params)(nil), "macaroon.v1.Params") proto.RegisterType((*Methods)(nil), "macaroon.v1.Methods") proto.RegisterType((*Scopes)(nil), "macaroon.v1.Scopes") proto.RegisterType((*Caveats)(nil), "macaroon.v1.Caveats") + proto.RegisterType((*Transactions)(nil), "macaroon.v1.Transactions") } func init() { proto.RegisterFile("macaroon/v1/genesis.proto", fileDescriptor_06e0b5dfdf5e52ba) } var fileDescriptor_06e0b5dfdf5e52ba = []byte{ - // 414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0xcb, 0xd3, 0x30, - 0x18, 0xc7, 0x9b, 0xbd, 0x2f, 0x2d, 0xcb, 0x2b, 0xa8, 0xd9, 0x84, 0x6e, 0x8c, 0x6e, 0xf4, 0xe2, - 0x50, 0x68, 0xd9, 0xbc, 0xed, 0xb6, 0x09, 0x7a, 0x12, 0x46, 0xb7, 0x93, 0x08, 0x23, 0x6b, 0xb3, - 0xae, 0x60, 0x9b, 0x92, 0x64, 0xc3, 0x7d, 0x05, 0xbd, 0x78, 0xf4, 0xb8, 0x8f, 0x20, 0xf8, 0x25, - 0x76, 0xdc, 0xd1, 0x93, 0xc8, 0x76, 0xd0, 0x8f, 0x21, 0x4d, 0xd2, 0xea, 0x74, 0xe0, 0x25, 0x3c, - 0xcd, 0xef, 0xf9, 0xff, 0xfb, 0x7f, 0x1e, 0x02, 0x5b, 0x29, 0x0e, 0x31, 0xa3, 0x34, 0xf3, 0xb7, - 0x03, 0x3f, 0x26, 0x19, 0xe1, 0x09, 0xf7, 0x72, 0x46, 0x05, 0x45, 0x77, 0x25, 0xf2, 0xb6, 0x83, - 0xf6, 0x43, 0x9c, 0x26, 0x19, 0xf5, 0xe5, 0xa9, 0x78, 0xbb, 0x19, 0xd3, 0x98, 0xca, 0xd2, 0x2f, - 0x2a, 0x75, 0xeb, 0x8e, 0xe1, 0xbd, 0x97, 0xca, 0x66, 0x26, 0xb0, 0x20, 0x68, 0x00, 0xcd, 0x1c, - 0x33, 0x9c, 0x72, 0x1b, 0xf4, 0x40, 0xff, 0x6e, 0xd8, 0xf0, 0xfe, 0xb0, 0xf5, 0xa6, 0x12, 0x4d, - 0x6e, 0x0f, 0xdf, 0xba, 0x46, 0xa0, 0x1b, 0xdd, 0x2f, 0x00, 0x9a, 0x0a, 0x20, 0x0f, 0x5a, 0x29, - 0x11, 0x6b, 0x1a, 0x95, 0xf2, 0xe6, 0x85, 0xfc, 0x95, 0x62, 0x41, 0xd9, 0x84, 0x9e, 0x42, 0x93, - 0x87, 0x34, 0x27, 0xdc, 0xae, 0x5d, 0xf9, 0xdb, 0x4c, 0xa2, 0x40, 0xb7, 0x14, 0xe6, 0x21, 0xde, - 0x12, 0x2c, 0xb8, 0x7d, 0x73, 0xc5, 0xfc, 0xb9, 0x62, 0x41, 0xd9, 0x34, 0xea, 0x7c, 0xda, 0x77, - 0x8d, 0x9f, 0xfb, 0x2e, 0x78, 0xff, 0xe3, 0xf3, 0x93, 0xfb, 0xd5, 0xe2, 0x74, 0xea, 0x37, 0xd0, - 0xd2, 0x71, 0x90, 0x0d, 0xad, 0x88, 0xac, 0xf0, 0xe6, 0xad, 0x90, 0xa9, 0xeb, 0x41, 0xf9, 0x89, - 0x3a, 0xb0, 0xce, 0x37, 0x79, 0x4e, 0x99, 0x20, 0x91, 0x5d, 0xeb, 0xdd, 0xf4, 0xeb, 0xc1, 0xef, - 0x8b, 0x51, 0xab, 0x34, 0x7f, 0x50, 0x99, 0xeb, 0xc1, 0xdc, 0x39, 0x34, 0x55, 0x7a, 0x84, 0xe0, - 0xed, 0x12, 0x73, 0xa2, 0x9d, 0x65, 0xfd, 0x1f, 0x5b, 0xfb, 0xdf, 0xcc, 0x6a, 0x03, 0xee, 0x07, - 0x00, 0x2d, 0x3d, 0x26, 0x1a, 0xc2, 0x47, 0x95, 0x64, 0xb1, 0x4a, 0x18, 0x17, 0x8b, 0x1c, 0x33, - 0xb1, 0xb3, 0x81, 0xf4, 0x6b, 0x54, 0xf0, 0x45, 0xc1, 0xa6, 0x05, 0xba, 0xd4, 0x88, 0x75, 0xc2, - 0x22, 0xad, 0xa9, 0xfd, 0xa5, 0x99, 0x17, 0x4c, 0x6a, 0xae, 0xa5, 0x51, 0x0b, 0x9e, 0x8c, 0x0f, - 0x27, 0x07, 0x1c, 0x4f, 0x0e, 0xf8, 0x7e, 0x72, 0xc0, 0xc7, 0xb3, 0x63, 0x1c, 0xcf, 0x8e, 0xf1, - 0xf5, 0xec, 0x18, 0xaf, 0x1f, 0xc7, 0x89, 0x58, 0x6f, 0x96, 0x5e, 0x48, 0x53, 0x9f, 0x66, 0x9c, - 0x66, 0xcc, 0x97, 0xc7, 0x3b, 0xbf, 0xf2, 0x10, 0xbb, 0x9c, 0xf0, 0xa5, 0x29, 0x1f, 0xe1, 0xb3, - 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xa6, 0x33, 0x5b, 0xd7, 0x02, 0x00, 0x00, + // 470 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x6a, 0xdb, 0x30, + 0x18, 0xc7, 0xad, 0xb4, 0x38, 0x8b, 0x5a, 0xe8, 0xa6, 0xb6, 0xe0, 0x86, 0xe2, 0x14, 0x5f, 0x56, + 0x36, 0xb0, 0x49, 0x77, 0xcb, 0xad, 0x1d, 0x6c, 0xa7, 0x41, 0x71, 0x73, 0x1a, 0x83, 0xa2, 0xd8, + 0xaa, 0x2d, 0xb0, 0x25, 0x23, 0x29, 0x59, 0xf3, 0x0a, 0x63, 0x87, 0x1d, 0x77, 0xec, 0x23, 0x0c, + 0xf6, 0x12, 0x3d, 0xf6, 0xb8, 0xd3, 0x18, 0xc9, 0x61, 0x7b, 0x8c, 0x61, 0x49, 0x76, 0xda, 0x2d, + 0xd0, 0x8b, 0x91, 0xbe, 0xdf, 0xf7, 0xff, 0x7f, 0xff, 0x4f, 0x18, 0x1e, 0x94, 0x38, 0xc1, 0x82, + 0x73, 0x16, 0xcd, 0x86, 0x51, 0x46, 0x18, 0x91, 0x54, 0x86, 0x95, 0xe0, 0x8a, 0xa3, 0xad, 0x06, + 0x85, 0xb3, 0x61, 0xff, 0x19, 0x2e, 0x29, 0xe3, 0x91, 0xfe, 0x1a, 0xde, 0xdf, 0xcb, 0x78, 0xc6, + 0xf5, 0x31, 0xaa, 0x4f, 0xb6, 0xba, 0x93, 0xd2, 0xb4, 0xf6, 0x52, 0xd7, 0xa6, 0x10, 0x9c, 0xc2, + 0xed, 0xb7, 0xc6, 0xf7, 0x42, 0x61, 0x45, 0xd0, 0x10, 0xba, 0x15, 0x16, 0xb8, 0x94, 0x1e, 0x38, + 0x02, 0xc7, 0x5b, 0x27, 0xbb, 0xe1, 0xbd, 0x39, 0xe1, 0xb9, 0x46, 0x67, 0x9b, 0xb7, 0x3f, 0x07, + 0x4e, 0x6c, 0x1b, 0x83, 0xef, 0x00, 0xba, 0x06, 0xa0, 0x10, 0x76, 0x4b, 0xa2, 0x72, 0x9e, 0x36, + 0xf2, 0xbd, 0x07, 0xf2, 0x77, 0x86, 0xc5, 0x4d, 0x13, 0x7a, 0x09, 0x5d, 0x99, 0xf0, 0x8a, 0x48, + 0xaf, 0xb3, 0x66, 0xda, 0x85, 0x46, 0xb1, 0x6d, 0xa9, 0xcd, 0x13, 0x3c, 0x23, 0x58, 0x49, 0x6f, + 0x63, 0x8d, 0xf9, 0x6b, 0xc3, 0xe2, 0xa6, 0x69, 0x74, 0xf8, 0xf5, 0x66, 0xe0, 0xfc, 0xb9, 0x19, + 0x80, 0x4f, 0xbf, 0xbf, 0xbd, 0xd8, 0x69, 0x5f, 0xd2, 0xa6, 0xfe, 0x00, 0xbb, 0x36, 0x0e, 0xf2, + 0x60, 0x37, 0x25, 0x57, 0x78, 0x5a, 0x28, 0x9d, 0xba, 0x17, 0x37, 0x57, 0x74, 0x08, 0x7b, 0x72, + 0x5a, 0x55, 0x5c, 0x28, 0x92, 0x7a, 0x9d, 0xa3, 0x8d, 0xe3, 0x5e, 0xbc, 0x2a, 0x8c, 0x0e, 0x1a, + 0xf3, 0xa7, 0xad, 0xb9, 0x5d, 0x2c, 0x18, 0x43, 0xd7, 0xa4, 0x47, 0x08, 0x6e, 0x4e, 0xb0, 0x24, + 0xd6, 0x59, 0x9f, 0x1f, 0xb1, 0xf5, 0xfe, 0xcf, 0x6c, 0x5e, 0x20, 0xf8, 0x0c, 0x60, 0xd7, 0xae, + 0x89, 0x4e, 0xe0, 0x7e, 0x2b, 0xb9, 0xbc, 0xa2, 0x42, 0xaa, 0xcb, 0x0a, 0x0b, 0x35, 0xf7, 0x80, + 0xf6, 0xdb, 0x6d, 0xe1, 0x9b, 0x9a, 0x9d, 0xd7, 0xe8, 0xa1, 0x46, 0xe5, 0x54, 0xa4, 0x56, 0xd3, + 0xf9, 0x47, 0x33, 0xae, 0x99, 0xd6, 0xac, 0x5b, 0xd2, 0x3e, 0x70, 0x90, 0xc3, 0xed, 0xb1, 0xc0, + 0x4c, 0xe2, 0x44, 0x51, 0xce, 0x64, 0xbd, 0x16, 0x2e, 0x0a, 0xfe, 0xb1, 0xa0, 0x52, 0xd9, 0x18, + 0xab, 0x02, 0xea, 0xc3, 0x27, 0x29, 0x61, 0x73, 0x0d, 0xcd, 0xbc, 0xf6, 0x3e, 0xf2, 0x9b, 0x21, + 0xfb, 0xed, 0x10, 0x75, 0xcf, 0xf9, 0xec, 0xf4, 0x76, 0xe1, 0x83, 0xbb, 0x85, 0x0f, 0x7e, 0x2d, + 0x7c, 0xf0, 0x65, 0xe9, 0x3b, 0x77, 0x4b, 0xdf, 0xf9, 0xb1, 0xf4, 0x9d, 0xf7, 0xcf, 0x33, 0xaa, + 0xf2, 0xe9, 0x24, 0x4c, 0x78, 0x19, 0x71, 0x26, 0x39, 0x13, 0x91, 0xfe, 0x5c, 0x47, 0x2b, 0xa7, + 0x79, 0x45, 0xe4, 0xc4, 0xd5, 0xff, 0xfb, 0xab, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x19, 0xb5, + 0x2c, 0xe7, 0x53, 0x03, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -463,6 +523,43 @@ func (this *Caveats) Equal(that interface{}) bool { } return true } +func (this *Transactions) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Transactions) + if !ok { + that2, ok := that.(Transactions) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Allowlist) != len(that1.Allowlist) { + return false + } + for i := range this.Allowlist { + if this.Allowlist[i] != that1.Allowlist[i] { + return false + } + } + if len(this.Denylist) != len(that1.Denylist) { + return false + } + for i := range this.Denylist { + if this.Denylist[i] != that1.Denylist[i] { + return false + } + } + return true +} func (m *GenesisState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -674,6 +771,47 @@ func (m *Caveats) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Transactions) 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 *Transactions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Transactions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denylist) > 0 { + for iNdEx := len(m.Denylist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denylist[iNdEx]) + copy(dAtA[i:], m.Denylist[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Denylist[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Allowlist) > 0 { + for iNdEx := len(m.Allowlist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Allowlist[iNdEx]) + copy(dAtA[i:], m.Allowlist[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Allowlist[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -776,6 +914,27 @@ func (m *Caveats) Size() (n int) { return n } +func (m *Transactions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Allowlist) > 0 { + for _, s := range m.Allowlist { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Denylist) > 0 { + for _, s := range m.Denylist { + 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 } @@ -1365,6 +1524,120 @@ func (m *Caveats) Unmarshal(dAtA []byte) error { } return nil } +func (m *Transactions) 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: Transactions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Transactions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowlist", 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.Allowlist = append(m.Allowlist, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denylist", 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.Denylist = append(m.Denylist, 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 skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/README.md b/x/oracle/README.md deleted file mode 100644 index 8f1028e62..000000000 --- a/x/oracle/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# `x/oracle` - -The Oracle module is responsible for collecting off-chain data and verifying its authenticity before submitting it to the blockchain. In this case, -the data is associated account balances for Ethereum/Bitcoin derived addresses. - -## Concepts - -## State - -Specify and describe structures expected to marshalled into the store, and their keys - -### Account State - -The Account state includes the user's public key, associated wallets, and other identification details. It is stored using the user's DID as the key. - -### Credential State - -The Credential state includes the claims about a subject and is stored using the credential ID as the key. - -## State Transitions - -Standard state transition operations triggered by hooks, messages, etc. - -## Messages - -Specify message structure(s) and expected state machine behaviour(s). - -## Begin Block - -Specify any begin-block operations. - -## End Block - -Specify any end-block operations. - -## Hooks - -Describe available hooks to be called by/from this module. - -## Events - -List and describe event tags used. - -## Client - -List and describe CLI commands and gRPC and REST endpoints. - -## Params - -List all module parameters, their types (in JSON) and identitys. - -## Future Improvements - -Describe future improvements of this module. - -## Tests - -Acceptance tests. - -## Appendix - -Supplementary details referenced elsewhere within the spec. -his is a module base generated with [`spawn`](https://github.com/rollchains/spawn). -his is a module base generated with [`spawn`](https://github.com/rollchains/spawn). diff --git a/x/oracle/autocli.go b/x/oracle/autocli.go deleted file mode 100644 index f56e4734f..000000000 --- a/x/oracle/autocli.go +++ /dev/null @@ -1,31 +0,0 @@ -package module - -import ( - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - modulev1 "github.com/onsonr/sonr/api/oracle/v1" -) - -// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. -func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { - return &autocliv1.ModuleOptions{ - Query: &autocliv1.ServiceCommandDescriptor{ - Service: modulev1.Query_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "Params", - Use: "params", - Short: "Query the current consensus parameters", - }, - }, - }, - Tx: &autocliv1.ServiceCommandDescriptor{ - Service: modulev1.Msg_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "UpdateParams", - Skip: false, // set to true if authority gated - }, - }, - }, - } -} diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go deleted file mode 100644 index 3e6fe099f..000000000 --- a/x/oracle/client/cli/query.go +++ /dev/null @@ -1,50 +0,0 @@ -package cli - -import ( - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - - "github.com/onsonr/sonr/x/oracle/types" -) - -// !NOTE: Must enable in module.go (disabled in favor of autocli.go) - -func GetQueryCmd() *cobra.Command { - queryCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for " + types.ModuleName, - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - queryCmd.AddCommand( - GetCmdParams(), - ) - return queryCmd -} - -func GetCmdParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Show all module params", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - return cmd -} diff --git a/x/oracle/client/cli/tx.go b/x/oracle/client/cli/tx.go deleted file mode 100644 index b6ae3f21c..000000000 --- a/x/oracle/client/cli/tx.go +++ /dev/null @@ -1,62 +0,0 @@ -package cli - -import ( - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - - "github.com/onsonr/sonr/x/oracle/types" -) - -// !NOTE: Must enable in module.go (disabled in favor of autocli.go) - -// NewTxCmd returns a root CLI command handler for certain modules -// transaction commands. -func NewTxCmd() *cobra.Command { - txCmd := &cobra.Command{ - Use: types.ModuleName, - Short: types.ModuleName + " subcommands.", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - txCmd.AddCommand( - MsgUpdateParams(), - ) - return txCmd -} - -// Returns a CLI command handler for registering a -// contract for the module. -func MsgUpdateParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "update-params [some-value]", - Short: "Update the params (must be submitted from the authority)", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - cliCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - senderAddress := cliCtx.GetFromAddress() - - msg := &types.MsgUpdateParams{ - Authority: senderAddress.String(), - Params: types.Params{}, - } - - if err := msg.Validate(); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - return cmd -} diff --git a/x/oracle/depinject.go b/x/oracle/depinject.go deleted file mode 100644 index 6e5fa178f..000000000 --- a/x/oracle/depinject.go +++ /dev/null @@ -1,65 +0,0 @@ -package module - -import ( - "os" - - "cosmossdk.io/core/address" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/store" - "cosmossdk.io/depinject" - "cosmossdk.io/log" - "github.com/cosmos/cosmos-sdk/codec" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - - modulev1 "github.com/onsonr/sonr/api/oracle/module/v1" - didkeeper "github.com/onsonr/sonr/x/did/keeper" - macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper" - "github.com/onsonr/sonr/x/oracle/keeper" -) - -var _ appmodule.AppModule = AppModule{} - -// IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() {} - -// IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() {} - -func init() { - appmodule.Register( - &modulev1.Module{}, - appmodule.Provide(ProvideModule), - ) -} - -type ModuleInputs struct { - depinject.In - - Cdc codec.Codec - StoreService store.KVStoreService - AddressCodec address.Codec - - DidKeeper didkeeper.Keeper - MacaroonKeeper macaroonkeeper.Keeper - StakingKeeper stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper -} - -type ModuleOutputs struct { - depinject.Out - - Module appmodule.AppModule - Keeper keeper.Keeper -} - -func ProvideModule(in ModuleInputs) ModuleOutputs { - govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() - - k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr) - m := NewAppModule(in.Cdc, k, in.DidKeeper, in.MacaroonKeeper) - - return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}} -} diff --git a/x/oracle/keeper/genesis.go b/x/oracle/keeper/genesis.go deleted file mode 100644 index 0269571cd..000000000 --- a/x/oracle/keeper/genesis.go +++ /dev/null @@ -1,37 +0,0 @@ -package keeper - -import ( - "context" - - "cosmossdk.io/log" - - "github.com/onsonr/sonr/x/oracle/types" -) - -func (k Keeper) Logger() log.Logger { - return k.logger -} - -// InitGenesis initializes the module's state from a genesis state. -func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error { - // this line is used by starport scaffolding # genesis/module/init - if err := data.Params.Validate(); err != nil { - return err - } - - return k.Params.Set(ctx, data.Params) -} - -// ExportGenesis exports the module's state to a genesis state. -func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { - params, err := k.Params.Get(ctx) - if err != nil { - panic(err) - } - - // this line is used by starport scaffolding # genesis/module/export - - return &types.GenesisState{ - Params: params, - } -} diff --git a/x/oracle/keeper/genesis_test.go b/x/oracle/keeper/genesis_test.go deleted file mode 100644 index 1b64785ea..000000000 --- a/x/oracle/keeper/genesis_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/onsonr/sonr/x/oracle/types" - "github.com/stretchr/testify/require" -) - -func TestGenesis(t *testing.T) { - f := SetupTest(t) - - genesisState := &types.GenesisState{ - Params: types.DefaultParams(), - - // this line is used by starport scaffolding # genesis/test/state - } - - f.k.InitGenesis(f.ctx, genesisState) - - got := f.k.ExportGenesis(f.ctx) - require.NotNil(t, got) - - // this line is used by starport scaffolding # genesis/test/assert -} diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go deleted file mode 100644 index b763a988c..000000000 --- a/x/oracle/keeper/keeper.go +++ /dev/null @@ -1,72 +0,0 @@ -package keeper - -import ( - "cosmossdk.io/collections" - storetypes "cosmossdk.io/core/store" - "cosmossdk.io/log" - "cosmossdk.io/orm/model/ormdb" - "github.com/cosmos/cosmos-sdk/codec" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - - apiv1 "github.com/onsonr/sonr/api/oracle/v1" - "github.com/onsonr/sonr/x/oracle/types" -) - -type Keeper struct { - cdc codec.BinaryCodec - - logger log.Logger - - // state management - Schema collections.Schema - Params collections.Item[types.Params] - OrmDB apiv1.StateStore - - authority string -} - -// NewKeeper creates a new Keeper instance -func NewKeeper( - cdc codec.BinaryCodec, - storeService storetypes.KVStoreService, - logger log.Logger, - authority string, -) Keeper { - logger = logger.With(log.ModuleKey, "x/"+types.ModuleName) - - sb := collections.NewSchemaBuilder(storeService) - - if authority == "" { - authority = authtypes.NewModuleAddress(govtypes.ModuleName).String() - } - - db, err := ormdb.NewModuleDB(&types.ORMModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService}) - if err != nil { - panic(err) - } - - store, err := apiv1.NewStateStore(db) - if err != nil { - panic(err) - } - - k := Keeper{ - cdc: cdc, - logger: logger, - - Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), - OrmDB: store, - - authority: authority, - } - - schema, err := sb.Build() - if err != nil { - panic(err) - } - - k.Schema = schema - - return k -} diff --git a/x/oracle/keeper/keeper_test.go b/x/oracle/keeper/keeper_test.go deleted file mode 100644 index a0eb510db..000000000 --- a/x/oracle/keeper/keeper_test.go +++ /dev/null @@ -1,142 +0,0 @@ -package keeper_test - -import ( - "testing" - - "cosmossdk.io/core/store" - "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" - "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/testutil" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - - didkeeper "github.com/onsonr/sonr/x/did/keeper" - macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper" - module "github.com/onsonr/sonr/x/oracle" - "github.com/onsonr/sonr/x/oracle/keeper" - "github.com/onsonr/sonr/x/oracle/types" -) - -var maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - minttypes.ModuleName: {authtypes.Minter}, - govtypes.ModuleName: {authtypes.Burner}, -} - -type testFixture struct { - suite.Suite - - ctx sdk.Context - k keeper.Keeper - msgServer types.MsgServer - queryServer types.QueryServer - appModule *module.AppModule - - accountkeeper authkeeper.AccountKeeper - bankkeeper bankkeeper.BaseKeeper - didkeeper didkeeper.Keeper - mack macaroonkeeper.Keeper - stakingKeeper *stakingkeeper.Keeper - mintkeeper mintkeeper.Keeper - - addrs []sdk.AccAddress - govModAddr string -} - -func SetupTest(t *testing.T) *testFixture { - t.Helper() - f := new(testFixture) - require := require.New(t) - - // Base setup - logger := log.NewTestLogger(t) - encCfg := moduletestutil.MakeTestEncodingConfig() - - f.govModAddr = authtypes.NewModuleAddress(govtypes.ModuleName).String() - f.addrs = simtestutil.CreateIncrementalAccounts(3) - - key := storetypes.NewKVStoreKey(types.ModuleName) - storeService := runtime.NewKVStoreService(key) - testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - - f.ctx = testCtx.Ctx - - // Register SDK modules. - registerBaseSDKModules(f, encCfg, storeService, logger, require) - - // Setup Keeper. - f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr) - f.msgServer = keeper.NewMsgServerImpl(f.k) - f.queryServer = keeper.NewQuerier(f.k) - f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.didkeeper, f.mack) - return f -} - -func registerModuleInterfaces(encCfg moduletestutil.TestEncodingConfig) { - authtypes.RegisterInterfaces(encCfg.InterfaceRegistry) - stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry) - - types.RegisterInterfaces(encCfg.InterfaceRegistry) -} - -func registerBaseSDKModules( - f *testFixture, - encCfg moduletestutil.TestEncodingConfig, - storeService store.KVStoreService, - logger log.Logger, - require *require.Assertions, -) { - registerModuleInterfaces(encCfg) - - // Auth Keeper. - f.accountkeeper = authkeeper.NewAccountKeeper( - encCfg.Codec, storeService, - authtypes.ProtoBaseAccount, - maccPerms, - authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, - f.govModAddr, - ) - - // Bank Keeper. - f.bankkeeper = bankkeeper.NewBaseKeeper( - encCfg.Codec, storeService, - f.accountkeeper, - nil, - f.govModAddr, logger, - ) - - // Staking Keeper. - f.stakingKeeper = stakingkeeper.NewKeeper( - encCfg.Codec, storeService, - f.accountkeeper, f.bankkeeper, f.govModAddr, - authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), - authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), - ) - require.NoError(f.stakingKeeper.SetParams(f.ctx, stakingtypes.DefaultParams())) - f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetNotBondedPool(f.ctx)) - f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetBondedPool(f.ctx)) - - // Mint Keeper. - f.mintkeeper = mintkeeper.NewKeeper( - encCfg.Codec, storeService, - f.stakingKeeper, f.accountkeeper, f.bankkeeper, - authtypes.FeeCollectorName, f.govModAddr, - ) - f.accountkeeper.SetModuleAccount(f.ctx, f.accountkeeper.GetModuleAccount(f.ctx, minttypes.ModuleName)) - f.mintkeeper.InitGenesis(f.ctx, f.accountkeeper, minttypes.DefaultGenesisState()) -} diff --git a/x/oracle/keeper/orm_test.go b/x/oracle/keeper/orm_test.go deleted file mode 100644 index d5a0af7f0..000000000 --- a/x/oracle/keeper/orm_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package keeper_test - -import ( - "testing" - - apiv1 "github.com/onsonr/sonr/api/oracle/v1" - "github.com/stretchr/testify/require" -) - -func TestORM(t *testing.T) { - f := SetupTest(t) - - dt := f.k.OrmDB.BalanceTable() - amt := uint64(7) - - err := dt.Insert(f.ctx, &apiv1.Balance{ - Amount: amt, - }) - require.NoError(t, err) - - require.NoError(t, err) -} diff --git a/x/oracle/keeper/querier.go b/x/oracle/keeper/querier.go deleted file mode 100644 index 82bce4f42..000000000 --- a/x/oracle/keeper/querier.go +++ /dev/null @@ -1,30 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/onsonr/sonr/x/oracle/types" -) - -var _ types.QueryServer = Querier{} - -type Querier struct { - Keeper -} - -func NewQuerier(keeper Keeper) Querier { - return Querier{Keeper: keeper} -} - -func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - - p, err := k.Keeper.Params.Get(ctx) - if err != nil { - return nil, err - } - - return &types.QueryParamsResponse{Params: &p}, nil -} diff --git a/x/oracle/keeper/rpc.go b/x/oracle/keeper/rpc.go deleted file mode 100644 index 92d03eeec..000000000 --- a/x/oracle/keeper/rpc.go +++ /dev/null @@ -1,29 +0,0 @@ -package keeper - -import ( - "context" - - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - - "cosmossdk.io/errors" - "github.com/onsonr/sonr/x/oracle/types" -) - -type msgServer struct { - k Keeper -} - -var _ types.MsgServer = msgServer{} - -// NewMsgServerImpl returns an implementation of the module MsgServer interface. -func NewMsgServerImpl(keeper Keeper) types.MsgServer { - return &msgServer{k: keeper} -} - -func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { - if ms.k.authority != msg.Authority { - return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) - } - - return nil, ms.k.Params.Set(ctx, msg.Params) -} diff --git a/x/oracle/keeper/rpc_test.go b/x/oracle/keeper/rpc_test.go deleted file mode 100644 index 65383ee5b..000000000 --- a/x/oracle/keeper/rpc_test.go +++ /dev/null @@ -1,56 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/onsonr/sonr/x/oracle/types" -) - -func TestParams(t *testing.T) { - f := SetupTest(t) - require := require.New(t) - - testCases := []struct { - name string - request *types.MsgUpdateParams - err bool - }{ - { - name: "fail; invalid authority", - request: &types.MsgUpdateParams{ - Authority: f.addrs[0].String(), - Params: types.DefaultParams(), - }, - err: true, - }, - { - name: "success", - request: &types.MsgUpdateParams{ - Authority: f.govModAddr, - Params: types.DefaultParams(), - }, - err: false, - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - _, err := f.msgServer.UpdateParams(f.ctx, tc.request) - - if tc.err { - require.Error(err) - } else { - require.NoError(err) - - r, err := f.queryServer.Params(f.ctx, &types.QueryParamsRequest{}) - require.NoError(err) - - require.EqualValues(&tc.request.Params, r.Params) - } - - }) - } -} diff --git a/x/oracle/module.go b/x/oracle/module.go deleted file mode 100644 index 2493ce207..000000000 --- a/x/oracle/module.go +++ /dev/null @@ -1,153 +0,0 @@ -package module - -import ( - "context" - "encoding/json" - - "cosmossdk.io/client/v2/autocli" - errorsmod "cosmossdk.io/errors" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - - didkeeper "github.com/onsonr/sonr/x/did/keeper" - macaroonkeeper "github.com/onsonr/sonr/x/macaroon/keeper" - "github.com/onsonr/sonr/x/oracle/keeper" - "github.com/onsonr/sonr/x/oracle/types" -) - -const ( - // ConsensusVersion defines the current x/oracle module consensus version. - ConsensusVersion = 1 - -// this line is used by starport scaffolding # simapp/module/const -) - -var ( - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleGenesis = AppModule{} - _ module.AppModule = AppModule{} - - _ autocli.HasAutoCLIConfig = AppModule{} -) - -// AppModuleBasic defines the basic application module used by the wasm module. -type AppModuleBasic struct { - cdc codec.Codec -} - -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper - didk didkeeper.Keeper - mack macaroonkeeper.Keeper -} - -// NewAppModule constructor -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, - didkeeper didkeeper.Keeper, - macaroonkeeper macaroonkeeper.Keeper, -) *AppModule { - return &AppModule{ - AppModuleBasic: AppModuleBasic{cdc: cdc}, - keeper: keeper, - didk: didkeeper, - mack: macaroonkeeper, - } -} - -func (a AppModuleBasic) Name() string { - return types.ModuleName -} - -func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(&types.GenesisState{ - Params: types.DefaultParams(), - }) -} - -func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error { - var data types.GenesisState - err := marshaler.UnmarshalJSON(message, &data) - if err != nil { - return err - } - if err := data.Params.Validate(); err != nil { - return errorsmod.Wrap(err, "params") - } - return nil -} - -func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { -} - -func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) - if err != nil { - // same behavior as in cosmos-sdk - panic(err) - } -} - -// Disable in favor of autocli.go. If you wish to use these, it will override AutoCLI methods. -/* -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() -} - -func (a AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} -*/ - -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterLegacyAminoCodec(cdc) -} - -func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) { - types.RegisterInterfaces(r) -} - -func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate { - var genesisState types.GenesisState - marshaler.MustUnmarshalJSON(message, &genesisState) - - if err := a.keeper.Params.Set(ctx, genesisState.Params); err != nil { - panic(err) - } - - return nil -} - -func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage { - genState := a.keeper.ExportGenesis(ctx) - return marshaler.MustMarshalJSON(genState) -} - -func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { -} - -func (a AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -func (a AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(a.keeper)) - types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(a.keeper)) -} - -// ConsensusVersion is a sequence number for state-breaking change of the -// module. It should be incremented on each consensus-breaking change -// introduced by the module. To avoid wrong/empty versions, the initial version -// should be set to 1. -func (a AppModule) ConsensusVersion() uint64 { - return ConsensusVersion -} diff --git a/x/oracle/types/codec.go b/x/oracle/types/codec.go deleted file mode 100644 index 550adfc39..000000000 --- a/x/oracle/types/codec.go +++ /dev/null @@ -1,37 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" - // this line is used by starport scaffolding # 1 -) - -var ( - amino = codec.NewLegacyAmino() - AminoCdc = codec.NewAminoCodec(amino) -) - -func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - sdk.RegisterLegacyAminoCodec(amino) -} - -// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgUpdateParams{}, ModuleName+"/MsgUpdateParams", nil) -} - -func RegisterInterfaces(registry types.InterfaceRegistry) { - // this line is used by starport scaffolding # 3 - - registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgUpdateParams{}, - ) - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go deleted file mode 100644 index 2cef31c98..000000000 --- a/x/oracle/types/genesis.go +++ /dev/null @@ -1,56 +0,0 @@ -package types - -import ( - "github.com/onsonr/sonr/pkg/orm/assettype" -) - -// this line is used by starport scaffolding # genesis/types/import - -// DefaultIndex is the default global index -const DefaultIndex uint64 = 1 - -// DefaultGenesis returns the default genesis state -func DefaultGenesis() *GenesisState { - return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), - } -} - -// Validate performs basic genesis state validation returning an error upon any -// failure. -func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate - - return gs.Params.Validate() -} - -// DefaultAssets returns the default asset infos: BTC, ETH, SNR, and USDC -func DefaultAssets() []*AssetInfo { - return []*AssetInfo{ - { - Name: "Bitcoin", - Symbol: "BTC", - Hrp: "bc", - Index: 0, - AssetType: assettype.Native.String(), - IconUrl: "https://cdn.sonr.land/BTC.svg", - }, - { - Name: "Ethereum", - Symbol: "ETH", - Hrp: "eth", - Index: 64, - AssetType: assettype.Native.String(), - IconUrl: "https://cdn.sonr.land/ETH.svg", - }, - { - Name: "Sonr", - Symbol: "SNR", - Hrp: "idx", - Index: 703, - AssetType: assettype.Native.String(), - IconUrl: "https://cdn.sonr.land/SNR.svg", - }, - } -} diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go deleted file mode 100644 index de457e8de..000000000 --- a/x/oracle/types/genesis.pb.go +++ /dev/null @@ -1,1202 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: oracle/v1/genesis.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 - -// GenesisState defines the module genesis state -type GenesisState struct { - // Params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_14b982a0a6345d1d, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// Params defines the set of module parameters. -type Params struct { - Assets *Assets `protobuf:"bytes,1,opt,name=assets,proto3" json:"assets,omitempty"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_14b982a0a6345d1d, []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) GetAssets() *Assets { - if m != nil { - return m.Assets - } - return nil -} - -type Assets struct { - Assets []*AssetInfo `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` -} - -func (m *Assets) Reset() { *m = Assets{} } -func (m *Assets) String() string { return proto.CompactTextString(m) } -func (*Assets) ProtoMessage() {} -func (*Assets) Descriptor() ([]byte, []int) { - return fileDescriptor_14b982a0a6345d1d, []int{2} -} -func (m *Assets) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Assets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Assets.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 *Assets) XXX_Merge(src proto.Message) { - xxx_messageInfo_Assets.Merge(m, src) -} -func (m *Assets) XXX_Size() int { - return m.Size() -} -func (m *Assets) XXX_DiscardUnknown() { - xxx_messageInfo_Assets.DiscardUnknown(m) -} - -var xxx_messageInfo_Assets proto.InternalMessageInfo - -func (m *Assets) GetAssets() []*AssetInfo { - if m != nil { - return m.Assets - } - return nil -} - -// AssetInfo defines the asset info -type AssetInfo struct { - // The coin type index for bip44 path - Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - // The hrp for bech32 address - Hrp string `protobuf:"bytes,2,opt,name=hrp,proto3" json:"hrp,omitempty"` - // The coin symbol - Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` - // The coin name - AssetType string `protobuf:"bytes,4,opt,name=asset_type,json=assetType,proto3" json:"asset_type,omitempty"` - // The name of the asset - Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` - // The icon url - IconUrl string `protobuf:"bytes,6,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` -} - -func (m *AssetInfo) Reset() { *m = AssetInfo{} } -func (m *AssetInfo) String() string { return proto.CompactTextString(m) } -func (*AssetInfo) ProtoMessage() {} -func (*AssetInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_14b982a0a6345d1d, []int{3} -} -func (m *AssetInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AssetInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AssetInfo.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 *AssetInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_AssetInfo.Merge(m, src) -} -func (m *AssetInfo) XXX_Size() int { - return m.Size() -} -func (m *AssetInfo) XXX_DiscardUnknown() { - xxx_messageInfo_AssetInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_AssetInfo proto.InternalMessageInfo - -func (m *AssetInfo) GetIndex() int64 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *AssetInfo) GetHrp() string { - if m != nil { - return m.Hrp - } - return "" -} - -func (m *AssetInfo) GetSymbol() string { - if m != nil { - return m.Symbol - } - return "" -} - -func (m *AssetInfo) GetAssetType() string { - if m != nil { - return m.AssetType - } - return "" -} - -func (m *AssetInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AssetInfo) GetIconUrl() string { - if m != nil { - return m.IconUrl - } - return "" -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "oracle.v1.GenesisState") - proto.RegisterType((*Params)(nil), "oracle.v1.Params") - proto.RegisterType((*Assets)(nil), "oracle.v1.Assets") - proto.RegisterType((*AssetInfo)(nil), "oracle.v1.AssetInfo") -} - -func init() { proto.RegisterFile("oracle/v1/genesis.proto", fileDescriptor_14b982a0a6345d1d) } - -var fileDescriptor_14b982a0a6345d1d = []byte{ - // 380 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xc1, 0x4e, 0xea, 0x40, - 0x18, 0x85, 0x3b, 0xb7, 0xd0, 0x7b, 0x3b, 0x5c, 0x13, 0x99, 0x10, 0xac, 0x4d, 0x2c, 0x84, 0xc4, - 0x04, 0x8d, 0xe9, 0x04, 0xdc, 0xb1, 0x21, 0xb2, 0x31, 0x6e, 0xd4, 0x54, 0xdd, 0xb8, 0x21, 0x05, - 0x87, 0xd2, 0xa4, 0x9d, 0x69, 0x3a, 0x85, 0xc0, 0x2b, 0xb8, 0x72, 0xe9, 0x92, 0x47, 0x70, 0xe3, - 0x3b, 0xb0, 0x64, 0xe9, 0xca, 0x18, 0x58, 0xe8, 0x63, 0x98, 0xce, 0x54, 0x42, 0x88, 0x9b, 0x3f, - 0xff, 0x7f, 0xce, 0xe9, 0x97, 0xd3, 0x0c, 0xdc, 0x63, 0xb1, 0xdb, 0x0f, 0x08, 0x1e, 0x37, 0xb0, - 0x47, 0x28, 0xe1, 0x3e, 0xb7, 0xa3, 0x98, 0x25, 0x0c, 0xe9, 0xd2, 0xb0, 0xc7, 0x0d, 0xb3, 0xe8, - 0x86, 0x3e, 0x65, 0x58, 0x4c, 0xe9, 0x9a, 0x25, 0x8f, 0x79, 0x4c, 0xac, 0x38, 0xdd, 0xa4, 0x5a, - 0x6b, 0xc3, 0xff, 0xe7, 0x12, 0x72, 0x93, 0xb8, 0x09, 0x41, 0x18, 0x6a, 0x91, 0x1b, 0xbb, 0x21, - 0x37, 0x40, 0x15, 0xd4, 0x0b, 0xcd, 0xa2, 0xbd, 0x86, 0xda, 0xd7, 0xc2, 0xe8, 0xe4, 0xe6, 0xef, - 0x15, 0xc5, 0xc9, 0x62, 0xb5, 0x2b, 0xa8, 0x49, 0x1d, 0x1d, 0x41, 0xcd, 0xe5, 0x9c, 0x24, 0xbf, - 0x7d, 0x7a, 0x26, 0x0c, 0x27, 0x0b, 0xb4, 0xcc, 0xe7, 0x59, 0x45, 0xf9, 0x9a, 0x55, 0xc0, 0xe3, - 0xe7, 0xcb, 0xf1, 0x4e, 0xf6, 0x3f, 0x19, 0xf0, 0x12, 0x6a, 0x32, 0x8d, 0x4e, 0x36, 0x80, 0x6a, - 0xbd, 0xd0, 0x2c, 0x6d, 0x03, 0x2f, 0xe8, 0x80, 0xad, 0x99, 0xe5, 0x6d, 0x9e, 0xd4, 0x6b, 0xaf, - 0x00, 0xea, 0xeb, 0x34, 0x2a, 0xc1, 0xbc, 0x4f, 0x1f, 0xc8, 0x44, 0x74, 0x54, 0x1d, 0x79, 0xa0, - 0x5d, 0xa8, 0x0e, 0xe3, 0xc8, 0xf8, 0x53, 0x05, 0x75, 0xdd, 0x49, 0x57, 0x54, 0x86, 0x1a, 0x9f, - 0x86, 0x3d, 0x16, 0x18, 0xaa, 0x10, 0xb3, 0x0b, 0x1d, 0x40, 0x28, 0xb8, 0xdd, 0x64, 0x1a, 0x11, - 0x23, 0x27, 0x3c, 0x5d, 0x28, 0xb7, 0xd3, 0x88, 0x20, 0x04, 0x73, 0xd4, 0x0d, 0x89, 0x91, 0x17, - 0x86, 0xd8, 0xd1, 0x3e, 0xfc, 0xe7, 0xf7, 0x19, 0xed, 0x8e, 0xe2, 0xc0, 0xd0, 0x84, 0xfe, 0x37, - 0xbd, 0xef, 0xe2, 0xa0, 0x65, 0xfe, 0x74, 0x2e, 0x6e, 0x76, 0xee, 0xfa, 0x74, 0xc0, 0x3a, 0xed, - 0xf9, 0xd2, 0x02, 0x8b, 0xa5, 0x05, 0x3e, 0x96, 0x16, 0x78, 0x5a, 0x59, 0xca, 0x62, 0x65, 0x29, - 0x6f, 0x2b, 0x4b, 0xb9, 0x3f, 0xf4, 0xfc, 0x64, 0x38, 0xea, 0xd9, 0x7d, 0x16, 0x62, 0x46, 0x39, - 0xa3, 0x31, 0x16, 0x63, 0x82, 0x33, 0x4a, 0xda, 0x8d, 0xf7, 0x34, 0xf1, 0xc2, 0xa7, 0xdf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xbd, 0x2b, 0xce, 0x32, 0x30, 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 !this.Assets.Equal(that1.Assets) { - return false - } - return true -} -func (this *Assets) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Assets) - if !ok { - that2, ok := that.(Assets) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Assets) != len(that1.Assets) { - return false - } - for i := range this.Assets { - if !this.Assets[i].Equal(that1.Assets[i]) { - return false - } - } - return true -} -func (this *AssetInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*AssetInfo) - if !ok { - that2, ok := that.(AssetInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - if this.Hrp != that1.Hrp { - return false - } - if this.Symbol != that1.Symbol { - return false - } - if this.AssetType != that1.AssetType { - return false - } - if this.Name != that1.Name { - return false - } - if this.IconUrl != that1.IconUrl { - return false - } - return true -} -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -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 m.Assets != nil { - { - size, err := m.Assets.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Assets) 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 *Assets) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Assets) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Assets) > 0 { - for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *AssetInfo) 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 *AssetInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AssetInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.IconUrl) > 0 { - i -= len(m.IconUrl) - copy(dAtA[i:], m.IconUrl) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.IconUrl))) - i-- - dAtA[i] = 0x32 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x2a - } - if len(m.AssetType) > 0 { - i -= len(m.AssetType) - copy(dAtA[i:], m.AssetType) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.AssetType))) - i-- - dAtA[i] = 0x22 - } - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Symbol))) - i-- - dAtA[i] = 0x1a - } - if len(m.Hrp) > 0 { - i -= len(m.Hrp) - copy(dAtA[i:], m.Hrp) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Hrp))) - i-- - dAtA[i] = 0x12 - } - if m.Index != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - 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++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Assets != nil { - l = m.Assets.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} - -func (m *Assets) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Assets) > 0 { - for _, e := range m.Assets { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func (m *AssetInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovGenesis(uint64(m.Index)) - } - l = len(m.Hrp) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.AssetType) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.IconUrl) - 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 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Assets == nil { - m.Assets = &Assets{} - } - if err := m.Assets.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 *Assets) 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: Assets: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Assets: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Assets = append(m.Assets, &AssetInfo{}) - if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := 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 *AssetInfo) 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: AssetInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AssetInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hrp", 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.Hrp = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AssetType", 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.AssetType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IconUrl", 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.IconUrl = 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 skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/oracle/types/genesis_test.go b/x/oracle/types/genesis_test.go deleted file mode 100644 index 914c8b084..000000000 --- a/x/oracle/types/genesis_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/onsonr/sonr/x/oracle/types" - - "github.com/stretchr/testify/require" -) - -func TestGenesisState_Validate(t *testing.T) { - tests := []struct { - desc string - genState *types.GenesisState - valid bool - }{ - { - desc: "default is valid", - genState: types.DefaultGenesis(), - valid: true, - }, - { - desc: "valid genesis state", - genState: &types.GenesisState{ - - // this line is used by starport scaffolding # types/genesis/validField - }, - valid: true, - }, - // this line is used by starport scaffolding # types/genesis/testcase - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } - }) - } -} diff --git a/x/oracle/types/keys.go b/x/oracle/types/keys.go deleted file mode 100644 index 355987cab..000000000 --- a/x/oracle/types/keys.go +++ /dev/null @@ -1,27 +0,0 @@ -package types - -import ( - "cosmossdk.io/collections" - - ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" -) - -var ( - // ParamsKey saves the current module params. - ParamsKey = collections.NewPrefix(0) -) - -const ( - ModuleName = "oracle" - - StoreKey = ModuleName - - QuerierRoute = ModuleName -) - -var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{ - SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ - {Id: 1, ProtoFileName: "oracle/v1/state.proto"}, - }, - Prefix: []byte{0}, -} diff --git a/x/oracle/types/msgs.go b/x/oracle/types/msgs.go deleted file mode 100644 index 81025a49a..000000000 --- a/x/oracle/types/msgs.go +++ /dev/null @@ -1,45 +0,0 @@ -package types - -import ( - "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var _ sdk.Msg = &MsgUpdateParams{} - -// NewMsgUpdateParams creates new instance of MsgUpdateParams -func NewMsgUpdateParams( - sender sdk.Address, - someValue bool, -) *MsgUpdateParams { - return &MsgUpdateParams{ - Authority: sender.String(), - Params: Params{}, - } -} - -// Route returns the name of the module -func (msg MsgUpdateParams) Route() string { return ModuleName } - -// Type returns the the action -func (msg MsgUpdateParams) Type() string { return "update_params" } - -// GetSignBytes implements the LegacyMsg interface. -func (msg MsgUpdateParams) GetSignBytes() []byte { - return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) -} - -// GetSigners returns the expected signers for a MsgUpdateParams message. -func (msg *MsgUpdateParams) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(msg.Authority) - return []sdk.AccAddress{addr} -} - -// ValidateBasic does a sanity check on the provided data. -func (msg *MsgUpdateParams) Validate() error { - if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { - return errors.Wrap(err, "invalid authority address") - } - - return msg.Params.Validate() -} diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go deleted file mode 100644 index 72e1bf5f7..000000000 --- a/x/oracle/types/params.go +++ /dev/null @@ -1,27 +0,0 @@ -package types - -import ( - "encoding/json" -) - -// DefaultParams returns default module parameters. -func DefaultParams() Params { - // TODO: - return Params{} -} - -// Stringer method for Params. -func (p Params) String() string { - bz, err := json.Marshal(p) - if err != nil { - panic(err) - } - - return string(bz) -} - -// Validate does the sanity check on the params. -func (p Params) Validate() error { - // TODO: - return nil -} diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go deleted file mode 100644 index 8dc7655f5..000000000 --- a/x/oracle/types/query.pb.go +++ /dev/null @@ -1,539 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: oracle/v1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// QueryParamsRequest is the request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_34238c8dfdfcd7ec, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is the response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params defines the parameters of the module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_34238c8dfdfcd7ec, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() *Params { - if m != nil { - return m.Params - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "oracle.v1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "oracle.v1.QueryParamsResponse") -} - -func init() { proto.RegisterFile("oracle/v1/query.proto", fileDescriptor_34238c8dfdfcd7ec) } - -var fileDescriptor_34238c8dfdfcd7ec = []byte{ - // 250 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0x2f, 0x4a, 0x4c, - 0xce, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0xe2, 0x84, 0x08, 0xeb, 0x95, 0x19, 0x4a, 0xc9, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7, 0xa4, - 0xea, 0x27, 0x16, 0x64, 0xea, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x15, - 0x43, 0x14, 0x4a, 0x89, 0x23, 0xf4, 0xa7, 0xa7, 0xe6, 0xa5, 0x16, 0x67, 0x42, 0x25, 0x94, 0x44, - 0xb8, 0x84, 0x02, 0x41, 0x06, 0x06, 0x24, 0x16, 0x25, 0xe6, 0x16, 0x07, 0xa5, 0x16, 0x96, 0xa6, - 0x16, 0x97, 0x28, 0x39, 0x70, 0x09, 0xa3, 0x88, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0x69, - 0x72, 0xb1, 0x15, 0x80, 0x45, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x04, 0xf5, 0xe0, 0xf6, - 0xeb, 0x41, 0x95, 0x42, 0x15, 0x18, 0x65, 0x73, 0xb1, 0x82, 0x4d, 0x10, 0x4a, 0xe2, 0x62, 0x83, - 0x48, 0x09, 0xc9, 0x22, 0xa9, 0xc6, 0xb4, 0x53, 0x4a, 0x0e, 0x97, 0x34, 0xc4, 0x72, 0x25, 0xc9, - 0xa6, 0xcb, 0x4f, 0x26, 0x33, 0x09, 0x0b, 0x09, 0xea, 0x23, 0xfc, 0x02, 0xb1, 0xcc, 0xc9, 0xfe, - 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, - 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x54, 0xd3, 0x33, 0x4b, 0x32, 0x4a, - 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xf3, 0xf3, 0x8a, 0xf3, 0xf3, 0x8a, 0xf4, 0xc1, 0x44, 0x05, - 0xcc, 0x90, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x60, 0x18, 0x03, 0x02, 0x00, 0x00, - 0xff, 0xff, 0x38, 0x25, 0xc7, 0xb6, 0x67, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Params queries all parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/oracle.v1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Params queries all parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/oracle.v1.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "oracle.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "oracle/v1/query.proto", -} - -func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Params == nil { - m.Params = &Params{} - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go deleted file mode 100644 index 99162a380..000000000 --- a/x/oracle/types/query.pb.gw.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: oracle/v1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"oracle", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage -) diff --git a/x/oracle/types/state.pb.go b/x/oracle/types/state.pb.go deleted file mode 100644 index 9cfd09c3b..000000000 --- a/x/oracle/types/state.pb.go +++ /dev/null @@ -1,666 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: oracle/v1/state.proto - -package types - -import ( - _ "cosmossdk.io/orm" - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Balance struct { - Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` -} - -func (m *Balance) Reset() { *m = Balance{} } -func (m *Balance) String() string { return proto.CompactTextString(m) } -func (*Balance) ProtoMessage() {} -func (*Balance) Descriptor() ([]byte, []int) { - return fileDescriptor_8840885873256d8c, []int{0} -} -func (m *Balance) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Balance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Balance.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 *Balance) XXX_Merge(src proto.Message) { - xxx_messageInfo_Balance.Merge(m, src) -} -func (m *Balance) XXX_Size() int { - return m.Size() -} -func (m *Balance) XXX_DiscardUnknown() { - xxx_messageInfo_Balance.DiscardUnknown(m) -} - -var xxx_messageInfo_Balance proto.InternalMessageInfo - -func (m *Balance) GetAccount() string { - if m != nil { - return m.Account - } - return "" -} - -func (m *Balance) GetAmount() uint64 { - if m != nil { - return m.Amount - } - return 0 -} - -type Account struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Chain string `protobuf:"bytes,3,opt,name=chain,proto3" json:"chain,omitempty"` - Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"` -} - -func (m *Account) Reset() { *m = Account{} } -func (m *Account) String() string { return proto.CompactTextString(m) } -func (*Account) ProtoMessage() {} -func (*Account) Descriptor() ([]byte, []int) { - return fileDescriptor_8840885873256d8c, []int{1} -} -func (m *Account) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Account.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 *Account) XXX_Merge(src proto.Message) { - xxx_messageInfo_Account.Merge(m, src) -} -func (m *Account) XXX_Size() int { - return m.Size() -} -func (m *Account) XXX_DiscardUnknown() { - xxx_messageInfo_Account.DiscardUnknown(m) -} - -var xxx_messageInfo_Account proto.InternalMessageInfo - -func (m *Account) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Account) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *Account) GetChain() string { - if m != nil { - return m.Chain - } - return "" -} - -func (m *Account) GetNetwork() string { - if m != nil { - return m.Network - } - return "" -} - -func init() { - proto.RegisterType((*Balance)(nil), "oracle.v1.Balance") - proto.RegisterType((*Account)(nil), "oracle.v1.Account") -} - -func init() { proto.RegisterFile("oracle/v1/state.proto", fileDescriptor_8840885873256d8c) } - -var fileDescriptor_8840885873256d8c = []byte{ - // 291 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x90, 0xc1, 0x4a, 0x03, 0x31, - 0x10, 0x86, 0x9b, 0xed, 0xda, 0xd2, 0x1c, 0x44, 0x82, 0xd5, 0xa8, 0x10, 0x4b, 0xa1, 0x50, 0xb0, - 0x6c, 0x28, 0xde, 0x7a, 0x11, 0xfb, 0x08, 0x7b, 0x14, 0x2f, 0x69, 0x36, 0xd8, 0xc5, 0x6e, 0xa6, - 0x24, 0x69, 0xd5, 0x97, 0x90, 0x3e, 0x81, 0xcf, 0xe3, 0xb1, 0xe0, 0xc5, 0xa3, 0xec, 0xbe, 0x81, - 0x4f, 0x20, 0x9b, 0x4d, 0xbd, 0x0c, 0xfc, 0x33, 0xdf, 0xfc, 0xff, 0x30, 0xb8, 0x0f, 0x46, 0xc8, - 0x95, 0xe2, 0xdb, 0x29, 0xb7, 0x4e, 0x38, 0x95, 0xac, 0x0d, 0x38, 0x20, 0xbd, 0xa6, 0x9d, 0x6c, - 0xa7, 0x97, 0xe7, 0x12, 0x6c, 0x01, 0x96, 0x83, 0x29, 0x6a, 0x0a, 0x4c, 0xd1, 0x30, 0xc3, 0x47, - 0xdc, 0x9d, 0x8b, 0x95, 0xd0, 0x52, 0x11, 0x8a, 0xbb, 0x42, 0x4a, 0xd8, 0x68, 0x47, 0xd1, 0x00, - 0x8d, 0x7b, 0xe9, 0x41, 0x92, 0x33, 0xdc, 0x11, 0x85, 0x1f, 0x44, 0x03, 0x34, 0x8e, 0xd3, 0xa0, - 0x66, 0xd7, 0xbf, 0x1f, 0x5f, 0xef, 0xed, 0x0b, 0xdc, 0xfb, 0xdf, 0x24, 0xf8, 0x80, 0x9e, 0x20, - 0x8a, 0x86, 0x3b, 0x84, 0xbb, 0xf7, 0x61, 0x72, 0x8c, 0xa3, 0x3c, 0xf3, 0xce, 0x71, 0x1a, 0xe5, - 0x99, 0x8f, 0xcb, 0x32, 0xa3, 0xac, 0xf5, 0xae, 0x75, 0x5c, 0x23, 0xc9, 0x29, 0x3e, 0x92, 0x4b, - 0x91, 0x6b, 0xda, 0xf6, 0xfd, 0x46, 0xd4, 0xbc, 0x56, 0xee, 0x05, 0xcc, 0x33, 0x8d, 0x1b, 0x3e, - 0xc8, 0xd9, 0x8d, 0x3f, 0x63, 0x84, 0xe3, 0x3a, 0x81, 0x5c, 0xe1, 0x7e, 0x30, 0x9a, 0xf8, 0xc5, - 0x49, 0xc0, 0xea, 0x83, 0x68, 0x34, 0xbf, 0xfb, 0x2c, 0x19, 0xda, 0x97, 0x0c, 0xfd, 0x94, 0x0c, - 0xed, 0x2a, 0xd6, 0xda, 0x57, 0xac, 0xf5, 0x5d, 0xb1, 0xd6, 0xc3, 0xe8, 0x29, 0x77, 0xcb, 0xcd, - 0x22, 0x91, 0x50, 0x70, 0xd0, 0x16, 0xb4, 0xe1, 0xbe, 0xbc, 0xf2, 0xf0, 0x5e, 0xf7, 0xb6, 0x56, - 0x76, 0xd1, 0xf1, 0x8f, 0xbb, 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x85, 0x67, 0x6c, 0x75, - 0x01, 0x00, 0x00, -} - -func (m *Balance) 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 *Balance) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Balance) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Amount != 0 { - i = encodeVarintState(dAtA, i, uint64(m.Amount)) - i-- - dAtA[i] = 0x10 - } - if len(m.Account) > 0 { - i -= len(m.Account) - copy(dAtA[i:], m.Account) - i = encodeVarintState(dAtA, i, uint64(len(m.Account))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Account) 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 *Account) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Network) > 0 { - i -= len(m.Network) - copy(dAtA[i:], m.Network) - i = encodeVarintState(dAtA, i, uint64(len(m.Network))) - i-- - dAtA[i] = 0x22 - } - if len(m.Chain) > 0 { - i -= len(m.Chain) - copy(dAtA[i:], m.Chain) - i = encodeVarintState(dAtA, i, uint64(len(m.Chain))) - i-- - dAtA[i] = 0x1a - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintState(dAtA, i, uint64(len(m.Address))) - 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 encodeVarintState(dAtA []byte, offset int, v uint64) int { - offset -= sovState(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Balance) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Account) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - if m.Amount != 0 { - n += 1 + sovState(uint64(m.Amount)) - } - return n -} - -func (m *Account) 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.Address) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Chain) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Network) - 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 -} -func sozState(x uint64) (n int) { - return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Balance) 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: Balance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Balance: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", 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.Account = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - m.Amount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Amount |= uint64(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 *Account) 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: Account: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chain", 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.Chain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", 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.Network = 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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowState - } - 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, ErrIntOverflowState - } - 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, ErrIntOverflowState - } - 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, ErrInvalidLengthState - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupState - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthState - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowState = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go deleted file mode 100644 index 8de2bf0a6..000000000 --- a/x/oracle/types/tx.pb.go +++ /dev/null @@ -1,601 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: oracle/v1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -type MsgUpdateParams struct { - // authority is the address of the governance account. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the parameters to update. - // - // NOTE: All parameters must be supplied. - Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_31571edce0094a5d, []int{0} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_31571edce0094a5d, []int{1} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgUpdateParams)(nil), "oracle.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "oracle.v1.MsgUpdateParamsResponse") -} - -func init() { proto.RegisterFile("oracle/v1/tx.proto", fileDescriptor_31571edce0094a5d) } - -var fileDescriptor_31571edce0094a5d = []byte{ - // 317 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x2f, 0x4a, 0x4c, - 0xce, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, - 0x84, 0x88, 0xe9, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, 0xe7, 0x16, - 0xa7, 0x83, 0x94, 0xe4, 0x16, 0xa7, 0x43, 0xd4, 0x48, 0x89, 0x23, 0xf4, 0xa5, 0xa7, 0xe6, 0xa5, - 0x16, 0x67, 0x16, 0x43, 0x25, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, 0x7d, 0x10, 0x0b, 0x2a, - 0x2a, 0x09, 0x31, 0x27, 0x1e, 0x22, 0x01, 0xe1, 0x40, 0xa4, 0x94, 0xba, 0x18, 0xb9, 0xf8, 0x7d, - 0x8b, 0xd3, 0x43, 0x0b, 0x52, 0x12, 0x4b, 0x52, 0x03, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x85, 0xcc, - 0xb8, 0x38, 0x13, 0x4b, 0x4b, 0x32, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, 0x25, 0x18, 0x15, 0x18, 0x35, - 0x38, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x15, 0x81, 0x6a, 0x74, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, - 0x0e, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0x42, 0x28, 0x15, 0xd2, 0xe7, 0x62, 0x2b, 0x00, 0x9b, - 0x20, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa8, 0x07, 0xf7, 0x8a, 0x1e, 0xc4, 0x68, 0x27, - 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0xca, 0xac, 0xf8, 0x9a, 0x9e, 0x6f, 0xd0, 0x42, 0x18, - 0xa0, 0x24, 0xc9, 0x25, 0x8e, 0xe6, 0x96, 0xa0, 0xd4, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa3, - 0x18, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0x21, 0x3f, 0x2e, 0x1e, 0x14, 0xa7, 0x4a, 0x21, 0x59, 0x81, - 0xa6, 0x55, 0x4a, 0x09, 0xb7, 0x1c, 0xcc, 0x58, 0x29, 0xd6, 0x86, 0xe7, 0x1b, 0xb4, 0x18, 0x9d, - 0xec, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, - 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x35, 0x3d, 0xb3, 0x24, - 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x3f, 0xaf, 0x38, 0x3f, 0xaf, 0x48, 0x1f, 0x4c, - 0x54, 0xe8, 0x43, 0xa3, 0xa0, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x9a, 0xc6, 0x80, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x94, 0xf5, 0x6d, 0x1c, 0xd1, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateParams defines a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/oracle.v1.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // UpdateParams defines a governance operation for updating the parameters. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateParams(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/oracle.v1.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "oracle.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "oracle/v1/tx.proto", -} - -func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgUpdateParams) 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 ErrIntOverflowTx - } - 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: MsgUpdateParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - 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 := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx - } - 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/vault/README.md b/x/vault/README.md index d4ea1153c..8f785335d 100644 --- a/x/vault/README.md +++ b/x/vault/README.md @@ -4,12 +4,68 @@ The Vault module is responsible for the management of IPFS deployed Decentralize ## Concepts -| Concept | Description | Reference | -| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -| Decentralized Web Node (DWN) | A decentralized, distributed, and secure network of nodes that store and share data. It is a decentralized alternative to traditional web hosting services. | | -| Decentralized Identifier (DID) | A unique identifier that is created, owned, and controlled by the user. It is used to establish a secure and verifiable digital identity. | | -| HTMX (Hypertext Markup Language eXtensions) | A set of extensions to HTML that allow for the creation of interactive web pages. It is used to enhance the user experience and provide additional functionality to web applications. | | -| IPFS (InterPlanetary File System) | A decentralized, peer-to-peer network for storing and sharing data. It is a distributed file system that allows for the creation and sharing of content across a network of nodes. | | -| WebAuthn (Web Authentication) | A set of APIs that allow websites to request user authentication using biometric or non-biometric factors. | | -| WebAssembly (Web Assembly) | A binary instruction format for a stack-based virtual machine. | | -| Verifiable Credential (VC) | A digital statement that can be cryptographically verified. | | +## State + +Specify and describe structures expected to marshalled into the store, and their keys + +### Account State + +The Account state includes the user's public key, associated wallets, and other identification details. It is stored using the user's DID as the key. + +### Credential State + +The Credential state includes the claims about a subject and is stored using the credential ID as the key. + +## State Transitions + +Standard state transition operations triggered by hooks, messages, etc. + +## Messages + +Specify message structure(s) and expected state machine behaviour(s). + +## Begin Block + +Specify any begin-block operations. + +## End Block + +Specify any end-block operations. + +## Hooks + +Describe available hooks to be called by/from this module. + +## Events + +List and describe event tags used. + +## Client + +List and describe CLI commands and gRPC and REST endpoints. + +## Params + +List all module parameters, their types (in JSON) and identitys. + +## Future Improvements + +Describe future improvements of this module. + +## Tests + +Acceptance tests. + +## Appendix + +Supplementary details referenced elsewhere within the spec. + +| Concept | Description | +| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Decentralized Web Node (DWN) | A decentralized, distributed, and secure network of nodes that store and share data. It is a decentralized alternative to traditional web hosting services. | +| Decentralized Identifier (DID) | A unique identifier that is created, owned, and controlled by the user. It is used to establish a secure and verifiable digital identity. | +| HTMX (Hypertext Markup Language eXtensions) | A set of extensions to HTML that allow for the creation of interactive web pages. It is used to enhance the user experience and provide additional functionality to web applications. | +| IPFS (InterPlanetary File System) | A decentralized, peer-to-peer network for storing and sharing data. It is a distributed file system that allows for the creation and sharing of content across a network of nodes. | +| WebAuthn (Web Authentication) | A set of APIs that allow websites to request user authentication using biometric or non-biometric factors. | +| WebAssembly (Web Assembly) | A binary instruction format for a stack-based virtual machine. | +| Verifiable Credential (VC) | A digital statement that can be cryptographically verified. | diff --git a/x/vault/keeper/assembly.go b/x/vault/keeper/assembly.go new file mode 100644 index 000000000..5a7549a20 --- /dev/null +++ b/x/vault/keeper/assembly.go @@ -0,0 +1,55 @@ +package keeper + +import ( + "context" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + dwngen "github.com/onsonr/sonr/internal/dwn/gen" + "github.com/onsonr/sonr/x/vault/types" +) + +// assembleVault assembles the initial vault +func (k Keeper) AssembleVault(ctx sdk.Context) (string, int64, error) { + _, con, err := k.DIDKeeper.NewController(ctx) + if err != nil { + return "", 0, err + } + usrKs, err := con.ExportUserKs() + if err != nil { + return "", 0, err + } + sch, err := k.CurrentSchema(ctx) + if err != nil { + return "", 0, err + } + v, err := types.NewVault(usrKs, con.SonrAddress(), con.ChainID(), sch) + if err != nil { + return "", 0, err + } + cid, err := k.ipfsClient.Unixfs().Add(context.Background(), v.FS) + if err != nil { + return "", 0, err + } + return cid.String(), k.CalculateExpiration(ctx, time.Second*15), nil +} + +// currentSchema returns the current schema +func (k Keeper) CurrentSchema(ctx sdk.Context) (*dwngen.Schema, error) { + p, err := k.Params.Get(ctx) + if err != nil { + return nil, err + } + schema := p.Schema + return &dwngen.Schema{ + Version: int(schema.Version), + Account: schema.Account, + Asset: schema.Asset, + Chain: schema.Chain, + Credential: schema.Credential, + Jwk: schema.Jwk, + Grant: schema.Grant, + Keyshare: schema.Keyshare, + Profile: schema.Profile, + }, nil +} diff --git a/x/vault/keeper/keeper.go b/x/vault/keeper/keeper.go index d526523af..d4cb77e35 100644 --- a/x/vault/keeper/keeper.go +++ b/x/vault/keeper/keeper.go @@ -1,22 +1,17 @@ package keeper import ( - "context" - "time" - "cosmossdk.io/collections" storetypes "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/orm/model/ormdb" "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/ipfs/kubo/client/rpc" apiv1 "github.com/onsonr/sonr/api/vault/v1" - "github.com/onsonr/sonr/pkg/dwn" didkeeper "github.com/onsonr/sonr/x/did/keeper" "github.com/onsonr/sonr/x/vault/types" ) @@ -88,48 +83,3 @@ func NewKeeper( return k } - -// currentSchema returns the current schema -func (k Keeper) CurrentSchema(ctx sdk.Context) (*dwn.Schema, error) { - p, err := k.Params.Get(ctx) - if err != nil { - return nil, err - } - schema := p.Schema - return &dwn.Schema{ - Version: int(schema.Version), - Account: schema.Account, - Asset: schema.Asset, - Chain: schema.Chain, - Credential: schema.Credential, - Jwk: schema.Jwk, - Grant: schema.Grant, - Keyshare: schema.Keyshare, - Profile: schema.Profile, - }, nil -} - -// assembleVault assembles the initial vault -func (k Keeper) AssembleVault(ctx sdk.Context) (string, int64, error) { - _, con, err := k.DIDKeeper.NewController(ctx) - if err != nil { - return "", 0, err - } - usrKs, err := con.ExportUserKs() - if err != nil { - return "", 0, err - } - sch, err := k.CurrentSchema(ctx) - if err != nil { - return "", 0, err - } - v, err := types.NewVault(usrKs, con.SonrAddress(), con.ChainID(), sch) - if err != nil { - return "", 0, err - } - cid, err := k.ipfsClient.Unixfs().Add(context.Background(), v.FS) - if err != nil { - return "", 0, err - } - return cid.String(), k.CalculateExpiration(ctx, time.Second*15), nil -} diff --git a/x/vault/keeper/querier.go b/x/vault/keeper/querier.go index 329eb59d3..aafc65707 100644 --- a/x/vault/keeper/querier.go +++ b/x/vault/keeper/querier.go @@ -35,8 +35,15 @@ func (k Querier) Sync(goCtx context.Context, req *types.SyncRequest) (*types.Syn return &types.SyncResponse{}, nil } -// BuildTx implements types.QueryServer. -func (k Querier) BuildTx(goCtx context.Context, req *types.BuildTxRequest) (*types.BuildTxResponse, error) { - // ctx := sdk.UnwrapSDKContext(goCtx) - return &types.BuildTxResponse{}, nil +// Schema implements types.QueryServer. +func (k Querier) Schema(goCtx context.Context, req *types.QuerySchemaRequest) (*types.QuerySchemaResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + p, err := k.Keeper.Params.Get(ctx) + if err != nil { + return nil, err + } + return &types.QuerySchemaResponse{ + Schema: p.Schema, + }, nil } diff --git a/x/vault/types/params.go b/x/vault/types/params.go index 0c028e4d9..7c0fee1e3 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/pkg/orm" + "github.com/onsonr/sonr/internal/orm" ) // DefaultParams returns default module parameters. diff --git a/x/vault/types/query.pb.go b/x/vault/types/query.pb.go index fec7bfb75..68bb5cbcf 100644 --- a/x/vault/types/query.pb.go +++ b/x/vault/types/query.pb.go @@ -111,22 +111,22 @@ func (m *QueryParamsResponse) GetParams() *Params { return nil } -// QueryIPFSRequest is the request type for the Query/IPFS RPC method. -type QueryIPFSRequest struct { +// QuerySchemaRequest is the request type for the Query/Schema RPC method. +type QuerySchemaRequest struct { } -func (m *QueryIPFSRequest) Reset() { *m = QueryIPFSRequest{} } -func (m *QueryIPFSRequest) String() string { return proto.CompactTextString(m) } -func (*QueryIPFSRequest) ProtoMessage() {} -func (*QueryIPFSRequest) Descriptor() ([]byte, []int) { +func (m *QuerySchemaRequest) Reset() { *m = QuerySchemaRequest{} } +func (m *QuerySchemaRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySchemaRequest) ProtoMessage() {} +func (*QuerySchemaRequest) Descriptor() ([]byte, []int) { return fileDescriptor_e6d49a2800ab3e4b, []int{2} } -func (m *QueryIPFSRequest) XXX_Unmarshal(b []byte) error { +func (m *QuerySchemaRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryIPFSRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySchemaRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryIPFSRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySchemaRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -136,36 +136,36 @@ func (m *QueryIPFSRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *QueryIPFSRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryIPFSRequest.Merge(m, src) +func (m *QuerySchemaRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySchemaRequest.Merge(m, src) } -func (m *QueryIPFSRequest) XXX_Size() int { +func (m *QuerySchemaRequest) XXX_Size() int { return m.Size() } -func (m *QueryIPFSRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryIPFSRequest.DiscardUnknown(m) +func (m *QuerySchemaRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySchemaRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryIPFSRequest proto.InternalMessageInfo +var xxx_messageInfo_QuerySchemaRequest proto.InternalMessageInfo -// QueryIPFSResponse is the response type for the Query/IPFS RPC method. -type QueryIPFSResponse struct { - // IPFS is the IPFS client status. - Ipfs bool `protobuf:"varint,1,opt,name=ipfs,proto3" json:"ipfs,omitempty"` +// QuerySchemaResponse is the response type for the Query/Schema RPC method. +type QuerySchemaResponse struct { + // Schema is the DID document. + Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"` } -func (m *QueryIPFSResponse) Reset() { *m = QueryIPFSResponse{} } -func (m *QueryIPFSResponse) String() string { return proto.CompactTextString(m) } -func (*QueryIPFSResponse) ProtoMessage() {} -func (*QueryIPFSResponse) Descriptor() ([]byte, []int) { +func (m *QuerySchemaResponse) Reset() { *m = QuerySchemaResponse{} } +func (m *QuerySchemaResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySchemaResponse) ProtoMessage() {} +func (*QuerySchemaResponse) Descriptor() ([]byte, []int) { return fileDescriptor_e6d49a2800ab3e4b, []int{3} } -func (m *QueryIPFSResponse) XXX_Unmarshal(b []byte) error { +func (m *QuerySchemaResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryIPFSResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QuerySchemaResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryIPFSResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QuerySchemaResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -175,23 +175,23 @@ func (m *QueryIPFSResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *QueryIPFSResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryIPFSResponse.Merge(m, src) +func (m *QuerySchemaResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySchemaResponse.Merge(m, src) } -func (m *QueryIPFSResponse) XXX_Size() int { +func (m *QuerySchemaResponse) XXX_Size() int { return m.Size() } -func (m *QueryIPFSResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryIPFSResponse.DiscardUnknown(m) +func (m *QuerySchemaResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySchemaResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryIPFSResponse proto.InternalMessageInfo +var xxx_messageInfo_QuerySchemaResponse proto.InternalMessageInfo -func (m *QueryIPFSResponse) GetIpfs() bool { +func (m *QuerySchemaResponse) GetSchema() *Schema { if m != nil { - return m.Ipfs + return m.Schema } - return false + return nil } // SyncRequest is the request type for the Sync RPC method. @@ -284,154 +284,42 @@ func (m *SyncResponse) GetSuccess() bool { return false } -// BuildTxRequest is the request type for the BuildTx RPC method. -type BuildTxRequest struct { - Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` - Pkl string `protobuf:"bytes,2,opt,name=pkl,proto3" json:"pkl,omitempty"` -} - -func (m *BuildTxRequest) Reset() { *m = BuildTxRequest{} } -func (m *BuildTxRequest) String() string { return proto.CompactTextString(m) } -func (*BuildTxRequest) ProtoMessage() {} -func (*BuildTxRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e6d49a2800ab3e4b, []int{6} -} -func (m *BuildTxRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BuildTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BuildTxRequest.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 *BuildTxRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_BuildTxRequest.Merge(m, src) -} -func (m *BuildTxRequest) XXX_Size() int { - return m.Size() -} -func (m *BuildTxRequest) XXX_DiscardUnknown() { - xxx_messageInfo_BuildTxRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_BuildTxRequest proto.InternalMessageInfo - -func (m *BuildTxRequest) GetDid() string { - if m != nil { - return m.Did - } - return "" -} - -func (m *BuildTxRequest) GetPkl() string { - if m != nil { - return m.Pkl - } - return "" -} - -// BuildTxResponse is the response type for the BuildTx RPC method. -type BuildTxResponse struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Tx string `protobuf:"bytes,2,opt,name=tx,proto3" json:"tx,omitempty"` -} - -func (m *BuildTxResponse) Reset() { *m = BuildTxResponse{} } -func (m *BuildTxResponse) String() string { return proto.CompactTextString(m) } -func (*BuildTxResponse) ProtoMessage() {} -func (*BuildTxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e6d49a2800ab3e4b, []int{7} -} -func (m *BuildTxResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BuildTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BuildTxResponse.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 *BuildTxResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_BuildTxResponse.Merge(m, src) -} -func (m *BuildTxResponse) XXX_Size() int { - return m.Size() -} -func (m *BuildTxResponse) XXX_DiscardUnknown() { - xxx_messageInfo_BuildTxResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_BuildTxResponse proto.InternalMessageInfo - -func (m *BuildTxResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -func (m *BuildTxResponse) GetTx() string { - if m != nil { - return m.Tx - } - return "" -} - func init() { proto.RegisterType((*QueryParamsRequest)(nil), "vault.v1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "vault.v1.QueryParamsResponse") - proto.RegisterType((*QueryIPFSRequest)(nil), "vault.v1.QueryIPFSRequest") - proto.RegisterType((*QueryIPFSResponse)(nil), "vault.v1.QueryIPFSResponse") + proto.RegisterType((*QuerySchemaRequest)(nil), "vault.v1.QuerySchemaRequest") + proto.RegisterType((*QuerySchemaResponse)(nil), "vault.v1.QuerySchemaResponse") proto.RegisterType((*SyncRequest)(nil), "vault.v1.SyncRequest") proto.RegisterType((*SyncResponse)(nil), "vault.v1.SyncResponse") - proto.RegisterType((*BuildTxRequest)(nil), "vault.v1.BuildTxRequest") - proto.RegisterType((*BuildTxResponse)(nil), "vault.v1.BuildTxResponse") } func init() { proto.RegisterFile("vault/v1/query.proto", fileDescriptor_e6d49a2800ab3e4b) } var fileDescriptor_e6d49a2800ab3e4b = []byte{ - // 424 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0x8b, 0xd3, 0x40, - 0x1c, 0xc5, 0x9b, 0xb8, 0x76, 0xd7, 0xff, 0x4a, 0xcd, 0xce, 0xae, 0x25, 0x1b, 0xd6, 0x28, 0x83, - 0x60, 0x4f, 0x09, 0x5b, 0xbd, 0x09, 0x0a, 0x3d, 0x08, 0x1e, 0x84, 0xda, 0x7a, 0xd1, 0x8b, 0xa4, - 0xe9, 0x18, 0x43, 0xd3, 0x99, 0x69, 0x66, 0x52, 0x92, 0xab, 0x9f, 0x40, 0xf4, 0x4b, 0x79, 0x2c, - 0x78, 0xf1, 0x28, 0xad, 0x1f, 0x44, 0x32, 0x99, 0x34, 0xad, 0x5a, 0xbc, 0x84, 0xc9, 0x9b, 0xf7, - 0x7e, 0xff, 0xcc, 0x9b, 0xc0, 0xc5, 0x32, 0xc8, 0x12, 0xe9, 0x2f, 0xaf, 0xfd, 0x45, 0x46, 0xd2, - 0xc2, 0xe3, 0x29, 0x93, 0x0c, 0x9d, 0x28, 0xd5, 0x5b, 0x5e, 0x3b, 0x57, 0x11, 0x63, 0x51, 0x42, - 0xfc, 0x80, 0xc7, 0x7e, 0x40, 0x29, 0x93, 0x81, 0x8c, 0x19, 0x15, 0x95, 0xcf, 0xe9, 0x6e, 0xd3, - 0x11, 0xa1, 0x44, 0xc4, 0x5a, 0xc7, 0x17, 0x80, 0x5e, 0x97, 0xb8, 0x61, 0x90, 0x06, 0x73, 0x31, - 0x22, 0x8b, 0x8c, 0x08, 0x89, 0x9f, 0xc3, 0xf9, 0x9e, 0x2a, 0x38, 0xa3, 0x82, 0xa0, 0x1e, 0xb4, - 0xb9, 0x52, 0x6c, 0xe3, 0x81, 0xd1, 0x3b, 0xed, 0x5b, 0x5e, 0x3d, 0xdd, 0xd3, 0x4e, 0xbd, 0x8f, - 0x11, 0x58, 0x0a, 0xf0, 0x72, 0xf8, 0x62, 0x5c, 0x43, 0x1f, 0xc1, 0xd9, 0x8e, 0xa6, 0x91, 0x08, - 0x8e, 0x62, 0xfe, 0xa1, 0x02, 0x9e, 0x8c, 0xd4, 0x1a, 0xdf, 0x87, 0xd3, 0x71, 0x41, 0x43, 0x9d, - 0x43, 0x16, 0xdc, 0x98, 0xc6, 0x53, 0xe5, 0xb8, 0x35, 0x2a, 0x97, 0xb8, 0x07, 0xb7, 0x2b, 0x83, - 0x86, 0xd8, 0x70, 0x2c, 0xb2, 0x30, 0x24, 0xa2, 0xe6, 0xd4, 0xaf, 0xf8, 0x09, 0x74, 0x06, 0x59, - 0x9c, 0x4c, 0xdf, 0xe4, 0x07, 0x69, 0xa5, 0xc2, 0x67, 0x89, 0x6d, 0x56, 0x0a, 0x9f, 0x25, 0xf8, - 0x29, 0xdc, 0xd9, 0xa6, 0xfe, 0x37, 0x02, 0x75, 0xc0, 0x94, 0xb9, 0x4e, 0x9b, 0x32, 0xef, 0x7f, - 0x31, 0xe1, 0xa6, 0x3a, 0x27, 0x7a, 0x0f, 0xed, 0xaa, 0x16, 0x74, 0xd5, 0x14, 0xf5, 0x77, 0xdb, - 0xce, 0xbd, 0x03, 0xbb, 0xd5, 0x68, 0x6c, 0x7f, 0xfa, 0xfe, 0xeb, 0xab, 0x89, 0x90, 0xe5, 0x6f, - 0xef, 0xb0, 0x6a, 0x19, 0xbd, 0x85, 0x63, 0xfd, 0x9d, 0xc8, 0x6e, 0x18, 0xfb, 0x07, 0x76, 0x2e, - 0xff, 0xb1, 0xa3, 0xc9, 0x97, 0x8a, 0x7c, 0x8e, 0xcf, 0x1a, 0xf2, 0xa4, 0xb4, 0xc8, 0x1c, 0xbd, - 0x82, 0xa3, 0xb2, 0x62, 0x74, 0xb7, 0x49, 0xef, 0xdc, 0x89, 0xd3, 0xfd, 0x53, 0xd6, 0xc4, 0xae, - 0x22, 0x5a, 0xb8, 0xd3, 0x10, 0x45, 0x41, 0xc3, 0xc1, 0xb3, 0x6f, 0x6b, 0xd7, 0x58, 0xad, 0x5d, - 0xe3, 0xe7, 0xda, 0x35, 0x3e, 0x6f, 0xdc, 0xd6, 0x6a, 0xe3, 0xb6, 0x7e, 0x6c, 0xdc, 0xd6, 0xbb, - 0x87, 0x51, 0x2c, 0x3f, 0x66, 0x13, 0x2f, 0x64, 0x73, 0x9f, 0x51, 0xc1, 0x68, 0xea, 0xab, 0x47, - 0xae, 0x09, 0xb2, 0xe0, 0x44, 0x4c, 0xda, 0xea, 0x6f, 0x7d, 0xfc, 0x3b, 0x00, 0x00, 0xff, 0xff, - 0x76, 0x05, 0xd8, 0x03, 0x05, 0x03, 0x00, 0x00, + // 364 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x4f, 0x4f, 0xfa, 0x30, + 0x1c, 0xc6, 0x19, 0xbf, 0x9f, 0x88, 0xc5, 0x98, 0xa5, 0x22, 0x21, 0x0b, 0x4e, 0xb3, 0x78, 0xe0, + 0xb4, 0x06, 0xbc, 0x6b, 0xe2, 0xdd, 0x44, 0xe1, 0xe6, 0xc5, 0x94, 0xd2, 0x8c, 0x25, 0xd0, 0x8e, + 0xb5, 0x23, 0xee, 0xea, 0x2b, 0x30, 0xf1, 0xe2, 0x4b, 0xf2, 0x48, 0xe2, 0xc5, 0xa3, 0x01, 0x5f, + 0x88, 0x59, 0x5b, 0xfe, 0x8c, 0xe9, 0x65, 0xd9, 0x9e, 0xef, 0xd3, 0xcf, 0xf3, 0xed, 0x93, 0x81, + 0xfa, 0x0c, 0x27, 0x63, 0x89, 0x66, 0x1d, 0x34, 0x4d, 0x68, 0x9c, 0xfa, 0x51, 0xcc, 0x25, 0x87, + 0x55, 0xa5, 0xfa, 0xb3, 0x8e, 0xd3, 0x0a, 0x38, 0x0f, 0xc6, 0x14, 0xe1, 0x28, 0x44, 0x98, 0x31, + 0x2e, 0xb1, 0x0c, 0x39, 0x13, 0xda, 0xe7, 0x34, 0xd6, 0xa7, 0x03, 0xca, 0xa8, 0x08, 0x8d, 0xee, + 0xd5, 0x01, 0xbc, 0xcf, 0x70, 0x77, 0x38, 0xc6, 0x13, 0xd1, 0xa3, 0xd3, 0x84, 0x0a, 0xe9, 0x5d, + 0x83, 0xe3, 0x9c, 0x2a, 0x22, 0xce, 0x04, 0x85, 0x6d, 0x50, 0x89, 0x94, 0xd2, 0xb4, 0xce, 0xad, + 0x76, 0xad, 0x6b, 0xfb, 0xab, 0x74, 0xdf, 0x38, 0xcd, 0x7c, 0x8d, 0xed, 0x93, 0x11, 0x9d, 0xe0, + 0x5d, 0xec, 0x4a, 0xdd, 0x60, 0x85, 0x52, 0x8a, 0x58, 0xe3, 0x34, 0x73, 0xef, 0x0c, 0xd4, 0xfa, + 0x29, 0x23, 0x86, 0x07, 0x6d, 0xf0, 0x6f, 0x18, 0x0e, 0xd5, 0xa9, 0x83, 0x5e, 0xf6, 0xea, 0xb5, + 0xc1, 0xa1, 0x36, 0x18, 0x74, 0x13, 0xec, 0x8b, 0x84, 0x10, 0x2a, 0xf4, 0xca, 0xd5, 0xde, 0xea, + 0xb3, 0xfb, 0x56, 0x06, 0x7b, 0x6a, 0x19, 0xf8, 0x08, 0x2a, 0x7a, 0x7b, 0xd8, 0xda, 0x04, 0x17, + 0x4b, 0x71, 0x4e, 0xff, 0x98, 0xea, 0x28, 0xaf, 0xf9, 0xfc, 0xf1, 0xfd, 0x5a, 0x86, 0xd0, 0x46, + 0xeb, 0xaa, 0x75, 0x19, 0x59, 0x80, 0xbe, 0x47, 0x21, 0x20, 0x57, 0x4f, 0x21, 0x20, 0x5f, 0xd3, + 0x6f, 0x01, 0xba, 0x16, 0x78, 0x0b, 0xfe, 0x67, 0xb7, 0x86, 0x27, 0x5b, 0xc5, 0x6d, 0x6a, 0x72, + 0x1a, 0xbb, 0xb2, 0x01, 0x36, 0x14, 0xd0, 0xf6, 0x8e, 0xb6, 0x80, 0x29, 0x23, 0x37, 0x57, 0xef, + 0x0b, 0xd7, 0x9a, 0x2f, 0x5c, 0xeb, 0x6b, 0xe1, 0x5a, 0x2f, 0x4b, 0xb7, 0x34, 0x5f, 0xba, 0xa5, + 0xcf, 0xa5, 0x5b, 0x7a, 0xb8, 0x08, 0x42, 0x39, 0x4a, 0x06, 0x3e, 0xe1, 0x13, 0xc4, 0x99, 0xe0, + 0x2c, 0x46, 0xea, 0xf1, 0x64, 0x08, 0x32, 0x8d, 0xa8, 0x18, 0x54, 0xd4, 0xaf, 0x75, 0xf9, 0x13, + 0x00, 0x00, 0xff, 0xff, 0x21, 0x69, 0x1c, 0x41, 0xb2, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -448,8 +336,9 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Params queries all parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // BuildTx builds an unsigned transaction message for the given PKL. - BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) + // Schema queries the DID document by its id. And returns the required PKL + // information + Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error) // Sync queries the DID document by its id. And returns the required PKL // information Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) @@ -472,9 +361,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) { - out := new(BuildTxResponse) - err := c.cc.Invoke(ctx, "/vault.v1.Query/BuildTx", in, out, opts...) +func (c *queryClient) Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error) { + out := new(QuerySchemaResponse) + err := c.cc.Invoke(ctx, "/vault.v1.Query/Schema", in, out, opts...) if err != nil { return nil, err } @@ -494,8 +383,9 @@ func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.Ca type QueryServer interface { // Params queries all parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // BuildTx builds an unsigned transaction message for the given PKL. - BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error) + // Schema queries the DID document by its id. And returns the required PKL + // information + Schema(context.Context, *QuerySchemaRequest) (*QuerySchemaResponse, error) // Sync queries the DID document by its id. And returns the required PKL // information Sync(context.Context, *SyncRequest) (*SyncResponse, error) @@ -508,8 +398,8 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) BuildTx(ctx context.Context, req *BuildTxRequest) (*BuildTxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BuildTx not implemented") +func (*UnimplementedQueryServer) Schema(ctx context.Context, req *QuerySchemaRequest) (*QuerySchemaResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Schema not implemented") } func (*UnimplementedQueryServer) Sync(ctx context.Context, req *SyncRequest) (*SyncResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") @@ -537,20 +427,20 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_BuildTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BuildTxRequest) +func _Query_Schema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySchemaRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).BuildTx(ctx, in) + return srv.(QueryServer).Schema(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/vault.v1.Query/BuildTx", + FullMethod: "/vault.v1.Query/Schema", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).BuildTx(ctx, req.(*BuildTxRequest)) + return srv.(QueryServer).Schema(ctx, req.(*QuerySchemaRequest)) } return interceptor(ctx, in, info, handler) } @@ -582,8 +472,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Params_Handler, }, { - MethodName: "BuildTx", - Handler: _Query_BuildTx_Handler, + MethodName: "Schema", + Handler: _Query_Schema_Handler, }, { MethodName: "Sync", @@ -652,7 +542,7 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryIPFSRequest) Marshal() (dAtA []byte, err error) { +func (m *QuerySchemaRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -662,12 +552,12 @@ func (m *QueryIPFSRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryIPFSRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySchemaRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryIPFSRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySchemaRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -675,7 +565,7 @@ func (m *QueryIPFSRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryIPFSResponse) Marshal() (dAtA []byte, err error) { +func (m *QuerySchemaResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -685,25 +575,27 @@ func (m *QueryIPFSResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryIPFSResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySchemaResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryIPFSResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySchemaResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Ipfs { - i-- - if m.Ipfs { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.Schema != nil { + { + size, err := m.Schema.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -771,83 +663,6 @@ func (m *SyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BuildTxRequest) 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 *BuildTxRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BuildTxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Pkl) > 0 { - i -= len(m.Pkl) - copy(dAtA[i:], m.Pkl) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Pkl))) - i-- - dAtA[i] = 0x12 - } - if len(m.Did) > 0 { - i -= len(m.Did) - copy(dAtA[i:], m.Did) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BuildTxResponse) 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 *BuildTxResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BuildTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tx) > 0 { - i -= len(m.Tx) - copy(dAtA[i:], m.Tx) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Tx))) - i-- - dAtA[i] = 0x12 - } - if m.Success { - i-- - if m.Success { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -881,7 +696,7 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryIPFSRequest) Size() (n int) { +func (m *QuerySchemaRequest) Size() (n int) { if m == nil { return 0 } @@ -890,14 +705,15 @@ func (m *QueryIPFSRequest) Size() (n int) { return n } -func (m *QueryIPFSResponse) Size() (n int) { +func (m *QuerySchemaResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Ipfs { - n += 2 + if m.Schema != nil { + l = m.Schema.Size() + n += 1 + l + sovQuery(uint64(l)) } return n } @@ -927,39 +743,6 @@ func (m *SyncResponse) Size() (n int) { return n } -func (m *BuildTxRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Did) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Pkl) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *BuildTxResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Success { - n += 2 - } - l = len(m.Tx) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1102,7 +885,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryIPFSRequest) Unmarshal(dAtA []byte) error { +func (m *QuerySchemaRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1125,10 +908,10 @@ func (m *QueryIPFSRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryIPFSRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySchemaRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryIPFSRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1152,7 +935,7 @@ func (m *QueryIPFSRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryIPFSResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySchemaResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1175,17 +958,17 @@ func (m *QueryIPFSResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryIPFSResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QuerySchemaResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryIPFSResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QuerySchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ipfs", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1195,12 +978,28 @@ func (m *QueryIPFSResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.Ipfs = bool(v != 0) + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Schema == nil { + m.Schema = &Schema{} + } + if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1374,222 +1173,6 @@ func (m *SyncResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *BuildTxRequest) 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: BuildTxRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BuildTxRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Did = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pkl", 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.Pkl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BuildTxResponse) 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: BuildTxResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BuildTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Success = bool(v != 0) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", 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.Tx = 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/vault/types/query.pb.gw.go b/x/vault/types/query.pb.gw.go index 712b1dbe7..9f543fc92 100644 --- a/x/vault/types/query.pb.gw.go +++ b/x/vault/types/query.pb.gw.go @@ -51,38 +51,20 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -var ( - filter_Query_BuildTx_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_BuildTx_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BuildTxRequest +func request_Query_Schema_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySchemaRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BuildTx_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.BuildTx(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.Schema(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_BuildTx_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq BuildTxRequest +func local_request_Query_Schema_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySchemaRequest var metadata runtime.ServerMetadata - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BuildTx_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.BuildTx(ctx, &protoReq) + msg, err := server.Schema(ctx, &protoReq) return msg, metadata, err } @@ -152,7 +134,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("POST", pattern_Query_BuildTx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Schema_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -163,7 +145,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_BuildTx_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_Schema_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 { @@ -171,7 +153,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_BuildTx_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Schema_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -259,7 +241,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("POST", pattern_Query_BuildTx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Schema_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) @@ -268,14 +250,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_BuildTx_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_Schema_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_BuildTx_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Schema_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -305,7 +287,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_BuildTx_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "buildtx"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Schema_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "schema"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "sync"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -313,7 +295,7 @@ var ( var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_BuildTx_0 = runtime.ForwardResponseMessage + forward_Query_Schema_0 = runtime.ForwardResponseMessage forward_Query_Sync_0 = runtime.ForwardResponseMessage ) diff --git a/x/vault/types/vault.go b/x/vault/types/vault.go index 38a7b1512..0e039147d 100644 --- a/x/vault/types/vault.go +++ b/x/vault/types/vault.go @@ -3,15 +3,16 @@ package types import ( "github.com/ipfs/boxo/files" - "github.com/onsonr/sonr/pkg/dwn" + "github.com/onsonr/sonr/internal/dwn" + dwngen "github.com/onsonr/sonr/internal/dwn/gen" ) type Vault struct { FS files.Node } -func NewVault(keyshareJSON string, adddress string, chainID string, schema *dwn.Schema) (*Vault, error) { - dwnCfg := &dwn.Config{ +func NewVault(keyshareJSON string, adddress string, chainID string, schema *dwngen.Schema) (*Vault, error) { + dwnCfg := &dwngen.Config{ Motr: createMotrConfig(keyshareJSON, adddress, "sonr.id"), Ipfs: defaultIPFSConfig(), Sonr: defaultSonrConfig(chainID), @@ -26,23 +27,23 @@ func NewVault(keyshareJSON string, adddress string, chainID string, schema *dwn. }, nil } -func createMotrConfig(keyshareJSON string, adddress string, origin string) *dwn.Motr { - return &dwn.Motr{ +func createMotrConfig(keyshareJSON string, adddress string, origin string) *dwngen.Motr { + return &dwngen.Motr{ Keyshare: keyshareJSON, Address: adddress, Origin: origin, } } -func defaultIPFSConfig() *dwn.IPFS { - return &dwn.IPFS{ +func defaultIPFSConfig() *dwngen.IPFS { + return &dwngen.IPFS{ ApiUrl: "https://api.sonr-ipfs.land", GatewayUrl: "https://ipfs.sonr.land", } } -func defaultSonrConfig(chainID string) *dwn.Sonr { - return &dwn.Sonr{ +func defaultSonrConfig(chainID string) *dwngen.Sonr { + return &dwngen.Sonr{ ApiUrl: "https://api.sonr.land", GrpcUrl: "https://grpc.sonr.land", RpcUrl: "https://rpc.sonr.land",