diff --git a/.air.toml b/.air.toml new file mode 100644 index 000000000..d19d21810 --- /dev/null +++ b/.air.toml @@ -0,0 +1,50 @@ +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 = "bunx wrangler -c ./cmd/motr/wrangler.toml dev" +include_dir = ["cmd/dwn", "cmd/motr", "internal", "models", "pkl"] +include_ext = ["go", "templ", "html", "pkl", "js", "mjs"] +include_file = [ + "wrangler.toml", + "Dockerfile", + ".goreleaser.yaml", + "go.mod", + "devbox.json", + ".air.toml", +] +kill_delay = "2s" +log = "build-errors.log" +poll = false +poll_interval = 0 +post_cmd = [] +pre_cmd = ["templ generate"] +rerun = false +rerun_delay = 500 +send_interrupt = false +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/.cz.toml b/.cz.toml new file mode 100644 index 000000000..6a3f5e1cd --- /dev/null +++ b/.cz.toml @@ -0,0 +1,7 @@ +[tool.commitizen] +name = "cz_conventional_commits" +tag_format = "v$version" +version_scheme = "semver" +version = "0.1.1" +update_changelog_on_bump = true +major_version_zero = true diff --git a/.envrc b/.envrc deleted file mode 100644 index 0ff5d0ea0..000000000 --- a/.envrc +++ /dev/null @@ -1,10 +0,0 @@ -# Automatically sets up your devbox environment whenever you cd into this -# directory via our direnv integration: -# -# Enter Nushell -eval "$(devbox generate direnv --print-envrc)" - -# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/ -# for more details -# - diff --git a/.github/workflows/auto-bump.yml b/.github/workflows/auto-bump.yml deleted file mode 100644 index 7a7db6141..000000000 --- a/.github/workflows/auto-bump.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Automatic Tag Bump -on: - pull_request: - types: - - closed - branches: - - main - -jobs: - build: - if: github.event.pull_request.merged == true - runs-on: ubuntu-22.04 - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.merge_commit_sha }} - fetch-depth: "0" - - - name: Bump version and push tag - uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token - WITH_V: true - PRERELEASE: true diff --git a/.github/workflows/buf-publish.yml b/.github/workflows/buf-publish.yml index 2cf261ab1..6c14104fc 100644 --- a/.github/workflows/buf-publish.yml +++ b/.github/workflows/buf-publish.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: # Run `git checkout` - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # Install the `buf` CLI - uses: bufbuild/buf-setup-action@v1 # Push only the Input in `proto` to the BSR @@ -20,3 +20,17 @@ jobs: with: input: proto buf_token: ${{ secrets.BUF_TOKEN }} + upload_pkl: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + - name: Upload to R2 + uses: ryand56/r2-upload-action@latest + with: + r2-account-id: ${{ secrets.R2_ACCOUNT_ID }} + r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }} + r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }} + r2-bucket: pkljar + source-dir: pkl + destination-dir: . diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 973f818b6..27c87bde2 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -1,4 +1,4 @@ -name: docker image release +name: Publish Docker Image # NOTE: For this action to work, you must enable write permissions in your github repository settings. # Settings -> Actions -> General. "Workflow Permissions". Select "Read and write permissions". @@ -18,6 +18,10 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} +permissions: + contents: read + packages: write + jobs: release-image: runs-on: ubuntu-latest diff --git a/.github/workflows/docker-vm-release.yml b/.github/workflows/docker-vm-release.yml new file mode 100644 index 000000000..1e0292546 --- /dev/null +++ b/.github/workflows/docker-vm-release.yml @@ -0,0 +1,59 @@ +name: Publish VM Image + +on: + push: + branches: [master, develop, feature/*] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + GO_VERSION: 1.22 + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +permissions: + contents: read + packages: write + +jobs: + release-image: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - run: | + DOCKER_REGISTRY=`echo "${{ env.REGISTRY }}/${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'` + echo "DOCKER_REGISTRY=$DOCKER_REGISTRY" >> $GITHUB_ENV + + REPO_NAME=`echo "${{ github.repository }}" | awk -F'/' '{print $2}' | tr '[:upper:]' '[:lower:]'` + echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV + # login to ghcr (public) with codebase remaining private + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push sonrvm image + uses: docker/build-push-action@v6 + with: + push: true + target: sonrvm + tags: ghcr.io/${{ github.repository_owner }}/sonrvm:latest + + - name: Build and push sonr-runner image + uses: docker/build-push-action@v6 + with: + push: true + target: sonr-runner + tags: ghcr.io/${{ github.repository_owner }}/sonr-runner:latest diff --git a/.github/workflows/release-binary.yml b/.github/workflows/run-goreleaser.yml similarity index 78% rename from .github/workflows/release-binary.yml rename to .github/workflows/run-goreleaser.yml index 59b309562..8089f9d48 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/run-goreleaser.yml @@ -4,11 +4,13 @@ name: "Release Binary" on: push: + branches: + - master tags: - - '**' + - v* -# Test Locally with: -# goreleaser build --skip-validate --snapshot --clean +permissions: + contents: write jobs: goreleaser: @@ -20,9 +22,9 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.21' + go-version: "1.21" - name: Clean up dist directory run: rm -rf dist @@ -40,4 +42,4 @@ jobs: version: latest args: release --skip-validate --clean env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/testnet-hetzner.yml b/.github/workflows/testnet-hetzner.yml deleted file mode 100644 index 12a3a843b..000000000 --- a/.github/workflows/testnet-hetzner.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: cloud testnet - -on: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc - -# https://github.com///settings/secrets/actions/new -# - HCLOUD_TOKEN -# - SSH_PRIVATE_KEY - -env: - GO_VERSION: 1.21.0 - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - LOCALIC_PORT: 8080 - LOCALIC_AUTH_KEY: "" - HETZNER_SSH_KEY: "reece-hetzner" - # HETZNER_MACHINE_TYPE: "cpx31" # shared 4vCPU ($7/Mo) - HETZNER_MACHINE_TYPE: "ccx23" # dedicated 4 CPU 16GB Ram ($25/Mo) - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - launch-testnet: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: TimDaub/hetzner-cloud-deploy-server-action@v2 - with: - # gh-actions-tn-v1.0.0 - server-name: "gh-actions-tn-${{github.ref_name}}" - server-image: "ubuntu-22.04" - server-type: ${{ env.HETZNER_MACHINE_TYPE }} - ssh-key-name: ${{ env.HETZNER_SSH_KEY }} - delete-server: false - startup-timeout: 40000 # ms - hcloud-token: ${{ secrets.HCLOUD_TOKEN }} - - - name: Set env variables - run: | - mkdir -p ~/.ssh/ && ssh-keyscan -H $SERVER_IPV4 >> ~/.ssh/known_hosts - echo "SERVER_IPV4_ADDR=$SERVER_IPV4" >> $GITHUB_ENV - echo "GITHUB_SHA=${{github.sha}}" >> $GITHUB_ENV - echo "GITHUB_REF_NAME=${{ github.ref_name }}" >> $GITHUB_ENV - echo "LOCALIC_PORT=${{ env.LOCALIC_PORT }}" >> $GITHUB_ENV - - - uses: JasonEtco/create-an-issue@v2.9.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - filename: .github/testnet.md - update_existing: true - - - name: Testnet setup - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ env.SERVER_IPV4_ADDR }} - username: root - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: 22 - script: | - sudo apt-get update - sudo DEBIAN_FRONTEND=noninteractive apt -y install make gcc jq bison ca-certificates curl - - wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz - sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz - echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc - export PATH=$PATH:/usr/local/go/bin - bash # idk if I can use this or not - - sudo DEBIAN_FRONTEND=noninteractive apt-get remove -y containerd.io - sudo DEBIAN_FRONTEND=noninteractive apt-get -y install docker.io docker-compose - sudo apt-get update - - wget https://github.com/strangelove-ventures/interchaintest/releases/download/v8.2.0/local-ic && chmod +x local-ic - sudo mv local-ic /usr/local/bin - - git clone https://github.com/strangelove-ventures/heighliner.git && cd heighliner - go build && chmod +x heighliner - sudo mv heighliner /usr/local/bin - - cd ~/ - git clone https://github.com/${{ github.repository }}.git chain && cd chain - git checkout ${{ github.ref_name }} - make local-image - - sudo screen -S testnet -d -m local-ic start ibc-testnet --api-address=0.0.0.0 --api-port=${{ env.LOCALIC_PORT }} --auth-key=${{ env.LOCALIC_AUTH_KEY }} - diff --git a/.gitignore b/.gitignore index 2e48dbf2f..888347d22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Binaries +.data *.exe *.exe~ *.dll @@ -17,6 +18,9 @@ aof* *.out buf.lock +# Exclude embedded files +!internal/files/dist + # Dependency directories node_modules/ @@ -72,3 +76,6 @@ sonr deploy/**/data x/.DS_Store .aider* + + +!motr/build diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 000000000..0211f77bc --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,72 @@ +project_name: core + +release: + github: + owner: onsonr + name: core + name_template: "{{.Tag}}" + +# Only uncomment os, arch, and targets if you are NOT using cosmwasm / wasm-light-client. +# Windows, 386 (32bit), and ARM are not Wasm compatible. +builds: + - id: core + goos: + - linux + - darwin + goarch: + - amd64 + main: ./cmd/sonrd + binary: sonrd + builder: go + gobinary: go + command: build + ldflags: + - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} +archives: + - id: default + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}' + format: tar.gz + files: + - src: LICENSE* + - src: README* + - src: CHANGELOG* +snapshot: + name_template: "{{ .Version }}-SNAPSHOT-{{ .ShortCommit }}" +checksum: + name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" + algorithm: sha256 +dist: dist +env_files: + github_token: ~/.config/goreleaser/github_token + gitlab_token: ~/.config/goreleaser/gitlab_token + gitea_token: ~/.config/goreleaser/gitea_token +source: + name_template: "{{ .ProjectName }}-{{ .Version }}" + format: tar.gz +gomod: + gobinary: go +announce: + twitter: + message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}" + mastodon: + message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}" + server: "" + reddit: + title_template: "{{ .ProjectName }} {{ .Tag }} is out!" + url_template: "{{ .ReleaseURL }}" + discord: + message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}" + author: GoReleaser + color: "3888754" + icon_url: https://goreleaser.com/static/avatar.png + telegram: + message_template: "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}" + webhook: + message_template: '{ "message": "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}"}' + content_type: application/json; charset=utf-8 +git: + tag_sort: -version:refname +github_urls: + download: https://github.com +gitlab_urls: + download: https://gitlab.com diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb..519ea2303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,124 @@ +## v0.1.1 (2024-09-05) + +### Fix + +- **release**: remove unnecessary quotes in tag pattern + +### Refactor + +- remove unused image building workflow + +## 0.1.0 (2024-09-05) + +### Feat + +- add SQLite database support +- Add targets for templ and vault in Makefile and use only make in devbox.json +- Add models.go file with database table structs +- Convert constant SQL queries to functions in queries.go and update db.go to use prepared statements +- Simplify db.go implementation +- Update the db implementation to use the provided go library +- Add DBConfig and DBOption types +- Add DIDNamespace and PermissionScope enums +- Add database enum types +- Update `createPermissionsTable` to match Permissions struct +- Add createKeysharesTable to internal/db/db.go +- Add constant SQL queries to queries.go and use prepared statements in db.go +- Update createProfilesTable and add createPropertiesTable +- Update the `createCredentialsTable` method to match the proper Credential struct +- Add keyshares table +- Implement database layer for Vault node +- introduce database layer +- Add method to initialize SQLite database +- add persistent SQLite database support in WASM +- **orm**: remove unused ORM models +- implement API endpoints for profile management +- Merge zkgate.go and zkprop.go logic +- Uncomment and modify zkgate code to work with Property struct +- Add zkgate.go file +- add WASM build step to devbox.json +- add KeyCurve and KeyType to KeyInfo in genesis +- Update the `CreateWitness` and `CreateAccumulator` and `VerifyWitness` and `UpdateAccumulator` to Use the new `Accumulator` and `Witness` types. Then Clean up the code in the file and refactor the marshalling methods +- add basic vault command operations +- add initial wasm entrypoint +- Implement IPFS file, location, and filesystem abstractions +- add IPFS file system abstraction +- Add AddFile and AddFolder methods +- Update GetCID and GetIPNS functions to read data from IPFS node +- Add local filesystem check for IPFS and IPNS +- Improve IPFS client initialization and mount checking +- Update `EncodePublicKey` to be the inverse of `DecodePublicKey` +- add DID model definitions +- add DID method for each coin +- Expand KeyType enum and update KeyInfo message in genesis.proto +- Add whitelisted key types to genesis params +- Add DID grants protobuf definition +- Add fields to KeyInfo struct to distinguish CBOR and standard blockchain key types +- Add new message types for AssetInfo, ChainInfo, Endpoint, ExplorerInfo, FeeInfo, and KeyInfo +- run sonr-node container in testnet network and make network external +- Add docker-compose.yaml file to start a Sonr testnet node + +### Fix + +- update Makefile to use sonrd instead of wasmd +- Remove unused statement map and prepare statements +- Refactor database connection and statement handling +- update db implementation to use go-sqlite3 v0.18.2 +- Reorder the SQL statements in the tables.go file +- update go-sqlite3 dependency to version 1.14.23 +- Update module names in protobuf files +- Ensure IPFS client is initialized before pinning CID +- Use Unixfs().Get() instead of Cat() for IPFS and IPNS content retrieval +- Initialize IPFS client and check for mounted directories +- update default assets with correct asset types +- Fix EncodePublicKey method in KeyInfo struct +- remove unused imports and simplify KeyInfo message +- bind node ports to localhost +- Update docker-compose network name to dokploy-network +- Update network name to dokploy +- remove unused port mapping +- Update docker-compose.yaml to use correct volume path +- update docker-compose volume name +- Update docker-compose.yaml to use shell directly for sonrd command +- replace "sh" with "/bin/sh" in docker-compose.yaml command + +### Refactor + +- remove unused template file +- Replace PrimaryKey with Property struct in zkprop.go +- remove unused FileSystem interface +- remove unused functions and types +- update AssetInfo protobuf definition +- add field to +- Update KeyKind Enum to have proper naming conventions +- Update `DIDNamespace` to have proper naming convention +- expose ports directly in docker-compose +- remove unused port mappings +- streamline script execution +- use CMD instead of ENTRYPOINT in Dockerfile + +## v0.0.1 (2024-08-28) + +### Feat + +- configure Sonr testnet environment +- Update Dockerfile to start and run a testnet +- add Equal methods for AssetInfo and ChainInfo types +- Add ProveWitness and SyncVault RPCs +- Add MsgRegisterService to handle service registration +- Add MsgRegisterService to handle service registration +- add enums.pulsar.go file for PermissionScope enum + +### Fix + +- Update runner image dependencies for debian-11 +- **deps**: update golang image to 1.21 +- **chains**: update nomic chain build target +- Remove unused `Meta` message from `genesis.proto` +- Add ProveWitness and SyncVault RPCs + +### Refactor + +- **deps**: Upgrade Debian base image to 11 +- Simplify the types and properties to keep a consistent structure for the blockchain +- remove PERMISSION_SCOPE_IDENTIFIERS_ENS enum value diff --git a/Dockerfile b/Dockerfile index 7a53e42de..3f927f3de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,41 @@ -FROM golang:1.21-alpine AS go-builder +FROM jetpackio/devbox:latest AS sonrvm + +# Installing your devbox project +WORKDIR /code +USER root:root + +RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code + +USER ${DEVBOX_USER}:${DEVBOX_USER} + +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} process-compose.yaml process-compose.yaml + +RUN devbox run -- echo "Installed Packages." + +ENTRYPOINT ["devbox", "run"] + +# -------------------------------------------------------- +FROM jetpackio/devbox:latest AS sonr-runner + +WORKDIR /code +USER root:root + +RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code + +USER ${DEVBOX_USER}:${DEVBOX_USER} + +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} process-compose.yaml process-compose.yaml +COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} . . + +RUN devbox run -- echo "Installed Packages." + +RUN git config --global --add safe.directory /code +ENTRYPOINT ["devbox", "run", "testnet"] + +# -------------------------------------------------------- +FROM golang:1.22-alpine AS go-builder SHELL ["/bin/sh", "-ecuxo", "pipefail"] @@ -29,16 +66,28 @@ RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \ && (file /code/build/sonrd | grep "statically linked") # -------------------------------------------------------- -FROM alpine:3.16 +FROM debian:11-slim COPY --from=go-builder /code/build/sonrd /usr/bin/sonrd -# Install dependencies used for Starship -RUN apk add --no-cache curl make bash jq sed +# Install dependencies for Debian 11 +RUN apt-get update && apt-get install -y \ + curl \ + make \ + bash \ + jq \ + sed \ + && rm -rf /var/lib/apt/lists/* + +COPY scripts/test_node.sh /usr/bin/test_node.sh WORKDIR /opt # rest server, tendermint p2p, tendermint rpc EXPOSE 1317 26656 26657 6060 +<<<<<<< HEAD +CMD ["test_node.sh"] +======= ENTRYPOINT ["/usr/bin/sonrd"] +>>>>>>> master diff --git a/Makefile b/Makefile index 200e23b1d..03fc8475f 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ SIMAPP = ./app # for dockerized protobuf tools DOCKER := $(shell which docker) -HTTPS_GIT := github.com/onsonr/hway.git +HTTPS_GIT := github.com/onsonr/sonr.git export GO111MODULE = on @@ -213,7 +213,7 @@ proto-check-breaking: ## --- Testnet Utilities --- get-localic: @echo "Installing local-interchain" - git clone --branch v8.2.0 https://github.com/strangelove-ventures/interchaintest.git interchaintest-downloader + git clone --branch v8.7.0 https://github.com/strangelove-ventures/interchaintest.git interchaintest-downloader cd interchaintest-downloader/local-interchain && make install @echo ✅ local-interchain installed $(shell which local-ic) @@ -230,7 +230,7 @@ local-image: ifeq (,$(shell which heighliner)) echo 'heighliner' binary not found. Consider running `make get-heighliner` else - heighliner build -c sonr --local -f chains.yaml + heighliner build -c sonrd --local -f chains.yaml endif .PHONY: get-heighliner local-image is-localic-installed @@ -292,3 +292,40 @@ sh-testnet: mod-tidy CHAIN_ID="sonr-testnet-1" BLOCK_TIME="1000ms" CLEAN=true sh scripts/test_node.sh .PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet + + + +############################################################################### +### templ & vault ### +############################################################################### + +.PHONY: dwn motr + +dwn: + @echo "(dwn) Building dwn.wasm -> IPFS Vault" + GOOS=js GOARCH=wasm go build -o ./internal/vfs/dwn.wasm ./cmd/dwn + +motr: + @echo "(motr) Building app.wasm -> Deploy to Cloudflare Workers" + GOOS=js GOARCH=wasm go build -o ./cmd/motr/build/app.wasm ./cmd/motr/main.go + +############################################################################### +### help ### +############################################################################### + + +help: + @echo "Usage: make " + @echo "" + @echo "Available targets:" + @echo " install : Install the binary" + @echo " local-image : Install the docker image" + @echo " proto-gen : Generate code from proto files" + @echo " testnet : Local devnet with IBC" + @echo " sh-testnet : Shell local devnet" + @echo " ictest-basic : Basic end-to-end test" + @echo " ictest-ibc : IBC end-to-end test" + @echo " templ : Generate templ files" + @echo " vault : Build vault.wasm" + +.PHONY: help diff --git a/README.md b/README.md index 53e3230b4..5945b3aee 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ # `sonr` - Sonr Chain -[![Go Reference](https://pkg.go.dev/badge/github.com/didao-org/sonr.svg)](https://pkg.go.dev/github.com/didao-org/sonr) -![GitHub commit activity](https://img.shields.io/github/commit-activity/w/didao-org/sonr) -![GitHub Release Date - Published_At](https://img.shields.io/github/release-date/didao-org/sonr) +[![Go Reference](https://pkg.go.dev/badge/github.com/onsonr/sonr.svg)](https://pkg.go.dev/github.com/onsonr/sonr) +![GitHub commit activity](https://img.shields.io/github/commit-activity/w/onsonr/sonr) +![GitHub Release Date - Published_At](https://img.shields.io/github/release-date/onsonr/sonr) [![Static Badge](https://img.shields.io/badge/homepage-sonr.io-blue?style=flat-square)](https://sonr.io) ![Discord](https://img.shields.io/discord/843061375160156170?logo=discord&label=Discord%20Chat) -[![Go Report Card](https://goreportcard.com/badge/github.com/didao-org/sonr)](https://goreportcard.com/report/github.com/didao-org/sonr) +[![Go Report Card](https://goreportcard.com/badge/github.com/onsonr/sonr)](https://goreportcard.com/report/github.com/onsonr/sonr) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=sonrhq_sonr&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=sonr-io_sonr) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=sonrhq_sonr&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=sonr-io_sonr) [![Mutable.ai Auto Wiki](https://img.shields.io/badge/Auto_Wiki-Mutable.ai-blue)](https://wiki.mutable.ai/di-dao/sonr) @@ -21,6 +21,22 @@ Sonr is a combination of decentralized primitives. Fundamentally, it is a peer-t
+## Components + +### `sonrd` + +The main blockchain node that runs the `sonr` chain. It is responsible for maintaining the state of the chain, including IPFS based vaults, and did documents. + +### `vault` + +The `vault` is a wasm module that is compiled and deployed to IPFS on behalf of the user. It is responsible for storing and retrieving encrypted data. + +- SQLite Database backend +- Encryption via admonition +- Authentication via webauthn +- Authorization via Macroons +- HTTP API + ## Acknowledgements Sonr would not have been possible without the direct and indirect support of the following organizations and individuals: @@ -35,7 +51,7 @@ Sonr would not have been possible without the direct and indirect support of the ## Community & Support -- [Forum](https://github.com/onsonr/hway/discussions) -- [Issues](https://github.com/onsonr/hway/issues) +- [Forum](https://github.com/onsonr/sonr/discussions) +- [Issues](https://github.com/onsonr/sonr/issues) - [Twitter](https://sonr.io/twitter) - [Dev Chat](https://sonr.io/discord) diff --git a/api/did/module/v1/module.pulsar.go b/api/did/module/v1/module.pulsar.go index 7c1691072..2b23de2d5 100644 --- a/api/did/module/v1/module.pulsar.go +++ b/api/did/module/v1/module.pulsar.go @@ -104,9 +104,9 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -120,9 +120,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -136,9 +136,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", descriptor.FullName())) } } @@ -156,9 +156,9 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -176,9 +176,9 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -189,9 +189,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module")) } - panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -201,7 +201,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in onsonr.hway.did.module.v1.Module", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in onsonr.sonr.did.module.v1.Module", d.FullName())) } panic("unreachable") } @@ -415,26 +415,26 @@ var File_did_module_v1_module_proto protoreflect.FileDescriptor var file_did_module_v1_module_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x6e, - 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, + 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x68, - 0x77, 0x61, 0x79, 0x42, 0xe8, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x6e, 0x73, 0x6f, - 0x6e, 0x72, 0x2e, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, + 0x6f, 0x6e, 0x72, 0x42, 0xe8, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x6e, 0x73, 0x6f, + 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x48, 0x44, 0x4d, 0xaa, 0x02, - 0x19, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x48, 0x77, 0x61, 0x79, 0x2e, 0x44, 0x69, 0x64, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x53, 0x44, 0x4d, 0xaa, 0x02, + 0x19, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x53, 0x6f, 0x6e, 0x72, 0x2e, 0x44, 0x69, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x4f, 0x6e, 0x73, - 0x6f, 0x6e, 0x72, 0x5c, 0x48, 0x77, 0x61, 0x79, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, + 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x25, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c, - 0x48, 0x77, 0x61, 0x79, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, + 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x1d, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x48, 0x77, 0x61, 0x79, 0x3a, 0x3a, 0x44, + 0x1d, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x53, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } @@ -453,7 +453,7 @@ func file_did_module_v1_module_proto_rawDescGZIP() []byte { var file_did_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_did_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: onsonr.hway.did.module.v1.Module + (*Module)(nil), // 0: onsonr.sonr.did.module.v1.Module } var file_did_module_v1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type diff --git a/api/did/v1/genesis.pulsar.go b/api/did/v1/genesis.pulsar.go index 42017748b..19e83d410 100644 --- a/api/did/v1/genesis.pulsar.go +++ b/api/did/v1/genesis.pulsar.go @@ -15,14 +15,16 @@ import ( ) var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_global_integrity protoreflect.FieldDescriptor ) func init() { file_did_v1_genesis_proto_init() md_GenesisState = File_did_v1_genesis_proto.Messages().ByName("GenesisState") fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_global_integrity = md_GenesisState.Fields().ByName("global_integrity") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -96,6 +98,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if x.GlobalIntegrity != nil { + value := protoreflect.ValueOfMessage(x.GlobalIntegrity.ProtoReflect()) + if !f(fd_GenesisState_global_integrity, value) { + return + } + } } // Has reports whether a field is populated. @@ -113,6 +121,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool switch fd.FullName() { case "did.v1.GenesisState.params": return x.Params != nil + case "did.v1.GenesisState.global_integrity": + return x.GlobalIntegrity != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -131,6 +141,8 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.GenesisState.params": x.Params = nil + case "did.v1.GenesisState.global_integrity": + x.GlobalIntegrity = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -150,6 +162,9 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "did.v1.GenesisState.params": value := x.Params return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.GenesisState.global_integrity": + value := x.GlobalIntegrity + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -172,6 +187,8 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value switch fd.FullName() { case "did.v1.GenesisState.params": x.Params = value.Message().Interface().(*Params) + case "did.v1.GenesisState.global_integrity": + x.GlobalIntegrity = value.Message().Interface().(*GlobalIntegrity) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -197,6 +214,11 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p x.Params = new(Params) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "did.v1.GenesisState.global_integrity": + if x.GlobalIntegrity == nil { + x.GlobalIntegrity = new(GlobalIntegrity) + } + return protoreflect.ValueOfMessage(x.GlobalIntegrity.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -213,6 +235,9 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "did.v1.GenesisState.params": m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.GenesisState.global_integrity": + m := new(GlobalIntegrity) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GenesisState")) @@ -286,6 +311,10 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } + if x.GlobalIntegrity != nil { + l = options.Size(x.GlobalIntegrity) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -315,6 +344,20 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.GlobalIntegrity != nil { + encoded, err := options.Marshal(x.GlobalIntegrity) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } if x.Params != nil { encoded, err := options.Marshal(x.Params) if err != nil { @@ -414,6 +457,640 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GlobalIntegrity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.GlobalIntegrity == nil { + x.GlobalIntegrity = &GlobalIntegrity{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.GlobalIntegrity); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_GlobalIntegrity protoreflect.MessageDescriptor + fd_GlobalIntegrity_controller protoreflect.FieldDescriptor + fd_GlobalIntegrity_seed protoreflect.FieldDescriptor + fd_GlobalIntegrity_accumulator protoreflect.FieldDescriptor + fd_GlobalIntegrity_count protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_GlobalIntegrity = File_did_v1_genesis_proto.Messages().ByName("GlobalIntegrity") + fd_GlobalIntegrity_controller = md_GlobalIntegrity.Fields().ByName("controller") + fd_GlobalIntegrity_seed = md_GlobalIntegrity.Fields().ByName("seed") + fd_GlobalIntegrity_accumulator = md_GlobalIntegrity.Fields().ByName("accumulator") + fd_GlobalIntegrity_count = md_GlobalIntegrity.Fields().ByName("count") +} + +var _ protoreflect.Message = (*fastReflection_GlobalIntegrity)(nil) + +type fastReflection_GlobalIntegrity GlobalIntegrity + +func (x *GlobalIntegrity) ProtoReflect() protoreflect.Message { + return (*fastReflection_GlobalIntegrity)(x) +} + +func (x *GlobalIntegrity) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GlobalIntegrity_messageType fastReflection_GlobalIntegrity_messageType +var _ protoreflect.MessageType = fastReflection_GlobalIntegrity_messageType{} + +type fastReflection_GlobalIntegrity_messageType struct{} + +func (x fastReflection_GlobalIntegrity_messageType) Zero() protoreflect.Message { + return (*fastReflection_GlobalIntegrity)(nil) +} +func (x fastReflection_GlobalIntegrity_messageType) New() protoreflect.Message { + return new(fastReflection_GlobalIntegrity) +} +func (x fastReflection_GlobalIntegrity_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GlobalIntegrity +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GlobalIntegrity) Descriptor() protoreflect.MessageDescriptor { + return md_GlobalIntegrity +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GlobalIntegrity) Type() protoreflect.MessageType { + return _fastReflection_GlobalIntegrity_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GlobalIntegrity) New() protoreflect.Message { + return new(fastReflection_GlobalIntegrity) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GlobalIntegrity) Interface() protoreflect.ProtoMessage { + return (*GlobalIntegrity)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GlobalIntegrity) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_GlobalIntegrity_controller, value) { + return + } + } + if x.Seed != "" { + value := protoreflect.ValueOfString(x.Seed) + if !f(fd_GlobalIntegrity_seed, value) { + return + } + } + if len(x.Accumulator) != 0 { + value := protoreflect.ValueOfBytes(x.Accumulator) + if !f(fd_GlobalIntegrity_accumulator, value) { + return + } + } + if x.Count != uint64(0) { + value := protoreflect.ValueOfUint64(x.Count) + if !f(fd_GlobalIntegrity_count, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GlobalIntegrity) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.GlobalIntegrity.controller": + return x.Controller != "" + case "did.v1.GlobalIntegrity.seed": + return x.Seed != "" + case "did.v1.GlobalIntegrity.accumulator": + return len(x.Accumulator) != 0 + case "did.v1.GlobalIntegrity.count": + return x.Count != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GlobalIntegrity) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.GlobalIntegrity.controller": + x.Controller = "" + case "did.v1.GlobalIntegrity.seed": + x.Seed = "" + case "did.v1.GlobalIntegrity.accumulator": + x.Accumulator = nil + case "did.v1.GlobalIntegrity.count": + x.Count = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GlobalIntegrity) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.GlobalIntegrity.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + case "did.v1.GlobalIntegrity.seed": + value := x.Seed + return protoreflect.ValueOfString(value) + case "did.v1.GlobalIntegrity.accumulator": + value := x.Accumulator + return protoreflect.ValueOfBytes(value) + case "did.v1.GlobalIntegrity.count": + value := x.Count + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GlobalIntegrity) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.GlobalIntegrity.controller": + x.Controller = value.Interface().(string) + case "did.v1.GlobalIntegrity.seed": + x.Seed = value.Interface().(string) + case "did.v1.GlobalIntegrity.accumulator": + x.Accumulator = value.Bytes() + case "did.v1.GlobalIntegrity.count": + x.Count = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GlobalIntegrity) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.GlobalIntegrity.controller": + panic(fmt.Errorf("field controller of message did.v1.GlobalIntegrity is not mutable")) + case "did.v1.GlobalIntegrity.seed": + panic(fmt.Errorf("field seed of message did.v1.GlobalIntegrity is not mutable")) + case "did.v1.GlobalIntegrity.accumulator": + panic(fmt.Errorf("field accumulator of message did.v1.GlobalIntegrity is not mutable")) + case "did.v1.GlobalIntegrity.count": + panic(fmt.Errorf("field count of message did.v1.GlobalIntegrity is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GlobalIntegrity) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.GlobalIntegrity.controller": + return protoreflect.ValueOfString("") + case "did.v1.GlobalIntegrity.seed": + return protoreflect.ValueOfString("") + case "did.v1.GlobalIntegrity.accumulator": + return protoreflect.ValueOfBytes(nil) + case "did.v1.GlobalIntegrity.count": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.GlobalIntegrity")) + } + panic(fmt.Errorf("message did.v1.GlobalIntegrity does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GlobalIntegrity) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.GlobalIntegrity", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GlobalIntegrity) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GlobalIntegrity) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GlobalIntegrity) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GlobalIntegrity) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GlobalIntegrity) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Seed) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Accumulator) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Count != 0 { + n += 1 + runtime.Sov(uint64(x.Count)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GlobalIntegrity) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Count != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Count)) + i-- + dAtA[i] = 0x20 + } + if len(x.Accumulator) > 0 { + i -= len(x.Accumulator) + copy(dAtA[i:], x.Accumulator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Accumulator))) + i-- + dAtA[i] = 0x1a + } + if len(x.Seed) > 0 { + i -= len(x.Seed) + copy(dAtA[i:], x.Seed) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Seed))) + i-- + dAtA[i] = 0x12 + } + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GlobalIntegrity) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GlobalIntegrity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GlobalIntegrity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Seed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Seed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accumulator", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Accumulator = append(x.Accumulator[:0], dAtA[iNdEx:postIndex]...) + if x.Accumulator == nil { + x.Accumulator = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + x.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Count |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -500,68 +1177,161 @@ func (x *_Params_1_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_Params_2_list)(nil) +var _ protoreflect.Map = (*_Params_2_map)(nil) -type _Params_2_list struct { - list *[]*ChainInfo +type _Params_2_map struct { + m *map[string]*KeyInfo } -func (x *_Params_2_list) Len() int { +func (x *_Params_2_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_Params_2_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfMessage(v.ProtoReflect()) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_Params_2_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_Params_2_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_Params_2_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_2_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*KeyInfo) + (*x.m)[concreteKey] = concreteValue +} + +func (x *_Params_2_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if ok { + return protoreflect.ValueOfMessage(v.ProtoReflect()) + } + newValue := new(KeyInfo) + (*x.m)[concreteKey] = newValue + return protoreflect.ValueOfMessage(newValue.ProtoReflect()) +} + +func (x *_Params_2_map) NewValue() protoreflect.Value { + v := new(KeyInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_2_map) IsValid() bool { + return x.m != nil +} + +var _ protoreflect.List = (*_Params_6_list)(nil) + +type _Params_6_list struct { + list *[]string +} + +func (x *_Params_6_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Params_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +func (x *_Params_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_Params_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ChainInfo) +func (x *_Params_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_Params_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ChainInfo) +func (x *_Params_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_Params_2_list) AppendMutable() protoreflect.Value { - v := new(ChainInfo) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) +func (x *_Params_6_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field AttestationFormats as it is not of Message kind")) } -func (x *_Params_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } +func (x *_Params_6_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_Params_2_list) NewElement() protoreflect.Value { - v := new(ChainInfo) - return protoreflect.ValueOfMessage(v.ProtoReflect()) +func (x *_Params_6_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) } -func (x *_Params_2_list) IsValid() bool { +func (x *_Params_6_list) IsValid() bool { return x.list != nil } var ( - md_Params protoreflect.MessageDescriptor - fd_Params_whitelisted_assets protoreflect.FieldDescriptor - fd_Params_whitelisted_chains protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_whitelisted_assets protoreflect.FieldDescriptor + fd_Params_allowed_public_keys protoreflect.FieldDescriptor + fd_Params_ipfs_active protoreflect.FieldDescriptor + fd_Params_localhost_registration_enabled protoreflect.FieldDescriptor + fd_Params_conveyance_preference protoreflect.FieldDescriptor + fd_Params_attestation_formats protoreflect.FieldDescriptor ) func init() { file_did_v1_genesis_proto_init() md_Params = File_did_v1_genesis_proto.Messages().ByName("Params") fd_Params_whitelisted_assets = md_Params.Fields().ByName("whitelisted_assets") - fd_Params_whitelisted_chains = md_Params.Fields().ByName("whitelisted_chains") + fd_Params_allowed_public_keys = md_Params.Fields().ByName("allowed_public_keys") + fd_Params_ipfs_active = md_Params.Fields().ByName("ipfs_active") + fd_Params_localhost_registration_enabled = md_Params.Fields().ByName("localhost_registration_enabled") + fd_Params_conveyance_preference = md_Params.Fields().ByName("conveyance_preference") + fd_Params_attestation_formats = md_Params.Fields().ByName("attestation_formats") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -573,7 +1343,7 @@ func (x *Params) ProtoReflect() protoreflect.Message { } func (x *Params) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_genesis_proto_msgTypes[1] + mi := &file_did_v1_genesis_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -635,9 +1405,33 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } - if len(x.WhitelistedChains) != 0 { - value := protoreflect.ValueOfList(&_Params_2_list{list: &x.WhitelistedChains}) - if !f(fd_Params_whitelisted_chains, value) { + if len(x.AllowedPublicKeys) != 0 { + value := protoreflect.ValueOfMap(&_Params_2_map{m: &x.AllowedPublicKeys}) + if !f(fd_Params_allowed_public_keys, value) { + return + } + } + if x.IpfsActive != false { + value := protoreflect.ValueOfBool(x.IpfsActive) + if !f(fd_Params_ipfs_active, value) { + return + } + } + if x.LocalhostRegistrationEnabled != false { + value := protoreflect.ValueOfBool(x.LocalhostRegistrationEnabled) + if !f(fd_Params_localhost_registration_enabled, value) { + return + } + } + if x.ConveyancePreference != "" { + value := protoreflect.ValueOfString(x.ConveyancePreference) + if !f(fd_Params_conveyance_preference, value) { + return + } + } + if len(x.AttestationFormats) != 0 { + value := protoreflect.ValueOfList(&_Params_6_list{list: &x.AttestationFormats}) + if !f(fd_Params_attestation_formats, value) { return } } @@ -658,8 +1452,16 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "did.v1.Params.whitelisted_assets": return len(x.WhitelistedAssets) != 0 - case "did.v1.Params.whitelisted_chains": - return len(x.WhitelistedChains) != 0 + case "did.v1.Params.allowed_public_keys": + return len(x.AllowedPublicKeys) != 0 + case "did.v1.Params.ipfs_active": + return x.IpfsActive != false + case "did.v1.Params.localhost_registration_enabled": + return x.LocalhostRegistrationEnabled != false + case "did.v1.Params.conveyance_preference": + return x.ConveyancePreference != "" + case "did.v1.Params.attestation_formats": + return len(x.AttestationFormats) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -678,8 +1480,16 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.Params.whitelisted_assets": x.WhitelistedAssets = nil - case "did.v1.Params.whitelisted_chains": - x.WhitelistedChains = nil + case "did.v1.Params.allowed_public_keys": + x.AllowedPublicKeys = nil + case "did.v1.Params.ipfs_active": + x.IpfsActive = false + case "did.v1.Params.localhost_registration_enabled": + x.LocalhostRegistrationEnabled = false + case "did.v1.Params.conveyance_preference": + x.ConveyancePreference = "" + case "did.v1.Params.attestation_formats": + x.AttestationFormats = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -702,11 +1512,26 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro } listValue := &_Params_1_list{list: &x.WhitelistedAssets} return protoreflect.ValueOfList(listValue) - case "did.v1.Params.whitelisted_chains": - if len(x.WhitelistedChains) == 0 { - return protoreflect.ValueOfList(&_Params_2_list{}) + case "did.v1.Params.allowed_public_keys": + if len(x.AllowedPublicKeys) == 0 { + return protoreflect.ValueOfMap(&_Params_2_map{}) } - listValue := &_Params_2_list{list: &x.WhitelistedChains} + mapValue := &_Params_2_map{m: &x.AllowedPublicKeys} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.Params.ipfs_active": + value := x.IpfsActive + return protoreflect.ValueOfBool(value) + case "did.v1.Params.localhost_registration_enabled": + value := x.LocalhostRegistrationEnabled + return protoreflect.ValueOfBool(value) + case "did.v1.Params.conveyance_preference": + value := x.ConveyancePreference + return protoreflect.ValueOfString(value) + case "did.v1.Params.attestation_formats": + if len(x.AttestationFormats) == 0 { + return protoreflect.ValueOfList(&_Params_6_list{}) + } + listValue := &_Params_6_list{list: &x.AttestationFormats} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -732,10 +1557,20 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto lv := value.List() clv := lv.(*_Params_1_list) x.WhitelistedAssets = *clv.list - case "did.v1.Params.whitelisted_chains": + case "did.v1.Params.allowed_public_keys": + mv := value.Map() + cmv := mv.(*_Params_2_map) + x.AllowedPublicKeys = *cmv.m + case "did.v1.Params.ipfs_active": + x.IpfsActive = value.Bool() + case "did.v1.Params.localhost_registration_enabled": + x.LocalhostRegistrationEnabled = value.Bool() + case "did.v1.Params.conveyance_preference": + x.ConveyancePreference = value.Interface().(string) + case "did.v1.Params.attestation_formats": lv := value.List() - clv := lv.(*_Params_2_list) - x.WhitelistedChains = *clv.list + clv := lv.(*_Params_6_list) + x.AttestationFormats = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -762,12 +1597,24 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore } value := &_Params_1_list{list: &x.WhitelistedAssets} return protoreflect.ValueOfList(value) - case "did.v1.Params.whitelisted_chains": - if x.WhitelistedChains == nil { - x.WhitelistedChains = []*ChainInfo{} + case "did.v1.Params.allowed_public_keys": + if x.AllowedPublicKeys == nil { + x.AllowedPublicKeys = make(map[string]*KeyInfo) } - value := &_Params_2_list{list: &x.WhitelistedChains} + value := &_Params_2_map{m: &x.AllowedPublicKeys} + return protoreflect.ValueOfMap(value) + case "did.v1.Params.attestation_formats": + if x.AttestationFormats == nil { + x.AttestationFormats = []string{} + } + value := &_Params_6_list{list: &x.AttestationFormats} return protoreflect.ValueOfList(value) + case "did.v1.Params.ipfs_active": + panic(fmt.Errorf("field ipfs_active of message did.v1.Params is not mutable")) + case "did.v1.Params.localhost_registration_enabled": + panic(fmt.Errorf("field localhost_registration_enabled of message did.v1.Params is not mutable")) + case "did.v1.Params.conveyance_preference": + panic(fmt.Errorf("field conveyance_preference of message did.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -784,9 +1631,18 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor case "did.v1.Params.whitelisted_assets": list := []*AssetInfo{} return protoreflect.ValueOfList(&_Params_1_list{list: &list}) - case "did.v1.Params.whitelisted_chains": - list := []*ChainInfo{} - return protoreflect.ValueOfList(&_Params_2_list{list: &list}) + case "did.v1.Params.allowed_public_keys": + m := make(map[string]*KeyInfo) + return protoreflect.ValueOfMap(&_Params_2_map{m: &m}) + case "did.v1.Params.ipfs_active": + return protoreflect.ValueOfBool(false) + case "did.v1.Params.localhost_registration_enabled": + return protoreflect.ValueOfBool(false) + case "did.v1.Params.conveyance_preference": + return protoreflect.ValueOfString("") + case "did.v1.Params.attestation_formats": + list := []string{} + return protoreflect.ValueOfList(&_Params_6_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) @@ -862,9 +1718,45 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } - if len(x.WhitelistedChains) > 0 { - for _, e := range x.WhitelistedChains { - l = options.Size(e) + if len(x.AllowedPublicKeys) > 0 { + SiZeMaP := func(k string, v *KeyInfo) { + l := 0 + if v != nil { + l = options.Size(v) + } + l += 1 + runtime.Sov(uint64(l)) + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.AllowedPublicKeys)) + for k := range x.AllowedPublicKeys { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.AllowedPublicKeys[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.AllowedPublicKeys { + SiZeMaP(k, v) + } + } + } + if x.IpfsActive { + n += 2 + } + if x.LocalhostRegistrationEnabled { + n += 2 + } + l = len(x.ConveyancePreference) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.AttestationFormats) > 0 { + for _, s := range x.AttestationFormats { + l = len(s) n += 1 + l + runtime.Sov(uint64(l)) } } @@ -897,9 +1789,46 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.WhitelistedChains) > 0 { - for iNdEx := len(x.WhitelistedChains) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.WhitelistedChains[iNdEx]) + if len(x.AttestationFormats) > 0 { + for iNdEx := len(x.AttestationFormats) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AttestationFormats[iNdEx]) + copy(dAtA[i:], x.AttestationFormats[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationFormats[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(x.ConveyancePreference) > 0 { + i -= len(x.ConveyancePreference) + copy(dAtA[i:], x.ConveyancePreference) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ConveyancePreference))) + i-- + dAtA[i] = 0x2a + } + if x.LocalhostRegistrationEnabled { + i-- + if x.LocalhostRegistrationEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if x.IpfsActive { + i-- + if x.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(x.AllowedPublicKeys) > 0 { + MaRsHaLmAp := func(k string, v *KeyInfo) (protoiface.MarshalOutput, error) { + baseI := i + encoded, err := options.Marshal(v) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -911,6 +1840,39 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForAllowedPublicKeys := make([]string, 0, len(x.AllowedPublicKeys)) + for k := range x.AllowedPublicKeys { + keysForAllowedPublicKeys = append(keysForAllowedPublicKeys, string(k)) + } + sort.Slice(keysForAllowedPublicKeys, func(i, j int) bool { + return keysForAllowedPublicKeys[i] < keysForAllowedPublicKeys[j] + }) + for iNdEx := len(keysForAllowedPublicKeys) - 1; iNdEx >= 0; iNdEx-- { + v := x.AllowedPublicKeys[string(keysForAllowedPublicKeys[iNdEx])] + out, err := MaRsHaLmAp(keysForAllowedPublicKeys[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.AllowedPublicKeys { + v := x.AllowedPublicKeys[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } } } if len(x.WhitelistedAssets) > 0 { @@ -1014,7 +1976,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WhitelistedChains", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AllowedPublicKeys", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1041,10 +2003,4575 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.WhitelistedChains = append(x.WhitelistedChains, &ChainInfo{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.WhitelistedChains[len(x.WhitelistedChains)-1]); err != nil { + if x.AllowedPublicKeys == nil { + x.AllowedPublicKeys = make(map[string]*KeyInfo) + } + var mapkey string + var mapvalue *KeyInfo + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapkey > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postmsgIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = &KeyInfo{} + if err := options.Unmarshal(dAtA[iNdEx:postmsgIndex], mapvalue); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + x.AllowedPublicKeys[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", 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.IpfsActive = bool(v != 0) + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LocalhostRegistrationEnabled", 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.LocalhostRegistrationEnabled = bool(v != 0) + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ConveyancePreference = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AttestationFormats = append(x.AttestationFormats, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_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_did_v1_genesis_proto_init() + md_AssetInfo = File_did_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_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_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 != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(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 "did.v1.AssetInfo.index": + return x.Index != int64(0) + case "did.v1.AssetInfo.hrp": + return x.Hrp != "" + case "did.v1.AssetInfo.symbol": + return x.Symbol != "" + case "did.v1.AssetInfo.asset_type": + return x.AssetType != 0 + case "did.v1.AssetInfo.name": + return x.Name != "" + case "did.v1.AssetInfo.icon_url": + return x.IconUrl != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.AssetInfo")) + } + panic(fmt.Errorf("message did.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 "did.v1.AssetInfo.index": + x.Index = int64(0) + case "did.v1.AssetInfo.hrp": + x.Hrp = "" + case "did.v1.AssetInfo.symbol": + x.Symbol = "" + case "did.v1.AssetInfo.asset_type": + x.AssetType = 0 + case "did.v1.AssetInfo.name": + x.Name = "" + case "did.v1.AssetInfo.icon_url": + x.IconUrl = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.AssetInfo")) + } + panic(fmt.Errorf("message did.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 "did.v1.AssetInfo.index": + value := x.Index + return protoreflect.ValueOfInt64(value) + case "did.v1.AssetInfo.hrp": + value := x.Hrp + return protoreflect.ValueOfString(value) + case "did.v1.AssetInfo.symbol": + value := x.Symbol + return protoreflect.ValueOfString(value) + case "did.v1.AssetInfo.asset_type": + value := x.AssetType + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.AssetInfo.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "did.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: did.v1.AssetInfo")) + } + panic(fmt.Errorf("message did.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 "did.v1.AssetInfo.index": + x.Index = value.Int() + case "did.v1.AssetInfo.hrp": + x.Hrp = value.Interface().(string) + case "did.v1.AssetInfo.symbol": + x.Symbol = value.Interface().(string) + case "did.v1.AssetInfo.asset_type": + x.AssetType = (AssetType)(value.Enum()) + case "did.v1.AssetInfo.name": + x.Name = value.Interface().(string) + case "did.v1.AssetInfo.icon_url": + x.IconUrl = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.AssetInfo")) + } + panic(fmt.Errorf("message did.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 "did.v1.AssetInfo.index": + panic(fmt.Errorf("field index of message did.v1.AssetInfo is not mutable")) + case "did.v1.AssetInfo.hrp": + panic(fmt.Errorf("field hrp of message did.v1.AssetInfo is not mutable")) + case "did.v1.AssetInfo.symbol": + panic(fmt.Errorf("field symbol of message did.v1.AssetInfo is not mutable")) + case "did.v1.AssetInfo.asset_type": + panic(fmt.Errorf("field asset_type of message did.v1.AssetInfo is not mutable")) + case "did.v1.AssetInfo.name": + panic(fmt.Errorf("field name of message did.v1.AssetInfo is not mutable")) + case "did.v1.AssetInfo.icon_url": + panic(fmt.Errorf("field icon_url of message did.v1.AssetInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.AssetInfo")) + } + panic(fmt.Errorf("message did.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 "did.v1.AssetInfo.index": + return protoreflect.ValueOfInt64(int64(0)) + case "did.v1.AssetInfo.hrp": + return protoreflect.ValueOfString("") + case "did.v1.AssetInfo.symbol": + return protoreflect.ValueOfString("") + case "did.v1.AssetInfo.asset_type": + return protoreflect.ValueOfEnum(0) + case "did.v1.AssetInfo.name": + return protoreflect.ValueOfString("") + case "did.v1.AssetInfo.icon_url": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.AssetInfo")) + } + panic(fmt.Errorf("message did.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 did.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)) + } + if x.AssetType != 0 { + n += 1 + runtime.Sov(uint64(x.AssetType)) + } + 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 x.AssetType != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.AssetType)) + i-- + dAtA[i] = 0x20 + } + 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 != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AssetType", wireType) + } + x.AssetType = 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.AssetType |= AssetType(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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, + } +} + +var ( + md_KeyInfo protoreflect.MessageDescriptor + fd_KeyInfo_role protoreflect.FieldDescriptor + fd_KeyInfo_algorithm protoreflect.FieldDescriptor + fd_KeyInfo_encoding protoreflect.FieldDescriptor + fd_KeyInfo_curve protoreflect.FieldDescriptor + fd_KeyInfo_type protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_KeyInfo = File_did_v1_genesis_proto.Messages().ByName("KeyInfo") + fd_KeyInfo_role = md_KeyInfo.Fields().ByName("role") + fd_KeyInfo_algorithm = md_KeyInfo.Fields().ByName("algorithm") + fd_KeyInfo_encoding = md_KeyInfo.Fields().ByName("encoding") + fd_KeyInfo_curve = md_KeyInfo.Fields().ByName("curve") + fd_KeyInfo_type = md_KeyInfo.Fields().ByName("type") +} + +var _ protoreflect.Message = (*fastReflection_KeyInfo)(nil) + +type fastReflection_KeyInfo KeyInfo + +func (x *KeyInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_KeyInfo)(x) +} + +func (x *KeyInfo) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_proto_msgTypes[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_KeyInfo_messageType fastReflection_KeyInfo_messageType +var _ protoreflect.MessageType = fastReflection_KeyInfo_messageType{} + +type fastReflection_KeyInfo_messageType struct{} + +func (x fastReflection_KeyInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_KeyInfo)(nil) +} +func (x fastReflection_KeyInfo_messageType) New() protoreflect.Message { + return new(fastReflection_KeyInfo) +} +func (x fastReflection_KeyInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_KeyInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_KeyInfo) Descriptor() protoreflect.MessageDescriptor { + return md_KeyInfo +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_KeyInfo) Type() protoreflect.MessageType { + return _fastReflection_KeyInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_KeyInfo) New() protoreflect.Message { + return new(fastReflection_KeyInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_KeyInfo) Interface() protoreflect.ProtoMessage { + return (*KeyInfo)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_KeyInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Role != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Role)) + if !f(fd_KeyInfo_role, value) { + return + } + } + if x.Algorithm != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Algorithm)) + if !f(fd_KeyInfo_algorithm, value) { + return + } + } + if x.Encoding != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Encoding)) + if !f(fd_KeyInfo_encoding, value) { + return + } + } + if x.Curve != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Curve)) + if !f(fd_KeyInfo_curve, value) { + return + } + } + if x.Type_ != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Type_)) + if !f(fd_KeyInfo_type, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_KeyInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.KeyInfo.role": + return x.Role != 0 + case "did.v1.KeyInfo.algorithm": + return x.Algorithm != 0 + case "did.v1.KeyInfo.encoding": + return x.Encoding != 0 + case "did.v1.KeyInfo.curve": + return x.Curve != 0 + case "did.v1.KeyInfo.type": + return x.Type_ != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_KeyInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.KeyInfo.role": + x.Role = 0 + case "did.v1.KeyInfo.algorithm": + x.Algorithm = 0 + case "did.v1.KeyInfo.encoding": + x.Encoding = 0 + case "did.v1.KeyInfo.curve": + x.Curve = 0 + case "did.v1.KeyInfo.type": + x.Type_ = 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_KeyInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.KeyInfo.role": + value := x.Role + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.KeyInfo.algorithm": + value := x.Algorithm + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.KeyInfo.encoding": + value := x.Encoding + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.KeyInfo.curve": + value := x.Curve + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.KeyInfo.type": + value := x.Type_ + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_KeyInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.KeyInfo.role": + x.Role = (KeyRole)(value.Enum()) + case "did.v1.KeyInfo.algorithm": + x.Algorithm = (KeyAlgorithm)(value.Enum()) + case "did.v1.KeyInfo.encoding": + x.Encoding = (KeyEncoding)(value.Enum()) + case "did.v1.KeyInfo.curve": + x.Curve = (KeyCurve)(value.Enum()) + case "did.v1.KeyInfo.type": + x.Type_ = (KeyType)(value.Enum()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_KeyInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.KeyInfo.role": + panic(fmt.Errorf("field role of message did.v1.KeyInfo is not mutable")) + case "did.v1.KeyInfo.algorithm": + panic(fmt.Errorf("field algorithm of message did.v1.KeyInfo is not mutable")) + case "did.v1.KeyInfo.encoding": + panic(fmt.Errorf("field encoding of message did.v1.KeyInfo is not mutable")) + case "did.v1.KeyInfo.curve": + panic(fmt.Errorf("field curve of message did.v1.KeyInfo is not mutable")) + case "did.v1.KeyInfo.type": + panic(fmt.Errorf("field type of message did.v1.KeyInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_KeyInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.KeyInfo.role": + return protoreflect.ValueOfEnum(0) + case "did.v1.KeyInfo.algorithm": + return protoreflect.ValueOfEnum(0) + case "did.v1.KeyInfo.encoding": + return protoreflect.ValueOfEnum(0) + case "did.v1.KeyInfo.curve": + return protoreflect.ValueOfEnum(0) + case "did.v1.KeyInfo.type": + return protoreflect.ValueOfEnum(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.KeyInfo")) + } + panic(fmt.Errorf("message did.v1.KeyInfo does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_KeyInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.KeyInfo", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_KeyInfo) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_KeyInfo) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_KeyInfo) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_KeyInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*KeyInfo) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Role != 0 { + n += 1 + runtime.Sov(uint64(x.Role)) + } + if x.Algorithm != 0 { + n += 1 + runtime.Sov(uint64(x.Algorithm)) + } + if x.Encoding != 0 { + n += 1 + runtime.Sov(uint64(x.Encoding)) + } + if x.Curve != 0 { + n += 1 + runtime.Sov(uint64(x.Curve)) + } + if x.Type_ != 0 { + n += 1 + runtime.Sov(uint64(x.Type_)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*KeyInfo) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Type_ != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Type_)) + i-- + dAtA[i] = 0x28 + } + if x.Curve != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Curve)) + i-- + dAtA[i] = 0x20 + } + if x.Encoding != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Encoding)) + i-- + dAtA[i] = 0x18 + } + if x.Algorithm != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Algorithm)) + i-- + dAtA[i] = 0x10 + } + if x.Role != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Role)) + 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().(*KeyInfo) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: KeyInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: KeyInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + x.Role = 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.Role |= KeyRole(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) + } + x.Algorithm = 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.Algorithm |= KeyAlgorithm(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) + } + x.Encoding = 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.Encoding |= KeyEncoding(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) + } + x.Curve = 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.Curve |= KeyCurve(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Type_", wireType) + } + x.Type_ = 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.Type_ |= KeyType(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 _ protoreflect.List = (*_ValidatorInfo_2_list)(nil) + +type _ValidatorInfo_2_list struct { + list *[]*ValidatorInfo_Endpoint +} + +func (x *_ValidatorInfo_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ValidatorInfo_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_ValidatorInfo_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ValidatorInfo_Endpoint) + (*x.list)[i] = concreteValue +} + +func (x *_ValidatorInfo_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ValidatorInfo_Endpoint) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ValidatorInfo_2_list) AppendMutable() protoreflect.Value { + v := new(ValidatorInfo_Endpoint) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ValidatorInfo_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_ValidatorInfo_2_list) NewElement() protoreflect.Value { + v := new(ValidatorInfo_Endpoint) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ValidatorInfo_2_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_ValidatorInfo_3_list)(nil) + +type _ValidatorInfo_3_list struct { + list *[]*ValidatorInfo_Endpoint +} + +func (x *_ValidatorInfo_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ValidatorInfo_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_ValidatorInfo_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ValidatorInfo_Endpoint) + (*x.list)[i] = concreteValue +} + +func (x *_ValidatorInfo_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ValidatorInfo_Endpoint) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ValidatorInfo_3_list) AppendMutable() protoreflect.Value { + v := new(ValidatorInfo_Endpoint) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ValidatorInfo_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_ValidatorInfo_3_list) NewElement() protoreflect.Value { + v := new(ValidatorInfo_Endpoint) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ValidatorInfo_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ValidatorInfo protoreflect.MessageDescriptor + fd_ValidatorInfo_moniker protoreflect.FieldDescriptor + fd_ValidatorInfo_grpc_endpoints protoreflect.FieldDescriptor + fd_ValidatorInfo_rest_endpoints protoreflect.FieldDescriptor + fd_ValidatorInfo_explorer protoreflect.FieldDescriptor + fd_ValidatorInfo_fee_info protoreflect.FieldDescriptor + fd_ValidatorInfo_ibc_channel protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_ValidatorInfo = File_did_v1_genesis_proto.Messages().ByName("ValidatorInfo") + fd_ValidatorInfo_moniker = md_ValidatorInfo.Fields().ByName("moniker") + fd_ValidatorInfo_grpc_endpoints = md_ValidatorInfo.Fields().ByName("grpc_endpoints") + fd_ValidatorInfo_rest_endpoints = md_ValidatorInfo.Fields().ByName("rest_endpoints") + fd_ValidatorInfo_explorer = md_ValidatorInfo.Fields().ByName("explorer") + fd_ValidatorInfo_fee_info = md_ValidatorInfo.Fields().ByName("fee_info") + fd_ValidatorInfo_ibc_channel = md_ValidatorInfo.Fields().ByName("ibc_channel") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorInfo)(nil) + +type fastReflection_ValidatorInfo ValidatorInfo + +func (x *ValidatorInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorInfo)(x) +} + +func (x *ValidatorInfo) 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_ValidatorInfo_messageType fastReflection_ValidatorInfo_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorInfo_messageType{} + +type fastReflection_ValidatorInfo_messageType struct{} + +func (x fastReflection_ValidatorInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorInfo)(nil) +} +func (x fastReflection_ValidatorInfo_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorInfo) +} +func (x fastReflection_ValidatorInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorInfo) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorInfo +} + +// 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_ValidatorInfo) Type() protoreflect.MessageType { + return _fastReflection_ValidatorInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorInfo) New() protoreflect.Message { + return new(fastReflection_ValidatorInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorInfo) Interface() protoreflect.ProtoMessage { + return (*ValidatorInfo)(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_ValidatorInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Moniker != "" { + value := protoreflect.ValueOfString(x.Moniker) + if !f(fd_ValidatorInfo_moniker, value) { + return + } + } + if len(x.GrpcEndpoints) != 0 { + value := protoreflect.ValueOfList(&_ValidatorInfo_2_list{list: &x.GrpcEndpoints}) + if !f(fd_ValidatorInfo_grpc_endpoints, value) { + return + } + } + if len(x.RestEndpoints) != 0 { + value := protoreflect.ValueOfList(&_ValidatorInfo_3_list{list: &x.RestEndpoints}) + if !f(fd_ValidatorInfo_rest_endpoints, value) { + return + } + } + if x.Explorer != nil { + value := protoreflect.ValueOfMessage(x.Explorer.ProtoReflect()) + if !f(fd_ValidatorInfo_explorer, value) { + return + } + } + if x.FeeInfo != nil { + value := protoreflect.ValueOfMessage(x.FeeInfo.ProtoReflect()) + if !f(fd_ValidatorInfo_fee_info, value) { + return + } + } + if x.IbcChannel != nil { + value := protoreflect.ValueOfMessage(x.IbcChannel.ProtoReflect()) + if !f(fd_ValidatorInfo_ibc_channel, 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_ValidatorInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.ValidatorInfo.moniker": + return x.Moniker != "" + case "did.v1.ValidatorInfo.grpc_endpoints": + return len(x.GrpcEndpoints) != 0 + case "did.v1.ValidatorInfo.rest_endpoints": + return len(x.RestEndpoints) != 0 + case "did.v1.ValidatorInfo.explorer": + return x.Explorer != nil + case "did.v1.ValidatorInfo.fee_info": + return x.FeeInfo != nil + case "did.v1.ValidatorInfo.ibc_channel": + return x.IbcChannel != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo 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_ValidatorInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.ValidatorInfo.moniker": + x.Moniker = "" + case "did.v1.ValidatorInfo.grpc_endpoints": + x.GrpcEndpoints = nil + case "did.v1.ValidatorInfo.rest_endpoints": + x.RestEndpoints = nil + case "did.v1.ValidatorInfo.explorer": + x.Explorer = nil + case "did.v1.ValidatorInfo.fee_info": + x.FeeInfo = nil + case "did.v1.ValidatorInfo.ibc_channel": + x.IbcChannel = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo 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_ValidatorInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.ValidatorInfo.moniker": + value := x.Moniker + return protoreflect.ValueOfString(value) + case "did.v1.ValidatorInfo.grpc_endpoints": + if len(x.GrpcEndpoints) == 0 { + return protoreflect.ValueOfList(&_ValidatorInfo_2_list{}) + } + listValue := &_ValidatorInfo_2_list{list: &x.GrpcEndpoints} + return protoreflect.ValueOfList(listValue) + case "did.v1.ValidatorInfo.rest_endpoints": + if len(x.RestEndpoints) == 0 { + return protoreflect.ValueOfList(&_ValidatorInfo_3_list{}) + } + listValue := &_ValidatorInfo_3_list{list: &x.RestEndpoints} + return protoreflect.ValueOfList(listValue) + case "did.v1.ValidatorInfo.explorer": + value := x.Explorer + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.ValidatorInfo.fee_info": + value := x.FeeInfo + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.ValidatorInfo.ibc_channel": + value := x.IbcChannel + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo 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_ValidatorInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.ValidatorInfo.moniker": + x.Moniker = value.Interface().(string) + case "did.v1.ValidatorInfo.grpc_endpoints": + lv := value.List() + clv := lv.(*_ValidatorInfo_2_list) + x.GrpcEndpoints = *clv.list + case "did.v1.ValidatorInfo.rest_endpoints": + lv := value.List() + clv := lv.(*_ValidatorInfo_3_list) + x.RestEndpoints = *clv.list + case "did.v1.ValidatorInfo.explorer": + x.Explorer = value.Message().Interface().(*ValidatorInfo_ExplorerInfo) + case "did.v1.ValidatorInfo.fee_info": + x.FeeInfo = value.Message().Interface().(*ValidatorInfo_FeeInfo) + case "did.v1.ValidatorInfo.ibc_channel": + x.IbcChannel = value.Message().Interface().(*ValidatorInfo_IBCChannel) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo 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_ValidatorInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ValidatorInfo.grpc_endpoints": + if x.GrpcEndpoints == nil { + x.GrpcEndpoints = []*ValidatorInfo_Endpoint{} + } + value := &_ValidatorInfo_2_list{list: &x.GrpcEndpoints} + return protoreflect.ValueOfList(value) + case "did.v1.ValidatorInfo.rest_endpoints": + if x.RestEndpoints == nil { + x.RestEndpoints = []*ValidatorInfo_Endpoint{} + } + value := &_ValidatorInfo_3_list{list: &x.RestEndpoints} + return protoreflect.ValueOfList(value) + case "did.v1.ValidatorInfo.explorer": + if x.Explorer == nil { + x.Explorer = new(ValidatorInfo_ExplorerInfo) + } + return protoreflect.ValueOfMessage(x.Explorer.ProtoReflect()) + case "did.v1.ValidatorInfo.fee_info": + if x.FeeInfo == nil { + x.FeeInfo = new(ValidatorInfo_FeeInfo) + } + return protoreflect.ValueOfMessage(x.FeeInfo.ProtoReflect()) + case "did.v1.ValidatorInfo.ibc_channel": + if x.IbcChannel == nil { + x.IbcChannel = new(ValidatorInfo_IBCChannel) + } + return protoreflect.ValueOfMessage(x.IbcChannel.ProtoReflect()) + case "did.v1.ValidatorInfo.moniker": + panic(fmt.Errorf("field moniker of message did.v1.ValidatorInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo 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_ValidatorInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ValidatorInfo.moniker": + return protoreflect.ValueOfString("") + case "did.v1.ValidatorInfo.grpc_endpoints": + list := []*ValidatorInfo_Endpoint{} + return protoreflect.ValueOfList(&_ValidatorInfo_2_list{list: &list}) + case "did.v1.ValidatorInfo.rest_endpoints": + list := []*ValidatorInfo_Endpoint{} + return protoreflect.ValueOfList(&_ValidatorInfo_3_list{list: &list}) + case "did.v1.ValidatorInfo.explorer": + m := new(ValidatorInfo_ExplorerInfo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.ValidatorInfo.fee_info": + m := new(ValidatorInfo_FeeInfo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.ValidatorInfo.ibc_channel": + m := new(ValidatorInfo_IBCChannel) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo 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_ValidatorInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.ValidatorInfo", 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_ValidatorInfo) 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_ValidatorInfo) 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_ValidatorInfo) 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_ValidatorInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ValidatorInfo) + 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.Moniker) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.GrpcEndpoints) > 0 { + for _, e := range x.GrpcEndpoints { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.RestEndpoints) > 0 { + for _, e := range x.RestEndpoints { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Explorer != nil { + l = options.Size(x.Explorer) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.FeeInfo != nil { + l = options.Size(x.FeeInfo) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.IbcChannel != nil { + l = options.Size(x.IbcChannel) + 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().(*ValidatorInfo) + 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.IbcChannel != nil { + encoded, err := options.Marshal(x.IbcChannel) + 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] = 0x32 + } + if x.FeeInfo != nil { + encoded, err := options.Marshal(x.FeeInfo) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if x.Explorer != nil { + encoded, err := options.Marshal(x.Explorer) + 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 len(x.RestEndpoints) > 0 { + for iNdEx := len(x.RestEndpoints) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.RestEndpoints[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.GrpcEndpoints) > 0 { + for iNdEx := len(x.GrpcEndpoints) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.GrpcEndpoints[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] = 0x12 + } + } + if len(x.Moniker) > 0 { + i -= len(x.Moniker) + copy(dAtA[i:], x.Moniker) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Moniker))) + 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().(*ValidatorInfo) + 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: ValidatorInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorInfo: 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 Moniker", 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.Moniker = 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 GrpcEndpoints", 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.GrpcEndpoints = append(x.GrpcEndpoints, &ValidatorInfo_Endpoint{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.GrpcEndpoints[len(x.GrpcEndpoints)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RestEndpoints", 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.RestEndpoints = append(x.RestEndpoints, &ValidatorInfo_Endpoint{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RestEndpoints[len(x.RestEndpoints)-1]); 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 Explorer", 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.Explorer == nil { + x.Explorer = &ValidatorInfo_ExplorerInfo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Explorer); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeeInfo", 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.FeeInfo == nil { + x.FeeInfo = &ValidatorInfo_FeeInfo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.FeeInfo); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IbcChannel", 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.IbcChannel == nil { + x.IbcChannel = &ValidatorInfo_IBCChannel{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.IbcChannel); 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_ValidatorInfo_Endpoint protoreflect.MessageDescriptor + fd_ValidatorInfo_Endpoint_url protoreflect.FieldDescriptor + fd_ValidatorInfo_Endpoint_is_primary protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_ValidatorInfo_Endpoint = File_did_v1_genesis_proto.Messages().ByName("ValidatorInfo").Messages().ByName("Endpoint") + fd_ValidatorInfo_Endpoint_url = md_ValidatorInfo_Endpoint.Fields().ByName("url") + fd_ValidatorInfo_Endpoint_is_primary = md_ValidatorInfo_Endpoint.Fields().ByName("is_primary") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorInfo_Endpoint)(nil) + +type fastReflection_ValidatorInfo_Endpoint ValidatorInfo_Endpoint + +func (x *ValidatorInfo_Endpoint) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorInfo_Endpoint)(x) +} + +func (x *ValidatorInfo_Endpoint) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_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_ValidatorInfo_Endpoint_messageType fastReflection_ValidatorInfo_Endpoint_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorInfo_Endpoint_messageType{} + +type fastReflection_ValidatorInfo_Endpoint_messageType struct{} + +func (x fastReflection_ValidatorInfo_Endpoint_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorInfo_Endpoint)(nil) +} +func (x fastReflection_ValidatorInfo_Endpoint_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorInfo_Endpoint) +} +func (x fastReflection_ValidatorInfo_Endpoint_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorInfo_Endpoint +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorInfo_Endpoint) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorInfo_Endpoint +} + +// 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_ValidatorInfo_Endpoint) Type() protoreflect.MessageType { + return _fastReflection_ValidatorInfo_Endpoint_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorInfo_Endpoint) New() protoreflect.Message { + return new(fastReflection_ValidatorInfo_Endpoint) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorInfo_Endpoint) Interface() protoreflect.ProtoMessage { + return (*ValidatorInfo_Endpoint)(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_ValidatorInfo_Endpoint) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Url != "" { + value := protoreflect.ValueOfString(x.Url) + if !f(fd_ValidatorInfo_Endpoint_url, value) { + return + } + } + if x.IsPrimary != false { + value := protoreflect.ValueOfBool(x.IsPrimary) + if !f(fd_ValidatorInfo_Endpoint_is_primary, 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_ValidatorInfo_Endpoint) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.ValidatorInfo.Endpoint.url": + return x.Url != "" + case "did.v1.ValidatorInfo.Endpoint.is_primary": + return x.IsPrimary != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.Endpoint")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.Endpoint 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_ValidatorInfo_Endpoint) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.ValidatorInfo.Endpoint.url": + x.Url = "" + case "did.v1.ValidatorInfo.Endpoint.is_primary": + x.IsPrimary = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.Endpoint")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.Endpoint 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_ValidatorInfo_Endpoint) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.ValidatorInfo.Endpoint.url": + value := x.Url + return protoreflect.ValueOfString(value) + case "did.v1.ValidatorInfo.Endpoint.is_primary": + value := x.IsPrimary + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.Endpoint")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.Endpoint 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_ValidatorInfo_Endpoint) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.ValidatorInfo.Endpoint.url": + x.Url = value.Interface().(string) + case "did.v1.ValidatorInfo.Endpoint.is_primary": + x.IsPrimary = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.Endpoint")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.Endpoint 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_ValidatorInfo_Endpoint) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ValidatorInfo.Endpoint.url": + panic(fmt.Errorf("field url of message did.v1.ValidatorInfo.Endpoint is not mutable")) + case "did.v1.ValidatorInfo.Endpoint.is_primary": + panic(fmt.Errorf("field is_primary of message did.v1.ValidatorInfo.Endpoint is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.Endpoint")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.Endpoint 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_ValidatorInfo_Endpoint) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ValidatorInfo.Endpoint.url": + return protoreflect.ValueOfString("") + case "did.v1.ValidatorInfo.Endpoint.is_primary": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.Endpoint")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.Endpoint 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_ValidatorInfo_Endpoint) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.ValidatorInfo.Endpoint", 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_ValidatorInfo_Endpoint) 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_ValidatorInfo_Endpoint) 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_ValidatorInfo_Endpoint) 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_ValidatorInfo_Endpoint) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ValidatorInfo_Endpoint) + 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.Url) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.IsPrimary { + n += 2 + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ValidatorInfo_Endpoint) + 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.IsPrimary { + i-- + if x.IsPrimary { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(x.Url) > 0 { + i -= len(x.Url) + copy(dAtA[i:], x.Url) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Url))) + 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().(*ValidatorInfo_Endpoint) + 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: ValidatorInfo_Endpoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorInfo_Endpoint: 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 Url", 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.Url = 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 IsPrimary", 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.IsPrimary = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ValidatorInfo_ExplorerInfo protoreflect.MessageDescriptor + fd_ValidatorInfo_ExplorerInfo_name protoreflect.FieldDescriptor + fd_ValidatorInfo_ExplorerInfo_url protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_ValidatorInfo_ExplorerInfo = File_did_v1_genesis_proto.Messages().ByName("ValidatorInfo").Messages().ByName("ExplorerInfo") + fd_ValidatorInfo_ExplorerInfo_name = md_ValidatorInfo_ExplorerInfo.Fields().ByName("name") + fd_ValidatorInfo_ExplorerInfo_url = md_ValidatorInfo_ExplorerInfo.Fields().ByName("url") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorInfo_ExplorerInfo)(nil) + +type fastReflection_ValidatorInfo_ExplorerInfo ValidatorInfo_ExplorerInfo + +func (x *ValidatorInfo_ExplorerInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorInfo_ExplorerInfo)(x) +} + +func (x *ValidatorInfo_ExplorerInfo) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_proto_msgTypes[8] + 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_ValidatorInfo_ExplorerInfo_messageType fastReflection_ValidatorInfo_ExplorerInfo_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorInfo_ExplorerInfo_messageType{} + +type fastReflection_ValidatorInfo_ExplorerInfo_messageType struct{} + +func (x fastReflection_ValidatorInfo_ExplorerInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorInfo_ExplorerInfo)(nil) +} +func (x fastReflection_ValidatorInfo_ExplorerInfo_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorInfo_ExplorerInfo) +} +func (x fastReflection_ValidatorInfo_ExplorerInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorInfo_ExplorerInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorInfo_ExplorerInfo) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorInfo_ExplorerInfo +} + +// 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_ValidatorInfo_ExplorerInfo) Type() protoreflect.MessageType { + return _fastReflection_ValidatorInfo_ExplorerInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorInfo_ExplorerInfo) New() protoreflect.Message { + return new(fastReflection_ValidatorInfo_ExplorerInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorInfo_ExplorerInfo) Interface() protoreflect.ProtoMessage { + return (*ValidatorInfo_ExplorerInfo)(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_ValidatorInfo_ExplorerInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_ValidatorInfo_ExplorerInfo_name, value) { + return + } + } + if x.Url != "" { + value := protoreflect.ValueOfString(x.Url) + if !f(fd_ValidatorInfo_ExplorerInfo_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_ValidatorInfo_ExplorerInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.ValidatorInfo.ExplorerInfo.name": + return x.Name != "" + case "did.v1.ValidatorInfo.ExplorerInfo.url": + return x.Url != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.ExplorerInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.ExplorerInfo 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_ValidatorInfo_ExplorerInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.ValidatorInfo.ExplorerInfo.name": + x.Name = "" + case "did.v1.ValidatorInfo.ExplorerInfo.url": + x.Url = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.ExplorerInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.ExplorerInfo 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_ValidatorInfo_ExplorerInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.ValidatorInfo.ExplorerInfo.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "did.v1.ValidatorInfo.ExplorerInfo.url": + value := x.Url + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.ExplorerInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.ExplorerInfo 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_ValidatorInfo_ExplorerInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.ValidatorInfo.ExplorerInfo.name": + x.Name = value.Interface().(string) + case "did.v1.ValidatorInfo.ExplorerInfo.url": + x.Url = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.ExplorerInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.ExplorerInfo 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_ValidatorInfo_ExplorerInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ValidatorInfo.ExplorerInfo.name": + panic(fmt.Errorf("field name of message did.v1.ValidatorInfo.ExplorerInfo is not mutable")) + case "did.v1.ValidatorInfo.ExplorerInfo.url": + panic(fmt.Errorf("field url of message did.v1.ValidatorInfo.ExplorerInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.ExplorerInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.ExplorerInfo 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_ValidatorInfo_ExplorerInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ValidatorInfo.ExplorerInfo.name": + return protoreflect.ValueOfString("") + case "did.v1.ValidatorInfo.ExplorerInfo.url": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.ExplorerInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.ExplorerInfo 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_ValidatorInfo_ExplorerInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.ValidatorInfo.ExplorerInfo", 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_ValidatorInfo_ExplorerInfo) 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_ValidatorInfo_ExplorerInfo) 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_ValidatorInfo_ExplorerInfo) 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_ValidatorInfo_ExplorerInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ValidatorInfo_ExplorerInfo) + 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.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Url) + 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().(*ValidatorInfo_ExplorerInfo) + 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.Url) > 0 { + i -= len(x.Url) + copy(dAtA[i:], x.Url) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Url))) + i-- + dAtA[i] = 0x12 + } + 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] = 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().(*ValidatorInfo_ExplorerInfo) + 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: ValidatorInfo_ExplorerInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorInfo_ExplorerInfo: 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 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 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Url", 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.Url = 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 _ protoreflect.List = (*_ValidatorInfo_FeeInfo_2_list)(nil) + +type _ValidatorInfo_FeeInfo_2_list struct { + list *[]string +} + +func (x *_ValidatorInfo_FeeInfo_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ValidatorInfo_FeeInfo_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_ValidatorInfo_FeeInfo_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_ValidatorInfo_FeeInfo_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_ValidatorInfo_FeeInfo_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message ValidatorInfo_FeeInfo at list field FeeRates as it is not of Message kind")) +} + +func (x *_ValidatorInfo_FeeInfo_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_ValidatorInfo_FeeInfo_2_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_ValidatorInfo_FeeInfo_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ValidatorInfo_FeeInfo protoreflect.MessageDescriptor + fd_ValidatorInfo_FeeInfo_base_denom protoreflect.FieldDescriptor + fd_ValidatorInfo_FeeInfo_fee_rates protoreflect.FieldDescriptor + fd_ValidatorInfo_FeeInfo_init_gas_limit protoreflect.FieldDescriptor + fd_ValidatorInfo_FeeInfo_is_simulable protoreflect.FieldDescriptor + fd_ValidatorInfo_FeeInfo_gas_multiply protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_ValidatorInfo_FeeInfo = File_did_v1_genesis_proto.Messages().ByName("ValidatorInfo").Messages().ByName("FeeInfo") + fd_ValidatorInfo_FeeInfo_base_denom = md_ValidatorInfo_FeeInfo.Fields().ByName("base_denom") + fd_ValidatorInfo_FeeInfo_fee_rates = md_ValidatorInfo_FeeInfo.Fields().ByName("fee_rates") + fd_ValidatorInfo_FeeInfo_init_gas_limit = md_ValidatorInfo_FeeInfo.Fields().ByName("init_gas_limit") + fd_ValidatorInfo_FeeInfo_is_simulable = md_ValidatorInfo_FeeInfo.Fields().ByName("is_simulable") + fd_ValidatorInfo_FeeInfo_gas_multiply = md_ValidatorInfo_FeeInfo.Fields().ByName("gas_multiply") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorInfo_FeeInfo)(nil) + +type fastReflection_ValidatorInfo_FeeInfo ValidatorInfo_FeeInfo + +func (x *ValidatorInfo_FeeInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorInfo_FeeInfo)(x) +} + +func (x *ValidatorInfo_FeeInfo) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ValidatorInfo_FeeInfo_messageType fastReflection_ValidatorInfo_FeeInfo_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorInfo_FeeInfo_messageType{} + +type fastReflection_ValidatorInfo_FeeInfo_messageType struct{} + +func (x fastReflection_ValidatorInfo_FeeInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorInfo_FeeInfo)(nil) +} +func (x fastReflection_ValidatorInfo_FeeInfo_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorInfo_FeeInfo) +} +func (x fastReflection_ValidatorInfo_FeeInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorInfo_FeeInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorInfo_FeeInfo) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorInfo_FeeInfo +} + +// 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_ValidatorInfo_FeeInfo) Type() protoreflect.MessageType { + return _fastReflection_ValidatorInfo_FeeInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorInfo_FeeInfo) New() protoreflect.Message { + return new(fastReflection_ValidatorInfo_FeeInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorInfo_FeeInfo) Interface() protoreflect.ProtoMessage { + return (*ValidatorInfo_FeeInfo)(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_ValidatorInfo_FeeInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BaseDenom != "" { + value := protoreflect.ValueOfString(x.BaseDenom) + if !f(fd_ValidatorInfo_FeeInfo_base_denom, value) { + return + } + } + if len(x.FeeRates) != 0 { + value := protoreflect.ValueOfList(&_ValidatorInfo_FeeInfo_2_list{list: &x.FeeRates}) + if !f(fd_ValidatorInfo_FeeInfo_fee_rates, value) { + return + } + } + if x.InitGasLimit != int32(0) { + value := protoreflect.ValueOfInt32(x.InitGasLimit) + if !f(fd_ValidatorInfo_FeeInfo_init_gas_limit, value) { + return + } + } + if x.IsSimulable != false { + value := protoreflect.ValueOfBool(x.IsSimulable) + if !f(fd_ValidatorInfo_FeeInfo_is_simulable, value) { + return + } + } + if x.GasMultiply != float64(0) || math.Signbit(x.GasMultiply) { + value := protoreflect.ValueOfFloat64(x.GasMultiply) + if !f(fd_ValidatorInfo_FeeInfo_gas_multiply, 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_ValidatorInfo_FeeInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.ValidatorInfo.FeeInfo.base_denom": + return x.BaseDenom != "" + case "did.v1.ValidatorInfo.FeeInfo.fee_rates": + return len(x.FeeRates) != 0 + case "did.v1.ValidatorInfo.FeeInfo.init_gas_limit": + return x.InitGasLimit != int32(0) + case "did.v1.ValidatorInfo.FeeInfo.is_simulable": + return x.IsSimulable != false + case "did.v1.ValidatorInfo.FeeInfo.gas_multiply": + return x.GasMultiply != float64(0) || math.Signbit(x.GasMultiply) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.FeeInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.FeeInfo 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_ValidatorInfo_FeeInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.ValidatorInfo.FeeInfo.base_denom": + x.BaseDenom = "" + case "did.v1.ValidatorInfo.FeeInfo.fee_rates": + x.FeeRates = nil + case "did.v1.ValidatorInfo.FeeInfo.init_gas_limit": + x.InitGasLimit = int32(0) + case "did.v1.ValidatorInfo.FeeInfo.is_simulable": + x.IsSimulable = false + case "did.v1.ValidatorInfo.FeeInfo.gas_multiply": + x.GasMultiply = float64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.FeeInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.FeeInfo 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_ValidatorInfo_FeeInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.ValidatorInfo.FeeInfo.base_denom": + value := x.BaseDenom + return protoreflect.ValueOfString(value) + case "did.v1.ValidatorInfo.FeeInfo.fee_rates": + if len(x.FeeRates) == 0 { + return protoreflect.ValueOfList(&_ValidatorInfo_FeeInfo_2_list{}) + } + listValue := &_ValidatorInfo_FeeInfo_2_list{list: &x.FeeRates} + return protoreflect.ValueOfList(listValue) + case "did.v1.ValidatorInfo.FeeInfo.init_gas_limit": + value := x.InitGasLimit + return protoreflect.ValueOfInt32(value) + case "did.v1.ValidatorInfo.FeeInfo.is_simulable": + value := x.IsSimulable + return protoreflect.ValueOfBool(value) + case "did.v1.ValidatorInfo.FeeInfo.gas_multiply": + value := x.GasMultiply + return protoreflect.ValueOfFloat64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.FeeInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.FeeInfo 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_ValidatorInfo_FeeInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.ValidatorInfo.FeeInfo.base_denom": + x.BaseDenom = value.Interface().(string) + case "did.v1.ValidatorInfo.FeeInfo.fee_rates": + lv := value.List() + clv := lv.(*_ValidatorInfo_FeeInfo_2_list) + x.FeeRates = *clv.list + case "did.v1.ValidatorInfo.FeeInfo.init_gas_limit": + x.InitGasLimit = int32(value.Int()) + case "did.v1.ValidatorInfo.FeeInfo.is_simulable": + x.IsSimulable = value.Bool() + case "did.v1.ValidatorInfo.FeeInfo.gas_multiply": + x.GasMultiply = value.Float() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.FeeInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.FeeInfo 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_ValidatorInfo_FeeInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ValidatorInfo.FeeInfo.fee_rates": + if x.FeeRates == nil { + x.FeeRates = []string{} + } + value := &_ValidatorInfo_FeeInfo_2_list{list: &x.FeeRates} + return protoreflect.ValueOfList(value) + case "did.v1.ValidatorInfo.FeeInfo.base_denom": + panic(fmt.Errorf("field base_denom of message did.v1.ValidatorInfo.FeeInfo is not mutable")) + case "did.v1.ValidatorInfo.FeeInfo.init_gas_limit": + panic(fmt.Errorf("field init_gas_limit of message did.v1.ValidatorInfo.FeeInfo is not mutable")) + case "did.v1.ValidatorInfo.FeeInfo.is_simulable": + panic(fmt.Errorf("field is_simulable of message did.v1.ValidatorInfo.FeeInfo is not mutable")) + case "did.v1.ValidatorInfo.FeeInfo.gas_multiply": + panic(fmt.Errorf("field gas_multiply of message did.v1.ValidatorInfo.FeeInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.FeeInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.FeeInfo 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_ValidatorInfo_FeeInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ValidatorInfo.FeeInfo.base_denom": + return protoreflect.ValueOfString("") + case "did.v1.ValidatorInfo.FeeInfo.fee_rates": + list := []string{} + return protoreflect.ValueOfList(&_ValidatorInfo_FeeInfo_2_list{list: &list}) + case "did.v1.ValidatorInfo.FeeInfo.init_gas_limit": + return protoreflect.ValueOfInt32(int32(0)) + case "did.v1.ValidatorInfo.FeeInfo.is_simulable": + return protoreflect.ValueOfBool(false) + case "did.v1.ValidatorInfo.FeeInfo.gas_multiply": + return protoreflect.ValueOfFloat64(float64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.FeeInfo")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.FeeInfo 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_ValidatorInfo_FeeInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.ValidatorInfo.FeeInfo", 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_ValidatorInfo_FeeInfo) 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_ValidatorInfo_FeeInfo) 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_ValidatorInfo_FeeInfo) 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_ValidatorInfo_FeeInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ValidatorInfo_FeeInfo) + 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.BaseDenom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.FeeRates) > 0 { + for _, s := range x.FeeRates { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.InitGasLimit != 0 { + n += 1 + runtime.Sov(uint64(x.InitGasLimit)) + } + if x.IsSimulable { + n += 2 + } + if x.GasMultiply != 0 || math.Signbit(x.GasMultiply) { + n += 9 + } + 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().(*ValidatorInfo_FeeInfo) + 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.GasMultiply != 0 || math.Signbit(x.GasMultiply) { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(x.GasMultiply)))) + i-- + dAtA[i] = 0x29 + } + if x.IsSimulable { + i-- + if x.IsSimulable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if x.InitGasLimit != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.InitGasLimit)) + i-- + dAtA[i] = 0x18 + } + if len(x.FeeRates) > 0 { + for iNdEx := len(x.FeeRates) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.FeeRates[iNdEx]) + copy(dAtA[i:], x.FeeRates[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FeeRates[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.BaseDenom) > 0 { + i -= len(x.BaseDenom) + copy(dAtA[i:], x.BaseDenom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BaseDenom))) + 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().(*ValidatorInfo_FeeInfo) + 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: ValidatorInfo_FeeInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorInfo_FeeInfo: 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 BaseDenom", 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.BaseDenom = 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 FeeRates", 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.FeeRates = append(x.FeeRates, 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 InitGasLimit", wireType) + } + x.InitGasLimit = 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.InitGasLimit |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IsSimulable", 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.IsSimulable = bool(v != 0) + case 5: + if wireType != 1 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GasMultiply", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + x.GasMultiply = float64(math.Float64frombits(v)) + 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_ValidatorInfo_IBCChannel protoreflect.MessageDescriptor + fd_ValidatorInfo_IBCChannel_id protoreflect.FieldDescriptor + fd_ValidatorInfo_IBCChannel_port protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_genesis_proto_init() + md_ValidatorInfo_IBCChannel = File_did_v1_genesis_proto.Messages().ByName("ValidatorInfo").Messages().ByName("IBCChannel") + fd_ValidatorInfo_IBCChannel_id = md_ValidatorInfo_IBCChannel.Fields().ByName("id") + fd_ValidatorInfo_IBCChannel_port = md_ValidatorInfo_IBCChannel.Fields().ByName("port") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorInfo_IBCChannel)(nil) + +type fastReflection_ValidatorInfo_IBCChannel ValidatorInfo_IBCChannel + +func (x *ValidatorInfo_IBCChannel) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorInfo_IBCChannel)(x) +} + +func (x *ValidatorInfo_IBCChannel) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_genesis_proto_msgTypes[10] + 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_ValidatorInfo_IBCChannel_messageType fastReflection_ValidatorInfo_IBCChannel_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorInfo_IBCChannel_messageType{} + +type fastReflection_ValidatorInfo_IBCChannel_messageType struct{} + +func (x fastReflection_ValidatorInfo_IBCChannel_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorInfo_IBCChannel)(nil) +} +func (x fastReflection_ValidatorInfo_IBCChannel_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorInfo_IBCChannel) +} +func (x fastReflection_ValidatorInfo_IBCChannel_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorInfo_IBCChannel +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorInfo_IBCChannel) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorInfo_IBCChannel +} + +// 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_ValidatorInfo_IBCChannel) Type() protoreflect.MessageType { + return _fastReflection_ValidatorInfo_IBCChannel_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorInfo_IBCChannel) New() protoreflect.Message { + return new(fastReflection_ValidatorInfo_IBCChannel) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorInfo_IBCChannel) Interface() protoreflect.ProtoMessage { + return (*ValidatorInfo_IBCChannel)(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_ValidatorInfo_IBCChannel) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_ValidatorInfo_IBCChannel_id, value) { + return + } + } + if x.Port != "" { + value := protoreflect.ValueOfString(x.Port) + if !f(fd_ValidatorInfo_IBCChannel_port, 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_ValidatorInfo_IBCChannel) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.ValidatorInfo.IBCChannel.id": + return x.Id != "" + case "did.v1.ValidatorInfo.IBCChannel.port": + return x.Port != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.IBCChannel")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.IBCChannel 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_ValidatorInfo_IBCChannel) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.ValidatorInfo.IBCChannel.id": + x.Id = "" + case "did.v1.ValidatorInfo.IBCChannel.port": + x.Port = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.IBCChannel")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.IBCChannel 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_ValidatorInfo_IBCChannel) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.ValidatorInfo.IBCChannel.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.ValidatorInfo.IBCChannel.port": + value := x.Port + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.IBCChannel")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.IBCChannel 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_ValidatorInfo_IBCChannel) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.ValidatorInfo.IBCChannel.id": + x.Id = value.Interface().(string) + case "did.v1.ValidatorInfo.IBCChannel.port": + x.Port = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.IBCChannel")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.IBCChannel 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_ValidatorInfo_IBCChannel) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ValidatorInfo.IBCChannel.id": + panic(fmt.Errorf("field id of message did.v1.ValidatorInfo.IBCChannel is not mutable")) + case "did.v1.ValidatorInfo.IBCChannel.port": + panic(fmt.Errorf("field port of message did.v1.ValidatorInfo.IBCChannel is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.IBCChannel")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.IBCChannel 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_ValidatorInfo_IBCChannel) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ValidatorInfo.IBCChannel.id": + return protoreflect.ValueOfString("") + case "did.v1.ValidatorInfo.IBCChannel.port": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ValidatorInfo.IBCChannel")) + } + panic(fmt.Errorf("message did.v1.ValidatorInfo.IBCChannel 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_ValidatorInfo_IBCChannel) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.ValidatorInfo.IBCChannel", 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_ValidatorInfo_IBCChannel) 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_ValidatorInfo_IBCChannel) 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_ValidatorInfo_IBCChannel) 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_ValidatorInfo_IBCChannel) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ValidatorInfo_IBCChannel) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Port) + 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().(*ValidatorInfo_IBCChannel) + 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.Port) > 0 { + i -= len(x.Port) + copy(dAtA[i:], x.Port) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Port))) + i-- + dAtA[i] = 0x12 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ValidatorInfo_IBCChannel) + 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: ValidatorInfo_IBCChannel: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorInfo_IBCChannel: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Port", 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.Port = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1094,6 +6621,584 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified +type AssetType int32 + +const ( + AssetType_ASSET_TYPE_UNSPECIFIED AssetType = 0 + AssetType_ASSET_TYPE_NATIVE AssetType = 1 + AssetType_ASSET_TYPE_WRAPPED AssetType = 2 + AssetType_ASSET_TYPE_STAKING AssetType = 3 + AssetType_ASSET_TYPE_POOL AssetType = 4 + AssetType_ASSET_TYPE_IBC AssetType = 5 + AssetType_ASSET_TYPE_CW20 AssetType = 6 +) + +// Enum value maps for AssetType. +var ( + AssetType_name = map[int32]string{ + 0: "ASSET_TYPE_UNSPECIFIED", + 1: "ASSET_TYPE_NATIVE", + 2: "ASSET_TYPE_WRAPPED", + 3: "ASSET_TYPE_STAKING", + 4: "ASSET_TYPE_POOL", + 5: "ASSET_TYPE_IBC", + 6: "ASSET_TYPE_CW20", + } + AssetType_value = map[string]int32{ + "ASSET_TYPE_UNSPECIFIED": 0, + "ASSET_TYPE_NATIVE": 1, + "ASSET_TYPE_WRAPPED": 2, + "ASSET_TYPE_STAKING": 3, + "ASSET_TYPE_POOL": 4, + "ASSET_TYPE_IBC": 5, + "ASSET_TYPE_CW20": 6, + } +) + +func (x AssetType) Enum() *AssetType { + p := new(AssetType) + *p = x + return p +} + +func (x AssetType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AssetType) Descriptor() protoreflect.EnumDescriptor { + return file_did_v1_genesis_proto_enumTypes[0].Descriptor() +} + +func (AssetType) Type() protoreflect.EnumType { + return &file_did_v1_genesis_proto_enumTypes[0] +} + +func (x AssetType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AssetType.Descriptor instead. +func (AssetType) EnumDescriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +// DIDNamespace define the different namespaces of DID +type DIDNamespace int32 + +const ( + DIDNamespace_DID_NAMESPACE_UNSPECIFIED DIDNamespace = 0 + DIDNamespace_DID_NAMESPACE_IPFS DIDNamespace = 1 + DIDNamespace_DID_NAMESPACE_SONR DIDNamespace = 2 + DIDNamespace_DID_NAMESPACE_BITCOIN DIDNamespace = 3 + DIDNamespace_DID_NAMESPACE_ETHEREUM DIDNamespace = 4 + DIDNamespace_DID_NAMESPACE_IBC DIDNamespace = 5 + DIDNamespace_DID_NAMESPACE_WEBAUTHN DIDNamespace = 6 + DIDNamespace_DID_NAMESPACE_DWN DIDNamespace = 7 + DIDNamespace_DID_NAMESPACE_SERVICE DIDNamespace = 8 +) + +// Enum value maps for DIDNamespace. +var ( + DIDNamespace_name = map[int32]string{ + 0: "DID_NAMESPACE_UNSPECIFIED", + 1: "DID_NAMESPACE_IPFS", + 2: "DID_NAMESPACE_SONR", + 3: "DID_NAMESPACE_BITCOIN", + 4: "DID_NAMESPACE_ETHEREUM", + 5: "DID_NAMESPACE_IBC", + 6: "DID_NAMESPACE_WEBAUTHN", + 7: "DID_NAMESPACE_DWN", + 8: "DID_NAMESPACE_SERVICE", + } + DIDNamespace_value = map[string]int32{ + "DID_NAMESPACE_UNSPECIFIED": 0, + "DID_NAMESPACE_IPFS": 1, + "DID_NAMESPACE_SONR": 2, + "DID_NAMESPACE_BITCOIN": 3, + "DID_NAMESPACE_ETHEREUM": 4, + "DID_NAMESPACE_IBC": 5, + "DID_NAMESPACE_WEBAUTHN": 6, + "DID_NAMESPACE_DWN": 7, + "DID_NAMESPACE_SERVICE": 8, + } +) + +func (x DIDNamespace) Enum() *DIDNamespace { + p := new(DIDNamespace) + *p = x + return p +} + +func (x DIDNamespace) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DIDNamespace) Descriptor() protoreflect.EnumDescriptor { + return file_did_v1_genesis_proto_enumTypes[1].Descriptor() +} + +func (DIDNamespace) Type() protoreflect.EnumType { + return &file_did_v1_genesis_proto_enumTypes[1] +} + +func (x DIDNamespace) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DIDNamespace.Descriptor instead. +func (DIDNamespace) EnumDescriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{1} +} + +// KeyAlgorithm defines the key algorithm +type KeyAlgorithm int32 + +const ( + KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED KeyAlgorithm = 0 + KeyAlgorithm_KEY_ALGORITHM_ES256 KeyAlgorithm = 1 + KeyAlgorithm_KEY_ALGORITHM_ES384 KeyAlgorithm = 2 + KeyAlgorithm_KEY_ALGORITHM_ES512 KeyAlgorithm = 3 + KeyAlgorithm_KEY_ALGORITHM_EDDSA KeyAlgorithm = 4 + KeyAlgorithm_KEY_ALGORITHM_ES256K KeyAlgorithm = 5 + KeyAlgorithm_KEY_ALGORITHM_ECDSA KeyAlgorithm = 6 // Fixed typo from EDCSA to ECDSA +) + +// Enum value maps for KeyAlgorithm. +var ( + KeyAlgorithm_name = map[int32]string{ + 0: "KEY_ALGORITHM_UNSPECIFIED", + 1: "KEY_ALGORITHM_ES256", + 2: "KEY_ALGORITHM_ES384", + 3: "KEY_ALGORITHM_ES512", + 4: "KEY_ALGORITHM_EDDSA", + 5: "KEY_ALGORITHM_ES256K", + 6: "KEY_ALGORITHM_ECDSA", + } + KeyAlgorithm_value = map[string]int32{ + "KEY_ALGORITHM_UNSPECIFIED": 0, + "KEY_ALGORITHM_ES256": 1, + "KEY_ALGORITHM_ES384": 2, + "KEY_ALGORITHM_ES512": 3, + "KEY_ALGORITHM_EDDSA": 4, + "KEY_ALGORITHM_ES256K": 5, + "KEY_ALGORITHM_ECDSA": 6, + } +) + +func (x KeyAlgorithm) Enum() *KeyAlgorithm { + p := new(KeyAlgorithm) + *p = x + return p +} + +func (x KeyAlgorithm) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KeyAlgorithm) Descriptor() protoreflect.EnumDescriptor { + return file_did_v1_genesis_proto_enumTypes[2].Descriptor() +} + +func (KeyAlgorithm) Type() protoreflect.EnumType { + return &file_did_v1_genesis_proto_enumTypes[2] +} + +func (x KeyAlgorithm) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use KeyAlgorithm.Descriptor instead. +func (KeyAlgorithm) EnumDescriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{2} +} + +// KeyCurve defines the key curve +type KeyCurve int32 + +const ( + KeyCurve_KEY_CURVE_UNSPECIFIED KeyCurve = 0 + KeyCurve_KEY_CURVE_P256 KeyCurve = 1 // NIST P-256 + KeyCurve_KEY_CURVE_P384 KeyCurve = 2 + KeyCurve_KEY_CURVE_P521 KeyCurve = 3 + KeyCurve_KEY_CURVE_X25519 KeyCurve = 4 + KeyCurve_KEY_CURVE_X448 KeyCurve = 5 + KeyCurve_KEY_CURVE_ED25519 KeyCurve = 6 + KeyCurve_KEY_CURVE_ED448 KeyCurve = 7 + KeyCurve_KEY_CURVE_SECP256K1 KeyCurve = 8 + KeyCurve_KEY_CURVE_BLS12381 KeyCurve = 9 + KeyCurve_KEY_CURVE_KECCAK256 KeyCurve = 10 +) + +// Enum value maps for KeyCurve. +var ( + KeyCurve_name = map[int32]string{ + 0: "KEY_CURVE_UNSPECIFIED", + 1: "KEY_CURVE_P256", + 2: "KEY_CURVE_P384", + 3: "KEY_CURVE_P521", + 4: "KEY_CURVE_X25519", + 5: "KEY_CURVE_X448", + 6: "KEY_CURVE_ED25519", + 7: "KEY_CURVE_ED448", + 8: "KEY_CURVE_SECP256K1", + 9: "KEY_CURVE_BLS12381", + 10: "KEY_CURVE_KECCAK256", + } + KeyCurve_value = map[string]int32{ + "KEY_CURVE_UNSPECIFIED": 0, + "KEY_CURVE_P256": 1, + "KEY_CURVE_P384": 2, + "KEY_CURVE_P521": 3, + "KEY_CURVE_X25519": 4, + "KEY_CURVE_X448": 5, + "KEY_CURVE_ED25519": 6, + "KEY_CURVE_ED448": 7, + "KEY_CURVE_SECP256K1": 8, + "KEY_CURVE_BLS12381": 9, + "KEY_CURVE_KECCAK256": 10, + } +) + +func (x KeyCurve) Enum() *KeyCurve { + p := new(KeyCurve) + *p = x + return p +} + +func (x KeyCurve) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KeyCurve) Descriptor() protoreflect.EnumDescriptor { + return file_did_v1_genesis_proto_enumTypes[3].Descriptor() +} + +func (KeyCurve) Type() protoreflect.EnumType { + return &file_did_v1_genesis_proto_enumTypes[3] +} + +func (x KeyCurve) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use KeyCurve.Descriptor instead. +func (KeyCurve) EnumDescriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{3} +} + +// KeyEncoding defines the key encoding +type KeyEncoding int32 + +const ( + KeyEncoding_KEY_ENCODING_UNSPECIFIED KeyEncoding = 0 + KeyEncoding_KEY_ENCODING_RAW KeyEncoding = 1 + KeyEncoding_KEY_ENCODING_HEX KeyEncoding = 2 + KeyEncoding_KEY_ENCODING_MULTIBASE KeyEncoding = 3 +) + +// Enum value maps for KeyEncoding. +var ( + KeyEncoding_name = map[int32]string{ + 0: "KEY_ENCODING_UNSPECIFIED", + 1: "KEY_ENCODING_RAW", + 2: "KEY_ENCODING_HEX", + 3: "KEY_ENCODING_MULTIBASE", + } + KeyEncoding_value = map[string]int32{ + "KEY_ENCODING_UNSPECIFIED": 0, + "KEY_ENCODING_RAW": 1, + "KEY_ENCODING_HEX": 2, + "KEY_ENCODING_MULTIBASE": 3, + } +) + +func (x KeyEncoding) Enum() *KeyEncoding { + p := new(KeyEncoding) + *p = x + return p +} + +func (x KeyEncoding) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KeyEncoding) Descriptor() protoreflect.EnumDescriptor { + return file_did_v1_genesis_proto_enumTypes[4].Descriptor() +} + +func (KeyEncoding) Type() protoreflect.EnumType { + return &file_did_v1_genesis_proto_enumTypes[4] +} + +func (x KeyEncoding) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use KeyEncoding.Descriptor instead. +func (KeyEncoding) EnumDescriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{4} +} + +// KeyRole defines the kind of key +type KeyRole int32 + +const ( + KeyRole_KEY_ROLE_UNSPECIFIED KeyRole = 0 + KeyRole_KEY_ROLE_AUTHENTICATION KeyRole = 1 // Passkeys and FIDO + KeyRole_KEY_ROLE_ASSERTION KeyRole = 2 // Zk Identifiers + KeyRole_KEY_ROLE_DELEGATION KeyRole = 3 // ETH,BTC,IBC addresses + KeyRole_KEY_ROLE_INVOCATION KeyRole = 4 // DWN Controllers +) + +// Enum value maps for KeyRole. +var ( + KeyRole_name = map[int32]string{ + 0: "KEY_ROLE_UNSPECIFIED", + 1: "KEY_ROLE_AUTHENTICATION", + 2: "KEY_ROLE_ASSERTION", + 3: "KEY_ROLE_DELEGATION", + 4: "KEY_ROLE_INVOCATION", + } + KeyRole_value = map[string]int32{ + "KEY_ROLE_UNSPECIFIED": 0, + "KEY_ROLE_AUTHENTICATION": 1, + "KEY_ROLE_ASSERTION": 2, + "KEY_ROLE_DELEGATION": 3, + "KEY_ROLE_INVOCATION": 4, + } +) + +func (x KeyRole) Enum() *KeyRole { + p := new(KeyRole) + *p = x + return p +} + +func (x KeyRole) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KeyRole) Descriptor() protoreflect.EnumDescriptor { + return file_did_v1_genesis_proto_enumTypes[5].Descriptor() +} + +func (KeyRole) Type() protoreflect.EnumType { + return &file_did_v1_genesis_proto_enumTypes[5] +} + +func (x KeyRole) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use KeyRole.Descriptor instead. +func (KeyRole) EnumDescriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{5} +} + +// KeyType defines the key type +type KeyType int32 + +const ( + KeyType_KEY_TYPE_UNSPECIFIED KeyType = 0 + KeyType_KEY_TYPE_OCTET KeyType = 1 + KeyType_KEY_TYPE_ELLIPTIC KeyType = 2 + KeyType_KEY_TYPE_RSA KeyType = 3 + KeyType_KEY_TYPE_SYMMETRIC KeyType = 4 + KeyType_KEY_TYPE_HMAC KeyType = 5 + KeyType_KEY_TYPE_MPC KeyType = 6 + KeyType_KEY_TYPE_ZK KeyType = 7 + KeyType_KEY_TYPE_WEBAUTHN KeyType = 8 + KeyType_KEY_TYPE_BIP32 KeyType = 9 +) + +// Enum value maps for KeyType. +var ( + KeyType_name = map[int32]string{ + 0: "KEY_TYPE_UNSPECIFIED", + 1: "KEY_TYPE_OCTET", + 2: "KEY_TYPE_ELLIPTIC", + 3: "KEY_TYPE_RSA", + 4: "KEY_TYPE_SYMMETRIC", + 5: "KEY_TYPE_HMAC", + 6: "KEY_TYPE_MPC", + 7: "KEY_TYPE_ZK", + 8: "KEY_TYPE_WEBAUTHN", + 9: "KEY_TYPE_BIP32", + } + KeyType_value = map[string]int32{ + "KEY_TYPE_UNSPECIFIED": 0, + "KEY_TYPE_OCTET": 1, + "KEY_TYPE_ELLIPTIC": 2, + "KEY_TYPE_RSA": 3, + "KEY_TYPE_SYMMETRIC": 4, + "KEY_TYPE_HMAC": 5, + "KEY_TYPE_MPC": 6, + "KEY_TYPE_ZK": 7, + "KEY_TYPE_WEBAUTHN": 8, + "KEY_TYPE_BIP32": 9, + } +) + +func (x KeyType) Enum() *KeyType { + p := new(KeyType) + *p = x + return p +} + +func (x KeyType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KeyType) Descriptor() protoreflect.EnumDescriptor { + return file_did_v1_genesis_proto_enumTypes[6].Descriptor() +} + +func (KeyType) Type() protoreflect.EnumType { + return &file_did_v1_genesis_proto_enumTypes[6] +} + +func (x KeyType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use KeyType.Descriptor instead. +func (KeyType) EnumDescriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{6} +} + +type KeyshareRole int32 + +const ( + KeyshareRole_KEYSHARE_ROLE_UNSPECIFIED KeyshareRole = 0 + KeyshareRole_KEYSHARE_ROLE_USER KeyshareRole = 1 + KeyshareRole_KEYSHARE_ROLE_VALIDATOR KeyshareRole = 2 +) + +// Enum value maps for KeyshareRole. +var ( + KeyshareRole_name = map[int32]string{ + 0: "KEYSHARE_ROLE_UNSPECIFIED", + 1: "KEYSHARE_ROLE_USER", + 2: "KEYSHARE_ROLE_VALIDATOR", + } + KeyshareRole_value = map[string]int32{ + "KEYSHARE_ROLE_UNSPECIFIED": 0, + "KEYSHARE_ROLE_USER": 1, + "KEYSHARE_ROLE_VALIDATOR": 2, + } +) + +func (x KeyshareRole) Enum() *KeyshareRole { + p := new(KeyshareRole) + *p = x + return p +} + +func (x KeyshareRole) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KeyshareRole) Descriptor() protoreflect.EnumDescriptor { + return file_did_v1_genesis_proto_enumTypes[7].Descriptor() +} + +func (KeyshareRole) Type() protoreflect.EnumType { + return &file_did_v1_genesis_proto_enumTypes[7] +} + +func (x KeyshareRole) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use KeyshareRole.Descriptor instead. +func (KeyshareRole) EnumDescriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{7} +} + +// PermissionScope define the Capabilities Controllers can grant for Services +type PermissionScope int32 + +const ( + PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0 + PermissionScope_PERMISSION_SCOPE_BASIC_INFO PermissionScope = 1 + PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ PermissionScope = 2 + PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE PermissionScope = 3 + PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ PermissionScope = 4 + PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE PermissionScope = 5 + PermissionScope_PERMISSION_SCOPE_WALLETS_READ PermissionScope = 6 + PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE PermissionScope = 7 + PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE PermissionScope = 8 + PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE PermissionScope = 9 + PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY PermissionScope = 10 + PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST PermissionScope = 11 + PermissionScope_PERMISSION_SCOPE_ADMIN_USER PermissionScope = 12 + PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR PermissionScope = 13 +) + +// Enum value maps for PermissionScope. +var ( + PermissionScope_name = map[int32]string{ + 0: "PERMISSION_SCOPE_UNSPECIFIED", + 1: "PERMISSION_SCOPE_BASIC_INFO", + 2: "PERMISSION_SCOPE_PERMISSIONS_READ", + 3: "PERMISSION_SCOPE_PERMISSIONS_WRITE", + 4: "PERMISSION_SCOPE_TRANSACTIONS_READ", + 5: "PERMISSION_SCOPE_TRANSACTIONS_WRITE", + 6: "PERMISSION_SCOPE_WALLETS_READ", + 7: "PERMISSION_SCOPE_WALLETS_CREATE", + 8: "PERMISSION_SCOPE_WALLETS_SUBSCRIBE", + 9: "PERMISSION_SCOPE_WALLETS_UPDATE", + 10: "PERMISSION_SCOPE_TRANSACTIONS_VERIFY", + 11: "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST", + 12: "PERMISSION_SCOPE_ADMIN_USER", + 13: "PERMISSION_SCOPE_ADMIN_VALIDATOR", + } + PermissionScope_value = map[string]int32{ + "PERMISSION_SCOPE_UNSPECIFIED": 0, + "PERMISSION_SCOPE_BASIC_INFO": 1, + "PERMISSION_SCOPE_PERMISSIONS_READ": 2, + "PERMISSION_SCOPE_PERMISSIONS_WRITE": 3, + "PERMISSION_SCOPE_TRANSACTIONS_READ": 4, + "PERMISSION_SCOPE_TRANSACTIONS_WRITE": 5, + "PERMISSION_SCOPE_WALLETS_READ": 6, + "PERMISSION_SCOPE_WALLETS_CREATE": 7, + "PERMISSION_SCOPE_WALLETS_SUBSCRIBE": 8, + "PERMISSION_SCOPE_WALLETS_UPDATE": 9, + "PERMISSION_SCOPE_TRANSACTIONS_VERIFY": 10, + "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": 11, + "PERMISSION_SCOPE_ADMIN_USER": 12, + "PERMISSION_SCOPE_ADMIN_VALIDATOR": 13, + } +) + +func (x PermissionScope) Enum() *PermissionScope { + p := new(PermissionScope) + *p = x + return p +} + +func (x PermissionScope) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PermissionScope) Descriptor() protoreflect.EnumDescriptor { + return file_did_v1_genesis_proto_enumTypes[8].Descriptor() +} + +func (PermissionScope) Type() protoreflect.EnumType { + return &file_did_v1_genesis_proto_enumTypes[8] +} + +func (x PermissionScope) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PermissionScope.Descriptor instead. +func (PermissionScope) EnumDescriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{8} +} + // GenesisState defines the module genesis state type GenesisState struct { state protoimpl.MessageState @@ -1102,6 +7207,8 @@ type GenesisState struct { // Params defines all the parameters of the module. Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + // GlobalIntegrity defines a zkp integrity proof for the entire DID namespace + GlobalIntegrity *GlobalIntegrity `protobuf:"bytes,2,opt,name=global_integrity,json=globalIntegrity,proto3" json:"global_integrity,omitempty"` } func (x *GenesisState) Reset() { @@ -1131,6 +7238,73 @@ func (x *GenesisState) GetParams() *Params { return nil } +func (x *GenesisState) GetGlobalIntegrity() *GlobalIntegrity { + if x != nil { + return x.GlobalIntegrity + } + return nil +} + +// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace +type GlobalIntegrity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + Seed string `protobuf:"bytes,2,opt,name=seed,proto3" json:"seed,omitempty"` + Accumulator []byte `protobuf:"bytes,3,opt,name=accumulator,proto3" json:"accumulator,omitempty"` + Count uint64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GlobalIntegrity) Reset() { + *x = GlobalIntegrity{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GlobalIntegrity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GlobalIntegrity) ProtoMessage() {} + +// Deprecated: Use GlobalIntegrity.ProtoReflect.Descriptor instead. +func (*GlobalIntegrity) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{1} +} + +func (x *GlobalIntegrity) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *GlobalIntegrity) GetSeed() string { + if x != nil { + return x.Seed + } + return "" +} + +func (x *GlobalIntegrity) GetAccumulator() []byte { + if x != nil { + return x.Accumulator + } + return nil +} + +func (x *GlobalIntegrity) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + // Params defines the set of module parameters. type Params struct { state protoimpl.MessageState @@ -1139,14 +7313,22 @@ type Params struct { // Whitelisted Assets WhitelistedAssets []*AssetInfo `protobuf:"bytes,1,rep,name=whitelisted_assets,json=whitelistedAssets,proto3" json:"whitelisted_assets,omitempty"` - // Whitelisted Blockchains - WhitelistedChains []*ChainInfo `protobuf:"bytes,2,rep,name=whitelisted_chains,json=whitelistedChains,proto3" json:"whitelisted_chains,omitempty"` + // Whitelisted Key Types + AllowedPublicKeys map[string]*KeyInfo `protobuf:"bytes,2,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // IpfsActive is a flag to enable/disable ipfs + IpfsActive bool `protobuf:"varint,3,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + // Localhost Registration Enabled + LocalhostRegistrationEnabled bool `protobuf:"varint,4,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"` + // ConveyancePreference defines the conveyance preference + ConveyancePreference string `protobuf:"bytes,5,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` + // AttestationFormats defines the attestation formats + AttestationFormats []string `protobuf:"bytes,6,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` } func (x *Params) Reset() { *x = Params{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_genesis_proto_msgTypes[1] + mi := &file_did_v1_genesis_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1160,7 +7342,7 @@ func (*Params) ProtoMessage() {} // Deprecated: Use Params.ProtoReflect.Descriptor instead. func (*Params) Descriptor() ([]byte, []int) { - return file_did_v1_genesis_proto_rawDescGZIP(), []int{1} + return file_did_v1_genesis_proto_rawDescGZIP(), []int{2} } func (x *Params) GetWhitelistedAssets() []*AssetInfo { @@ -1170,45 +7352,726 @@ func (x *Params) GetWhitelistedAssets() []*AssetInfo { return nil } -func (x *Params) GetWhitelistedChains() []*ChainInfo { +func (x *Params) GetAllowedPublicKeys() map[string]*KeyInfo { if x != nil { - return x.WhitelistedChains + return x.AllowedPublicKeys } return nil } +func (x *Params) GetIpfsActive() bool { + if x != nil { + return x.IpfsActive + } + return false +} + +func (x *Params) GetLocalhostRegistrationEnabled() bool { + if x != nil { + return x.LocalhostRegistrationEnabled + } + return false +} + +func (x *Params) GetConveyancePreference() string { + if x != nil { + return x.ConveyancePreference + } + return "" +} + +func (x *Params) GetAttestationFormats() []string { + if x != nil { + return x.AttestationFormats + } + return nil +} + +// 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 AssetType `protobuf:"varint,4,opt,name=asset_type,json=assetType,proto3,enum=did.v1.AssetType" json:"asset_type,omitempty"` + // The name of the asset + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + // The 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_did_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_did_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() AssetType { + if x != nil { + return x.AssetType + } + return AssetType_ASSET_TYPE_UNSPECIFIED +} + +func (x *AssetInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AssetInfo) GetIconUrl() string { + if x != nil { + return x.IconUrl + } + return "" +} + +// KeyInfo defines information for accepted PubKey types +type KeyInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Role KeyRole `protobuf:"varint,1,opt,name=role,proto3,enum=did.v1.KeyRole" json:"role,omitempty"` + Algorithm KeyAlgorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=did.v1.KeyAlgorithm" json:"algorithm,omitempty"` // e.g., "ES256", "EdDSA", "ES256K" + Encoding KeyEncoding `protobuf:"varint,3,opt,name=encoding,proto3,enum=did.v1.KeyEncoding" json:"encoding,omitempty"` // e.g., "hex", "base64", "multibase" + Curve KeyCurve `protobuf:"varint,4,opt,name=curve,proto3,enum=did.v1.KeyCurve" json:"curve,omitempty"` // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1" + Type_ KeyType `protobuf:"varint,5,opt,name=type,proto3,enum=did.v1.KeyType" json:"type,omitempty"` // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC" +} + +func (x *KeyInfo) Reset() { + *x = KeyInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyInfo) ProtoMessage() {} + +// Deprecated: Use KeyInfo.ProtoReflect.Descriptor instead. +func (*KeyInfo) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{4} +} + +func (x *KeyInfo) GetRole() KeyRole { + if x != nil { + return x.Role + } + return KeyRole_KEY_ROLE_UNSPECIFIED +} + +func (x *KeyInfo) GetAlgorithm() KeyAlgorithm { + if x != nil { + return x.Algorithm + } + return KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED +} + +func (x *KeyInfo) GetEncoding() KeyEncoding { + if x != nil { + return x.Encoding + } + return KeyEncoding_KEY_ENCODING_UNSPECIFIED +} + +func (x *KeyInfo) GetCurve() KeyCurve { + if x != nil { + return x.Curve + } + return KeyCurve_KEY_CURVE_UNSPECIFIED +} + +func (x *KeyInfo) GetType_() KeyType { + if x != nil { + return x.Type_ + } + return KeyType_KEY_TYPE_UNSPECIFIED +} + +// ValidatorInfo defines information for accepted Validator nodes +type ValidatorInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + GrpcEndpoints []*ValidatorInfo_Endpoint `protobuf:"bytes,2,rep,name=grpc_endpoints,json=grpcEndpoints,proto3" json:"grpc_endpoints,omitempty"` + RestEndpoints []*ValidatorInfo_Endpoint `protobuf:"bytes,3,rep,name=rest_endpoints,json=restEndpoints,proto3" json:"rest_endpoints,omitempty"` + Explorer *ValidatorInfo_ExplorerInfo `protobuf:"bytes,4,opt,name=explorer,proto3" json:"explorer,omitempty"` + FeeInfo *ValidatorInfo_FeeInfo `protobuf:"bytes,5,opt,name=fee_info,json=feeInfo,proto3" json:"fee_info,omitempty"` + IbcChannel *ValidatorInfo_IBCChannel `protobuf:"bytes,6,opt,name=ibc_channel,json=ibcChannel,proto3" json:"ibc_channel,omitempty"` +} + +func (x *ValidatorInfo) Reset() { + *x = ValidatorInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidatorInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorInfo) ProtoMessage() {} + +// Deprecated: Use ValidatorInfo.ProtoReflect.Descriptor instead. +func (*ValidatorInfo) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{5} +} + +func (x *ValidatorInfo) GetMoniker() string { + if x != nil { + return x.Moniker + } + return "" +} + +func (x *ValidatorInfo) GetGrpcEndpoints() []*ValidatorInfo_Endpoint { + if x != nil { + return x.GrpcEndpoints + } + return nil +} + +func (x *ValidatorInfo) GetRestEndpoints() []*ValidatorInfo_Endpoint { + if x != nil { + return x.RestEndpoints + } + return nil +} + +func (x *ValidatorInfo) GetExplorer() *ValidatorInfo_ExplorerInfo { + if x != nil { + return x.Explorer + } + return nil +} + +func (x *ValidatorInfo) GetFeeInfo() *ValidatorInfo_FeeInfo { + if x != nil { + return x.FeeInfo + } + return nil +} + +func (x *ValidatorInfo) GetIbcChannel() *ValidatorInfo_IBCChannel { + if x != nil { + return x.IbcChannel + } + return nil +} + +// Endpoint defines an endpoint +type ValidatorInfo_Endpoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + IsPrimary bool `protobuf:"varint,2,opt,name=is_primary,json=isPrimary,proto3" json:"is_primary,omitempty"` +} + +func (x *ValidatorInfo_Endpoint) Reset() { + *x = ValidatorInfo_Endpoint{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidatorInfo_Endpoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorInfo_Endpoint) ProtoMessage() {} + +// Deprecated: Use ValidatorInfo_Endpoint.ProtoReflect.Descriptor instead. +func (*ValidatorInfo_Endpoint) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *ValidatorInfo_Endpoint) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *ValidatorInfo_Endpoint) GetIsPrimary() bool { + if x != nil { + return x.IsPrimary + } + return false +} + +// ExplorerInfo defines the explorer info +type ValidatorInfo_ExplorerInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` +} + +func (x *ValidatorInfo_ExplorerInfo) Reset() { + *x = ValidatorInfo_ExplorerInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidatorInfo_ExplorerInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorInfo_ExplorerInfo) ProtoMessage() {} + +// Deprecated: Use ValidatorInfo_ExplorerInfo.ProtoReflect.Descriptor instead. +func (*ValidatorInfo_ExplorerInfo) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{5, 1} +} + +func (x *ValidatorInfo_ExplorerInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ValidatorInfo_ExplorerInfo) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +// FeeInfo defines a fee info +type ValidatorInfo_FeeInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + FeeRates []string `protobuf:"bytes,2,rep,name=fee_rates,json=feeRates,proto3" json:"fee_rates,omitempty"` + InitGasLimit int32 `protobuf:"varint,3,opt,name=init_gas_limit,json=initGasLimit,proto3" json:"init_gas_limit,omitempty"` + IsSimulable bool `protobuf:"varint,4,opt,name=is_simulable,json=isSimulable,proto3" json:"is_simulable,omitempty"` + GasMultiply float64 `protobuf:"fixed64,5,opt,name=gas_multiply,json=gasMultiply,proto3" json:"gas_multiply,omitempty"` +} + +func (x *ValidatorInfo_FeeInfo) Reset() { + *x = ValidatorInfo_FeeInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidatorInfo_FeeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorInfo_FeeInfo) ProtoMessage() {} + +// Deprecated: Use ValidatorInfo_FeeInfo.ProtoReflect.Descriptor instead. +func (*ValidatorInfo_FeeInfo) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{5, 2} +} + +func (x *ValidatorInfo_FeeInfo) GetBaseDenom() string { + if x != nil { + return x.BaseDenom + } + return "" +} + +func (x *ValidatorInfo_FeeInfo) GetFeeRates() []string { + if x != nil { + return x.FeeRates + } + return nil +} + +func (x *ValidatorInfo_FeeInfo) GetInitGasLimit() int32 { + if x != nil { + return x.InitGasLimit + } + return 0 +} + +func (x *ValidatorInfo_FeeInfo) GetIsSimulable() bool { + if x != nil { + return x.IsSimulable + } + return false +} + +func (x *ValidatorInfo_FeeInfo) GetGasMultiply() float64 { + if x != nil { + return x.GasMultiply + } + return 0 +} + +// IBCChannel defines the IBC channel info +type ValidatorInfo_IBCChannel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Port string `protobuf:"bytes,2,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *ValidatorInfo_IBCChannel) Reset() { + *x = ValidatorInfo_IBCChannel{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_genesis_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidatorInfo_IBCChannel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorInfo_IBCChannel) ProtoMessage() {} + +// Deprecated: Use ValidatorInfo_IBCChannel.ProtoReflect.Descriptor instead. +func (*ValidatorInfo_IBCChannel) Descriptor() ([]byte, []int) { + return file_did_v1_genesis_proto_rawDescGZIP(), []int{5, 3} +} + +func (x *ValidatorInfo_IBCChannel) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ValidatorInfo_IBCChannel) GetPort() string { + if x != nil { + return x.Port + } + return "" +} + var File_did_v1_genesis_proto protoreflect.FileDescriptor var file_did_v1_genesis_proto_rawDesc = []byte{ 0x0a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x14, - 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, - 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3c, 0x0a, 0x0c, 0x47, - 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, - 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xa5, 0x01, 0x0a, 0x06, 0x50, 0x61, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x11, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x42, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x52, 0x0f, 0x67, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x22, 0x7d, 0x0a, 0x0f, 0x47, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x65, 0x65, + 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, + 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xde, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, - 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, - 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, - 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, - 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 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, 0x68, 0x77, 0x61, 0x79, 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, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x55, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x64, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1f, 0x0a, + 0x0b, 0x69, 0x70, 0x66, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x69, 0x70, 0x66, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x44, + 0x0a, 0x1e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, + 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, + 0x63, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x50, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x1a, 0x55, 0x0a, 0x16, 0x41, 0x6c, + 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, + 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, + 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xac, 0x01, 0x0a, 0x09, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, + 0x0a, 0x03, 0x68, 0x72, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x72, 0x70, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x30, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x22, 0xe0, 0x01, 0x0a, 0x07, 0x4b, 0x65, + 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, + 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x61, 0x6c, + 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x2f, + 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, + 0x26, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, + 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, + 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xcd, 0x05, 0x0a, + 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, 0x67, 0x72, 0x70, 0x63, + 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x52, 0x0d, 0x67, 0x72, 0x70, 0x63, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, + 0x45, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x45, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x45, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x3e, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x78, + 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x08, 0x66, 0x65, 0x65, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x46, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x66, 0x65, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x41, 0x0a, 0x0b, 0x69, 0x62, 0x63, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x49, 0x42, 0x43, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x0a, 0x69, 0x62, 0x63, 0x43, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x1a, 0x3b, 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, + 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, + 0x1a, 0x34, 0x0a, 0x0c, 0x45, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x1a, 0xb1, 0x01, 0x0a, 0x07, 0x46, 0x65, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, 0x44, 0x65, 0x6e, 0x6f, + 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x66, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x73, 0x12, 0x24, + 0x0a, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x47, 0x61, 0x73, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x73, 0x69, 0x6d, 0x75, 0x6c, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x53, 0x69, + 0x6d, 0x75, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x61, 0x73, 0x5f, 0x6d, + 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x67, + 0x61, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x1a, 0x30, 0x0a, 0x0a, 0x49, 0x42, + 0x43, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x2a, 0xac, 0x01, 0x0a, + 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x53, + 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x41, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x16, 0x0a, + 0x12, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x57, 0x52, 0x41, 0x50, + 0x50, 0x45, 0x44, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4b, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x13, 0x0a, + 0x0f, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x4f, 0x4f, 0x4c, + 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x32, 0x30, 0x10, 0x06, 0x2a, 0xf9, 0x01, 0x0a, 0x0c, + 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x19, + 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x44, + 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x46, + 0x53, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, + 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x4f, 0x4e, 0x52, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x44, + 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x42, 0x49, 0x54, + 0x43, 0x4f, 0x49, 0x4e, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, + 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x45, 0x54, 0x48, 0x45, 0x52, 0x45, 0x55, 0x4d, + 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, + 0x41, 0x43, 0x45, 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x49, 0x44, + 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x57, 0x45, 0x42, 0x41, 0x55, + 0x54, 0x48, 0x4e, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, + 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x44, 0x57, 0x4e, 0x10, 0x07, 0x12, 0x19, 0x0a, 0x15, + 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, + 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x08, 0x2a, 0xc4, 0x01, 0x0a, 0x0c, 0x4b, 0x65, 0x79, 0x41, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1d, 0x0a, 0x19, 0x4b, 0x45, 0x59, 0x5f, + 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, + 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x32, 0x35, 0x36, 0x10, 0x01, + 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, + 0x4d, 0x5f, 0x45, 0x53, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, + 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x35, 0x31, 0x32, + 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, + 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x44, 0x44, 0x53, 0x41, 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14, 0x4b, + 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x32, + 0x35, 0x36, 0x4b, 0x10, 0x05, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, + 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x10, 0x06, 0x2a, 0x81, + 0x02, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x4b, + 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, + 0x52, 0x56, 0x45, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, + 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x12, + 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x35, 0x32, 0x31, + 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, + 0x58, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, + 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x58, 0x34, 0x34, 0x38, 0x10, 0x05, 0x12, 0x15, 0x0a, 0x11, + 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x45, 0x44, 0x32, 0x35, 0x35, 0x31, + 0x39, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, + 0x5f, 0x45, 0x44, 0x34, 0x34, 0x38, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, + 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x32, 0x35, 0x36, 0x4b, 0x31, 0x10, + 0x08, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x42, + 0x4c, 0x53, 0x31, 0x32, 0x33, 0x38, 0x31, 0x10, 0x09, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, + 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x4b, 0x45, 0x43, 0x43, 0x41, 0x4b, 0x32, 0x35, 0x36, + 0x10, 0x0a, 0x2a, 0x73, 0x0a, 0x0b, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, + 0x67, 0x12, 0x1c, 0x0a, 0x18, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, + 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, + 0x52, 0x41, 0x57, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, + 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x48, 0x45, 0x58, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4b, + 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4d, 0x55, 0x4c, 0x54, + 0x49, 0x42, 0x41, 0x53, 0x45, 0x10, 0x03, 0x2a, 0x8a, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x52, + 0x6f, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, + 0x17, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, + 0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, + 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x53, 0x53, 0x45, 0x52, 0x54, 0x49, 0x4f, 0x4e, + 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x44, + 0x45, 0x4c, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, + 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x4f, 0x43, 0x41, 0x54, 0x49, + 0x4f, 0x4e, 0x10, 0x04, 0x2a, 0xd9, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, + 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x43, 0x54, 0x45, 0x54, 0x10, 0x01, 0x12, 0x15, + 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4c, 0x4c, 0x49, 0x50, + 0x54, 0x49, 0x43, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x52, 0x53, 0x41, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x04, 0x12, + 0x11, 0x0a, 0x0d, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x4d, 0x41, 0x43, + 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, + 0x50, 0x43, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x5a, 0x4b, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x57, 0x45, 0x42, 0x41, 0x55, 0x54, 0x48, 0x4e, 0x10, 0x08, 0x12, 0x12, 0x0a, 0x0e, + 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x49, 0x50, 0x33, 0x32, 0x10, 0x09, + 0x2a, 0x62, 0x0a, 0x0c, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x52, 0x6f, 0x6c, 0x65, + 0x12, 0x1d, 0x0a, 0x19, 0x4b, 0x45, 0x59, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5f, 0x52, 0x4f, 0x4c, + 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x53, 0x48, 0x41, 0x52, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, + 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x45, 0x59, 0x53, 0x48, + 0x41, 0x52, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, + 0x4f, 0x52, 0x10, 0x02, 0x2a, 0xa7, 0x04, 0x0a, 0x0f, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x45, 0x52, 0x4d, + 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x45, + 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x42, + 0x41, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, 0x50, + 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, + 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44, + 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, + 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, + 0x4e, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x03, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, + 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, + 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44, + 0x10, 0x04, 0x12, 0x27, 0x0a, 0x23, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, + 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, + 0x4f, 0x4e, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x05, 0x12, 0x21, 0x0a, 0x1d, 0x50, + 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, + 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x06, 0x12, 0x23, + 0x0a, 0x1f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, + 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, + 0x45, 0x10, 0x07, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, + 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, + 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x10, 0x08, 0x12, 0x23, 0x0a, 0x1f, 0x50, + 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, + 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x09, + 0x12, 0x28, 0x0a, 0x24, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, + 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, + 0x53, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x0a, 0x12, 0x2b, 0x0a, 0x27, 0x50, 0x45, + 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, + 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x42, 0x52, 0x4f, 0x41, + 0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0x0b, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x45, 0x52, 0x4d, 0x49, + 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49, + 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x0c, 0x12, 0x24, 0x0a, 0x20, 0x50, 0x45, 0x52, 0x4d, + 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x41, 0x44, 0x4d, + 0x49, 0x4e, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x0d, 0x42, 0x7c, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, + 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, + 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, + 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1223,22 +8086,52 @@ 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, 2) +var file_did_v1_genesis_proto_enumTypes = make([]protoimpl.EnumInfo, 9) +var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_did_v1_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: did.v1.GenesisState - (*Params)(nil), // 1: did.v1.Params - (*AssetInfo)(nil), // 2: did.v1.AssetInfo - (*ChainInfo)(nil), // 3: did.v1.ChainInfo + (AssetType)(0), // 0: did.v1.AssetType + (DIDNamespace)(0), // 1: did.v1.DIDNamespace + (KeyAlgorithm)(0), // 2: did.v1.KeyAlgorithm + (KeyCurve)(0), // 3: did.v1.KeyCurve + (KeyEncoding)(0), // 4: did.v1.KeyEncoding + (KeyRole)(0), // 5: did.v1.KeyRole + (KeyType)(0), // 6: did.v1.KeyType + (KeyshareRole)(0), // 7: did.v1.KeyshareRole + (PermissionScope)(0), // 8: did.v1.PermissionScope + (*GenesisState)(nil), // 9: did.v1.GenesisState + (*GlobalIntegrity)(nil), // 10: did.v1.GlobalIntegrity + (*Params)(nil), // 11: did.v1.Params + (*AssetInfo)(nil), // 12: did.v1.AssetInfo + (*KeyInfo)(nil), // 13: did.v1.KeyInfo + (*ValidatorInfo)(nil), // 14: did.v1.ValidatorInfo + nil, // 15: did.v1.Params.AllowedPublicKeysEntry + (*ValidatorInfo_Endpoint)(nil), // 16: did.v1.ValidatorInfo.Endpoint + (*ValidatorInfo_ExplorerInfo)(nil), // 17: did.v1.ValidatorInfo.ExplorerInfo + (*ValidatorInfo_FeeInfo)(nil), // 18: did.v1.ValidatorInfo.FeeInfo + (*ValidatorInfo_IBCChannel)(nil), // 19: did.v1.ValidatorInfo.IBCChannel } var file_did_v1_genesis_proto_depIdxs = []int32{ - 1, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params - 2, // 1: did.v1.Params.whitelisted_assets:type_name -> did.v1.AssetInfo - 3, // 2: did.v1.Params.whitelisted_chains:type_name -> did.v1.ChainInfo - 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 + 11, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params + 10, // 1: did.v1.GenesisState.global_integrity:type_name -> did.v1.GlobalIntegrity + 12, // 2: did.v1.Params.whitelisted_assets:type_name -> did.v1.AssetInfo + 15, // 3: did.v1.Params.allowed_public_keys:type_name -> did.v1.Params.AllowedPublicKeysEntry + 0, // 4: did.v1.AssetInfo.asset_type:type_name -> did.v1.AssetType + 5, // 5: did.v1.KeyInfo.role:type_name -> did.v1.KeyRole + 2, // 6: did.v1.KeyInfo.algorithm:type_name -> did.v1.KeyAlgorithm + 4, // 7: did.v1.KeyInfo.encoding:type_name -> did.v1.KeyEncoding + 3, // 8: did.v1.KeyInfo.curve:type_name -> did.v1.KeyCurve + 6, // 9: did.v1.KeyInfo.type:type_name -> did.v1.KeyType + 16, // 10: did.v1.ValidatorInfo.grpc_endpoints:type_name -> did.v1.ValidatorInfo.Endpoint + 16, // 11: did.v1.ValidatorInfo.rest_endpoints:type_name -> did.v1.ValidatorInfo.Endpoint + 17, // 12: did.v1.ValidatorInfo.explorer:type_name -> did.v1.ValidatorInfo.ExplorerInfo + 18, // 13: did.v1.ValidatorInfo.fee_info:type_name -> did.v1.ValidatorInfo.FeeInfo + 19, // 14: did.v1.ValidatorInfo.ibc_channel:type_name -> did.v1.ValidatorInfo.IBCChannel + 13, // 15: did.v1.Params.AllowedPublicKeysEntry.value:type_name -> did.v1.KeyInfo + 16, // [16:16] is the sub-list for method output_type + 16, // [16:16] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_did_v1_genesis_proto_init() } @@ -1261,6 +8154,18 @@ func file_did_v1_genesis_proto_init() { } } file_did_v1_genesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GlobalIntegrity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Params); i { case 0: return &v.state @@ -1272,19 +8177,104 @@ 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.(*AssetInfo); 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.(*KeyInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_genesis_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidatorInfo); 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[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidatorInfo_Endpoint); 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[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidatorInfo_ExplorerInfo); 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[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidatorInfo_FeeInfo); 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[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidatorInfo_IBCChannel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_genesis_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, + NumEnums: 9, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, GoTypes: file_did_v1_genesis_proto_goTypes, DependencyIndexes: file_did_v1_genesis_proto_depIdxs, + EnumInfos: file_did_v1_genesis_proto_enumTypes, MessageInfos: file_did_v1_genesis_proto_msgTypes, }.Build() File_did_v1_genesis_proto = out.File diff --git a/api/did/v1/models.pulsar.go b/api/did/v1/models.pulsar.go new file mode 100644 index 000000000..4cea413c9 --- /dev/null +++ b/api/did/v1/models.pulsar.go @@ -0,0 +1,10267 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package didv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sort "sort" + sync "sync" +) + +var ( + md_Alias protoreflect.MessageDescriptor + fd_Alias_subject protoreflect.FieldDescriptor + fd_Alias_origin protoreflect.FieldDescriptor + fd_Alias_controller protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_Alias = File_did_v1_models_proto.Messages().ByName("Alias") + fd_Alias_subject = md_Alias.Fields().ByName("subject") + fd_Alias_origin = md_Alias.Fields().ByName("origin") + fd_Alias_controller = md_Alias.Fields().ByName("controller") +} + +var _ protoreflect.Message = (*fastReflection_Alias)(nil) + +type fastReflection_Alias Alias + +func (x *Alias) ProtoReflect() protoreflect.Message { + return (*fastReflection_Alias)(x) +} + +func (x *Alias) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_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_Alias_messageType fastReflection_Alias_messageType +var _ protoreflect.MessageType = fastReflection_Alias_messageType{} + +type fastReflection_Alias_messageType struct{} + +func (x fastReflection_Alias_messageType) Zero() protoreflect.Message { + return (*fastReflection_Alias)(nil) +} +func (x fastReflection_Alias_messageType) New() protoreflect.Message { + return new(fastReflection_Alias) +} +func (x fastReflection_Alias_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Alias +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Alias) Descriptor() protoreflect.MessageDescriptor { + return md_Alias +} + +// 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_Alias) Type() protoreflect.MessageType { + return _fastReflection_Alias_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Alias) New() protoreflect.Message { + return new(fastReflection_Alias) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Alias) Interface() protoreflect.ProtoMessage { + return (*Alias)(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_Alias) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_Alias_subject, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_Alias_origin, value) { + return + } + } + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_Alias_controller, 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_Alias) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Alias.subject": + return x.Subject != "" + case "did.v1.Alias.origin": + return x.Origin != "" + case "did.v1.Alias.controller": + return x.Controller != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) + } + panic(fmt.Errorf("message did.v1.Alias 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_Alias) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Alias.subject": + x.Subject = "" + case "did.v1.Alias.origin": + x.Origin = "" + case "did.v1.Alias.controller": + x.Controller = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) + } + panic(fmt.Errorf("message did.v1.Alias 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_Alias) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Alias.subject": + value := x.Subject + return protoreflect.ValueOfString(value) + case "did.v1.Alias.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.Alias.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) + } + panic(fmt.Errorf("message did.v1.Alias 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_Alias) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Alias.subject": + x.Subject = value.Interface().(string) + case "did.v1.Alias.origin": + x.Origin = value.Interface().(string) + case "did.v1.Alias.controller": + x.Controller = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) + } + panic(fmt.Errorf("message did.v1.Alias 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_Alias) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Alias.subject": + panic(fmt.Errorf("field subject of message did.v1.Alias is not mutable")) + case "did.v1.Alias.origin": + panic(fmt.Errorf("field origin of message did.v1.Alias is not mutable")) + case "did.v1.Alias.controller": + panic(fmt.Errorf("field controller of message did.v1.Alias is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) + } + panic(fmt.Errorf("message did.v1.Alias 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_Alias) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Alias.subject": + return protoreflect.ValueOfString("") + case "did.v1.Alias.origin": + return protoreflect.ValueOfString("") + case "did.v1.Alias.controller": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Alias")) + } + panic(fmt.Errorf("message did.v1.Alias 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_Alias) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Alias", 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_Alias) 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_Alias) 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_Alias) 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_Alias) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Alias) + 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.Subject) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Controller) + 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().(*Alias) + 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.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + i-- + dAtA[i] = 0x1a + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + 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().(*Alias) + 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: Alias: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Alias: 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 Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 = (*_Credential_6_list)(nil) + +type _Credential_6_list struct { + list *[]string +} + +func (x *_Credential_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Credential_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Credential_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Credential_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Credential_6_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Credential at list field Transport as it is not of Message kind")) +} + +func (x *_Credential_6_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Credential_6_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Credential_6_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Credential protoreflect.MessageDescriptor + fd_Credential_subject protoreflect.FieldDescriptor + fd_Credential_attestation_type protoreflect.FieldDescriptor + fd_Credential_origin protoreflect.FieldDescriptor + fd_Credential_credential_id protoreflect.FieldDescriptor + fd_Credential_public_key protoreflect.FieldDescriptor + fd_Credential_transport protoreflect.FieldDescriptor + fd_Credential_sign_count protoreflect.FieldDescriptor + fd_Credential_user_present protoreflect.FieldDescriptor + fd_Credential_user_verified protoreflect.FieldDescriptor + fd_Credential_backup_eligible protoreflect.FieldDescriptor + fd_Credential_backup_state protoreflect.FieldDescriptor + fd_Credential_clone_warning protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_Credential = File_did_v1_models_proto.Messages().ByName("Credential") + fd_Credential_subject = md_Credential.Fields().ByName("subject") + fd_Credential_attestation_type = md_Credential.Fields().ByName("attestation_type") + fd_Credential_origin = md_Credential.Fields().ByName("origin") + fd_Credential_credential_id = md_Credential.Fields().ByName("credential_id") + fd_Credential_public_key = md_Credential.Fields().ByName("public_key") + fd_Credential_transport = md_Credential.Fields().ByName("transport") + fd_Credential_sign_count = md_Credential.Fields().ByName("sign_count") + fd_Credential_user_present = md_Credential.Fields().ByName("user_present") + fd_Credential_user_verified = md_Credential.Fields().ByName("user_verified") + fd_Credential_backup_eligible = md_Credential.Fields().ByName("backup_eligible") + fd_Credential_backup_state = md_Credential.Fields().ByName("backup_state") + fd_Credential_clone_warning = md_Credential.Fields().ByName("clone_warning") +} + +var _ protoreflect.Message = (*fastReflection_Credential)(nil) + +type fastReflection_Credential Credential + +func (x *Credential) ProtoReflect() protoreflect.Message { + return (*fastReflection_Credential)(x) +} + +func (x *Credential) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_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_Credential_messageType fastReflection_Credential_messageType +var _ protoreflect.MessageType = fastReflection_Credential_messageType{} + +type fastReflection_Credential_messageType struct{} + +func (x fastReflection_Credential_messageType) Zero() protoreflect.Message { + return (*fastReflection_Credential)(nil) +} +func (x fastReflection_Credential_messageType) New() protoreflect.Message { + return new(fastReflection_Credential) +} +func (x fastReflection_Credential_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Credential +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Credential) Descriptor() protoreflect.MessageDescriptor { + return md_Credential +} + +// 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_Credential) Type() protoreflect.MessageType { + return _fastReflection_Credential_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Credential) New() protoreflect.Message { + return new(fastReflection_Credential) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Credential) Interface() protoreflect.ProtoMessage { + return (*Credential)(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_Credential) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_Credential_subject, value) { + return + } + } + if x.AttestationType != "" { + value := protoreflect.ValueOfString(x.AttestationType) + if !f(fd_Credential_attestation_type, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_Credential_origin, value) { + return + } + } + if len(x.CredentialId) != 0 { + value := protoreflect.ValueOfBytes(x.CredentialId) + if !f(fd_Credential_credential_id, value) { + return + } + } + if len(x.PublicKey) != 0 { + value := protoreflect.ValueOfBytes(x.PublicKey) + if !f(fd_Credential_public_key, value) { + return + } + } + if len(x.Transport) != 0 { + value := protoreflect.ValueOfList(&_Credential_6_list{list: &x.Transport}) + if !f(fd_Credential_transport, value) { + return + } + } + if x.SignCount != uint32(0) { + value := protoreflect.ValueOfUint32(x.SignCount) + if !f(fd_Credential_sign_count, value) { + return + } + } + if x.UserPresent != false { + value := protoreflect.ValueOfBool(x.UserPresent) + if !f(fd_Credential_user_present, value) { + return + } + } + if x.UserVerified != false { + value := protoreflect.ValueOfBool(x.UserVerified) + if !f(fd_Credential_user_verified, value) { + return + } + } + if x.BackupEligible != false { + value := protoreflect.ValueOfBool(x.BackupEligible) + if !f(fd_Credential_backup_eligible, value) { + return + } + } + if x.BackupState != false { + value := protoreflect.ValueOfBool(x.BackupState) + if !f(fd_Credential_backup_state, value) { + return + } + } + if x.CloneWarning != false { + value := protoreflect.ValueOfBool(x.CloneWarning) + if !f(fd_Credential_clone_warning, 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_Credential) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Credential.subject": + return x.Subject != "" + case "did.v1.Credential.attestation_type": + return x.AttestationType != "" + case "did.v1.Credential.origin": + return x.Origin != "" + case "did.v1.Credential.credential_id": + return len(x.CredentialId) != 0 + case "did.v1.Credential.public_key": + return len(x.PublicKey) != 0 + case "did.v1.Credential.transport": + return len(x.Transport) != 0 + case "did.v1.Credential.sign_count": + return x.SignCount != uint32(0) + case "did.v1.Credential.user_present": + return x.UserPresent != false + case "did.v1.Credential.user_verified": + return x.UserVerified != false + case "did.v1.Credential.backup_eligible": + return x.BackupEligible != false + case "did.v1.Credential.backup_state": + return x.BackupState != false + case "did.v1.Credential.clone_warning": + return x.CloneWarning != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) + } + panic(fmt.Errorf("message did.v1.Credential 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_Credential) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Credential.subject": + x.Subject = "" + case "did.v1.Credential.attestation_type": + x.AttestationType = "" + case "did.v1.Credential.origin": + x.Origin = "" + case "did.v1.Credential.credential_id": + x.CredentialId = nil + case "did.v1.Credential.public_key": + x.PublicKey = nil + case "did.v1.Credential.transport": + x.Transport = nil + case "did.v1.Credential.sign_count": + x.SignCount = uint32(0) + case "did.v1.Credential.user_present": + x.UserPresent = false + case "did.v1.Credential.user_verified": + x.UserVerified = false + case "did.v1.Credential.backup_eligible": + x.BackupEligible = false + case "did.v1.Credential.backup_state": + x.BackupState = false + case "did.v1.Credential.clone_warning": + x.CloneWarning = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) + } + panic(fmt.Errorf("message did.v1.Credential 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_Credential) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Credential.subject": + value := x.Subject + return protoreflect.ValueOfString(value) + case "did.v1.Credential.attestation_type": + value := x.AttestationType + return protoreflect.ValueOfString(value) + case "did.v1.Credential.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.Credential.credential_id": + value := x.CredentialId + return protoreflect.ValueOfBytes(value) + case "did.v1.Credential.public_key": + value := x.PublicKey + return protoreflect.ValueOfBytes(value) + case "did.v1.Credential.transport": + if len(x.Transport) == 0 { + return protoreflect.ValueOfList(&_Credential_6_list{}) + } + listValue := &_Credential_6_list{list: &x.Transport} + return protoreflect.ValueOfList(listValue) + case "did.v1.Credential.sign_count": + value := x.SignCount + return protoreflect.ValueOfUint32(value) + case "did.v1.Credential.user_present": + value := x.UserPresent + return protoreflect.ValueOfBool(value) + case "did.v1.Credential.user_verified": + value := x.UserVerified + return protoreflect.ValueOfBool(value) + case "did.v1.Credential.backup_eligible": + value := x.BackupEligible + return protoreflect.ValueOfBool(value) + case "did.v1.Credential.backup_state": + value := x.BackupState + return protoreflect.ValueOfBool(value) + case "did.v1.Credential.clone_warning": + value := x.CloneWarning + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) + } + panic(fmt.Errorf("message did.v1.Credential 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_Credential) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Credential.subject": + x.Subject = value.Interface().(string) + case "did.v1.Credential.attestation_type": + x.AttestationType = value.Interface().(string) + case "did.v1.Credential.origin": + x.Origin = value.Interface().(string) + case "did.v1.Credential.credential_id": + x.CredentialId = value.Bytes() + case "did.v1.Credential.public_key": + x.PublicKey = value.Bytes() + case "did.v1.Credential.transport": + lv := value.List() + clv := lv.(*_Credential_6_list) + x.Transport = *clv.list + case "did.v1.Credential.sign_count": + x.SignCount = uint32(value.Uint()) + case "did.v1.Credential.user_present": + x.UserPresent = value.Bool() + case "did.v1.Credential.user_verified": + x.UserVerified = value.Bool() + case "did.v1.Credential.backup_eligible": + x.BackupEligible = value.Bool() + case "did.v1.Credential.backup_state": + x.BackupState = value.Bool() + case "did.v1.Credential.clone_warning": + x.CloneWarning = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) + } + panic(fmt.Errorf("message did.v1.Credential 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_Credential) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Credential.transport": + if x.Transport == nil { + x.Transport = []string{} + } + value := &_Credential_6_list{list: &x.Transport} + return protoreflect.ValueOfList(value) + case "did.v1.Credential.subject": + panic(fmt.Errorf("field subject of message did.v1.Credential is not mutable")) + case "did.v1.Credential.attestation_type": + panic(fmt.Errorf("field attestation_type of message did.v1.Credential is not mutable")) + case "did.v1.Credential.origin": + panic(fmt.Errorf("field origin of message did.v1.Credential is not mutable")) + case "did.v1.Credential.credential_id": + panic(fmt.Errorf("field credential_id of message did.v1.Credential is not mutable")) + case "did.v1.Credential.public_key": + panic(fmt.Errorf("field public_key of message did.v1.Credential is not mutable")) + case "did.v1.Credential.sign_count": + panic(fmt.Errorf("field sign_count of message did.v1.Credential is not mutable")) + case "did.v1.Credential.user_present": + panic(fmt.Errorf("field user_present of message did.v1.Credential is not mutable")) + case "did.v1.Credential.user_verified": + panic(fmt.Errorf("field user_verified of message did.v1.Credential is not mutable")) + case "did.v1.Credential.backup_eligible": + panic(fmt.Errorf("field backup_eligible of message did.v1.Credential is not mutable")) + case "did.v1.Credential.backup_state": + panic(fmt.Errorf("field backup_state of message did.v1.Credential is not mutable")) + case "did.v1.Credential.clone_warning": + panic(fmt.Errorf("field clone_warning of message did.v1.Credential is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) + } + panic(fmt.Errorf("message did.v1.Credential 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_Credential) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Credential.subject": + return protoreflect.ValueOfString("") + case "did.v1.Credential.attestation_type": + return protoreflect.ValueOfString("") + case "did.v1.Credential.origin": + return protoreflect.ValueOfString("") + case "did.v1.Credential.credential_id": + return protoreflect.ValueOfBytes(nil) + case "did.v1.Credential.public_key": + return protoreflect.ValueOfBytes(nil) + case "did.v1.Credential.transport": + list := []string{} + return protoreflect.ValueOfList(&_Credential_6_list{list: &list}) + case "did.v1.Credential.sign_count": + return protoreflect.ValueOfUint32(uint32(0)) + case "did.v1.Credential.user_present": + return protoreflect.ValueOfBool(false) + case "did.v1.Credential.user_verified": + return protoreflect.ValueOfBool(false) + case "did.v1.Credential.backup_eligible": + return protoreflect.ValueOfBool(false) + case "did.v1.Credential.backup_state": + return protoreflect.ValueOfBool(false) + case "did.v1.Credential.clone_warning": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Credential")) + } + panic(fmt.Errorf("message did.v1.Credential 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_Credential) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Credential", 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_Credential) 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_Credential) 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_Credential) 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_Credential) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Credential) + 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.Subject) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.AttestationType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CredentialId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PublicKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Transport) > 0 { + for _, s := range x.Transport { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.SignCount != 0 { + n += 1 + runtime.Sov(uint64(x.SignCount)) + } + if x.UserPresent { + n += 2 + } + if x.UserVerified { + n += 2 + } + if x.BackupEligible { + n += 2 + } + if x.BackupState { + n += 2 + } + if x.CloneWarning { + n += 2 + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Credential) + 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.CloneWarning { + i-- + if x.CloneWarning { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if x.BackupState { + i-- + if x.BackupState { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if x.BackupEligible { + i-- + if x.BackupEligible { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if x.UserVerified { + i-- + if x.UserVerified { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if x.UserPresent { + i-- + if x.UserPresent { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if x.SignCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.SignCount)) + i-- + dAtA[i] = 0x38 + } + if len(x.Transport) > 0 { + for iNdEx := len(x.Transport) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Transport[iNdEx]) + copy(dAtA[i:], x.Transport[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Transport[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(x.PublicKey) > 0 { + i -= len(x.PublicKey) + copy(dAtA[i:], x.PublicKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) + i-- + dAtA[i] = 0x2a + } + if len(x.CredentialId) > 0 { + i -= len(x.CredentialId) + copy(dAtA[i:], x.CredentialId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CredentialId))) + i-- + dAtA[i] = 0x22 + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x1a + } + if len(x.AttestationType) > 0 { + i -= len(x.AttestationType) + copy(dAtA[i:], x.AttestationType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationType))) + i-- + dAtA[i] = 0x12 + } + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + i-- + dAtA[i] = 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().(*Credential) + 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: Credential: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Credential: 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 Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AttestationType", 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.AttestationType = 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 Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CredentialId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CredentialId = append(x.CredentialId[:0], dAtA[iNdEx:postIndex]...) + if x.CredentialId == nil { + x.CredentialId = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", 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.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if x.PublicKey == nil { + x.PublicKey = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Transport", 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.Transport = append(x.Transport, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SignCount", wireType) + } + x.SignCount = 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.SignCount |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UserPresent", 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.UserPresent = bool(v != 0) + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UserVerified", 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.UserVerified = bool(v != 0) + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BackupEligible", 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.BackupEligible = bool(v != 0) + case 11: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BackupState", 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.BackupState = bool(v != 0) + case 12: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CloneWarning", 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.CloneWarning = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_Document_3_list)(nil) + +type _Document_3_list struct { + list *[]string +} + +func (x *_Document_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Authentication as it is not of Message kind")) +} + +func (x *_Document_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_4_list)(nil) + +type _Document_4_list struct { + list *[]string +} + +func (x *_Document_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field AssertionMethod as it is not of Message kind")) +} + +func (x *_Document_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_4_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_5_list)(nil) + +type _Document_5_list struct { + list *[]string +} + +func (x *_Document_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_5_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityDelegation as it is not of Message kind")) +} + +func (x *_Document_5_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_5_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_5_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_6_list)(nil) + +type _Document_6_list struct { + list *[]string +} + +func (x *_Document_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_6_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field CapabilityInvocation as it is not of Message kind")) +} + +func (x *_Document_6_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_6_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_6_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Document_7_list)(nil) + +type _Document_7_list struct { + list *[]string +} + +func (x *_Document_7_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Document_7_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Document_7_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Document_7_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Document_7_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Document at list field Service as it is not of Message kind")) +} + +func (x *_Document_7_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Document_7_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Document_7_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Document protoreflect.MessageDescriptor + fd_Document_id protoreflect.FieldDescriptor + fd_Document_controller protoreflect.FieldDescriptor + fd_Document_authentication protoreflect.FieldDescriptor + fd_Document_assertion_method protoreflect.FieldDescriptor + fd_Document_capability_delegation protoreflect.FieldDescriptor + fd_Document_capability_invocation protoreflect.FieldDescriptor + fd_Document_service protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_Document = File_did_v1_models_proto.Messages().ByName("Document") + fd_Document_id = md_Document.Fields().ByName("id") + fd_Document_controller = md_Document.Fields().ByName("controller") + fd_Document_authentication = md_Document.Fields().ByName("authentication") + fd_Document_assertion_method = md_Document.Fields().ByName("assertion_method") + fd_Document_capability_delegation = md_Document.Fields().ByName("capability_delegation") + fd_Document_capability_invocation = md_Document.Fields().ByName("capability_invocation") + fd_Document_service = md_Document.Fields().ByName("service") +} + +var _ protoreflect.Message = (*fastReflection_Document)(nil) + +type fastReflection_Document Document + +func (x *Document) ProtoReflect() protoreflect.Message { + return (*fastReflection_Document)(x) +} + +func (x *Document) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_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_Document_messageType fastReflection_Document_messageType +var _ protoreflect.MessageType = fastReflection_Document_messageType{} + +type fastReflection_Document_messageType struct{} + +func (x fastReflection_Document_messageType) Zero() protoreflect.Message { + return (*fastReflection_Document)(nil) +} +func (x fastReflection_Document_messageType) New() protoreflect.Message { + return new(fastReflection_Document) +} +func (x fastReflection_Document_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Document +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Document) Descriptor() protoreflect.MessageDescriptor { + return md_Document +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Document) Type() protoreflect.MessageType { + return _fastReflection_Document_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Document) New() protoreflect.Message { + return new(fastReflection_Document) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Document) Interface() protoreflect.ProtoMessage { + return (*Document)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Document) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Document_id, value) { + return + } + } + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_Document_controller, value) { + return + } + } + if len(x.Authentication) != 0 { + value := protoreflect.ValueOfList(&_Document_3_list{list: &x.Authentication}) + if !f(fd_Document_authentication, value) { + return + } + } + if len(x.AssertionMethod) != 0 { + value := protoreflect.ValueOfList(&_Document_4_list{list: &x.AssertionMethod}) + if !f(fd_Document_assertion_method, value) { + return + } + } + if len(x.CapabilityDelegation) != 0 { + value := protoreflect.ValueOfList(&_Document_5_list{list: &x.CapabilityDelegation}) + if !f(fd_Document_capability_delegation, value) { + return + } + } + if len(x.CapabilityInvocation) != 0 { + value := protoreflect.ValueOfList(&_Document_6_list{list: &x.CapabilityInvocation}) + if !f(fd_Document_capability_invocation, value) { + return + } + } + if len(x.Service) != 0 { + value := protoreflect.ValueOfList(&_Document_7_list{list: &x.Service}) + if !f(fd_Document_service, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Document) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Document.id": + return x.Id != "" + case "did.v1.Document.controller": + return x.Controller != "" + case "did.v1.Document.authentication": + return len(x.Authentication) != 0 + case "did.v1.Document.assertion_method": + return len(x.AssertionMethod) != 0 + case "did.v1.Document.capability_delegation": + return len(x.CapabilityDelegation) != 0 + case "did.v1.Document.capability_invocation": + return len(x.CapabilityInvocation) != 0 + case "did.v1.Document.service": + return len(x.Service) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Document.id": + x.Id = "" + case "did.v1.Document.controller": + x.Controller = "" + case "did.v1.Document.authentication": + x.Authentication = nil + case "did.v1.Document.assertion_method": + x.AssertionMethod = nil + case "did.v1.Document.capability_delegation": + x.CapabilityDelegation = nil + case "did.v1.Document.capability_invocation": + x.CapabilityInvocation = nil + case "did.v1.Document.service": + x.Service = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Document) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Document.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.Document.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + case "did.v1.Document.authentication": + if len(x.Authentication) == 0 { + return protoreflect.ValueOfList(&_Document_3_list{}) + } + listValue := &_Document_3_list{list: &x.Authentication} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.assertion_method": + if len(x.AssertionMethod) == 0 { + return protoreflect.ValueOfList(&_Document_4_list{}) + } + listValue := &_Document_4_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.capability_delegation": + if len(x.CapabilityDelegation) == 0 { + return protoreflect.ValueOfList(&_Document_5_list{}) + } + listValue := &_Document_5_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.capability_invocation": + if len(x.CapabilityInvocation) == 0 { + return protoreflect.ValueOfList(&_Document_6_list{}) + } + listValue := &_Document_6_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(listValue) + case "did.v1.Document.service": + if len(x.Service) == 0 { + return protoreflect.ValueOfList(&_Document_7_list{}) + } + listValue := &_Document_7_list{list: &x.Service} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Document.id": + x.Id = value.Interface().(string) + case "did.v1.Document.controller": + x.Controller = value.Interface().(string) + case "did.v1.Document.authentication": + lv := value.List() + clv := lv.(*_Document_3_list) + x.Authentication = *clv.list + case "did.v1.Document.assertion_method": + lv := value.List() + clv := lv.(*_Document_4_list) + x.AssertionMethod = *clv.list + case "did.v1.Document.capability_delegation": + lv := value.List() + clv := lv.(*_Document_5_list) + x.CapabilityDelegation = *clv.list + case "did.v1.Document.capability_invocation": + lv := value.List() + clv := lv.(*_Document_6_list) + x.CapabilityInvocation = *clv.list + case "did.v1.Document.service": + lv := value.List() + clv := lv.(*_Document_7_list) + x.Service = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Document.authentication": + if x.Authentication == nil { + x.Authentication = []string{} + } + value := &_Document_3_list{list: &x.Authentication} + return protoreflect.ValueOfList(value) + case "did.v1.Document.assertion_method": + if x.AssertionMethod == nil { + x.AssertionMethod = []string{} + } + value := &_Document_4_list{list: &x.AssertionMethod} + return protoreflect.ValueOfList(value) + case "did.v1.Document.capability_delegation": + if x.CapabilityDelegation == nil { + x.CapabilityDelegation = []string{} + } + value := &_Document_5_list{list: &x.CapabilityDelegation} + return protoreflect.ValueOfList(value) + case "did.v1.Document.capability_invocation": + if x.CapabilityInvocation == nil { + x.CapabilityInvocation = []string{} + } + value := &_Document_6_list{list: &x.CapabilityInvocation} + return protoreflect.ValueOfList(value) + case "did.v1.Document.service": + if x.Service == nil { + x.Service = []string{} + } + value := &_Document_7_list{list: &x.Service} + return protoreflect.ValueOfList(value) + case "did.v1.Document.id": + panic(fmt.Errorf("field id of message did.v1.Document is not mutable")) + case "did.v1.Document.controller": + panic(fmt.Errorf("field controller of message did.v1.Document is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Document) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Document.id": + return protoreflect.ValueOfString("") + case "did.v1.Document.controller": + return protoreflect.ValueOfString("") + case "did.v1.Document.authentication": + list := []string{} + return protoreflect.ValueOfList(&_Document_3_list{list: &list}) + case "did.v1.Document.assertion_method": + list := []string{} + return protoreflect.ValueOfList(&_Document_4_list{list: &list}) + case "did.v1.Document.capability_delegation": + list := []string{} + return protoreflect.ValueOfList(&_Document_5_list{list: &list}) + case "did.v1.Document.capability_invocation": + list := []string{} + return protoreflect.ValueOfList(&_Document_6_list{list: &list}) + case "did.v1.Document.service": + list := []string{} + return protoreflect.ValueOfList(&_Document_7_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Document")) + } + panic(fmt.Errorf("message did.v1.Document does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Document) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Document", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Document) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Document) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Document) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Document) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Document) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Authentication) > 0 { + for _, s := range x.Authentication { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.AssertionMethod) > 0 { + for _, s := range x.AssertionMethod { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityDelegation) > 0 { + for _, s := range x.CapabilityDelegation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.CapabilityInvocation) > 0 { + for _, s := range x.CapabilityInvocation { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.Service) > 0 { + for _, s := range x.Service { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Document) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Service) > 0 { + for iNdEx := len(x.Service) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Service[iNdEx]) + copy(dAtA[i:], x.Service[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Service[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(x.CapabilityInvocation) > 0 { + for iNdEx := len(x.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityInvocation[iNdEx]) + copy(dAtA[i:], x.CapabilityInvocation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityInvocation[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(x.CapabilityDelegation) > 0 { + for iNdEx := len(x.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.CapabilityDelegation[iNdEx]) + copy(dAtA[i:], x.CapabilityDelegation[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CapabilityDelegation[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(x.AssertionMethod) > 0 { + for iNdEx := len(x.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.AssertionMethod[iNdEx]) + copy(dAtA[i:], x.AssertionMethod[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AssertionMethod[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(x.Authentication) > 0 { + for iNdEx := len(x.Authentication) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Authentication[iNdEx]) + copy(dAtA[i:], x.Authentication[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authentication[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + i-- + dAtA[i] = 0x12 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Document) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Document: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authentication = append(x.Authentication, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AssertionMethod", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AssertionMethod = append(x.AssertionMethod, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CapabilityDelegation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CapabilityDelegation = append(x.CapabilityDelegation, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CapabilityInvocation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CapabilityInvocation = append(x.CapabilityInvocation, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Service = append(x.Service, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.Map = (*_Keyshare_1_map)(nil) + +type _Keyshare_1_map struct { + m *map[string]string +} + +func (x *_Keyshare_1_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_Keyshare_1_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfString(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_Keyshare_1_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_Keyshare_1_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_Keyshare_1_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfString(v) +} + +func (x *_Keyshare_1_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_Keyshare_1_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 *_Keyshare_1_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Keyshare_1_map) IsValid() bool { + return x.m != nil +} + +var _ protoreflect.Map = (*_Keyshare_2_map)(nil) + +type _Keyshare_2_map struct { + m *map[string][]byte +} + +func (x *_Keyshare_2_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_Keyshare_2_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfBytes(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_Keyshare_2_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_Keyshare_2_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_Keyshare_2_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfBytes(v) +} + +func (x *_Keyshare_2_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.Bytes() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_Keyshare_2_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 *_Keyshare_2_map) NewValue() protoreflect.Value { + var v []byte + return protoreflect.ValueOfBytes(v) +} + +func (x *_Keyshare_2_map) IsValid() bool { + return x.m != nil +} + +var ( + md_Keyshare protoreflect.MessageDescriptor + fd_Keyshare_metadata protoreflect.FieldDescriptor + fd_Keyshare_payloads protoreflect.FieldDescriptor + fd_Keyshare_protocol protoreflect.FieldDescriptor + fd_Keyshare_public_key protoreflect.FieldDescriptor + fd_Keyshare_version protoreflect.FieldDescriptor + fd_Keyshare_role protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_Keyshare = File_did_v1_models_proto.Messages().ByName("Keyshare") + fd_Keyshare_metadata = md_Keyshare.Fields().ByName("metadata") + fd_Keyshare_payloads = md_Keyshare.Fields().ByName("payloads") + fd_Keyshare_protocol = md_Keyshare.Fields().ByName("protocol") + fd_Keyshare_public_key = md_Keyshare.Fields().ByName("public_key") + fd_Keyshare_version = md_Keyshare.Fields().ByName("version") + fd_Keyshare_role = md_Keyshare.Fields().ByName("role") +} + +var _ protoreflect.Message = (*fastReflection_Keyshare)(nil) + +type fastReflection_Keyshare Keyshare + +func (x *Keyshare) ProtoReflect() protoreflect.Message { + return (*fastReflection_Keyshare)(x) +} + +func (x *Keyshare) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_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_Keyshare_messageType fastReflection_Keyshare_messageType +var _ protoreflect.MessageType = fastReflection_Keyshare_messageType{} + +type fastReflection_Keyshare_messageType struct{} + +func (x fastReflection_Keyshare_messageType) Zero() protoreflect.Message { + return (*fastReflection_Keyshare)(nil) +} +func (x fastReflection_Keyshare_messageType) New() protoreflect.Message { + return new(fastReflection_Keyshare) +} +func (x fastReflection_Keyshare_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Keyshare +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Keyshare) Descriptor() protoreflect.MessageDescriptor { + return md_Keyshare +} + +// 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_Keyshare) Type() protoreflect.MessageType { + return _fastReflection_Keyshare_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Keyshare) New() protoreflect.Message { + return new(fastReflection_Keyshare) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Keyshare) Interface() protoreflect.ProtoMessage { + return (*Keyshare)(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_Keyshare) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Metadata) != 0 { + value := protoreflect.ValueOfMap(&_Keyshare_1_map{m: &x.Metadata}) + if !f(fd_Keyshare_metadata, value) { + return + } + } + if len(x.Payloads) != 0 { + value := protoreflect.ValueOfMap(&_Keyshare_2_map{m: &x.Payloads}) + if !f(fd_Keyshare_payloads, value) { + return + } + } + if x.Protocol != "" { + value := protoreflect.ValueOfString(x.Protocol) + if !f(fd_Keyshare_protocol, value) { + return + } + } + if len(x.PublicKey) != 0 { + value := protoreflect.ValueOfBytes(x.PublicKey) + if !f(fd_Keyshare_public_key, value) { + return + } + } + if x.Version != uint32(0) { + value := protoreflect.ValueOfUint32(x.Version) + if !f(fd_Keyshare_version, value) { + return + } + } + if x.Role != int32(0) { + value := protoreflect.ValueOfInt32(x.Role) + if !f(fd_Keyshare_role, 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_Keyshare) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Keyshare.metadata": + return len(x.Metadata) != 0 + case "did.v1.Keyshare.payloads": + return len(x.Payloads) != 0 + case "did.v1.Keyshare.protocol": + return x.Protocol != "" + case "did.v1.Keyshare.public_key": + return len(x.PublicKey) != 0 + case "did.v1.Keyshare.version": + return x.Version != uint32(0) + case "did.v1.Keyshare.role": + return x.Role != int32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) + } + panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Keyshare.metadata": + x.Metadata = nil + case "did.v1.Keyshare.payloads": + x.Payloads = nil + case "did.v1.Keyshare.protocol": + x.Protocol = "" + case "did.v1.Keyshare.public_key": + x.PublicKey = nil + case "did.v1.Keyshare.version": + x.Version = uint32(0) + case "did.v1.Keyshare.role": + x.Role = int32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) + } + panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Keyshare.metadata": + if len(x.Metadata) == 0 { + return protoreflect.ValueOfMap(&_Keyshare_1_map{}) + } + mapValue := &_Keyshare_1_map{m: &x.Metadata} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.Keyshare.payloads": + if len(x.Payloads) == 0 { + return protoreflect.ValueOfMap(&_Keyshare_2_map{}) + } + mapValue := &_Keyshare_2_map{m: &x.Payloads} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.Keyshare.protocol": + value := x.Protocol + return protoreflect.ValueOfString(value) + case "did.v1.Keyshare.public_key": + value := x.PublicKey + return protoreflect.ValueOfBytes(value) + case "did.v1.Keyshare.version": + value := x.Version + return protoreflect.ValueOfUint32(value) + case "did.v1.Keyshare.role": + value := x.Role + return protoreflect.ValueOfInt32(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) + } + panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Keyshare.metadata": + mv := value.Map() + cmv := mv.(*_Keyshare_1_map) + x.Metadata = *cmv.m + case "did.v1.Keyshare.payloads": + mv := value.Map() + cmv := mv.(*_Keyshare_2_map) + x.Payloads = *cmv.m + case "did.v1.Keyshare.protocol": + x.Protocol = value.Interface().(string) + case "did.v1.Keyshare.public_key": + x.PublicKey = value.Bytes() + case "did.v1.Keyshare.version": + x.Version = uint32(value.Uint()) + case "did.v1.Keyshare.role": + x.Role = int32(value.Int()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) + } + panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Keyshare.metadata": + if x.Metadata == nil { + x.Metadata = make(map[string]string) + } + value := &_Keyshare_1_map{m: &x.Metadata} + return protoreflect.ValueOfMap(value) + case "did.v1.Keyshare.payloads": + if x.Payloads == nil { + x.Payloads = make(map[string][]byte) + } + value := &_Keyshare_2_map{m: &x.Payloads} + return protoreflect.ValueOfMap(value) + case "did.v1.Keyshare.protocol": + panic(fmt.Errorf("field protocol of message did.v1.Keyshare is not mutable")) + case "did.v1.Keyshare.public_key": + panic(fmt.Errorf("field public_key of message did.v1.Keyshare is not mutable")) + case "did.v1.Keyshare.version": + panic(fmt.Errorf("field version of message did.v1.Keyshare is not mutable")) + case "did.v1.Keyshare.role": + panic(fmt.Errorf("field role of message did.v1.Keyshare is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) + } + panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Keyshare.metadata": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_Keyshare_1_map{m: &m}) + case "did.v1.Keyshare.payloads": + m := make(map[string][]byte) + return protoreflect.ValueOfMap(&_Keyshare_2_map{m: &m}) + case "did.v1.Keyshare.protocol": + return protoreflect.ValueOfString("") + case "did.v1.Keyshare.public_key": + return protoreflect.ValueOfBytes(nil) + case "did.v1.Keyshare.version": + return protoreflect.ValueOfUint32(uint32(0)) + case "did.v1.Keyshare.role": + return protoreflect.ValueOfInt32(int32(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Keyshare")) + } + panic(fmt.Errorf("message did.v1.Keyshare 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_Keyshare) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Keyshare", 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_Keyshare) 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_Keyshare) 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_Keyshare) 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_Keyshare) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Keyshare) + 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.Metadata) > 0 { + SiZeMaP := func(k string, v string) { + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Metadata)) + for k := range x.Metadata { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Metadata[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Metadata { + SiZeMaP(k, v) + } + } + } + if len(x.Payloads) > 0 { + SiZeMaP := func(k string, v []byte) { + l = 1 + len(v) + runtime.Sov(uint64(len(v))) + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Payloads)) + for k := range x.Payloads { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Payloads[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Payloads { + SiZeMaP(k, v) + } + } + } + l = len(x.Protocol) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PublicKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Version != 0 { + n += 1 + runtime.Sov(uint64(x.Version)) + } + if x.Role != 0 { + n += 1 + runtime.Sov(uint64(x.Role)) + } + 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().(*Keyshare) + 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.Role != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Role)) + i-- + dAtA[i] = 0x30 + } + if x.Version != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Version)) + i-- + dAtA[i] = 0x28 + } + if len(x.PublicKey) > 0 { + i -= len(x.PublicKey) + copy(dAtA[i:], x.PublicKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) + i-- + dAtA[i] = 0x22 + } + if len(x.Protocol) > 0 { + i -= len(x.Protocol) + copy(dAtA[i:], x.Protocol) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Protocol))) + i-- + dAtA[i] = 0x1a + } + if len(x.Payloads) > 0 { + MaRsHaLmAp := func(k string, v []byte) (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] = 0x12 + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForPayloads := make([]string, 0, len(x.Payloads)) + for k := range x.Payloads { + keysForPayloads = append(keysForPayloads, string(k)) + } + sort.Slice(keysForPayloads, func(i, j int) bool { + return keysForPayloads[i] < keysForPayloads[j] + }) + for iNdEx := len(keysForPayloads) - 1; iNdEx >= 0; iNdEx-- { + v := x.Payloads[string(keysForPayloads[iNdEx])] + out, err := MaRsHaLmAp(keysForPayloads[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Payloads { + v := x.Payloads[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if len(x.Metadata) > 0 { + MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForMetadata := make([]string, 0, len(x.Metadata)) + for k := range x.Metadata { + keysForMetadata = append(keysForMetadata, string(k)) + } + sort.Slice(keysForMetadata, func(i, j int) bool { + return keysForMetadata[i] < keysForMetadata[j] + }) + for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { + v := x.Metadata[string(keysForMetadata[iNdEx])] + out, err := MaRsHaLmAp(keysForMetadata[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Metadata { + v := x.Metadata[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if 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().(*Keyshare) + 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: Keyshare: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Keyshare: 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 Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Metadata == nil { + x.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapkey > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + x.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Payloads", 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.Payloads == nil { + x.Payloads = make(map[string][]byte) + } + var mapkey string + var mapvalue []byte + 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 mapbyteLen 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++ + mapbyteLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intMapbyteLen := int(mapbyteLen) + if intMapbyteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postbytesIndex := iNdEx + intMapbyteLen + if postbytesIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postbytesIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapvalue = make([]byte, mapbyteLen) + copy(mapvalue, dAtA[iNdEx:postbytesIndex]) + iNdEx = postbytesIndex + } 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.Payloads[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Protocol", 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.Protocol = 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 PublicKey", 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.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if x.PublicKey == nil { + x.PublicKey = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + x.Version = 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.Version |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + x.Role = 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.Role |= int32(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 _ protoreflect.List = (*_Permissions_1_list)(nil) + +type _Permissions_1_list struct { + list *[]DIDNamespace +} + +func (x *_Permissions_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Permissions_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)((*x.list)[i])) +} + +func (x *_Permissions_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Enum() + concreteValue := (DIDNamespace)(valueUnwrapped) + (*x.list)[i] = concreteValue +} + +func (x *_Permissions_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Enum() + concreteValue := (DIDNamespace)(valueUnwrapped) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Permissions_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Permissions at list field Grants as it is not of Message kind")) +} + +func (x *_Permissions_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Permissions_1_list) NewElement() protoreflect.Value { + v := 0 + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(v)) +} + +func (x *_Permissions_1_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Permissions_2_list)(nil) + +type _Permissions_2_list struct { + list *[]PermissionScope +} + +func (x *_Permissions_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Permissions_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)((*x.list)[i])) +} + +func (x *_Permissions_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Enum() + concreteValue := (PermissionScope)(valueUnwrapped) + (*x.list)[i] = concreteValue +} + +func (x *_Permissions_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Enum() + concreteValue := (PermissionScope)(valueUnwrapped) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Permissions_2_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Permissions at list field Scopes as it is not of Message kind")) +} + +func (x *_Permissions_2_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Permissions_2_list) NewElement() protoreflect.Value { + v := 0 + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(v)) +} + +func (x *_Permissions_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_Permissions protoreflect.MessageDescriptor + fd_Permissions_grants protoreflect.FieldDescriptor + fd_Permissions_scopes protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_Permissions = File_did_v1_models_proto.Messages().ByName("Permissions") + fd_Permissions_grants = md_Permissions.Fields().ByName("grants") + fd_Permissions_scopes = md_Permissions.Fields().ByName("scopes") +} + +var _ protoreflect.Message = (*fastReflection_Permissions)(nil) + +type fastReflection_Permissions Permissions + +func (x *Permissions) ProtoReflect() protoreflect.Message { + return (*fastReflection_Permissions)(x) +} + +func (x *Permissions) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_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_Permissions_messageType fastReflection_Permissions_messageType +var _ protoreflect.MessageType = fastReflection_Permissions_messageType{} + +type fastReflection_Permissions_messageType struct{} + +func (x fastReflection_Permissions_messageType) Zero() protoreflect.Message { + return (*fastReflection_Permissions)(nil) +} +func (x fastReflection_Permissions_messageType) New() protoreflect.Message { + return new(fastReflection_Permissions) +} +func (x fastReflection_Permissions_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Permissions +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Permissions) Descriptor() protoreflect.MessageDescriptor { + return md_Permissions +} + +// 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_Permissions) Type() protoreflect.MessageType { + return _fastReflection_Permissions_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Permissions) New() protoreflect.Message { + return new(fastReflection_Permissions) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Permissions) Interface() protoreflect.ProtoMessage { + return (*Permissions)(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_Permissions) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Grants) != 0 { + value := protoreflect.ValueOfList(&_Permissions_1_list{list: &x.Grants}) + if !f(fd_Permissions_grants, value) { + return + } + } + if len(x.Scopes) != 0 { + value := protoreflect.ValueOfList(&_Permissions_2_list{list: &x.Scopes}) + if !f(fd_Permissions_scopes, 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_Permissions) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Permissions.grants": + return len(x.Grants) != 0 + case "did.v1.Permissions.scopes": + return len(x.Scopes) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) + } + panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Permissions.grants": + x.Grants = nil + case "did.v1.Permissions.scopes": + x.Scopes = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) + } + panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Permissions.grants": + if len(x.Grants) == 0 { + return protoreflect.ValueOfList(&_Permissions_1_list{}) + } + listValue := &_Permissions_1_list{list: &x.Grants} + return protoreflect.ValueOfList(listValue) + case "did.v1.Permissions.scopes": + if len(x.Scopes) == 0 { + return protoreflect.ValueOfList(&_Permissions_2_list{}) + } + listValue := &_Permissions_2_list{list: &x.Scopes} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) + } + panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Permissions.grants": + lv := value.List() + clv := lv.(*_Permissions_1_list) + x.Grants = *clv.list + case "did.v1.Permissions.scopes": + lv := value.List() + clv := lv.(*_Permissions_2_list) + x.Scopes = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) + } + panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Permissions.grants": + if x.Grants == nil { + x.Grants = []DIDNamespace{} + } + value := &_Permissions_1_list{list: &x.Grants} + return protoreflect.ValueOfList(value) + case "did.v1.Permissions.scopes": + if x.Scopes == nil { + x.Scopes = []PermissionScope{} + } + value := &_Permissions_2_list{list: &x.Scopes} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) + } + panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Permissions.grants": + list := []DIDNamespace{} + return protoreflect.ValueOfList(&_Permissions_1_list{list: &list}) + case "did.v1.Permissions.scopes": + list := []PermissionScope{} + return protoreflect.ValueOfList(&_Permissions_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Permissions")) + } + panic(fmt.Errorf("message did.v1.Permissions 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_Permissions) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Permissions", 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_Permissions) 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_Permissions) 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_Permissions) 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_Permissions) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Permissions) + 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.Grants) > 0 { + l = 0 + for _, e := range x.Grants { + l += runtime.Sov(uint64(e)) + } + n += 1 + runtime.Sov(uint64(l)) + l + } + if len(x.Scopes) > 0 { + l = 0 + for _, e := range x.Scopes { + l += runtime.Sov(uint64(e)) + } + n += 1 + runtime.Sov(uint64(l)) + 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().(*Permissions) + 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.Scopes) > 0 { + var pksize2 int + for _, num := range x.Scopes { + pksize2 += runtime.Sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range x.Scopes { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = runtime.EncodeVarint(dAtA, i, uint64(pksize2)) + i-- + dAtA[i] = 0x12 + } + if len(x.Grants) > 0 { + var pksize4 int + for _, num := range x.Grants { + pksize4 += runtime.Sov(uint64(num)) + } + i -= pksize4 + j3 := i + for _, num1 := range x.Grants { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j3] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j3++ + } + dAtA[j3] = uint8(num) + j3++ + } + i = runtime.EncodeVarint(dAtA, i, uint64(pksize4)) + 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().(*Permissions) + 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: Permissions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Permissions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v DIDNamespace + 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 |= DIDNamespace(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Grants = append(x.Grants, v) + } else if wireType == 2 { + var packedLen 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++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + packedLen + 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 + } + var elementCount int + if elementCount != 0 && len(x.Grants) == 0 { + x.Grants = make([]DIDNamespace, 0, elementCount) + } + for iNdEx < postIndex { + var v DIDNamespace + 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 |= DIDNamespace(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Grants = append(x.Grants, v) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Grants", wireType) + } + case 2: + if wireType == 0 { + var v PermissionScope + 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 |= PermissionScope(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Scopes = append(x.Scopes, v) + } else if wireType == 2 { + var packedLen 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++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + packedLen + 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 + } + var elementCount int + if elementCount != 0 && len(x.Scopes) == 0 { + x.Scopes = make([]PermissionScope, 0, elementCount) + } + for iNdEx < postIndex { + var v PermissionScope + 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 |= PermissionScope(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Scopes = append(x.Scopes, v) + } + } else { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType) + } + 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_algorithm protoreflect.FieldDescriptor + fd_PubKey_encoding protoreflect.FieldDescriptor + fd_PubKey_curve protoreflect.FieldDescriptor + fd_PubKey_key_type protoreflect.FieldDescriptor + fd_PubKey_raw protoreflect.FieldDescriptor + fd_PubKey_jwk protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_PubKey = File_did_v1_models_proto.Messages().ByName("PubKey") + fd_PubKey_role = md_PubKey.Fields().ByName("role") + fd_PubKey_algorithm = md_PubKey.Fields().ByName("algorithm") + fd_PubKey_encoding = md_PubKey.Fields().ByName("encoding") + fd_PubKey_curve = md_PubKey.Fields().ByName("curve") + fd_PubKey_key_type = md_PubKey.Fields().ByName("key_type") + fd_PubKey_raw = md_PubKey.Fields().ByName("raw") + 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_models_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_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 != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Role)) + if !f(fd_PubKey_role, value) { + return + } + } + if x.Algorithm != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Algorithm)) + if !f(fd_PubKey_algorithm, value) { + return + } + } + if x.Encoding != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Encoding)) + if !f(fd_PubKey_encoding, value) { + return + } + } + if x.Curve != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Curve)) + if !f(fd_PubKey_curve, value) { + return + } + } + if x.KeyType != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.KeyType)) + if !f(fd_PubKey_key_type, value) { + return + } + } + if len(x.Raw) != 0 { + value := protoreflect.ValueOfBytes(x.Raw) + if !f(fd_PubKey_raw, 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 != 0 + case "did.v1.PubKey.algorithm": + return x.Algorithm != 0 + case "did.v1.PubKey.encoding": + return x.Encoding != 0 + case "did.v1.PubKey.curve": + return x.Curve != 0 + case "did.v1.PubKey.key_type": + return x.KeyType != 0 + case "did.v1.PubKey.raw": + return len(x.Raw) != 0 + 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 = 0 + case "did.v1.PubKey.algorithm": + x.Algorithm = 0 + case "did.v1.PubKey.encoding": + x.Encoding = 0 + case "did.v1.PubKey.curve": + x.Curve = 0 + case "did.v1.PubKey.key_type": + x.KeyType = 0 + case "did.v1.PubKey.raw": + x.Raw = 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.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.PubKey.algorithm": + value := x.Algorithm + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.PubKey.encoding": + value := x.Encoding + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.PubKey.curve": + value := x.Curve + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.PubKey.key_type": + value := x.KeyType + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.PubKey.raw": + value := x.Raw + return protoreflect.ValueOfBytes(value) + 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 = (KeyRole)(value.Enum()) + case "did.v1.PubKey.algorithm": + x.Algorithm = (KeyAlgorithm)(value.Enum()) + case "did.v1.PubKey.encoding": + x.Encoding = (KeyEncoding)(value.Enum()) + case "did.v1.PubKey.curve": + x.Curve = (KeyCurve)(value.Enum()) + case "did.v1.PubKey.key_type": + x.KeyType = (KeyType)(value.Enum()) + case "did.v1.PubKey.raw": + x.Raw = value.Bytes() + case "did.v1.PubKey.jwk": + x.Jwk = value.Message().Interface().(*PubKey_JWK) + 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.jwk": + if x.Jwk == nil { + x.Jwk = new(PubKey_JWK) + } + 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.algorithm": + panic(fmt.Errorf("field algorithm of message did.v1.PubKey is not mutable")) + case "did.v1.PubKey.encoding": + panic(fmt.Errorf("field encoding of message did.v1.PubKey is not mutable")) + case "did.v1.PubKey.curve": + panic(fmt.Errorf("field curve 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")) + case "did.v1.PubKey.raw": + panic(fmt.Errorf("field raw 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.ValueOfEnum(0) + case "did.v1.PubKey.algorithm": + return protoreflect.ValueOfEnum(0) + case "did.v1.PubKey.encoding": + return protoreflect.ValueOfEnum(0) + case "did.v1.PubKey.curve": + return protoreflect.ValueOfEnum(0) + case "did.v1.PubKey.key_type": + return protoreflect.ValueOfEnum(0) + case "did.v1.PubKey.raw": + return protoreflect.ValueOfBytes(nil) + case "did.v1.PubKey.jwk": + m := new(PubKey_JWK) + 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 + if x.Role != 0 { + n += 1 + runtime.Sov(uint64(x.Role)) + } + if x.Algorithm != 0 { + n += 1 + runtime.Sov(uint64(x.Algorithm)) + } + if x.Encoding != 0 { + n += 1 + runtime.Sov(uint64(x.Encoding)) + } + if x.Curve != 0 { + n += 1 + runtime.Sov(uint64(x.Curve)) + } + if x.KeyType != 0 { + n += 1 + runtime.Sov(uint64(x.KeyType)) + } + l = len(x.Raw) + if l > 0 { + 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] = 0x3a + } + if len(x.Raw) > 0 { + i -= len(x.Raw) + copy(dAtA[i:], x.Raw) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Raw))) + i-- + dAtA[i] = 0x32 + } + if x.KeyType != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.KeyType)) + i-- + dAtA[i] = 0x28 + } + if x.Curve != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Curve)) + i-- + dAtA[i] = 0x20 + } + if x.Encoding != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Encoding)) + i-- + dAtA[i] = 0x18 + } + if x.Algorithm != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Algorithm)) + i-- + dAtA[i] = 0x10 + } + if x.Role != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Role)) + 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().(*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 != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + x.Role = 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.Role |= KeyRole(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) + } + x.Algorithm = 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.Algorithm |= KeyAlgorithm(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) + } + x.Encoding = 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.Encoding |= KeyEncoding(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) + } + x.Curve = 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.Curve |= KeyCurve(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KeyType", wireType) + } + x.KeyType = 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.KeyType |= KeyType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Raw", 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.Raw = append(x.Raw[:0], dAtA[iNdEx:postIndex]...) + if x.Raw == nil { + x.Raw = []byte{} + } + iNdEx = postIndex + case 7: + 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 = &PubKey_JWK{} + } + 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_PubKey_JWK protoreflect.MessageDescriptor + fd_PubKey_JWK_kty protoreflect.FieldDescriptor + fd_PubKey_JWK_crv protoreflect.FieldDescriptor + fd_PubKey_JWK_x protoreflect.FieldDescriptor + fd_PubKey_JWK_y protoreflect.FieldDescriptor + fd_PubKey_JWK_n protoreflect.FieldDescriptor + fd_PubKey_JWK_e protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_PubKey_JWK = File_did_v1_models_proto.Messages().ByName("PubKey").Messages().ByName("JWK") + fd_PubKey_JWK_kty = md_PubKey_JWK.Fields().ByName("kty") + fd_PubKey_JWK_crv = md_PubKey_JWK.Fields().ByName("crv") + fd_PubKey_JWK_x = md_PubKey_JWK.Fields().ByName("x") + fd_PubKey_JWK_y = md_PubKey_JWK.Fields().ByName("y") + fd_PubKey_JWK_n = md_PubKey_JWK.Fields().ByName("n") + fd_PubKey_JWK_e = md_PubKey_JWK.Fields().ByName("e") +} + +var _ protoreflect.Message = (*fastReflection_PubKey_JWK)(nil) + +type fastReflection_PubKey_JWK PubKey_JWK + +func (x *PubKey_JWK) ProtoReflect() protoreflect.Message { + return (*fastReflection_PubKey_JWK)(x) +} + +func (x *PubKey_JWK) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_proto_msgTypes[12] + 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_JWK_messageType fastReflection_PubKey_JWK_messageType +var _ protoreflect.MessageType = fastReflection_PubKey_JWK_messageType{} + +type fastReflection_PubKey_JWK_messageType struct{} + +func (x fastReflection_PubKey_JWK_messageType) Zero() protoreflect.Message { + return (*fastReflection_PubKey_JWK)(nil) +} +func (x fastReflection_PubKey_JWK_messageType) New() protoreflect.Message { + return new(fastReflection_PubKey_JWK) +} +func (x fastReflection_PubKey_JWK_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_PubKey_JWK +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_PubKey_JWK) Descriptor() protoreflect.MessageDescriptor { + return md_PubKey_JWK +} + +// 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_JWK) Type() protoreflect.MessageType { + return _fastReflection_PubKey_JWK_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_PubKey_JWK) New() protoreflect.Message { + return new(fastReflection_PubKey_JWK) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_PubKey_JWK) Interface() protoreflect.ProtoMessage { + return (*PubKey_JWK)(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_JWK) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Kty != "" { + value := protoreflect.ValueOfString(x.Kty) + if !f(fd_PubKey_JWK_kty, value) { + return + } + } + if x.Crv != "" { + value := protoreflect.ValueOfString(x.Crv) + if !f(fd_PubKey_JWK_crv, value) { + return + } + } + if x.X != "" { + value := protoreflect.ValueOfString(x.X) + if !f(fd_PubKey_JWK_x, value) { + return + } + } + if x.Y != "" { + value := protoreflect.ValueOfString(x.Y) + if !f(fd_PubKey_JWK_y, value) { + return + } + } + if x.N != "" { + value := protoreflect.ValueOfString(x.N) + if !f(fd_PubKey_JWK_n, value) { + return + } + } + if x.E != "" { + value := protoreflect.ValueOfString(x.E) + if !f(fd_PubKey_JWK_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_PubKey_JWK) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.PubKey.JWK.kty": + return x.Kty != "" + case "did.v1.PubKey.JWK.crv": + return x.Crv != "" + case "did.v1.PubKey.JWK.x": + return x.X != "" + case "did.v1.PubKey.JWK.y": + return x.Y != "" + case "did.v1.PubKey.JWK.n": + return x.N != "" + case "did.v1.PubKey.JWK.e": + return x.E != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK 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_JWK) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.PubKey.JWK.kty": + x.Kty = "" + case "did.v1.PubKey.JWK.crv": + x.Crv = "" + case "did.v1.PubKey.JWK.x": + x.X = "" + case "did.v1.PubKey.JWK.y": + x.Y = "" + case "did.v1.PubKey.JWK.n": + x.N = "" + case "did.v1.PubKey.JWK.e": + x.E = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK 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_JWK) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.PubKey.JWK.kty": + value := x.Kty + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.JWK.crv": + value := x.Crv + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.JWK.x": + value := x.X + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.JWK.y": + value := x.Y + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.JWK.n": + value := x.N + return protoreflect.ValueOfString(value) + case "did.v1.PubKey.JWK.e": + value := x.E + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK 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_JWK) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.PubKey.JWK.kty": + x.Kty = value.Interface().(string) + case "did.v1.PubKey.JWK.crv": + x.Crv = value.Interface().(string) + case "did.v1.PubKey.JWK.x": + x.X = value.Interface().(string) + case "did.v1.PubKey.JWK.y": + x.Y = value.Interface().(string) + case "did.v1.PubKey.JWK.n": + x.N = value.Interface().(string) + case "did.v1.PubKey.JWK.e": + x.E = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK 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_JWK) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.PubKey.JWK.kty": + panic(fmt.Errorf("field kty of message did.v1.PubKey.JWK is not mutable")) + case "did.v1.PubKey.JWK.crv": + panic(fmt.Errorf("field crv of message did.v1.PubKey.JWK is not mutable")) + case "did.v1.PubKey.JWK.x": + panic(fmt.Errorf("field x of message did.v1.PubKey.JWK is not mutable")) + case "did.v1.PubKey.JWK.y": + panic(fmt.Errorf("field y of message did.v1.PubKey.JWK is not mutable")) + case "did.v1.PubKey.JWK.n": + panic(fmt.Errorf("field n of message did.v1.PubKey.JWK is not mutable")) + case "did.v1.PubKey.JWK.e": + panic(fmt.Errorf("field e of message did.v1.PubKey.JWK is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK 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_JWK) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.PubKey.JWK.kty": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.JWK.crv": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.JWK.x": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.JWK.y": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.JWK.n": + return protoreflect.ValueOfString("") + case "did.v1.PubKey.JWK.e": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PubKey.JWK")) + } + panic(fmt.Errorf("message did.v1.PubKey.JWK 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_JWK) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.PubKey.JWK", 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_JWK) 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_JWK) 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_JWK) 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_JWK) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*PubKey_JWK) + 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().(*PubKey_JWK) + 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().(*PubKey_JWK) + 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_JWK: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PubKey_JWK: 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 _ protoreflect.Map = (*_Service_6_map)(nil) + +type _Service_6_map struct { + m *map[string]string +} + +func (x *_Service_6_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_Service_6_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfString(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_Service_6_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_Service_6_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_Service_6_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfString(v) +} + +func (x *_Service_6_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_Service_6_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") +} + +func (x *_Service_6_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Service_6_map) IsValid() bool { + return x.m != nil +} + +var ( + md_Service protoreflect.MessageDescriptor + fd_Service_id protoreflect.FieldDescriptor + fd_Service_service_type protoreflect.FieldDescriptor + fd_Service_authority protoreflect.FieldDescriptor + fd_Service_origin protoreflect.FieldDescriptor + fd_Service_description protoreflect.FieldDescriptor + fd_Service_service_endpoints protoreflect.FieldDescriptor + fd_Service_permissions protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_Service = File_did_v1_models_proto.Messages().ByName("Service") + fd_Service_id = md_Service.Fields().ByName("id") + fd_Service_service_type = md_Service.Fields().ByName("service_type") + fd_Service_authority = md_Service.Fields().ByName("authority") + fd_Service_origin = md_Service.Fields().ByName("origin") + fd_Service_description = md_Service.Fields().ByName("description") + fd_Service_service_endpoints = md_Service.Fields().ByName("service_endpoints") + fd_Service_permissions = md_Service.Fields().ByName("permissions") +} + +var _ protoreflect.Message = (*fastReflection_Service)(nil) + +type fastReflection_Service Service + +func (x *Service) ProtoReflect() protoreflect.Message { + return (*fastReflection_Service)(x) +} + +func (x *Service) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_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_Service_messageType fastReflection_Service_messageType +var _ protoreflect.MessageType = fastReflection_Service_messageType{} + +type fastReflection_Service_messageType struct{} + +func (x fastReflection_Service_messageType) Zero() protoreflect.Message { + return (*fastReflection_Service)(nil) +} +func (x fastReflection_Service_messageType) New() protoreflect.Message { + return new(fastReflection_Service) +} +func (x fastReflection_Service_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Service +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Service) Descriptor() protoreflect.MessageDescriptor { + return md_Service +} + +// 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_Service) Type() protoreflect.MessageType { + return _fastReflection_Service_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Service) New() protoreflect.Message { + return new(fastReflection_Service) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Service) Interface() protoreflect.ProtoMessage { + return (*Service)(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_Service) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Service_id, value) { + return + } + } + if x.ServiceType != "" { + value := protoreflect.ValueOfString(x.ServiceType) + if !f(fd_Service_service_type, value) { + return + } + } + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Service_authority, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_Service_origin, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_Service_description, value) { + return + } + } + if len(x.ServiceEndpoints) != 0 { + value := protoreflect.ValueOfMap(&_Service_6_map{m: &x.ServiceEndpoints}) + if !f(fd_Service_service_endpoints, value) { + return + } + } + if x.Permissions != nil { + value := protoreflect.ValueOfMessage(x.Permissions.ProtoReflect()) + if !f(fd_Service_permissions, 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_Service) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.Service.id": + return x.Id != "" + case "did.v1.Service.service_type": + return x.ServiceType != "" + case "did.v1.Service.authority": + return x.Authority != "" + case "did.v1.Service.origin": + return x.Origin != "" + case "did.v1.Service.description": + return x.Description != "" + case "did.v1.Service.service_endpoints": + return len(x.ServiceEndpoints) != 0 + case "did.v1.Service.permissions": + return x.Permissions != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.Service.id": + x.Id = "" + case "did.v1.Service.service_type": + x.ServiceType = "" + case "did.v1.Service.authority": + x.Authority = "" + case "did.v1.Service.origin": + x.Origin = "" + case "did.v1.Service.description": + x.Description = "" + case "did.v1.Service.service_endpoints": + x.ServiceEndpoints = nil + case "did.v1.Service.permissions": + x.Permissions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.Service.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.Service.service_type": + value := x.ServiceType + return protoreflect.ValueOfString(value) + case "did.v1.Service.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "did.v1.Service.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.Service.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "did.v1.Service.service_endpoints": + if len(x.ServiceEndpoints) == 0 { + return protoreflect.ValueOfMap(&_Service_6_map{}) + } + mapValue := &_Service_6_map{m: &x.ServiceEndpoints} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.Service.permissions": + value := x.Permissions + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.Service.id": + x.Id = value.Interface().(string) + case "did.v1.Service.service_type": + x.ServiceType = value.Interface().(string) + case "did.v1.Service.authority": + x.Authority = value.Interface().(string) + case "did.v1.Service.origin": + x.Origin = value.Interface().(string) + case "did.v1.Service.description": + x.Description = value.Interface().(string) + case "did.v1.Service.service_endpoints": + mv := value.Map() + cmv := mv.(*_Service_6_map) + x.ServiceEndpoints = *cmv.m + case "did.v1.Service.permissions": + x.Permissions = value.Message().Interface().(*Permissions) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Service.service_endpoints": + if x.ServiceEndpoints == nil { + x.ServiceEndpoints = make(map[string]string) + } + value := &_Service_6_map{m: &x.ServiceEndpoints} + return protoreflect.ValueOfMap(value) + case "did.v1.Service.permissions": + if x.Permissions == nil { + x.Permissions = new(Permissions) + } + return protoreflect.ValueOfMessage(x.Permissions.ProtoReflect()) + case "did.v1.Service.id": + panic(fmt.Errorf("field id of message did.v1.Service is not mutable")) + case "did.v1.Service.service_type": + panic(fmt.Errorf("field service_type of message did.v1.Service is not mutable")) + case "did.v1.Service.authority": + panic(fmt.Errorf("field authority of message did.v1.Service is not mutable")) + case "did.v1.Service.origin": + panic(fmt.Errorf("field origin of message did.v1.Service is not mutable")) + case "did.v1.Service.description": + panic(fmt.Errorf("field description of message did.v1.Service is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.Service.id": + return protoreflect.ValueOfString("") + case "did.v1.Service.service_type": + return protoreflect.ValueOfString("") + case "did.v1.Service.authority": + return protoreflect.ValueOfString("") + case "did.v1.Service.origin": + return protoreflect.ValueOfString("") + case "did.v1.Service.description": + return protoreflect.ValueOfString("") + case "did.v1.Service.service_endpoints": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_Service_6_map{m: &m}) + case "did.v1.Service.permissions": + m := new(Permissions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + } + panic(fmt.Errorf("message did.v1.Service 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_Service) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.Service", 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_Service) 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_Service) 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_Service) 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_Service) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Service) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ServiceType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ServiceEndpoints) > 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.ServiceEndpoints)) + for k := range x.ServiceEndpoints { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.ServiceEndpoints[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.ServiceEndpoints { + SiZeMaP(k, v) + } + } + } + if x.Permissions != nil { + l = options.Size(x.Permissions) + 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().(*Service) + 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.Permissions != nil { + encoded, err := options.Marshal(x.Permissions) + 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] = 0x3a + } + if len(x.ServiceEndpoints) > 0 { + MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForServiceEndpoints := make([]string, 0, len(x.ServiceEndpoints)) + for k := range x.ServiceEndpoints { + keysForServiceEndpoints = append(keysForServiceEndpoints, string(k)) + } + sort.Slice(keysForServiceEndpoints, func(i, j int) bool { + return keysForServiceEndpoints[i] < keysForServiceEndpoints[j] + }) + for iNdEx := len(keysForServiceEndpoints) - 1; iNdEx >= 0; iNdEx-- { + v := x.ServiceEndpoints[string(keysForServiceEndpoints[iNdEx])] + out, err := MaRsHaLmAp(keysForServiceEndpoints[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.ServiceEndpoints { + v := x.ServiceEndpoints[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x2a + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x22 + } + 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] = 0x1a + } + if len(x.ServiceType) > 0 { + i -= len(x.ServiceType) + copy(dAtA[i:], x.ServiceType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceType))) + i-- + dAtA[i] = 0x12 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Service) + 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: Service: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceType", 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.ServiceType = 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 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 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = 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 ServiceEndpoints", 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.ServiceEndpoints == nil { + x.ServiceEndpoints = 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.ServiceEndpoints[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Permissions", 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.Permissions == nil { + x.Permissions = &Permissions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Permissions); 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_ServiceInfo protoreflect.MessageDescriptor + fd_ServiceInfo_exists protoreflect.FieldDescriptor + fd_ServiceInfo_origin protoreflect.FieldDescriptor + fd_ServiceInfo_fingerprint protoreflect.FieldDescriptor + fd_ServiceInfo_service protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_ServiceInfo = File_did_v1_models_proto.Messages().ByName("ServiceInfo") + fd_ServiceInfo_exists = md_ServiceInfo.Fields().ByName("exists") + fd_ServiceInfo_origin = md_ServiceInfo.Fields().ByName("origin") + fd_ServiceInfo_fingerprint = md_ServiceInfo.Fields().ByName("fingerprint") + fd_ServiceInfo_service = md_ServiceInfo.Fields().ByName("service") +} + +var _ protoreflect.Message = (*fastReflection_ServiceInfo)(nil) + +type fastReflection_ServiceInfo ServiceInfo + +func (x *ServiceInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_ServiceInfo)(x) +} + +func (x *ServiceInfo) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_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_ServiceInfo_messageType fastReflection_ServiceInfo_messageType +var _ protoreflect.MessageType = fastReflection_ServiceInfo_messageType{} + +type fastReflection_ServiceInfo_messageType struct{} + +func (x fastReflection_ServiceInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_ServiceInfo)(nil) +} +func (x fastReflection_ServiceInfo_messageType) New() protoreflect.Message { + return new(fastReflection_ServiceInfo) +} +func (x fastReflection_ServiceInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ServiceInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ServiceInfo) Descriptor() protoreflect.MessageDescriptor { + return md_ServiceInfo +} + +// 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_ServiceInfo) Type() protoreflect.MessageType { + return _fastReflection_ServiceInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ServiceInfo) New() protoreflect.Message { + return new(fastReflection_ServiceInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ServiceInfo) Interface() protoreflect.ProtoMessage { + return (*ServiceInfo)(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_ServiceInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Exists != false { + value := protoreflect.ValueOfBool(x.Exists) + if !f(fd_ServiceInfo_exists, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_ServiceInfo_origin, value) { + return + } + } + if x.Fingerprint != "" { + value := protoreflect.ValueOfString(x.Fingerprint) + if !f(fd_ServiceInfo_fingerprint, value) { + return + } + } + if x.Service != nil { + value := protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + if !f(fd_ServiceInfo_service, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ServiceInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.ServiceInfo.exists": + return x.Exists != false + case "did.v1.ServiceInfo.origin": + return x.Origin != "" + case "did.v1.ServiceInfo.fingerprint": + return x.Fingerprint != "" + case "did.v1.ServiceInfo.service": + return x.Service != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) + } + panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.ServiceInfo.exists": + x.Exists = false + case "did.v1.ServiceInfo.origin": + x.Origin = "" + case "did.v1.ServiceInfo.fingerprint": + x.Fingerprint = "" + case "did.v1.ServiceInfo.service": + x.Service = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) + } + panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.ServiceInfo.exists": + value := x.Exists + return protoreflect.ValueOfBool(value) + case "did.v1.ServiceInfo.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.ServiceInfo.fingerprint": + value := x.Fingerprint + return protoreflect.ValueOfString(value) + case "did.v1.ServiceInfo.service": + value := x.Service + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) + } + panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.ServiceInfo.exists": + x.Exists = value.Bool() + case "did.v1.ServiceInfo.origin": + x.Origin = value.Interface().(string) + case "did.v1.ServiceInfo.fingerprint": + x.Fingerprint = value.Interface().(string) + case "did.v1.ServiceInfo.service": + x.Service = value.Message().Interface().(*Service) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) + } + panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ServiceInfo.service": + if x.Service == nil { + x.Service = new(Service) + } + return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + case "did.v1.ServiceInfo.exists": + panic(fmt.Errorf("field exists of message did.v1.ServiceInfo is not mutable")) + case "did.v1.ServiceInfo.origin": + panic(fmt.Errorf("field origin of message did.v1.ServiceInfo is not mutable")) + case "did.v1.ServiceInfo.fingerprint": + panic(fmt.Errorf("field fingerprint of message did.v1.ServiceInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) + } + panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ServiceInfo.exists": + return protoreflect.ValueOfBool(false) + case "did.v1.ServiceInfo.origin": + return protoreflect.ValueOfString("") + case "did.v1.ServiceInfo.fingerprint": + return protoreflect.ValueOfString("") + case "did.v1.ServiceInfo.service": + m := new(Service) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceInfo")) + } + panic(fmt.Errorf("message did.v1.ServiceInfo 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_ServiceInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.ServiceInfo", 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_ServiceInfo) 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_ServiceInfo) 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_ServiceInfo) 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_ServiceInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ServiceInfo) + 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.Exists { + n += 2 + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Fingerprint) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Service != nil { + l = options.Size(x.Service) + 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().(*ServiceInfo) + 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.Service != nil { + encoded, err := options.Marshal(x.Service) + 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 len(x.Fingerprint) > 0 { + i -= len(x.Fingerprint) + copy(dAtA[i:], x.Fingerprint) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Fingerprint))) + i-- + dAtA[i] = 0x1a + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x12 + } + if x.Exists { + i-- + if x.Exists { + 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().(*ServiceInfo) + 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: ServiceInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ServiceInfo: 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 Exists", 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.Exists = 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 Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Fingerprint", 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.Fingerprint = 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 Service", 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.Service == nil { + x.Service = &Service{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Service); 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_FirstPartyCaveat protoreflect.MessageDescriptor + fd_FirstPartyCaveat_scope protoreflect.FieldDescriptor + fd_FirstPartyCaveat_exp protoreflect.FieldDescriptor + fd_FirstPartyCaveat_cnf protoreflect.FieldDescriptor + fd_FirstPartyCaveat_aud protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_FirstPartyCaveat = File_did_v1_models_proto.Messages().ByName("FirstPartyCaveat") + fd_FirstPartyCaveat_scope = md_FirstPartyCaveat.Fields().ByName("scope") + fd_FirstPartyCaveat_exp = md_FirstPartyCaveat.Fields().ByName("exp") + fd_FirstPartyCaveat_cnf = md_FirstPartyCaveat.Fields().ByName("cnf") + fd_FirstPartyCaveat_aud = md_FirstPartyCaveat.Fields().ByName("aud") +} + +var _ protoreflect.Message = (*fastReflection_FirstPartyCaveat)(nil) + +type fastReflection_FirstPartyCaveat FirstPartyCaveat + +func (x *FirstPartyCaveat) ProtoReflect() protoreflect.Message { + return (*fastReflection_FirstPartyCaveat)(x) +} + +func (x *FirstPartyCaveat) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_FirstPartyCaveat_messageType fastReflection_FirstPartyCaveat_messageType +var _ protoreflect.MessageType = fastReflection_FirstPartyCaveat_messageType{} + +type fastReflection_FirstPartyCaveat_messageType struct{} + +func (x fastReflection_FirstPartyCaveat_messageType) Zero() protoreflect.Message { + return (*fastReflection_FirstPartyCaveat)(nil) +} +func (x fastReflection_FirstPartyCaveat_messageType) New() protoreflect.Message { + return new(fastReflection_FirstPartyCaveat) +} +func (x fastReflection_FirstPartyCaveat_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_FirstPartyCaveat +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_FirstPartyCaveat) Descriptor() protoreflect.MessageDescriptor { + return md_FirstPartyCaveat +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_FirstPartyCaveat) Type() protoreflect.MessageType { + return _fastReflection_FirstPartyCaveat_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_FirstPartyCaveat) New() protoreflect.Message { + return new(fastReflection_FirstPartyCaveat) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_FirstPartyCaveat) Interface() protoreflect.ProtoMessage { + return (*FirstPartyCaveat)(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_FirstPartyCaveat) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Scope != nil { + value := protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) + if !f(fd_FirstPartyCaveat_scope, value) { + return + } + } + if x.Exp != int64(0) { + value := protoreflect.ValueOfInt64(x.Exp) + if !f(fd_FirstPartyCaveat_exp, value) { + return + } + } + if x.Cnf != "" { + value := protoreflect.ValueOfString(x.Cnf) + if !f(fd_FirstPartyCaveat_cnf, value) { + return + } + } + if x.Aud != "" { + value := protoreflect.ValueOfString(x.Aud) + if !f(fd_FirstPartyCaveat_aud, value) { + return + } + } +} + +// 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_FirstPartyCaveat) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.FirstPartyCaveat.scope": + return x.Scope != nil + case "did.v1.FirstPartyCaveat.exp": + return x.Exp != int64(0) + case "did.v1.FirstPartyCaveat.cnf": + return x.Cnf != "" + case "did.v1.FirstPartyCaveat.aud": + return x.Aud != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_FirstPartyCaveat) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.FirstPartyCaveat.scope": + x.Scope = nil + case "did.v1.FirstPartyCaveat.exp": + x.Exp = int64(0) + case "did.v1.FirstPartyCaveat.cnf": + x.Cnf = "" + case "did.v1.FirstPartyCaveat.aud": + x.Aud = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_FirstPartyCaveat) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.FirstPartyCaveat.scope": + value := x.Scope + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.FirstPartyCaveat.exp": + value := x.Exp + return protoreflect.ValueOfInt64(value) + case "did.v1.FirstPartyCaveat.cnf": + value := x.Cnf + return protoreflect.ValueOfString(value) + case "did.v1.FirstPartyCaveat.aud": + value := x.Aud + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_FirstPartyCaveat) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.FirstPartyCaveat.scope": + x.Scope = value.Message().Interface().(*Permissions) + case "did.v1.FirstPartyCaveat.exp": + x.Exp = value.Int() + case "did.v1.FirstPartyCaveat.cnf": + x.Cnf = value.Interface().(string) + case "did.v1.FirstPartyCaveat.aud": + x.Aud = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.FirstPartyCaveat 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_FirstPartyCaveat) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.FirstPartyCaveat.scope": + if x.Scope == nil { + x.Scope = new(Permissions) + } + return protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) + case "did.v1.FirstPartyCaveat.exp": + panic(fmt.Errorf("field exp of message did.v1.FirstPartyCaveat is not mutable")) + case "did.v1.FirstPartyCaveat.cnf": + panic(fmt.Errorf("field cnf of message did.v1.FirstPartyCaveat is not mutable")) + case "did.v1.FirstPartyCaveat.aud": + panic(fmt.Errorf("field aud of message did.v1.FirstPartyCaveat is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.FirstPartyCaveat does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_FirstPartyCaveat) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.FirstPartyCaveat.scope": + m := new(Permissions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.FirstPartyCaveat.exp": + return protoreflect.ValueOfInt64(int64(0)) + case "did.v1.FirstPartyCaveat.cnf": + return protoreflect.ValueOfString("") + case "did.v1.FirstPartyCaveat.aud": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.FirstPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.FirstPartyCaveat does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_FirstPartyCaveat) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.FirstPartyCaveat", 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_FirstPartyCaveat) 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_FirstPartyCaveat) 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_FirstPartyCaveat) 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_FirstPartyCaveat) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*FirstPartyCaveat) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Scope != nil { + l = options.Size(x.Scope) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Exp != 0 { + n += 1 + runtime.Sov(uint64(x.Exp)) + } + l = len(x.Cnf) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Aud) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*FirstPartyCaveat) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Aud) > 0 { + i -= len(x.Aud) + copy(dAtA[i:], x.Aud) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Aud))) + i-- + dAtA[i] = 0x22 + } + if len(x.Cnf) > 0 { + i -= len(x.Cnf) + copy(dAtA[i:], x.Cnf) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cnf))) + i-- + dAtA[i] = 0x1a + } + if x.Exp != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Exp)) + i-- + dAtA[i] = 0x10 + } + if x.Scope != nil { + encoded, err := options.Marshal(x.Scope) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*FirstPartyCaveat) + 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: FirstPartyCaveat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FirstPartyCaveat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Scope == nil { + x.Scope = &Permissions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Scope); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) + } + x.Exp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Exp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Cnf", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Cnf = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Aud", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Aud = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ThirdPartyCaveat protoreflect.MessageDescriptor + fd_ThirdPartyCaveat_scope protoreflect.FieldDescriptor + fd_ThirdPartyCaveat_exp protoreflect.FieldDescriptor + fd_ThirdPartyCaveat_cnf protoreflect.FieldDescriptor + fd_ThirdPartyCaveat_aud protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_models_proto_init() + md_ThirdPartyCaveat = File_did_v1_models_proto.Messages().ByName("ThirdPartyCaveat") + fd_ThirdPartyCaveat_scope = md_ThirdPartyCaveat.Fields().ByName("scope") + fd_ThirdPartyCaveat_exp = md_ThirdPartyCaveat.Fields().ByName("exp") + fd_ThirdPartyCaveat_cnf = md_ThirdPartyCaveat.Fields().ByName("cnf") + fd_ThirdPartyCaveat_aud = md_ThirdPartyCaveat.Fields().ByName("aud") +} + +var _ protoreflect.Message = (*fastReflection_ThirdPartyCaveat)(nil) + +type fastReflection_ThirdPartyCaveat ThirdPartyCaveat + +func (x *ThirdPartyCaveat) ProtoReflect() protoreflect.Message { + return (*fastReflection_ThirdPartyCaveat)(x) +} + +func (x *ThirdPartyCaveat) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_models_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ThirdPartyCaveat_messageType fastReflection_ThirdPartyCaveat_messageType +var _ protoreflect.MessageType = fastReflection_ThirdPartyCaveat_messageType{} + +type fastReflection_ThirdPartyCaveat_messageType struct{} + +func (x fastReflection_ThirdPartyCaveat_messageType) Zero() protoreflect.Message { + return (*fastReflection_ThirdPartyCaveat)(nil) +} +func (x fastReflection_ThirdPartyCaveat_messageType) New() protoreflect.Message { + return new(fastReflection_ThirdPartyCaveat) +} +func (x fastReflection_ThirdPartyCaveat_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ThirdPartyCaveat +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ThirdPartyCaveat) Descriptor() protoreflect.MessageDescriptor { + return md_ThirdPartyCaveat +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ThirdPartyCaveat) Type() protoreflect.MessageType { + return _fastReflection_ThirdPartyCaveat_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ThirdPartyCaveat) New() protoreflect.Message { + return new(fastReflection_ThirdPartyCaveat) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ThirdPartyCaveat) Interface() protoreflect.ProtoMessage { + return (*ThirdPartyCaveat)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ThirdPartyCaveat) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Scope != nil { + value := protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) + if !f(fd_ThirdPartyCaveat_scope, value) { + return + } + } + if x.Exp != int64(0) { + value := protoreflect.ValueOfInt64(x.Exp) + if !f(fd_ThirdPartyCaveat_exp, value) { + return + } + } + if x.Cnf != "" { + value := protoreflect.ValueOfString(x.Cnf) + if !f(fd_ThirdPartyCaveat_cnf, value) { + return + } + } + if x.Aud != "" { + value := protoreflect.ValueOfString(x.Aud) + if !f(fd_ThirdPartyCaveat_aud, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ThirdPartyCaveat) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + return x.Scope != nil + case "did.v1.ThirdPartyCaveat.exp": + return x.Exp != int64(0) + case "did.v1.ThirdPartyCaveat.cnf": + return x.Cnf != "" + case "did.v1.ThirdPartyCaveat.aud": + return x.Aud != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ThirdPartyCaveat) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + x.Scope = nil + case "did.v1.ThirdPartyCaveat.exp": + x.Exp = int64(0) + case "did.v1.ThirdPartyCaveat.cnf": + x.Cnf = "" + case "did.v1.ThirdPartyCaveat.aud": + x.Aud = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ThirdPartyCaveat) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + value := x.Scope + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.ThirdPartyCaveat.exp": + value := x.Exp + return protoreflect.ValueOfInt64(value) + case "did.v1.ThirdPartyCaveat.cnf": + value := x.Cnf + return protoreflect.ValueOfString(value) + case "did.v1.ThirdPartyCaveat.aud": + value := x.Aud + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ThirdPartyCaveat) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + x.Scope = value.Message().Interface().(*Permissions) + case "did.v1.ThirdPartyCaveat.exp": + x.Exp = value.Int() + case "did.v1.ThirdPartyCaveat.cnf": + x.Cnf = value.Interface().(string) + case "did.v1.ThirdPartyCaveat.aud": + x.Aud = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ThirdPartyCaveat) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + if x.Scope == nil { + x.Scope = new(Permissions) + } + return protoreflect.ValueOfMessage(x.Scope.ProtoReflect()) + case "did.v1.ThirdPartyCaveat.exp": + panic(fmt.Errorf("field exp of message did.v1.ThirdPartyCaveat is not mutable")) + case "did.v1.ThirdPartyCaveat.cnf": + panic(fmt.Errorf("field cnf of message did.v1.ThirdPartyCaveat is not mutable")) + case "did.v1.ThirdPartyCaveat.aud": + panic(fmt.Errorf("field aud of message did.v1.ThirdPartyCaveat is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ThirdPartyCaveat) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ThirdPartyCaveat.scope": + m := new(Permissions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.ThirdPartyCaveat.exp": + return protoreflect.ValueOfInt64(int64(0)) + case "did.v1.ThirdPartyCaveat.cnf": + return protoreflect.ValueOfString("") + case "did.v1.ThirdPartyCaveat.aud": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ThirdPartyCaveat")) + } + panic(fmt.Errorf("message did.v1.ThirdPartyCaveat does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ThirdPartyCaveat) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.ThirdPartyCaveat", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ThirdPartyCaveat) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ThirdPartyCaveat) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ThirdPartyCaveat) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ThirdPartyCaveat) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ThirdPartyCaveat) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Scope != nil { + l = options.Size(x.Scope) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Exp != 0 { + n += 1 + runtime.Sov(uint64(x.Exp)) + } + l = len(x.Cnf) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Aud) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ThirdPartyCaveat) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Aud) > 0 { + i -= len(x.Aud) + copy(dAtA[i:], x.Aud) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Aud))) + i-- + dAtA[i] = 0x22 + } + if len(x.Cnf) > 0 { + i -= len(x.Cnf) + copy(dAtA[i:], x.Cnf) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cnf))) + i-- + dAtA[i] = 0x1a + } + if x.Exp != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Exp)) + i-- + dAtA[i] = 0x10 + } + if x.Scope != nil { + encoded, err := options.Marshal(x.Scope) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ThirdPartyCaveat) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ThirdPartyCaveat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ThirdPartyCaveat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Scope == nil { + x.Scope = &Permissions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Scope); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) + } + x.Exp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Exp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Cnf", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Cnf = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Aud", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Aud = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: did/v1/models.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) +) + +// Alias defines a subject/origin pair +type Alias struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` +} + +func (x *Alias) Reset() { + *x = Alias{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Alias) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Alias) ProtoMessage() {} + +// Deprecated: Use Alias.ProtoReflect.Descriptor instead. +func (*Alias) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{0} +} + +func (x *Alias) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *Alias) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *Alias) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +type Credential struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + AttestationType string `protobuf:"bytes,2,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"` + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` + CredentialId []byte `protobuf:"bytes,4,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` + PublicKey []byte `protobuf:"bytes,5,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Transport []string `protobuf:"bytes,6,rep,name=transport,proto3" json:"transport,omitempty"` + SignCount uint32 `protobuf:"varint,7,opt,name=sign_count,json=signCount,proto3" json:"sign_count,omitempty"` + UserPresent bool `protobuf:"varint,8,opt,name=user_present,json=userPresent,proto3" json:"user_present,omitempty"` + UserVerified bool `protobuf:"varint,9,opt,name=user_verified,json=userVerified,proto3" json:"user_verified,omitempty"` + BackupEligible bool `protobuf:"varint,10,opt,name=backup_eligible,json=backupEligible,proto3" json:"backup_eligible,omitempty"` + BackupState bool `protobuf:"varint,11,opt,name=backup_state,json=backupState,proto3" json:"backup_state,omitempty"` + CloneWarning bool `protobuf:"varint,12,opt,name=clone_warning,json=cloneWarning,proto3" json:"clone_warning,omitempty"` +} + +func (x *Credential) Reset() { + *x = Credential{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Credential) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Credential) ProtoMessage() {} + +// Deprecated: Use Credential.ProtoReflect.Descriptor instead. +func (*Credential) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{1} +} + +func (x *Credential) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *Credential) GetAttestationType() string { + if x != nil { + return x.AttestationType + } + return "" +} + +func (x *Credential) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *Credential) GetCredentialId() []byte { + if x != nil { + return x.CredentialId + } + return nil +} + +func (x *Credential) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *Credential) GetTransport() []string { + if x != nil { + return x.Transport + } + return nil +} + +func (x *Credential) GetSignCount() uint32 { + if x != nil { + return x.SignCount + } + return 0 +} + +func (x *Credential) GetUserPresent() bool { + if x != nil { + return x.UserPresent + } + return false +} + +func (x *Credential) GetUserVerified() bool { + if x != nil { + return x.UserVerified + } + return false +} + +func (x *Credential) GetBackupEligible() bool { + if x != nil { + return x.BackupEligible + } + return false +} + +func (x *Credential) GetBackupState() bool { + if x != nil { + return x.BackupState + } + return false +} + +func (x *Credential) GetCloneWarning() bool { + if x != nil { + return x.CloneWarning + } + return false +} + +// Document defines a DID document +type Document struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` // The DID of the controller + Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"` + AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"` +} + +func (x *Document) Reset() { + *x = Document{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Document) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Document) ProtoMessage() {} + +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{2} +} + +func (x *Document) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Document) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *Document) GetAuthentication() []string { + if x != nil { + return x.Authentication + } + return nil +} + +func (x *Document) GetAssertionMethod() []string { + if x != nil { + return x.AssertionMethod + } + return nil +} + +func (x *Document) GetCapabilityDelegation() []string { + if x != nil { + return x.CapabilityDelegation + } + return nil +} + +func (x *Document) GetCapabilityInvocation() []string { + if x != nil { + return x.CapabilityInvocation + } + return nil +} + +func (x *Document) GetService() []string { + if x != nil { + return x.Service + } + return nil +} + +// Keyshare defines a keyshare from the MPC protocol +type Keyshare struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Metadata map[string]string `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Payloads map[string][]byte `protobuf:"bytes,2,rep,name=payloads,proto3" json:"payloads,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"` + PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Version uint32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` + Role int32 `protobuf:"varint,6,opt,name=role,proto3" json:"role,omitempty"` // 0 =none, 1 = validator, 2 = user +} + +func (x *Keyshare) Reset() { + *x = Keyshare{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Keyshare) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Keyshare) ProtoMessage() {} + +// Deprecated: Use Keyshare.ProtoReflect.Descriptor instead. +func (*Keyshare) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{3} +} + +func (x *Keyshare) GetMetadata() map[string]string { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Keyshare) GetPayloads() map[string][]byte { + if x != nil { + return x.Payloads + } + return nil +} + +func (x *Keyshare) GetProtocol() string { + if x != nil { + return x.Protocol + } + return "" +} + +func (x *Keyshare) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *Keyshare) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *Keyshare) GetRole() int32 { + if x != nil { + return x.Role + } + return 0 +} + +// Permissions contains a list of grants and access control rules for +// a Service. +type Permissions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Grants []DIDNamespace `protobuf:"varint,1,rep,packed,name=grants,proto3,enum=did.v1.DIDNamespace" json:"grants,omitempty"` + Scopes []PermissionScope `protobuf:"varint,2,rep,packed,name=scopes,proto3,enum=did.v1.PermissionScope" json:"scopes,omitempty"` +} + +func (x *Permissions) Reset() { + *x = Permissions{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Permissions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Permissions) ProtoMessage() {} + +// Deprecated: Use Permissions.ProtoReflect.Descriptor instead. +func (*Permissions) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{4} +} + +func (x *Permissions) GetGrants() []DIDNamespace { + if x != nil { + return x.Grants + } + return nil +} + +func (x *Permissions) GetScopes() []PermissionScope { + if x != nil { + return x.Scopes + } + return nil +} + +// PubKey defines a public key for a did +type PubKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Role KeyRole `protobuf:"varint,1,opt,name=role,proto3,enum=did.v1.KeyRole" json:"role,omitempty"` + Algorithm KeyAlgorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=did.v1.KeyAlgorithm" json:"algorithm,omitempty"` + Encoding KeyEncoding `protobuf:"varint,3,opt,name=encoding,proto3,enum=did.v1.KeyEncoding" json:"encoding,omitempty"` + Curve KeyCurve `protobuf:"varint,4,opt,name=curve,proto3,enum=did.v1.KeyCurve" json:"curve,omitempty"` + KeyType KeyType `protobuf:"varint,5,opt,name=key_type,json=keyType,proto3,enum=did.v1.KeyType" json:"key_type,omitempty"` + Raw []byte `protobuf:"bytes,6,opt,name=raw,proto3" json:"raw,omitempty"` + Jwk *PubKey_JWK `protobuf:"bytes,7,opt,name=jwk,proto3" json:"jwk,omitempty"` +} + +func (x *PubKey) Reset() { + *x = PubKey{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[5] + 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_models_proto_rawDescGZIP(), []int{5} +} + +func (x *PubKey) GetRole() KeyRole { + if x != nil { + return x.Role + } + return KeyRole_KEY_ROLE_UNSPECIFIED +} + +func (x *PubKey) GetAlgorithm() KeyAlgorithm { + if x != nil { + return x.Algorithm + } + return KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED +} + +func (x *PubKey) GetEncoding() KeyEncoding { + if x != nil { + return x.Encoding + } + return KeyEncoding_KEY_ENCODING_UNSPECIFIED +} + +func (x *PubKey) GetCurve() KeyCurve { + if x != nil { + return x.Curve + } + return KeyCurve_KEY_CURVE_UNSPECIFIED +} + +func (x *PubKey) GetKeyType() KeyType { + if x != nil { + return x.KeyType + } + return KeyType_KEY_TYPE_UNSPECIFIED +} + +func (x *PubKey) GetRaw() []byte { + if x != nil { + return x.Raw + } + return nil +} + +func (x *PubKey) GetJwk() *PubKey_JWK { + if x != nil { + return x.Jwk + } + return nil +} + +// Service defines a Decentralized Service on the Sonr Blockchain +type Service struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + ServiceEndpoints map[string]string `protobuf:"bytes,6,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Permissions *Permissions `protobuf:"bytes,7,opt,name=permissions,proto3" json:"permissions,omitempty"` +} + +func (x *Service) Reset() { + *x = Service{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Service) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Service) ProtoMessage() {} + +// Deprecated: Use Service.ProtoReflect.Descriptor instead. +func (*Service) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{6} +} + +func (x *Service) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Service) GetServiceType() string { + if x != nil { + return x.ServiceType + } + return "" +} + +func (x *Service) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *Service) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *Service) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Service) GetServiceEndpoints() map[string]string { + if x != nil { + return x.ServiceEndpoints + } + return nil +} + +func (x *Service) GetPermissions() *Permissions { + if x != nil { + return x.Permissions + } + return nil +} + +// ServicceInfo defines a Decentralized Service on the Sonr Blockchain +type ServiceInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Fingerprint string `protobuf:"bytes,3,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` + Service *Service `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` +} + +func (x *ServiceInfo) Reset() { + *x = ServiceInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServiceInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServiceInfo) ProtoMessage() {} + +// Deprecated: Use ServiceInfo.ProtoReflect.Descriptor instead. +func (*ServiceInfo) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{7} +} + +func (x *ServiceInfo) GetExists() bool { + if x != nil { + return x.Exists + } + return false +} + +func (x *ServiceInfo) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *ServiceInfo) GetFingerprint() string { + if x != nil { + return x.Fingerprint + } + return "" +} + +func (x *ServiceInfo) GetService() *Service { + if x != nil { + return x.Service + } + return nil +} + +// FirstPartyCaveat defines a first party caveat +type FirstPartyCaveat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` + Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` + Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` +} + +func (x *FirstPartyCaveat) Reset() { + *x = FirstPartyCaveat{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FirstPartyCaveat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FirstPartyCaveat) ProtoMessage() {} + +// Deprecated: Use FirstPartyCaveat.ProtoReflect.Descriptor instead. +func (*FirstPartyCaveat) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{8} +} + +func (x *FirstPartyCaveat) GetScope() *Permissions { + if x != nil { + return x.Scope + } + return nil +} + +func (x *FirstPartyCaveat) GetExp() int64 { + if x != nil { + return x.Exp + } + return 0 +} + +func (x *FirstPartyCaveat) GetCnf() string { + if x != nil { + return x.Cnf + } + return "" +} + +func (x *FirstPartyCaveat) GetAud() string { + if x != nil { + return x.Aud + } + return "" +} + +// ThirdPartyCaveat defines a third party caveat +type ThirdPartyCaveat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` + Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` + Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` +} + +func (x *ThirdPartyCaveat) Reset() { + *x = ThirdPartyCaveat{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ThirdPartyCaveat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ThirdPartyCaveat) ProtoMessage() {} + +// Deprecated: Use ThirdPartyCaveat.ProtoReflect.Descriptor instead. +func (*ThirdPartyCaveat) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{9} +} + +func (x *ThirdPartyCaveat) GetScope() *Permissions { + if x != nil { + return x.Scope + } + return nil +} + +func (x *ThirdPartyCaveat) GetExp() int64 { + if x != nil { + return x.Exp + } + return 0 +} + +func (x *ThirdPartyCaveat) GetCnf() string { + if x != nil { + return x.Cnf + } + return "" +} + +func (x *ThirdPartyCaveat) GetAud() string { + if x != nil { + return x.Aud + } + return "" +} + +// JWK represents a JSON Web Key +type PubKey_JWK struct { + state protoimpl.MessageState + 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 *PubKey_JWK) Reset() { + *x = PubKey_JWK{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_models_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PubKey_JWK) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PubKey_JWK) ProtoMessage() {} + +// Deprecated: Use PubKey_JWK.ProtoReflect.Descriptor instead. +func (*PubKey_JWK) Descriptor() ([]byte, []int) { + return file_did_v1_models_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *PubKey_JWK) GetKty() string { + if x != nil { + return x.Kty + } + return "" +} + +func (x *PubKey_JWK) GetCrv() string { + if x != nil { + return x.Crv + } + return "" +} + +func (x *PubKey_JWK) GetX() string { + if x != nil { + return x.X + } + return "" +} + +func (x *PubKey_JWK) GetY() string { + if x != nil { + return x.Y + } + return "" +} + +func (x *PubKey_JWK) GetN() string { + if x != nil { + return x.N + } + return "" +} + +func (x *PubKey_JWK) GetE() string { + if x != nil { + return x.E + } + return "" +} + +var File_did_v1_models_proto protoreflect.FileDescriptor + +var file_did_v1_models_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x64, + 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x05, 0x41, 0x6c, 0x69, + 0x61, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x22, 0xa3, 0x03, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x29, 0x0a, + 0x10, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, + 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, + 0x72, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, + 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x50, 0x72, 0x65, + 0x73, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x75, 0x73, 0x65, + 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x62, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x5f, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x45, 0x6c, 0x69, 0x67, 0x69, 0x62, + 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x5f, 0x77, + 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x63, 0x6c, + 0x6f, 0x6e, 0x65, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x22, 0x91, 0x02, 0x0a, 0x08, 0x44, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x29, 0x0a, 0x10, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65, 0x72, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, + 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, + 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, + 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xe5, + 0x02, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 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, 0x3a, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, + 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 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, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 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, 0x22, 0x6c, 0x0a, 0x0b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x06, 0x67, 0x72, 0x61, + 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x06, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x22, 0x81, 0x03, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, + 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x2f, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, + 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, + 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x0a, 0x05, 0x63, 0x75, 0x72, + 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, + 0x65, 0x12, 0x2a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x72, 0x61, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, 0x61, 0x77, 0x12, + 0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x2e, 0x4a, 0x57, 0x4b, + 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x1a, 0x61, 0x0a, 0x03, 0x4a, 0x57, 0x4b, 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, 0xe4, 0x02, 0x0a, 0x07, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x70, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 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, + 0x8a, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, + 0x20, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x73, 0x0a, 0x10, + 0x46, 0x69, 0x72, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x79, 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, + 0x12, 0x29, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, + 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, + 0x03, 0x63, 0x6e, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6e, 0x66, 0x12, + 0x10, 0x0a, 0x03, 0x61, 0x75, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x75, + 0x64, 0x22, 0x73, 0x0a, 0x10, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x79, 0x43, + 0x61, 0x76, 0x65, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, + 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6e, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x63, 0x6e, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x75, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x61, 0x75, 0x64, 0x42, 0x7b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, + 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, + 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_did_v1_models_proto_rawDescOnce sync.Once + file_did_v1_models_proto_rawDescData = file_did_v1_models_proto_rawDesc +) + +func file_did_v1_models_proto_rawDescGZIP() []byte { + file_did_v1_models_proto_rawDescOnce.Do(func() { + file_did_v1_models_proto_rawDescData = protoimpl.X.CompressGZIP(file_did_v1_models_proto_rawDescData) + }) + return file_did_v1_models_proto_rawDescData +} + +var file_did_v1_models_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_did_v1_models_proto_goTypes = []interface{}{ + (*Alias)(nil), // 0: did.v1.Alias + (*Credential)(nil), // 1: did.v1.Credential + (*Document)(nil), // 2: did.v1.Document + (*Keyshare)(nil), // 3: did.v1.Keyshare + (*Permissions)(nil), // 4: did.v1.Permissions + (*PubKey)(nil), // 5: did.v1.PubKey + (*Service)(nil), // 6: did.v1.Service + (*ServiceInfo)(nil), // 7: did.v1.ServiceInfo + (*FirstPartyCaveat)(nil), // 8: did.v1.FirstPartyCaveat + (*ThirdPartyCaveat)(nil), // 9: did.v1.ThirdPartyCaveat + nil, // 10: did.v1.Keyshare.MetadataEntry + nil, // 11: did.v1.Keyshare.PayloadsEntry + (*PubKey_JWK)(nil), // 12: did.v1.PubKey.JWK + nil, // 13: did.v1.Service.ServiceEndpointsEntry + (DIDNamespace)(0), // 14: did.v1.DIDNamespace + (PermissionScope)(0), // 15: did.v1.PermissionScope + (KeyRole)(0), // 16: did.v1.KeyRole + (KeyAlgorithm)(0), // 17: did.v1.KeyAlgorithm + (KeyEncoding)(0), // 18: did.v1.KeyEncoding + (KeyCurve)(0), // 19: did.v1.KeyCurve + (KeyType)(0), // 20: did.v1.KeyType +} +var file_did_v1_models_proto_depIdxs = []int32{ + 10, // 0: did.v1.Keyshare.metadata:type_name -> did.v1.Keyshare.MetadataEntry + 11, // 1: did.v1.Keyshare.payloads:type_name -> did.v1.Keyshare.PayloadsEntry + 14, // 2: did.v1.Permissions.grants:type_name -> did.v1.DIDNamespace + 15, // 3: did.v1.Permissions.scopes:type_name -> did.v1.PermissionScope + 16, // 4: did.v1.PubKey.role:type_name -> did.v1.KeyRole + 17, // 5: did.v1.PubKey.algorithm:type_name -> did.v1.KeyAlgorithm + 18, // 6: did.v1.PubKey.encoding:type_name -> did.v1.KeyEncoding + 19, // 7: did.v1.PubKey.curve:type_name -> did.v1.KeyCurve + 20, // 8: did.v1.PubKey.key_type:type_name -> did.v1.KeyType + 12, // 9: did.v1.PubKey.jwk:type_name -> did.v1.PubKey.JWK + 13, // 10: did.v1.Service.service_endpoints:type_name -> did.v1.Service.ServiceEndpointsEntry + 4, // 11: did.v1.Service.permissions:type_name -> did.v1.Permissions + 6, // 12: did.v1.ServiceInfo.service:type_name -> did.v1.Service + 4, // 13: did.v1.FirstPartyCaveat.scope:type_name -> did.v1.Permissions + 4, // 14: did.v1.ThirdPartyCaveat.scope:type_name -> did.v1.Permissions + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_did_v1_models_proto_init() } +func file_did_v1_models_proto_init() { + if File_did_v1_models_proto != nil { + return + } + file_did_v1_genesis_proto_init() + if !protoimpl.UnsafeEnabled { + file_did_v1_models_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Alias); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_models_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Credential); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_models_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Document); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_models_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Keyshare); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_models_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Permissions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_models_proto_msgTypes[5].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_models_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Service); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_models_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServiceInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_models_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FirstPartyCaveat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_models_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ThirdPartyCaveat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_models_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PubKey_JWK); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_did_v1_models_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_did_v1_models_proto_goTypes, + DependencyIndexes: file_did_v1_models_proto_depIdxs, + MessageInfos: file_did_v1_models_proto_msgTypes, + }.Build() + File_did_v1_models_proto = out.File + file_did_v1_models_proto_rawDesc = nil + file_did_v1_models_proto_goTypes = nil + file_did_v1_models_proto_depIdxs = nil +} diff --git a/api/did/v1/query.pulsar.go b/api/did/v1/query.pulsar.go index 39deb96a2..f3ca4e4e9 100644 --- a/api/did/v1/query.pulsar.go +++ b/api/did/v1/query.pulsar.go @@ -15,23 +15,31 @@ import ( ) var ( - md_QueryParamsRequest protoreflect.MessageDescriptor + md_QueryRequest protoreflect.MessageDescriptor + fd_QueryRequest_did protoreflect.FieldDescriptor + fd_QueryRequest_origin protoreflect.FieldDescriptor + fd_QueryRequest_key protoreflect.FieldDescriptor + fd_QueryRequest_asset protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() - md_QueryParamsRequest = File_did_v1_query_proto.Messages().ByName("QueryParamsRequest") + md_QueryRequest = File_did_v1_query_proto.Messages().ByName("QueryRequest") + fd_QueryRequest_did = md_QueryRequest.Fields().ByName("did") + fd_QueryRequest_origin = md_QueryRequest.Fields().ByName("origin") + fd_QueryRequest_key = md_QueryRequest.Fields().ByName("key") + fd_QueryRequest_asset = md_QueryRequest.Fields().ByName("asset") } -var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryRequest)(nil) -type fastReflection_QueryParamsRequest QueryParamsRequest +type fastReflection_QueryRequest QueryRequest -func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryParamsRequest)(x) +func (x *QueryRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRequest)(x) } -func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { +func (x *QueryRequest) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_query_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -43,43 +51,43 @@ func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} +var _fastReflection_QueryRequest_messageType fastReflection_QueryRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryRequest_messageType{} -type fastReflection_QueryParamsRequest_messageType struct{} +type fastReflection_QueryRequest_messageType struct{} -func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryParamsRequest)(nil) +func (x fastReflection_QueryRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRequest)(nil) } -func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryParamsRequest) +func (x fastReflection_QueryRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRequest) } -func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryParamsRequest +func (x fastReflection_QueryRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryParamsRequest +func (x *fastReflection_QueryRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRequest } // 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 +func (x *fastReflection_QueryRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { - return new(fastReflection_QueryParamsRequest) +func (x *fastReflection_QueryRequest) New() protoreflect.Message { + return new(fastReflection_QueryRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { - return (*QueryParamsRequest)(x) +func (x *fastReflection_QueryRequest) Interface() protoreflect.ProtoMessage { + return (*QueryRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -87,7 +95,31 @@ func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessag // 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) { +func (x *fastReflection_QueryRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_QueryRequest_did, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_QueryRequest_origin, value) { + return + } + } + if x.Key != "" { + value := protoreflect.ValueOfString(x.Key) + if !f(fd_QueryRequest_key, value) { + return + } + } + if x.Asset != "" { + value := protoreflect.ValueOfString(x.Asset) + if !f(fd_QueryRequest_asset, value) { + return + } + } } // Has reports whether a field is populated. @@ -101,13 +133,21 @@ func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescr // 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 { +func (x *fastReflection_QueryRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "did.v1.QueryRequest.did": + return x.Did != "" + case "did.v1.QueryRequest.origin": + return x.Origin != "" + case "did.v1.QueryRequest.key": + return x.Key != "" + case "did.v1.QueryRequest.asset": + return x.Asset != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) } - panic(fmt.Errorf("message did.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryRequest does not contain field %s", fd.FullName())) } } @@ -117,13 +157,21 @@ func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "did.v1.QueryRequest.did": + x.Did = "" + case "did.v1.QueryRequest.origin": + x.Origin = "" + case "did.v1.QueryRequest.key": + x.Key = "" + case "did.v1.QueryRequest.asset": + x.Asset = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) } - panic(fmt.Errorf("message did.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryRequest does not contain field %s", fd.FullName())) } } @@ -133,13 +181,25 @@ func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescripto // 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 { +func (x *fastReflection_QueryRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "did.v1.QueryRequest.did": + value := x.Did + return protoreflect.ValueOfString(value) + case "did.v1.QueryRequest.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.QueryRequest.key": + value := x.Key + return protoreflect.ValueOfString(value) + case "did.v1.QueryRequest.asset": + value := x.Asset + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) } - panic(fmt.Errorf("message did.v1.QueryParamsRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.QueryRequest does not contain field %s", descriptor.FullName())) } } @@ -153,13 +213,21 @@ func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDes // 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) { +func (x *fastReflection_QueryRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "did.v1.QueryRequest.did": + x.Did = value.Interface().(string) + case "did.v1.QueryRequest.origin": + x.Origin = value.Interface().(string) + case "did.v1.QueryRequest.key": + x.Key = value.Interface().(string) + case "did.v1.QueryRequest.asset": + x.Asset = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) } - panic(fmt.Errorf("message did.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryRequest does not contain field %s", fd.FullName())) } } @@ -173,36 +241,52 @@ func (x *fastReflection_QueryParamsRequest) 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_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.QueryRequest.did": + panic(fmt.Errorf("field did of message did.v1.QueryRequest is not mutable")) + case "did.v1.QueryRequest.origin": + panic(fmt.Errorf("field origin of message did.v1.QueryRequest is not mutable")) + case "did.v1.QueryRequest.key": + panic(fmt.Errorf("field key of message did.v1.QueryRequest is not mutable")) + case "did.v1.QueryRequest.asset": + panic(fmt.Errorf("field asset of message did.v1.QueryRequest is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) } - panic(fmt.Errorf("message did.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryRequest 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 { +func (x *fastReflection_QueryRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.QueryRequest.did": + return protoreflect.ValueOfString("") + case "did.v1.QueryRequest.origin": + return protoreflect.ValueOfString("") + case "did.v1.QueryRequest.key": + return protoreflect.ValueOfString("") + case "did.v1.QueryRequest.asset": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRequest")) } - panic(fmt.Errorf("message did.v1.QueryParamsRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryRequest 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 { +func (x *fastReflection_QueryRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryParamsRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryRequest", d.FullName())) } panic("unreachable") } @@ -210,7 +294,7 @@ func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescr // 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 { +func (x *fastReflection_QueryRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -221,7 +305,7 @@ func (x *fastReflection_QueryParamsRequest) 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_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -233,7 +317,7 @@ func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFi // 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 { +func (x *fastReflection_QueryRequest) IsValid() bool { return x != nil } @@ -243,9 +327,9 @@ func (x *fastReflection_QueryParamsRequest) 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_QueryParamsRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryParamsRequest) + x := input.Message.Interface().(*QueryRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -257,6 +341,22 @@ func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + l = len(x.Did) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Key) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Asset) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -267,7 +367,7 @@ func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryParamsRequest) + x := input.Message.Interface().(*QueryRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -286,6 +386,34 @@ func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Asset) > 0 { + i -= len(x.Asset) + copy(dAtA[i:], x.Asset) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Asset))) + i-- + dAtA[i] = 0x22 + } + if len(x.Key) > 0 { + i -= len(x.Key) + copy(dAtA[i:], x.Key) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key))) + i-- + dAtA[i] = 0x1a + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(x.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -297,7 +425,7 @@ func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryParamsRequest) + x := input.Message.Interface().(*QueryRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -329,12 +457,851 @@ func (x *fastReflection_QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequest: 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) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Asset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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_QueryResponse protoreflect.MessageDescriptor + fd_QueryResponse_success protoreflect.FieldDescriptor + fd_QueryResponse_query protoreflect.FieldDescriptor + fd_QueryResponse_document protoreflect.FieldDescriptor + fd_QueryResponse_service protoreflect.FieldDescriptor + fd_QueryResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryResponse = File_did_v1_query_proto.Messages().ByName("QueryResponse") + fd_QueryResponse_success = md_QueryResponse.Fields().ByName("success") + fd_QueryResponse_query = md_QueryResponse.Fields().ByName("query") + fd_QueryResponse_document = md_QueryResponse.Fields().ByName("document") + fd_QueryResponse_service = md_QueryResponse.Fields().ByName("service") + fd_QueryResponse_params = md_QueryResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryResponse)(nil) + +type fastReflection_QueryResponse QueryResponse + +func (x *QueryResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryResponse)(x) +} + +func (x *QueryResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_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_QueryResponse_messageType fastReflection_QueryResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryResponse_messageType{} + +type fastReflection_QueryResponse_messageType struct{} + +func (x fastReflection_QueryResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryResponse)(nil) +} +func (x fastReflection_QueryResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryResponse) +} +func (x fastReflection_QueryResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryResponse +} + +// 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_QueryResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryResponse) New() protoreflect.Message { + return new(fastReflection_QueryResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryResponse) Interface() protoreflect.ProtoMessage { + return (*QueryResponse)(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_QueryResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_QueryResponse_success, value) { + return + } + } + if x.Query != "" { + value := protoreflect.ValueOfString(x.Query) + if !f(fd_QueryResponse_query, value) { + return + } + } + if x.Document != nil { + value := protoreflect.ValueOfMessage(x.Document.ProtoReflect()) + if !f(fd_QueryResponse_document, value) { + return + } + } + if x.Service != nil { + value := protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + if !f(fd_QueryResponse_service, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryResponse_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_QueryResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryResponse.success": + return x.Success != false + case "did.v1.QueryResponse.query": + return x.Query != "" + case "did.v1.QueryResponse.document": + return x.Document != nil + case "did.v1.QueryResponse.service": + return x.Service != nil + case "did.v1.QueryResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) + } + panic(fmt.Errorf("message did.v1.QueryResponse 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_QueryResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryResponse.success": + x.Success = false + case "did.v1.QueryResponse.query": + x.Query = "" + case "did.v1.QueryResponse.document": + x.Document = nil + case "did.v1.QueryResponse.service": + x.Service = nil + case "did.v1.QueryResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) + } + panic(fmt.Errorf("message did.v1.QueryResponse 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_QueryResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryResponse.success": + value := x.Success + return protoreflect.ValueOfBool(value) + case "did.v1.QueryResponse.query": + value := x.Query + return protoreflect.ValueOfString(value) + case "did.v1.QueryResponse.document": + value := x.Document + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.QueryResponse.service": + value := x.Service + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.QueryResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) + } + panic(fmt.Errorf("message did.v1.QueryResponse 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_QueryResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryResponse.success": + x.Success = value.Bool() + case "did.v1.QueryResponse.query": + x.Query = value.Interface().(string) + case "did.v1.QueryResponse.document": + x.Document = value.Message().Interface().(*Document) + case "did.v1.QueryResponse.service": + x.Service = value.Message().Interface().(*ServiceInfo) + case "did.v1.QueryResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) + } + panic(fmt.Errorf("message did.v1.QueryResponse 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_QueryResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryResponse.document": + if x.Document == nil { + x.Document = new(Document) + } + return protoreflect.ValueOfMessage(x.Document.ProtoReflect()) + case "did.v1.QueryResponse.service": + if x.Service == nil { + x.Service = new(ServiceInfo) + } + return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + case "did.v1.QueryResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "did.v1.QueryResponse.success": + panic(fmt.Errorf("field success of message did.v1.QueryResponse is not mutable")) + case "did.v1.QueryResponse.query": + panic(fmt.Errorf("field query of message did.v1.QueryResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) + } + panic(fmt.Errorf("message did.v1.QueryResponse 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_QueryResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryResponse.success": + return protoreflect.ValueOfBool(false) + case "did.v1.QueryResponse.query": + return protoreflect.ValueOfString("") + case "did.v1.QueryResponse.document": + m := new(Document) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.QueryResponse.service": + m := new(ServiceInfo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.QueryResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResponse")) + } + panic(fmt.Errorf("message did.v1.QueryResponse 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_QueryResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryResponse", 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_QueryResponse) 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_QueryResponse) 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_QueryResponse) 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_QueryResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryResponse) + 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.Query) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Document != nil { + l = options.Size(x.Document) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Service != nil { + l = options.Size(x.Service) + 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().(*QueryResponse) + 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] = 0x2a + } + if x.Service != nil { + encoded, err := options.Marshal(x.Service) + 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.Document != nil { + encoded, err := options.Marshal(x.Document) + 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.Query) > 0 { + i -= len(x.Query) + copy(dAtA[i:], x.Query) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Query))) + 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().(*QueryResponse) + 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: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResponse: 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 Query", 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.Query = 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 Document", 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.Document == nil { + x.Document = &Document{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Document); 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 Service", 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.Service == nil { + x.Service = &ServiceInfo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Service); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field 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:]) @@ -390,7 +1357,7 @@ func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { } func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[1] + mi := &file_did_v1_query_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -805,446 +1772,77 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } } +var _ protoreflect.List = (*_QueryParamsAssetsResponse_1_list)(nil) + +type _QueryParamsAssetsResponse_1_list struct { + list *[]*AssetInfo +} + +func (x *_QueryParamsAssetsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryParamsAssetsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryParamsAssetsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AssetInfo) + (*x.list)[i] = concreteValue +} + +func (x *_QueryParamsAssetsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*AssetInfo) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryParamsAssetsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(AssetInfo) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryParamsAssetsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryParamsAssetsResponse_1_list) NewElement() protoreflect.Value { + v := new(AssetInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryParamsAssetsResponse_1_list) IsValid() bool { + return x.list != nil +} + var ( - md_QueryAccountsRequest protoreflect.MessageDescriptor - fd_QueryAccountsRequest_did protoreflect.FieldDescriptor + md_QueryParamsAssetsResponse protoreflect.MessageDescriptor + fd_QueryParamsAssetsResponse_assets protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() - md_QueryAccountsRequest = File_did_v1_query_proto.Messages().ByName("QueryAccountsRequest") - fd_QueryAccountsRequest_did = md_QueryAccountsRequest.Fields().ByName("did") + md_QueryParamsAssetsResponse = File_did_v1_query_proto.Messages().ByName("QueryParamsAssetsResponse") + fd_QueryParamsAssetsResponse_assets = md_QueryParamsAssetsResponse.Fields().ByName("assets") } -var _ protoreflect.Message = (*fastReflection_QueryAccountsRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryParamsAssetsResponse)(nil) -type fastReflection_QueryAccountsRequest QueryAccountsRequest +type fastReflection_QueryParamsAssetsResponse QueryParamsAssetsResponse -func (x *QueryAccountsRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAccountsRequest)(x) +func (x *QueryParamsAssetsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsAssetsResponse)(x) } -func (x *QueryAccountsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryAccountsRequest_messageType fastReflection_QueryAccountsRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryAccountsRequest_messageType{} - -type fastReflection_QueryAccountsRequest_messageType struct{} - -func (x fastReflection_QueryAccountsRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAccountsRequest)(nil) -} -func (x fastReflection_QueryAccountsRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAccountsRequest) -} -func (x fastReflection_QueryAccountsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountsRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryAccountsRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountsRequest -} - -// 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_QueryAccountsRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryAccountsRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAccountsRequest) New() protoreflect.Message { - return new(fastReflection_QueryAccountsRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAccountsRequest) Interface() protoreflect.ProtoMessage { - return (*QueryAccountsRequest)(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_QueryAccountsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_QueryAccountsRequest_did, 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_QueryAccountsRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.QueryAccountsRequest.did": - return x.Did != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsRequest 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_QueryAccountsRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.QueryAccountsRequest.did": - x.Did = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsRequest 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_QueryAccountsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.QueryAccountsRequest.did": - value := x.Did - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsRequest 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_QueryAccountsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.QueryAccountsRequest.did": - x.Did = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsRequest 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_QueryAccountsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryAccountsRequest.did": - panic(fmt.Errorf("field did of message did.v1.QueryAccountsRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsRequest 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_QueryAccountsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryAccountsRequest.did": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryAccountsRequest 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_QueryAccountsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryAccountsRequest", 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_QueryAccountsRequest) 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_QueryAccountsRequest) 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_QueryAccountsRequest) 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_QueryAccountsRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAccountsRequest) - 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)) - } - 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().(*QueryAccountsRequest) - 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.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().(*QueryAccountsRequest) - 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: QueryAccountsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountsRequest: 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 - 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_QueryAccountsResponse protoreflect.MessageDescriptor - fd_QueryAccountsResponse_exists protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_QueryAccountsResponse = File_did_v1_query_proto.Messages().ByName("QueryAccountsResponse") - fd_QueryAccountsResponse_exists = md_QueryAccountsResponse.Fields().ByName("exists") -} - -var _ protoreflect.Message = (*fastReflection_QueryAccountsResponse)(nil) - -type fastReflection_QueryAccountsResponse QueryAccountsResponse - -func (x *QueryAccountsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAccountsResponse)(x) -} - -func (x *QueryAccountsResponse) slowProtoReflect() protoreflect.Message { +func (x *QueryParamsAssetsResponse) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_query_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1256,43 +1854,43 @@ func (x *QueryAccountsResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryAccountsResponse_messageType fastReflection_QueryAccountsResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryAccountsResponse_messageType{} +var _fastReflection_QueryParamsAssetsResponse_messageType fastReflection_QueryParamsAssetsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsAssetsResponse_messageType{} -type fastReflection_QueryAccountsResponse_messageType struct{} +type fastReflection_QueryParamsAssetsResponse_messageType struct{} -func (x fastReflection_QueryAccountsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAccountsResponse)(nil) +func (x fastReflection_QueryParamsAssetsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsAssetsResponse)(nil) } -func (x fastReflection_QueryAccountsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAccountsResponse) +func (x fastReflection_QueryParamsAssetsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsAssetsResponse) } -func (x fastReflection_QueryAccountsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountsResponse +func (x fastReflection_QueryParamsAssetsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsAssetsResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryAccountsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAccountsResponse +func (x *fastReflection_QueryParamsAssetsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsAssetsResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryAccountsResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryAccountsResponse_messageType +func (x *fastReflection_QueryParamsAssetsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsAssetsResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAccountsResponse) New() protoreflect.Message { - return new(fastReflection_QueryAccountsResponse) +func (x *fastReflection_QueryParamsAssetsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsAssetsResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAccountsResponse) Interface() protoreflect.ProtoMessage { - return (*QueryAccountsResponse)(x) +func (x *fastReflection_QueryParamsAssetsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsAssetsResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -1300,10 +1898,10 @@ func (x *fastReflection_QueryAccountsResponse) Interface() protoreflect.ProtoMes // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryAccountsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Exists != false { - value := protoreflect.ValueOfBool(x.Exists) - if !f(fd_QueryAccountsResponse_exists, value) { +func (x *fastReflection_QueryParamsAssetsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Assets) != 0 { + value := protoreflect.ValueOfList(&_QueryParamsAssetsResponse_1_list{list: &x.Assets}) + if !f(fd_QueryParamsAssetsResponse_assets, value) { return } } @@ -1320,15 +1918,15 @@ func (x *fastReflection_QueryAccountsResponse) Range(f func(protoreflect.FieldDe // 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_QueryAccountsResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryParamsAssetsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.QueryAccountsResponse.exists": - return x.Exists != false + case "did.v1.QueryParamsAssetsResponse.assets": + return len(x.Assets) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse does not contain field %s", fd.FullName())) } } @@ -1338,15 +1936,15 @@ func (x *fastReflection_QueryAccountsResponse) Has(fd protoreflect.FieldDescript // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountsResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryParamsAssetsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.QueryAccountsResponse.exists": - x.Exists = false + case "did.v1.QueryParamsAssetsResponse.assets": + x.Assets = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse does not contain field %s", fd.FullName())) } } @@ -1356,16 +1954,19 @@ func (x *fastReflection_QueryAccountsResponse) Clear(fd protoreflect.FieldDescri // 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_QueryAccountsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryParamsAssetsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.QueryAccountsResponse.exists": - value := x.Exists - return protoreflect.ValueOfBool(value) + case "did.v1.QueryParamsAssetsResponse.assets": + if len(x.Assets) == 0 { + return protoreflect.ValueOfList(&_QueryParamsAssetsResponse_1_list{}) + } + listValue := &_QueryParamsAssetsResponse_1_list{list: &x.Assets} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse does not contain field %s", descriptor.FullName())) } } @@ -1379,15 +1980,17 @@ func (x *fastReflection_QueryAccountsResponse) Get(descriptor protoreflect.Field // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryParamsAssetsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.QueryAccountsResponse.exists": - x.Exists = value.Bool() + case "did.v1.QueryParamsAssetsResponse.assets": + lv := value.List() + clv := lv.(*_QueryParamsAssetsResponse_1_list) + x.Assets = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse does not contain field %s", fd.FullName())) } } @@ -1401,40 +2004,45 @@ func (x *fastReflection_QueryAccountsResponse) Set(fd protoreflect.FieldDescript // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryParamsAssetsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryAccountsResponse.exists": - panic(fmt.Errorf("field exists of message did.v1.QueryAccountsResponse is not mutable")) + case "did.v1.QueryParamsAssetsResponse.assets": + if x.Assets == nil { + x.Assets = []*AssetInfo{} + } + value := &_QueryParamsAssetsResponse_1_list{list: &x.Assets} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryAccountsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryParamsAssetsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryAccountsResponse.exists": - return protoreflect.ValueOfBool(false) + case "did.v1.QueryParamsAssetsResponse.assets": + list := []*AssetInfo{} + return protoreflect.ValueOfList(&_QueryParamsAssetsResponse_1_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryAccountsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsAssetsResponse")) } - panic(fmt.Errorf("message did.v1.QueryAccountsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsAssetsResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryAccountsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryParamsAssetsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryAccountsResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryParamsAssetsResponse", d.FullName())) } panic("unreachable") } @@ -1442,7 +2050,7 @@ func (x *fastReflection_QueryAccountsResponse) WhichOneof(d protoreflect.OneofDe // 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_QueryAccountsResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryParamsAssetsResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1453,7 +2061,7 @@ func (x *fastReflection_QueryAccountsResponse) GetUnknown() protoreflect.RawFiel // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAccountsResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryParamsAssetsResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1465,7 +2073,7 @@ func (x *fastReflection_QueryAccountsResponse) SetUnknown(fields protoreflect.Ra // 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_QueryAccountsResponse) IsValid() bool { +func (x *fastReflection_QueryParamsAssetsResponse) IsValid() bool { return x != nil } @@ -1475,9 +2083,9 @@ func (x *fastReflection_QueryAccountsResponse) 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_QueryAccountsResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryParamsAssetsResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAccountsResponse) + x := input.Message.Interface().(*QueryParamsAssetsResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1489,8 +2097,11 @@ func (x *fastReflection_QueryAccountsResponse) ProtoMethods() *protoiface.Method var n int var l int _ = l - if x.Exists { - n += 2 + 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) @@ -1502,7 +2113,7 @@ func (x *fastReflection_QueryAccountsResponse) ProtoMethods() *protoiface.Method } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAccountsResponse) + x := input.Message.Interface().(*QueryParamsAssetsResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1521,1052 +2132,20 @@ func (x *fastReflection_QueryAccountsResponse) ProtoMethods() *protoiface.Method i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Exists { - i-- - if x.Exists { - 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().(*QueryAccountsResponse) - 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: QueryAccountsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAccountsResponse: 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 Exists", 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.Exists = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) + 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.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, 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_QueryCredentialsRequest protoreflect.MessageDescriptor - fd_QueryCredentialsRequest_did protoreflect.FieldDescriptor - fd_QueryCredentialsRequest_origin protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_QueryCredentialsRequest = File_did_v1_query_proto.Messages().ByName("QueryCredentialsRequest") - fd_QueryCredentialsRequest_did = md_QueryCredentialsRequest.Fields().ByName("did") - fd_QueryCredentialsRequest_origin = md_QueryCredentialsRequest.Fields().ByName("origin") -} - -var _ protoreflect.Message = (*fastReflection_QueryCredentialsRequest)(nil) - -type fastReflection_QueryCredentialsRequest QueryCredentialsRequest - -func (x *QueryCredentialsRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryCredentialsRequest)(x) -} - -func (x *QueryCredentialsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryCredentialsRequest_messageType fastReflection_QueryCredentialsRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryCredentialsRequest_messageType{} - -type fastReflection_QueryCredentialsRequest_messageType struct{} - -func (x fastReflection_QueryCredentialsRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryCredentialsRequest)(nil) -} -func (x fastReflection_QueryCredentialsRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryCredentialsRequest) -} -func (x fastReflection_QueryCredentialsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryCredentialsRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryCredentialsRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryCredentialsRequest -} - -// 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_QueryCredentialsRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryCredentialsRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryCredentialsRequest) New() protoreflect.Message { - return new(fastReflection_QueryCredentialsRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryCredentialsRequest) Interface() protoreflect.ProtoMessage { - return (*QueryCredentialsRequest)(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_QueryCredentialsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_QueryCredentialsRequest_did, value) { - return - } - } - if x.Origin != "" { - value := protoreflect.ValueOfString(x.Origin) - if !f(fd_QueryCredentialsRequest_origin, 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_QueryCredentialsRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.QueryCredentialsRequest.did": - return x.Did != "" - case "did.v1.QueryCredentialsRequest.origin": - return x.Origin != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsRequest 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_QueryCredentialsRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.QueryCredentialsRequest.did": - x.Did = "" - case "did.v1.QueryCredentialsRequest.origin": - x.Origin = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsRequest 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_QueryCredentialsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.QueryCredentialsRequest.did": - value := x.Did - return protoreflect.ValueOfString(value) - case "did.v1.QueryCredentialsRequest.origin": - value := x.Origin - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsRequest 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_QueryCredentialsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.QueryCredentialsRequest.did": - x.Did = value.Interface().(string) - case "did.v1.QueryCredentialsRequest.origin": - x.Origin = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsRequest 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_QueryCredentialsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryCredentialsRequest.did": - panic(fmt.Errorf("field did of message did.v1.QueryCredentialsRequest is not mutable")) - case "did.v1.QueryCredentialsRequest.origin": - panic(fmt.Errorf("field origin of message did.v1.QueryCredentialsRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsRequest 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_QueryCredentialsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryCredentialsRequest.did": - return protoreflect.ValueOfString("") - case "did.v1.QueryCredentialsRequest.origin": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsRequest")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsRequest 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_QueryCredentialsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryCredentialsRequest", 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_QueryCredentialsRequest) 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_QueryCredentialsRequest) 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_QueryCredentialsRequest) 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_QueryCredentialsRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryCredentialsRequest) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Did) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Origin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - 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().(*QueryCredentialsRequest) - 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.Origin) > 0 { - i -= len(x.Origin) - copy(dAtA[i:], x.Origin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) - i-- - dAtA[i] = 0x12 - } - if len(x.Did) > 0 { - i -= len(x.Did) - copy(dAtA[i:], x.Did) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryCredentialsRequest) - 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: QueryCredentialsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCredentialsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Did = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Origin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.Map = (*_QueryCredentialsResponse_1_map)(nil) - -type _QueryCredentialsResponse_1_map struct { - m *map[string][]byte -} - -func (x *_QueryCredentialsResponse_1_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_QueryCredentialsResponse_1_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - if x.m == nil { - return - } - for k, v := range *x.m { - mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) - mapValue := protoreflect.ValueOfBytes(v) - if !f(mapKey, mapValue) { - break - } - } -} - -func (x *_QueryCredentialsResponse_1_map) Has(key protoreflect.MapKey) bool { - if x.m == nil { - return false - } - keyUnwrapped := key.String() - concreteValue := keyUnwrapped - _, ok := (*x.m)[concreteValue] - return ok -} - -func (x *_QueryCredentialsResponse_1_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_QueryCredentialsResponse_1_map) Get(key protoreflect.MapKey) protoreflect.Value { - if x.m == nil { - return protoreflect.Value{} - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if !ok { - return protoreflect.Value{} - } - return protoreflect.ValueOfBytes(v) -} - -func (x *_QueryCredentialsResponse_1_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.Bytes() - concreteValue := valueUnwrapped - (*x.m)[concreteKey] = concreteValue -} - -func (x *_QueryCredentialsResponse_1_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 *_QueryCredentialsResponse_1_map) NewValue() protoreflect.Value { - var v []byte - return protoreflect.ValueOfBytes(v) -} - -func (x *_QueryCredentialsResponse_1_map) IsValid() bool { - return x.m != nil -} - -var ( - md_QueryCredentialsResponse protoreflect.MessageDescriptor - fd_QueryCredentialsResponse_credentials protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_QueryCredentialsResponse = File_did_v1_query_proto.Messages().ByName("QueryCredentialsResponse") - fd_QueryCredentialsResponse_credentials = md_QueryCredentialsResponse.Fields().ByName("credentials") -} - -var _ protoreflect.Message = (*fastReflection_QueryCredentialsResponse)(nil) - -type fastReflection_QueryCredentialsResponse QueryCredentialsResponse - -func (x *QueryCredentialsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryCredentialsResponse)(x) -} - -func (x *QueryCredentialsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryCredentialsResponse_messageType fastReflection_QueryCredentialsResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryCredentialsResponse_messageType{} - -type fastReflection_QueryCredentialsResponse_messageType struct{} - -func (x fastReflection_QueryCredentialsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryCredentialsResponse)(nil) -} -func (x fastReflection_QueryCredentialsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryCredentialsResponse) -} -func (x fastReflection_QueryCredentialsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryCredentialsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryCredentialsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryCredentialsResponse -} - -// 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_QueryCredentialsResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryCredentialsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryCredentialsResponse) New() protoreflect.Message { - return new(fastReflection_QueryCredentialsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryCredentialsResponse) Interface() protoreflect.ProtoMessage { - return (*QueryCredentialsResponse)(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_QueryCredentialsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Credentials) != 0 { - value := protoreflect.ValueOfMap(&_QueryCredentialsResponse_1_map{m: &x.Credentials}) - if !f(fd_QueryCredentialsResponse_credentials, 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_QueryCredentialsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.QueryCredentialsResponse.credentials": - return len(x.Credentials) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse 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_QueryCredentialsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.QueryCredentialsResponse.credentials": - x.Credentials = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse 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_QueryCredentialsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.QueryCredentialsResponse.credentials": - if len(x.Credentials) == 0 { - return protoreflect.ValueOfMap(&_QueryCredentialsResponse_1_map{}) - } - mapValue := &_QueryCredentialsResponse_1_map{m: &x.Credentials} - return protoreflect.ValueOfMap(mapValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse 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_QueryCredentialsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.QueryCredentialsResponse.credentials": - mv := value.Map() - cmv := mv.(*_QueryCredentialsResponse_1_map) - x.Credentials = *cmv.m - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse 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_QueryCredentialsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryCredentialsResponse.credentials": - if x.Credentials == nil { - x.Credentials = make(map[string][]byte) - } - value := &_QueryCredentialsResponse_1_map{m: &x.Credentials} - return protoreflect.ValueOfMap(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse 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_QueryCredentialsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryCredentialsResponse.credentials": - m := make(map[string][]byte) - return protoreflect.ValueOfMap(&_QueryCredentialsResponse_1_map{m: &m}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryCredentialsResponse")) - } - panic(fmt.Errorf("message did.v1.QueryCredentialsResponse 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_QueryCredentialsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryCredentialsResponse", 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_QueryCredentialsResponse) 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_QueryCredentialsResponse) 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_QueryCredentialsResponse) 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_QueryCredentialsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryCredentialsResponse) - 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.Credentials) > 0 { - SiZeMaP := func(k string, v []byte) { - l = 1 + len(v) + runtime.Sov(uint64(len(v))) - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.Credentials)) - for k := range x.Credentials { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Credentials[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Credentials { - SiZeMaP(k, v) - } - } - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryCredentialsResponse) - 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.Credentials) > 0 { - MaRsHaLmAp := func(k string, v []byte) (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 -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForCredentials := make([]string, 0, len(x.Credentials)) - for k := range x.Credentials { - keysForCredentials = append(keysForCredentials, string(k)) - } - sort.Slice(keysForCredentials, func(i, j int) bool { - return keysForCredentials[i] < keysForCredentials[j] - }) - for iNdEx := len(keysForCredentials) - 1; iNdEx >= 0; iNdEx-- { - v := x.Credentials[string(keysForCredentials[iNdEx])] - out, err := MaRsHaLmAp(keysForCredentials[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Credentials { - v := x.Credentials[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } } } if input.Buf != nil { @@ -2580,7 +2159,7 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryCredentialsResponse) + x := input.Message.Interface().(*QueryParamsAssetsResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2612,15 +2191,15 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCredentialsResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsAssetsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCredentialsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsAssetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) + 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 { @@ -2647,11 +2226,598 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Credentials == nil { - x.Credentials = make(map[string][]byte) + x.Assets = append(x.Assets, &AssetInfo{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Assets[len(x.Assets)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.Map = (*_QueryParamsKeysResponse_1_map)(nil) + +type _QueryParamsKeysResponse_1_map struct { + m *map[string]*KeyInfo +} + +func (x *_QueryParamsKeysResponse_1_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_QueryParamsKeysResponse_1_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfMessage(v.ProtoReflect()) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_QueryParamsKeysResponse_1_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_QueryParamsKeysResponse_1_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_QueryParamsKeysResponse_1_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryParamsKeysResponse_1_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*KeyInfo) + (*x.m)[concreteKey] = concreteValue +} + +func (x *_QueryParamsKeysResponse_1_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if ok { + return protoreflect.ValueOfMessage(v.ProtoReflect()) + } + newValue := new(KeyInfo) + (*x.m)[concreteKey] = newValue + return protoreflect.ValueOfMessage(newValue.ProtoReflect()) +} + +func (x *_QueryParamsKeysResponse_1_map) NewValue() protoreflect.Value { + v := new(KeyInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryParamsKeysResponse_1_map) IsValid() bool { + return x.m != nil +} + +var ( + md_QueryParamsKeysResponse protoreflect.MessageDescriptor + fd_QueryParamsKeysResponse_keys protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_query_proto_init() + md_QueryParamsKeysResponse = File_did_v1_query_proto.Messages().ByName("QueryParamsKeysResponse") + fd_QueryParamsKeysResponse_keys = md_QueryParamsKeysResponse.Fields().ByName("keys") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsKeysResponse)(nil) + +type fastReflection_QueryParamsKeysResponse QueryParamsKeysResponse + +func (x *QueryParamsKeysResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsKeysResponse)(x) +} + +func (x *QueryParamsKeysResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsKeysResponse_messageType fastReflection_QueryParamsKeysResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsKeysResponse_messageType{} + +type fastReflection_QueryParamsKeysResponse_messageType struct{} + +func (x fastReflection_QueryParamsKeysResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsKeysResponse)(nil) +} +func (x fastReflection_QueryParamsKeysResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsKeysResponse) +} +func (x fastReflection_QueryParamsKeysResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsKeysResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsKeysResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsKeysResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsKeysResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsKeysResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsKeysResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsKeysResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsKeysResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsKeysResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsKeysResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Keys) != 0 { + value := protoreflect.ValueOfMap(&_QueryParamsKeysResponse_1_map{m: &x.Keys}) + if !f(fd_QueryParamsKeysResponse_keys, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsKeysResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + return len(x.Keys) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsKeysResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + x.Keys = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsKeysResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + if len(x.Keys) == 0 { + return protoreflect.ValueOfMap(&_QueryParamsKeysResponse_1_map{}) + } + mapValue := &_QueryParamsKeysResponse_1_map{m: &x.Keys} + return protoreflect.ValueOfMap(mapValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsKeysResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + mv := value.Map() + cmv := mv.(*_QueryParamsKeysResponse_1_map) + x.Keys = *cmv.m + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsKeysResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + if x.Keys == nil { + x.Keys = make(map[string]*KeyInfo) + } + value := &_QueryParamsKeysResponse_1_map{m: &x.Keys} + return protoreflect.ValueOfMap(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsKeysResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsKeysResponse.keys": + m := make(map[string]*KeyInfo) + return protoreflect.ValueOfMap(&_QueryParamsKeysResponse_1_map{m: &m}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsKeysResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsKeysResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsKeysResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryParamsKeysResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsKeysResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsKeysResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsKeysResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsKeysResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsKeysResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Keys) > 0 { + SiZeMaP := func(k string, v *KeyInfo) { + l := 0 + if v != nil { + l = options.Size(v) + } + l += 1 + runtime.Sov(uint64(l)) + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Keys)) + for k := range x.Keys { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Keys[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Keys { + SiZeMaP(k, v) + } + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsKeysResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Keys) > 0 { + MaRsHaLmAp := func(k string, v *KeyInfo) (protoiface.MarshalOutput, error) { + baseI := i + encoded, err := options.Marshal(v) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForKeys := make([]string, 0, len(x.Keys)) + for k := range x.Keys { + keysForKeys = append(keysForKeys, string(k)) + } + sort.Slice(keysForKeys, func(i, j int) bool { + return keysForKeys[i] < keysForKeys[j] + }) + for iNdEx := len(keysForKeys) - 1; iNdEx >= 0; iNdEx-- { + v := x.Keys[string(keysForKeys[iNdEx])] + out, err := MaRsHaLmAp(keysForKeys[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.Keys { + v := x.Keys[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsKeysResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsKeysResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsKeysResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Keys == nil { + x.Keys = make(map[string]*KeyInfo) } var mapkey string - var mapvalue []byte + var mapvalue *KeyInfo for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -2700,7 +2866,7 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { - var mapbyteLen uint64 + var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2710,25 +2876,26 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met } b := dAtA[iNdEx] iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift + mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { + if mapmsglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - if postbytesIndex > l { + if postmsgIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex + mapvalue = &KeyInfo{} + if err := options.Unmarshal(dAtA[iNdEx:postmsgIndex], mapvalue); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postmsgIndex } else { iNdEx = entryPreIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2744,7 +2911,7 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met iNdEx += skippy } } - x.Credentials[mapkey] = mapvalue + x.Keys[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -2782,26 +2949,26 @@ func (x *fastReflection_QueryCredentialsResponse) ProtoMethods() *protoiface.Met } var ( - md_QueryIdentitiesRequest protoreflect.MessageDescriptor - fd_QueryIdentitiesRequest_did protoreflect.FieldDescriptor + md_QueryParamsByKeyResponse protoreflect.MessageDescriptor + fd_QueryParamsByKeyResponse_key protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() - md_QueryIdentitiesRequest = File_did_v1_query_proto.Messages().ByName("QueryIdentitiesRequest") - fd_QueryIdentitiesRequest_did = md_QueryIdentitiesRequest.Fields().ByName("did") + md_QueryParamsByKeyResponse = File_did_v1_query_proto.Messages().ByName("QueryParamsByKeyResponse") + fd_QueryParamsByKeyResponse_key = md_QueryParamsByKeyResponse.Fields().ByName("key") } -var _ protoreflect.Message = (*fastReflection_QueryIdentitiesRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryParamsByKeyResponse)(nil) -type fastReflection_QueryIdentitiesRequest QueryIdentitiesRequest +type fastReflection_QueryParamsByKeyResponse QueryParamsByKeyResponse -func (x *QueryIdentitiesRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryIdentitiesRequest)(x) +func (x *QueryParamsByKeyResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsByKeyResponse)(x) } -func (x *QueryIdentitiesRequest) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[6] +func (x *QueryParamsByKeyResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2812,43 +2979,43 @@ func (x *QueryIdentitiesRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryIdentitiesRequest_messageType fastReflection_QueryIdentitiesRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryIdentitiesRequest_messageType{} +var _fastReflection_QueryParamsByKeyResponse_messageType fastReflection_QueryParamsByKeyResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsByKeyResponse_messageType{} -type fastReflection_QueryIdentitiesRequest_messageType struct{} +type fastReflection_QueryParamsByKeyResponse_messageType struct{} -func (x fastReflection_QueryIdentitiesRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryIdentitiesRequest)(nil) +func (x fastReflection_QueryParamsByKeyResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsByKeyResponse)(nil) } -func (x fastReflection_QueryIdentitiesRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryIdentitiesRequest) +func (x fastReflection_QueryParamsByKeyResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsByKeyResponse) } -func (x fastReflection_QueryIdentitiesRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryIdentitiesRequest +func (x fastReflection_QueryParamsByKeyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsByKeyResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryIdentitiesRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryIdentitiesRequest +func (x *fastReflection_QueryParamsByKeyResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsByKeyResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryIdentitiesRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryIdentitiesRequest_messageType +func (x *fastReflection_QueryParamsByKeyResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsByKeyResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryIdentitiesRequest) New() protoreflect.Message { - return new(fastReflection_QueryIdentitiesRequest) +func (x *fastReflection_QueryParamsByKeyResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsByKeyResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryIdentitiesRequest) Interface() protoreflect.ProtoMessage { - return (*QueryIdentitiesRequest)(x) +func (x *fastReflection_QueryParamsByKeyResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsByKeyResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -2856,10 +3023,10 @@ func (x *fastReflection_QueryIdentitiesRequest) Interface() protoreflect.ProtoMe // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryIdentitiesRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_QueryIdentitiesRequest_did, value) { +func (x *fastReflection_QueryParamsByKeyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Key != nil { + value := protoreflect.ValueOfMessage(x.Key.ProtoReflect()) + if !f(fd_QueryParamsByKeyResponse_key, value) { return } } @@ -2876,15 +3043,15 @@ func (x *fastReflection_QueryIdentitiesRequest) Range(f func(protoreflect.FieldD // 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_QueryIdentitiesRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryParamsByKeyResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.QueryIdentitiesRequest.did": - return x.Did != "" + case "did.v1.QueryParamsByKeyResponse.key": + return x.Key != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) } - panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse does not contain field %s", fd.FullName())) } } @@ -2894,15 +3061,15 @@ func (x *fastReflection_QueryIdentitiesRequest) Has(fd protoreflect.FieldDescrip // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryIdentitiesRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryParamsByKeyResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.QueryIdentitiesRequest.did": - x.Did = "" + case "did.v1.QueryParamsByKeyResponse.key": + x.Key = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) } - panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse does not contain field %s", fd.FullName())) } } @@ -2912,1404 +3079,16 @@ func (x *fastReflection_QueryIdentitiesRequest) Clear(fd protoreflect.FieldDescr // 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_QueryIdentitiesRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryParamsByKeyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.QueryIdentitiesRequest.did": - value := x.Did - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) - } - panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest 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_QueryIdentitiesRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.QueryIdentitiesRequest.did": - x.Did = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) - } - panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest 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_QueryIdentitiesRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryIdentitiesRequest.did": - panic(fmt.Errorf("field did of message did.v1.QueryIdentitiesRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) - } - panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest 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_QueryIdentitiesRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryIdentitiesRequest.did": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesRequest")) - } - panic(fmt.Errorf("message did.v1.QueryIdentitiesRequest 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_QueryIdentitiesRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryIdentitiesRequest", 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_QueryIdentitiesRequest) 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_QueryIdentitiesRequest) 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_QueryIdentitiesRequest) 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_QueryIdentitiesRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryIdentitiesRequest) - 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)) - } - 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().(*QueryIdentitiesRequest) - 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.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().(*QueryIdentitiesRequest) - 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: QueryIdentitiesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIdentitiesRequest: 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 - 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 = (*_QueryIdentitiesResponse_2_list)(nil) - -type _QueryIdentitiesResponse_2_list struct { - list *[]*VerificationMethod -} - -func (x *_QueryIdentitiesResponse_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryIdentitiesResponse_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryIdentitiesResponse_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*VerificationMethod) - (*x.list)[i] = concreteValue -} - -func (x *_QueryIdentitiesResponse_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*VerificationMethod) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryIdentitiesResponse_2_list) AppendMutable() protoreflect.Value { - v := new(VerificationMethod) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryIdentitiesResponse_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryIdentitiesResponse_2_list) NewElement() protoreflect.Value { - v := new(VerificationMethod) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryIdentitiesResponse_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_QueryIdentitiesResponse protoreflect.MessageDescriptor - fd_QueryIdentitiesResponse_exists protoreflect.FieldDescriptor - fd_QueryIdentitiesResponse_verificationMethod protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_QueryIdentitiesResponse = File_did_v1_query_proto.Messages().ByName("QueryIdentitiesResponse") - fd_QueryIdentitiesResponse_exists = md_QueryIdentitiesResponse.Fields().ByName("exists") - fd_QueryIdentitiesResponse_verificationMethod = md_QueryIdentitiesResponse.Fields().ByName("verificationMethod") -} - -var _ protoreflect.Message = (*fastReflection_QueryIdentitiesResponse)(nil) - -type fastReflection_QueryIdentitiesResponse QueryIdentitiesResponse - -func (x *QueryIdentitiesResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryIdentitiesResponse)(x) -} - -func (x *QueryIdentitiesResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryIdentitiesResponse_messageType fastReflection_QueryIdentitiesResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryIdentitiesResponse_messageType{} - -type fastReflection_QueryIdentitiesResponse_messageType struct{} - -func (x fastReflection_QueryIdentitiesResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryIdentitiesResponse)(nil) -} -func (x fastReflection_QueryIdentitiesResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryIdentitiesResponse) -} -func (x fastReflection_QueryIdentitiesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryIdentitiesResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryIdentitiesResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryIdentitiesResponse -} - -// 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_QueryIdentitiesResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryIdentitiesResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryIdentitiesResponse) New() protoreflect.Message { - return new(fastReflection_QueryIdentitiesResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryIdentitiesResponse) Interface() protoreflect.ProtoMessage { - return (*QueryIdentitiesResponse)(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_QueryIdentitiesResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Exists != false { - value := protoreflect.ValueOfBool(x.Exists) - if !f(fd_QueryIdentitiesResponse_exists, value) { - return - } - } - if len(x.VerificationMethod) != 0 { - value := protoreflect.ValueOfList(&_QueryIdentitiesResponse_2_list{list: &x.VerificationMethod}) - if !f(fd_QueryIdentitiesResponse_verificationMethod, 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_QueryIdentitiesResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.QueryIdentitiesResponse.exists": - return x.Exists != false - case "did.v1.QueryIdentitiesResponse.verificationMethod": - return len(x.VerificationMethod) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) - } - panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse 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_QueryIdentitiesResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.QueryIdentitiesResponse.exists": - x.Exists = false - case "did.v1.QueryIdentitiesResponse.verificationMethod": - x.VerificationMethod = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) - } - panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse 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_QueryIdentitiesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.QueryIdentitiesResponse.exists": - value := x.Exists - return protoreflect.ValueOfBool(value) - case "did.v1.QueryIdentitiesResponse.verificationMethod": - if len(x.VerificationMethod) == 0 { - return protoreflect.ValueOfList(&_QueryIdentitiesResponse_2_list{}) - } - listValue := &_QueryIdentitiesResponse_2_list{list: &x.VerificationMethod} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) - } - panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse 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_QueryIdentitiesResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.QueryIdentitiesResponse.exists": - x.Exists = value.Bool() - case "did.v1.QueryIdentitiesResponse.verificationMethod": - lv := value.List() - clv := lv.(*_QueryIdentitiesResponse_2_list) - x.VerificationMethod = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) - } - panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse 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_QueryIdentitiesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryIdentitiesResponse.verificationMethod": - if x.VerificationMethod == nil { - x.VerificationMethod = []*VerificationMethod{} - } - value := &_QueryIdentitiesResponse_2_list{list: &x.VerificationMethod} - return protoreflect.ValueOfList(value) - case "did.v1.QueryIdentitiesResponse.exists": - panic(fmt.Errorf("field exists of message did.v1.QueryIdentitiesResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) - } - panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse 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_QueryIdentitiesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryIdentitiesResponse.exists": - return protoreflect.ValueOfBool(false) - case "did.v1.QueryIdentitiesResponse.verificationMethod": - list := []*VerificationMethod{} - return protoreflect.ValueOfList(&_QueryIdentitiesResponse_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryIdentitiesResponse")) - } - panic(fmt.Errorf("message did.v1.QueryIdentitiesResponse 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_QueryIdentitiesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryIdentitiesResponse", 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_QueryIdentitiesResponse) 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_QueryIdentitiesResponse) 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_QueryIdentitiesResponse) 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_QueryIdentitiesResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryIdentitiesResponse) - 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.Exists { - n += 2 - } - if len(x.VerificationMethod) > 0 { - for _, e := range x.VerificationMethod { - 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().(*QueryIdentitiesResponse) - 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.VerificationMethod) > 0 { - for iNdEx := len(x.VerificationMethod) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.VerificationMethod[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] = 0x12 - } - } - if x.Exists { - i-- - if x.Exists { - 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().(*QueryIdentitiesResponse) - 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: QueryIdentitiesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryIdentitiesResponse: 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 Exists", 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.Exists = 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 VerificationMethod", 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.VerificationMethod = append(x.VerificationMethod, &VerificationMethod{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VerificationMethod[len(x.VerificationMethod)-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_QueryResolveRequest protoreflect.MessageDescriptor - fd_QueryResolveRequest_did protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_QueryResolveRequest = File_did_v1_query_proto.Messages().ByName("QueryResolveRequest") - fd_QueryResolveRequest_did = md_QueryResolveRequest.Fields().ByName("did") -} - -var _ protoreflect.Message = (*fastReflection_QueryResolveRequest)(nil) - -type fastReflection_QueryResolveRequest QueryResolveRequest - -func (x *QueryResolveRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryResolveRequest)(x) -} - -func (x *QueryResolveRequest) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[8] - 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_QueryResolveRequest_messageType fastReflection_QueryResolveRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryResolveRequest_messageType{} - -type fastReflection_QueryResolveRequest_messageType struct{} - -func (x fastReflection_QueryResolveRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryResolveRequest)(nil) -} -func (x fastReflection_QueryResolveRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryResolveRequest) -} -func (x fastReflection_QueryResolveRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryResolveRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryResolveRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryResolveRequest -} - -// 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_QueryResolveRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryResolveRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryResolveRequest) New() protoreflect.Message { - return new(fastReflection_QueryResolveRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryResolveRequest) Interface() protoreflect.ProtoMessage { - return (*QueryResolveRequest)(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_QueryResolveRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_QueryResolveRequest_did, 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_QueryResolveRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.QueryResolveRequest.did": - return x.Did != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveRequest")) - } - panic(fmt.Errorf("message did.v1.QueryResolveRequest 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_QueryResolveRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.QueryResolveRequest.did": - x.Did = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveRequest")) - } - panic(fmt.Errorf("message did.v1.QueryResolveRequest 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_QueryResolveRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.QueryResolveRequest.did": - value := x.Did - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveRequest")) - } - panic(fmt.Errorf("message did.v1.QueryResolveRequest 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_QueryResolveRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.QueryResolveRequest.did": - x.Did = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveRequest")) - } - panic(fmt.Errorf("message did.v1.QueryResolveRequest 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_QueryResolveRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryResolveRequest.did": - panic(fmt.Errorf("field did of message did.v1.QueryResolveRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveRequest")) - } - panic(fmt.Errorf("message did.v1.QueryResolveRequest 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_QueryResolveRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.QueryResolveRequest.did": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveRequest")) - } - panic(fmt.Errorf("message did.v1.QueryResolveRequest 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_QueryResolveRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryResolveRequest", 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_QueryResolveRequest) 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_QueryResolveRequest) 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_QueryResolveRequest) 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_QueryResolveRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryResolveRequest) - 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)) - } - 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().(*QueryResolveRequest) - 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.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().(*QueryResolveRequest) - 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: QueryResolveRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResolveRequest: 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 - 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_QueryResolveResponse protoreflect.MessageDescriptor - fd_QueryResolveResponse_document protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_query_proto_init() - md_QueryResolveResponse = File_did_v1_query_proto.Messages().ByName("QueryResolveResponse") - fd_QueryResolveResponse_document = md_QueryResolveResponse.Fields().ByName("document") -} - -var _ protoreflect.Message = (*fastReflection_QueryResolveResponse)(nil) - -type fastReflection_QueryResolveResponse QueryResolveResponse - -func (x *QueryResolveResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryResolveResponse)(x) -} - -func (x *QueryResolveResponse) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryResolveResponse_messageType fastReflection_QueryResolveResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryResolveResponse_messageType{} - -type fastReflection_QueryResolveResponse_messageType struct{} - -func (x fastReflection_QueryResolveResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryResolveResponse)(nil) -} -func (x fastReflection_QueryResolveResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryResolveResponse) -} -func (x fastReflection_QueryResolveResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryResolveResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryResolveResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryResolveResponse -} - -// 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_QueryResolveResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryResolveResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryResolveResponse) New() protoreflect.Message { - return new(fastReflection_QueryResolveResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryResolveResponse) Interface() protoreflect.ProtoMessage { - return (*QueryResolveResponse)(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_QueryResolveResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Document != nil { - value := protoreflect.ValueOfMessage(x.Document.ProtoReflect()) - if !f(fd_QueryResolveResponse_document, 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_QueryResolveResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.QueryResolveResponse.document": - return x.Document != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) - } - panic(fmt.Errorf("message did.v1.QueryResolveResponse 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_QueryResolveResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.QueryResolveResponse.document": - x.Document = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) - } - panic(fmt.Errorf("message did.v1.QueryResolveResponse 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_QueryResolveResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.QueryResolveResponse.document": - value := x.Document + case "did.v1.QueryParamsByKeyResponse.key": + value := x.Key return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) } - panic(fmt.Errorf("message did.v1.QueryResolveResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse does not contain field %s", descriptor.FullName())) } } @@ -4323,15 +3102,15 @@ func (x *fastReflection_QueryResolveResponse) Get(descriptor protoreflect.FieldD // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryResolveResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryParamsByKeyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.QueryResolveResponse.document": - x.Document = value.Message().Interface().(*Document) + case "did.v1.QueryParamsByKeyResponse.key": + x.Key = value.Message().Interface().(*KeyInfo) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) } - panic(fmt.Errorf("message did.v1.QueryResolveResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse does not contain field %s", fd.FullName())) } } @@ -4345,44 +3124,44 @@ func (x *fastReflection_QueryResolveResponse) Set(fd protoreflect.FieldDescripto // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryResolveResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryParamsByKeyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryResolveResponse.document": - if x.Document == nil { - x.Document = new(Document) + case "did.v1.QueryParamsByKeyResponse.key": + if x.Key == nil { + x.Key = new(KeyInfo) } - return protoreflect.ValueOfMessage(x.Document.ProtoReflect()) + return protoreflect.ValueOfMessage(x.Key.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) } - panic(fmt.Errorf("message did.v1.QueryResolveResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryResolveResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryParamsByKeyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.QueryResolveResponse.document": - m := new(Document) + case "did.v1.QueryParamsByKeyResponse.key": + m := new(KeyInfo) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryResolveResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByKeyResponse")) } - panic(fmt.Errorf("message did.v1.QueryResolveResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.QueryParamsByKeyResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryResolveResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryParamsByKeyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryResolveResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryParamsByKeyResponse", d.FullName())) } panic("unreachable") } @@ -4390,7 +3169,7 @@ func (x *fastReflection_QueryResolveResponse) WhichOneof(d protoreflect.OneofDes // 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_QueryResolveResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryParamsByKeyResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4401,7 +3180,7 @@ func (x *fastReflection_QueryResolveResponse) GetUnknown() protoreflect.RawField // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryResolveResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryParamsByKeyResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4413,7 +3192,7 @@ func (x *fastReflection_QueryResolveResponse) SetUnknown(fields protoreflect.Raw // 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_QueryResolveResponse) IsValid() bool { +func (x *fastReflection_QueryParamsByKeyResponse) IsValid() bool { return x != nil } @@ -4423,9 +3202,9 @@ func (x *fastReflection_QueryResolveResponse) 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_QueryResolveResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryParamsByKeyResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryResolveResponse) + x := input.Message.Interface().(*QueryParamsByKeyResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4437,8 +3216,8 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods var n int var l int _ = l - if x.Document != nil { - l = options.Size(x.Document) + if x.Key != nil { + l = options.Size(x.Key) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -4451,7 +3230,7 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryResolveResponse) + x := input.Message.Interface().(*QueryParamsByKeyResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4470,8 +3249,8 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Document != nil { - encoded, err := options.Marshal(x.Document) + if x.Key != nil { + encoded, err := options.Marshal(x.Key) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4495,7 +3274,7 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryResolveResponse) + x := input.Message.Interface().(*QueryParamsByKeyResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4527,15 +3306,15 @@ func (x *fastReflection_QueryResolveResponse) 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: QueryResolveResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsByKeyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryResolveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsByKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4562,10 +3341,10 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Document == nil { - x.Document = &Document{} + if x.Key == nil { + x.Key = &KeyInfo{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Document); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Key); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -4605,26 +3384,26 @@ func (x *fastReflection_QueryResolveResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryServiceRequest protoreflect.MessageDescriptor - fd_QueryServiceRequest_origin protoreflect.FieldDescriptor + md_QueryParamsByAssetResponse protoreflect.MessageDescriptor + fd_QueryParamsByAssetResponse_asset protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() - md_QueryServiceRequest = File_did_v1_query_proto.Messages().ByName("QueryServiceRequest") - fd_QueryServiceRequest_origin = md_QueryServiceRequest.Fields().ByName("origin") + md_QueryParamsByAssetResponse = File_did_v1_query_proto.Messages().ByName("QueryParamsByAssetResponse") + fd_QueryParamsByAssetResponse_asset = md_QueryParamsByAssetResponse.Fields().ByName("asset") } -var _ protoreflect.Message = (*fastReflection_QueryServiceRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryParamsByAssetResponse)(nil) -type fastReflection_QueryServiceRequest QueryServiceRequest +type fastReflection_QueryParamsByAssetResponse QueryParamsByAssetResponse -func (x *QueryServiceRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryServiceRequest)(x) +func (x *QueryParamsByAssetResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsByAssetResponse)(x) } -func (x *QueryServiceRequest) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_query_proto_msgTypes[10] +func (x *QueryParamsByAssetResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4635,30 +3414,37 @@ func (x *QueryServiceRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryServiceRequest_messageType fastReflection_QueryServiceRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryServiceRequest_messageType{} +var _fastReflection_QueryParamsByAssetResponse_messageType fastReflection_QueryParamsByAssetResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsByAssetResponse_messageType{} -type fastReflection_QueryServiceRequest_messageType struct{} +type fastReflection_QueryParamsByAssetResponse_messageType struct{} -func (x fastReflection_QueryServiceRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryServiceRequest)(nil) +func (x fastReflection_QueryParamsByAssetResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsByAssetResponse)(nil) } -func (x fastReflection_QueryServiceRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryServiceRequest) +func (x fastReflection_QueryParamsByAssetResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsByAssetResponse) } -func (x fastReflection_QueryServiceRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryServiceRequest +func (x fastReflection_QueryParamsByAssetResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsByAssetResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryServiceRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryServiceRequest +func (x *fastReflection_QueryParamsByAssetResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsByAssetResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsByAssetResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsByAssetResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsByAssetResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsByAssetResponse) func (x *fastReflection_QueryServiceRequest) Type() protoreflect.MessageType { return _fastReflection_QueryServiceRequest_messageType } @@ -4670,6 +3456,8 @@ func (x *fastReflection_QueryServiceRequest) New() protoreflect.Message { // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsByAssetResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsByAssetResponse)(x) func (x *fastReflection_QueryServiceRequest) Interface() protoreflect.ProtoMessage { return (*QueryServiceRequest)(x) } @@ -4679,6 +3467,10 @@ func (x *fastReflection_QueryServiceRequest) Interface() protoreflect.ProtoMessa // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. +func (x *fastReflection_QueryParamsByAssetResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Asset != nil { + value := protoreflect.ValueOfMessage(x.Asset.ProtoReflect()) + if !f(fd_QueryParamsByAssetResponse_asset, value) { func (x *fastReflection_QueryServiceRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Origin != "" { value := protoreflect.ValueOfString(x.Origin) @@ -4699,6 +3491,15 @@ func (x *fastReflection_QueryServiceRequest) Range(f func(protoreflect.FieldDesc // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsByAssetResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + return x.Asset != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse does not contain field %s", fd.FullName())) func (x *fastReflection_QueryServiceRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "did.v1.QueryServiceRequest.origin": @@ -4717,6 +3518,15 @@ func (x *fastReflection_QueryServiceRequest) Has(fd protoreflect.FieldDescriptor // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsByAssetResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + x.Asset = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse does not contain field %s", fd.FullName())) func (x *fastReflection_QueryServiceRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.QueryServiceRequest.origin": @@ -4735,6 +3545,16 @@ func (x *fastReflection_QueryServiceRequest) Clear(fd protoreflect.FieldDescript // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsByAssetResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + value := x.Asset + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse does not contain field %s", descriptor.FullName())) func (x *fastReflection_QueryServiceRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "did.v1.QueryServiceRequest.origin": @@ -4758,6 +3578,15 @@ func (x *fastReflection_QueryServiceRequest) Get(descriptor protoreflect.FieldDe // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsByAssetResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + x.Asset = value.Message().Interface().(*AssetInfo) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse does not contain field %s", fd.FullName())) func (x *fastReflection_QueryServiceRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "did.v1.QueryServiceRequest.origin": @@ -4780,6 +3609,18 @@ func (x *fastReflection_QueryServiceRequest) 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_QueryParamsByAssetResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + if x.Asset == nil { + x.Asset = new(AssetInfo) + } + return protoreflect.ValueOfMessage(x.Asset.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse does not contain field %s", fd.FullName())) func (x *fastReflection_QueryServiceRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "did.v1.QueryServiceRequest.origin": @@ -4795,6 +3636,16 @@ func (x *fastReflection_QueryServiceRequest) Mutable(fd protoreflect.FieldDescri // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsByAssetResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryParamsByAssetResponse.asset": + m := new(AssetInfo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryParamsByAssetResponse")) + } + panic(fmt.Errorf("message did.v1.QueryParamsByAssetResponse does not contain field %s", fd.FullName())) func (x *fastReflection_QueryServiceRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "did.v1.QueryServiceRequest.origin": @@ -4810,6 +3661,10 @@ func (x *fastReflection_QueryServiceRequest) NewField(fd protoreflect.FieldDescr // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsByAssetResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryParamsByAssetResponse", d.FullName())) func (x *fastReflection_QueryServiceRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: @@ -4821,6 +3676,7 @@ func (x *fastReflection_QueryServiceRequest) WhichOneof(d protoreflect.OneofDesc // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsByAssetResponse) GetUnknown() protoreflect.RawFields { func (x *fastReflection_QueryServiceRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4832,6 +3688,7 @@ func (x *fastReflection_QueryServiceRequest) 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_QueryParamsByAssetResponse) SetUnknown(fields protoreflect.RawFields) { func (x *fastReflection_QueryServiceRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4844,6 +3701,7 @@ func (x *fastReflection_QueryServiceRequest) SetUnknown(fields protoreflect.RawF // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsByAssetResponse) IsValid() bool { func (x *fastReflection_QueryServiceRequest) IsValid() bool { return x != nil } @@ -4854,6 +3712,9 @@ func (x *fastReflection_QueryServiceRequest) 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_QueryParamsByAssetResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsByAssetResponse) func (x *fastReflection_QueryServiceRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*QueryServiceRequest) @@ -4868,6 +3729,8 @@ func (x *fastReflection_QueryServiceRequest) ProtoMethods() *protoiface.Methods var n int var l int _ = l + if x.Asset != nil { + l = options.Size(x.Asset) l = len(x.Origin) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -4882,6 +3745,7 @@ func (x *fastReflection_QueryServiceRequest) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsByAssetResponse) x := input.Message.Interface().(*QueryServiceRequest) if x == nil { return protoiface.MarshalOutput{ @@ -4901,6 +3765,17 @@ func (x *fastReflection_QueryServiceRequest) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Asset != nil { + encoded, err := options.Marshal(x.Asset) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) if len(x.Origin) > 0 { i -= len(x.Origin) copy(dAtA[i:], x.Origin) @@ -4919,6 +3794,7 @@ func (x *fastReflection_QueryServiceRequest) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsByAssetResponse) x := input.Message.Interface().(*QueryServiceRequest) if x == nil { return protoiface.UnmarshalOutput{ @@ -4951,6 +3827,10 @@ func (x *fastReflection_QueryServiceRequest) 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: QueryParamsByAssetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsByAssetResponse: illegal tag %d (wire type %d)", fieldNum, wire) return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryServiceRequest: wiretype end group for non-group") } if fieldNum <= 0 { @@ -4959,9 +3839,10 @@ func (x *fastReflection_QueryServiceRequest) ProtoMethods() *protoiface.Methods switch fieldNum { case 1: if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -4971,22 +3852,27 @@ func (x *fastReflection_QueryServiceRequest) ProtoMethods() *protoiface.Methods } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } + if x.Asset == nil { + x.Asset = &AssetInfo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Asset); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } x.Origin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: @@ -5024,13 +3910,75 @@ func (x *fastReflection_QueryServiceRequest) ProtoMethods() *protoiface.Methods } } +var _ protoreflect.List = (*_QueryRegistrationOptionsByKeyResponse_1_list)(nil) + +type _QueryRegistrationOptionsByKeyResponse_1_list struct { + list *[]string +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message QueryRegistrationOptionsByKeyResponse at list field RegistrationOptions as it is not of Message kind")) +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_QueryRegistrationOptionsByKeyResponse_1_list) IsValid() bool { + return x.list != nil +} + var ( + md_QueryRegistrationOptionsByKeyResponse protoreflect.MessageDescriptor + fd_QueryRegistrationOptionsByKeyResponse_registration_options protoreflect.FieldDescriptor md_QueryServiceResponse protoreflect.MessageDescriptor fd_QueryServiceResponse_options protoreflect.FieldDescriptor ) func init() { file_did_v1_query_proto_init() + md_QueryRegistrationOptionsByKeyResponse = File_did_v1_query_proto.Messages().ByName("QueryRegistrationOptionsByKeyResponse") + fd_QueryRegistrationOptionsByKeyResponse_registration_options = md_QueryRegistrationOptionsByKeyResponse.Fields().ByName("registration_options") +} + +var _ protoreflect.Message = (*fastReflection_QueryRegistrationOptionsByKeyResponse)(nil) + +type fastReflection_QueryRegistrationOptionsByKeyResponse QueryRegistrationOptionsByKeyResponse + +func (x *QueryRegistrationOptionsByKeyResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRegistrationOptionsByKeyResponse)(x) +} + +func (x *QueryRegistrationOptionsByKeyResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_query_proto_msgTypes[7] md_QueryServiceResponse = File_did_v1_query_proto.Messages().ByName("QueryServiceResponse") fd_QueryServiceResponse_options = md_QueryServiceResponse.Fields().ByName("options") } @@ -5055,6 +4003,19 @@ func (x *QueryServiceResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +var _fastReflection_QueryRegistrationOptionsByKeyResponse_messageType fastReflection_QueryRegistrationOptionsByKeyResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryRegistrationOptionsByKeyResponse_messageType{} + +type fastReflection_QueryRegistrationOptionsByKeyResponse_messageType struct{} + +func (x fastReflection_QueryRegistrationOptionsByKeyResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRegistrationOptionsByKeyResponse)(nil) +} +func (x fastReflection_QueryRegistrationOptionsByKeyResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRegistrationOptionsByKeyResponse) +} +func (x fastReflection_QueryRegistrationOptionsByKeyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRegistrationOptionsByKeyResponse var _fastReflection_QueryServiceResponse_messageType fastReflection_QueryServiceResponse_messageType var _ protoreflect.MessageType = fastReflection_QueryServiceResponse_messageType{} @@ -5072,6 +4033,8 @@ func (x fastReflection_QueryServiceResponse_messageType) Descriptor() protorefle // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRegistrationOptionsByKeyResponse func (x *fastReflection_QueryServiceResponse) Descriptor() protoreflect.MessageDescriptor { return md_QueryServiceResponse } @@ -5079,6 +4042,13 @@ func (x *fastReflection_QueryServiceResponse) Descriptor() protoreflect.MessageD // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryRegistrationOptionsByKeyResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) New() protoreflect.Message { + return new(fastReflection_QueryRegistrationOptionsByKeyResponse) func (x *fastReflection_QueryServiceResponse) Type() protoreflect.MessageType { return _fastReflection_QueryServiceResponse_messageType } @@ -5090,6 +4060,8 @@ func (x *fastReflection_QueryServiceResponse) New() protoreflect.Message { // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Interface() protoreflect.ProtoMessage { + return (*QueryRegistrationOptionsByKeyResponse)(x) func (x *fastReflection_QueryServiceResponse) Interface() protoreflect.ProtoMessage { return (*QueryServiceResponse)(x) } @@ -5099,6 +4071,10 @@ func (x *fastReflection_QueryServiceResponse) Interface() protoreflect.ProtoMess // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.RegistrationOptions) != 0 { + value := protoreflect.ValueOfList(&_QueryRegistrationOptionsByKeyResponse_1_list{list: &x.RegistrationOptions}) + if !f(fd_QueryRegistrationOptionsByKeyResponse_registration_options, value) { func (x *fastReflection_QueryServiceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Options != "" { value := protoreflect.ValueOfString(x.Options) @@ -5119,6 +4095,15 @@ func (x *fastReflection_QueryServiceResponse) Range(f func(protoreflect.FieldDes // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + return len(x.RegistrationOptions) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse does not contain field %s", fd.FullName())) func (x *fastReflection_QueryServiceResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "did.v1.QueryServiceResponse.options": @@ -5137,6 +4122,15 @@ func (x *fastReflection_QueryServiceResponse) Has(fd protoreflect.FieldDescripto // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + x.RegistrationOptions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse does not contain field %s", fd.FullName())) func (x *fastReflection_QueryServiceResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.QueryServiceResponse.options": @@ -5155,6 +4149,19 @@ func (x *fastReflection_QueryServiceResponse) Clear(fd protoreflect.FieldDescrip // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + if len(x.RegistrationOptions) == 0 { + return protoreflect.ValueOfList(&_QueryRegistrationOptionsByKeyResponse_1_list{}) + } + listValue := &_QueryRegistrationOptionsByKeyResponse_1_list{list: &x.RegistrationOptions} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse does not contain field %s", descriptor.FullName())) func (x *fastReflection_QueryServiceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "did.v1.QueryServiceResponse.options": @@ -5178,6 +4185,17 @@ func (x *fastReflection_QueryServiceResponse) Get(descriptor protoreflect.FieldD // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + lv := value.List() + clv := lv.(*_QueryRegistrationOptionsByKeyResponse_1_list) + x.RegistrationOptions = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse does not contain field %s", fd.FullName())) func (x *fastReflection_QueryServiceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "did.v1.QueryServiceResponse.options": @@ -5200,6 +4218,19 @@ func (x *fastReflection_QueryServiceResponse) Set(fd protoreflect.FieldDescripto // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + if x.RegistrationOptions == nil { + x.RegistrationOptions = []string{} + } + value := &_QueryRegistrationOptionsByKeyResponse_1_list{list: &x.RegistrationOptions} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse does not contain field %s", fd.FullName())) func (x *fastReflection_QueryServiceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "did.v1.QueryServiceResponse.options": @@ -5215,6 +4246,16 @@ func (x *fastReflection_QueryServiceResponse) Mutable(fd protoreflect.FieldDescr // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.QueryRegistrationOptionsByKeyResponse.registration_options": + list := []string{} + return protoreflect.ValueOfList(&_QueryRegistrationOptionsByKeyResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.QueryRegistrationOptionsByKeyResponse")) + } + panic(fmt.Errorf("message did.v1.QueryRegistrationOptionsByKeyResponse does not contain field %s", fd.FullName())) func (x *fastReflection_QueryServiceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "did.v1.QueryServiceResponse.options": @@ -5230,6 +4271,10 @@ func (x *fastReflection_QueryServiceResponse) NewField(fd protoreflect.FieldDesc // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.QueryRegistrationOptionsByKeyResponse", d.FullName())) func (x *fastReflection_QueryServiceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: @@ -5241,6 +4286,7 @@ func (x *fastReflection_QueryServiceResponse) WhichOneof(d protoreflect.OneofDes // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) GetUnknown() protoreflect.RawFields { func (x *fastReflection_QueryServiceResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -5252,6 +4298,7 @@ func (x *fastReflection_QueryServiceResponse) GetUnknown() protoreflect.RawField // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) SetUnknown(fields protoreflect.RawFields) { func (x *fastReflection_QueryServiceResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -5264,6 +4311,7 @@ func (x *fastReflection_QueryServiceResponse) SetUnknown(fields protoreflect.Raw // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. +func (x *fastReflection_QueryRegistrationOptionsByKeyResponse) IsValid() bool { func (x *fastReflection_QueryServiceResponse) IsValid() bool { return x != nil } @@ -5274,6 +4322,9 @@ func (x *fastReflection_QueryServiceResponse) 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_QueryRegistrationOptionsByKeyResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRegistrationOptionsByKeyResponse) func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*QueryServiceResponse) @@ -5288,9 +4339,11 @@ func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods var n int var l int _ = l - l = len(x.Options) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.RegistrationOptions) > 0 { + for _, s := range x.RegistrationOptions { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -5302,6 +4355,7 @@ func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryRegistrationOptionsByKeyResponse) x := input.Message.Interface().(*QueryServiceResponse) if x == nil { return protoiface.MarshalOutput{ @@ -5321,12 +4375,14 @@ func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Options) > 0 { - i -= len(x.Options) - copy(dAtA[i:], x.Options) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Options))) - i-- - dAtA[i] = 0xa + if len(x.RegistrationOptions) > 0 { + for iNdEx := len(x.RegistrationOptions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.RegistrationOptions[iNdEx]) + copy(dAtA[i:], x.RegistrationOptions[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RegistrationOptions[iNdEx]))) + i-- + dAtA[i] = 0xa + } } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -5339,6 +4395,7 @@ func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryRegistrationOptionsByKeyResponse) x := input.Message.Interface().(*QueryServiceResponse) if x == nil { return protoiface.UnmarshalOutput{ @@ -5371,6 +4428,10 @@ func (x *fastReflection_QueryServiceResponse) 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: QueryRegistrationOptionsByKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRegistrationOptionsByKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryServiceResponse: wiretype end group for non-group") } if fieldNum <= 0 { @@ -5379,7 +4440,7 @@ func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RegistrationOptions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5407,7 +4468,7 @@ func (x *fastReflection_QueryServiceResponse) ProtoMethods() *protoiface.Methods if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Options = string(dAtA[iNdEx:postIndex]) + x.RegistrationOptions = append(x.RegistrationOptions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -5457,15 +4518,20 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// QueryParamsRequest is the request type for the Query/Params RPC method. -type QueryParamsRequest struct { +// Queryequest is the request type for the Query/Params RPC method. +type QueryRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Asset string `protobuf:"bytes,4,opt,name=asset,proto3" json:"asset,omitempty"` } -func (x *QueryParamsRequest) Reset() { - *x = QueryParamsRequest{} +func (x *QueryRequest) Reset() { + *x = QueryRequest{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_query_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5473,31 +4539,126 @@ func (x *QueryParamsRequest) Reset() { } } -func (x *QueryParamsRequest) String() string { +func (x *QueryRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryRequest) ProtoMessage() {} -// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. +func (*QueryRequest) Descriptor() ([]byte, []int) { return file_did_v1_query_proto_rawDescGZIP(), []int{0} } +func (x *QueryRequest) GetDid() string { + if x != nil { + return x.Did + } + return "" +} + +func (x *QueryRequest) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *QueryRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *QueryRequest) GetAsset() string { + if x != nil { + return x.Asset + } + return "" +} + +// QueryResolveResponse is the response type for the Query/Resolve RPC method. +type QueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` + Document *Document `protobuf:"bytes,3,opt,name=document,proto3" json:"document,omitempty"` + Service *ServiceInfo `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` + Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryResponse) Reset() { + *x = QueryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResponse) ProtoMessage() {} + +// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. +func (*QueryResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *QueryResponse) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *QueryResponse) GetDocument() *Document { + if x != nil { + return x.Document + } + return nil +} + +func (x *QueryResponse) GetService() *ServiceInfo { + if x != nil { + return x.Service + } + return nil +} + +func (x *QueryResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + // QueryParamsResponse is the response type for the Query/Params RPC method. type QueryParamsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // params 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_did_v1_query_proto_msgTypes[1] + mi := &file_did_v1_query_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5511,7 +4672,7 @@ func (*QueryParamsResponse) ProtoMessage() {} // Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return file_did_v1_query_proto_rawDescGZIP(), []int{1} + return file_did_v1_query_proto_rawDescGZIP(), []int{2} } func (x *QueryParamsResponse) GetParams() *Params { @@ -5521,12 +4682,18 @@ func (x *QueryParamsResponse) GetParams() *Params { return nil } +type QueryParamsAssetsResponse struct { // QueryAccountsRequest is the request type for the Query/Exists RPC method. type QueryAccountsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + Assets []*AssetInfo `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` +} + +func (x *QueryParamsAssetsResponse) Reset() { + *x = QueryParamsAssetsResponse{} Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` } @@ -5575,6 +4742,18 @@ func (x *QueryAccountsResponse) Reset() { } } +func (x *QueryParamsAssetsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsAssetsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsAssetsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsAssetsResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryParamsAssetsResponse) GetAssets() []*AssetInfo { func (x *QueryAccountsResponse) String() string { return protoimpl.X.MessageStringOf(x) } @@ -5588,11 +4767,12 @@ func (*QueryAccountsResponse) Descriptor() ([]byte, []int) { func (x *QueryAccountsResponse) GetExists() bool { if x != nil { - return x.Exists + return x.Assets } - return false + return nil } +type QueryParamsKeysResponse struct { // QueryCredentialsRequest is the request type for the Query/Exists RPC method. type QueryCredentialsRequest struct { state protoimpl.MessageState @@ -5759,11 +4939,12 @@ type QueryResolveRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + Keys map[string]*KeyInfo `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` } -func (x *QueryResolveRequest) Reset() { - *x = QueryResolveRequest{} +func (x *QueryParamsKeysResponse) Reset() { + *x = QueryParamsKeysResponse{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_query_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5771,12 +4952,20 @@ func (x *QueryResolveRequest) Reset() { } } -func (x *QueryResolveRequest) String() string { +func (x *QueryParamsKeysResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryResolveRequest) ProtoMessage() {} +func (*QueryParamsKeysResponse) ProtoMessage() {} +// Deprecated: Use QueryParamsKeysResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsKeysResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryParamsKeysResponse) GetKeys() map[string]*KeyInfo { + if x != nil { + return x.Keys // Deprecated: Use QueryResolveRequest.ProtoReflect.Descriptor instead. func (*QueryResolveRequest) Descriptor() ([]byte, []int) { return file_did_v1_query_proto_rawDescGZIP(), []int{8} @@ -5786,21 +4975,21 @@ func (x *QueryResolveRequest) GetDid() string { if x != nil { return x.Did } - return "" + return nil } -// QueryResolveResponse is the response type for the Query/Resolve RPC method. -type QueryResolveResponse struct { +type QueryParamsByKeyResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + Key *KeyInfo `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // document is the DID document Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` } -func (x *QueryResolveResponse) Reset() { - *x = QueryResolveResponse{} +func (x *QueryParamsByKeyResponse) Reset() { + *x = QueryParamsByKeyResponse{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_query_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5808,12 +4997,18 @@ func (x *QueryResolveResponse) Reset() { } } -func (x *QueryResolveResponse) String() string { +func (x *QueryParamsByKeyResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryResolveResponse) ProtoMessage() {} +func (*QueryParamsByKeyResponse) ProtoMessage() {} +// Deprecated: Use QueryParamsByKeyResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsByKeyResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryParamsByKeyResponse) GetKey() *KeyInfo { // Deprecated: Use QueryResolveResponse.ProtoReflect.Descriptor instead. func (*QueryResolveResponse) Descriptor() ([]byte, []int) { return file_did_v1_query_proto_rawDescGZIP(), []int{9} @@ -5821,17 +5016,23 @@ func (*QueryResolveResponse) Descriptor() ([]byte, []int) { func (x *QueryResolveResponse) GetDocument() *Document { if x != nil { - return x.Document + return x.Key } return nil } +type QueryParamsByAssetResponse struct { // QueryServiceRequest is the request type for the Query/LoginOptions RPC method. type QueryServiceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + Asset *AssetInfo `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` +} + +func (x *QueryParamsByAssetResponse) Reset() { + *x = QueryParamsByAssetResponse{} Origin string `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"` } @@ -5844,6 +5045,20 @@ func (x *QueryServiceRequest) Reset() { } } +func (x *QueryParamsByAssetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsByAssetResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsByAssetResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsByAssetResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryParamsByAssetResponse) GetAsset() *AssetInfo { + if x != nil { + return x.Asset func (x *QueryServiceRequest) String() string { return protoimpl.X.MessageStringOf(x) } @@ -5859,19 +5074,21 @@ func (x *QueryServiceRequest) GetOrigin() string { if x != nil { return x.Origin } - return "" + return nil } +type QueryRegistrationOptionsByKeyResponse struct { // QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. type QueryServiceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // options is the PublicKeyCredentialAttestationOptions - Options string `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` + RegistrationOptions []string `protobuf:"bytes,1,rep,name=registration_options,json=registrationOptions,proto3" json:"registration_options,omitempty"` } +func (x *QueryRegistrationOptionsByKeyResponse) Reset() { + *x = QueryRegistrationOptionsByKeyResponse{} func (x *QueryServiceResponse) Reset() { *x = QueryServiceResponse{} if protoimpl.UnsafeEnabled { @@ -5881,6 +5098,18 @@ func (x *QueryServiceResponse) Reset() { } } +func (x *QueryRegistrationOptionsByKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRegistrationOptionsByKeyResponse) ProtoMessage() {} + +// Deprecated: Use QueryRegistrationOptionsByKeyResponse.ProtoReflect.Descriptor instead. +func (*QueryRegistrationOptionsByKeyResponse) Descriptor() ([]byte, []int) { + return file_did_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryRegistrationOptionsByKeyResponse) GetRegistrationOptions() []string { func (x *QueryServiceResponse) String() string { return protoimpl.X.MessageStringOf(x) } @@ -5894,15 +5123,125 @@ func (*QueryServiceResponse) Descriptor() ([]byte, []int) { func (x *QueryServiceResponse) GetOptions() string { if x != nil { - return x.Options + return x.RegistrationOptions } - return "" + return nil } var File_did_v1_query_proto protoreflect.FileDescriptor var file_did_v1_query_proto_rawDesc = []byte{ 0x0a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x64, 0x69, + 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x22, 0xc4, 0x01, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2c, 0x0a, 0x08, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x64, + 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x3d, + 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x46, 0x0a, + 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, + 0x1a, 0x48, 0x0a, 0x09, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3d, 0x0a, 0x18, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x79, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x45, 0x0a, 0x1a, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x79, 0x41, 0x73, 0x73, 0x65, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, + 0x22, 0x5a, 0x0a, 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x4b, 0x65, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xc2, 0x05, 0x0a, + 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x4c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x53, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x5c, 0x0a, 0x0d, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x79, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, + 0x16, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x2f, + 0x7b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x7d, 0x12, 0x4f, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x56, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x7d, + 0x12, 0x70, 0x0a, 0x18, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x2e, 0x64, + 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x21, 0x12, 0x1f, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x2f, + 0x7b, 0x6b, 0x65, 0x79, 0x7d, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x14, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x12, 0x51, + 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x15, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x7d, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, + 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, + 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, + 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 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, 0x14, 0x64, 0x69, 0x64, 0x2f, @@ -6021,6 +5360,54 @@ func file_did_v1_query_proto_rawDescGZIP() []byte { return file_did_v1_query_proto_rawDescData } +var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_did_v1_query_proto_goTypes = []interface{}{ + (*QueryRequest)(nil), // 0: did.v1.QueryRequest + (*QueryResponse)(nil), // 1: did.v1.QueryResponse + (*QueryParamsResponse)(nil), // 2: did.v1.QueryParamsResponse + (*QueryParamsAssetsResponse)(nil), // 3: did.v1.QueryParamsAssetsResponse + (*QueryParamsKeysResponse)(nil), // 4: did.v1.QueryParamsKeysResponse + (*QueryParamsByKeyResponse)(nil), // 5: did.v1.QueryParamsByKeyResponse + (*QueryParamsByAssetResponse)(nil), // 6: did.v1.QueryParamsByAssetResponse + (*QueryRegistrationOptionsByKeyResponse)(nil), // 7: did.v1.QueryRegistrationOptionsByKeyResponse + nil, // 8: did.v1.QueryParamsKeysResponse.KeysEntry + (*Document)(nil), // 9: did.v1.Document + (*ServiceInfo)(nil), // 10: did.v1.ServiceInfo + (*Params)(nil), // 11: did.v1.Params + (*AssetInfo)(nil), // 12: did.v1.AssetInfo + (*KeyInfo)(nil), // 13: did.v1.KeyInfo +} +var file_did_v1_query_proto_depIdxs = []int32{ + 9, // 0: did.v1.QueryResponse.document:type_name -> did.v1.Document + 10, // 1: did.v1.QueryResponse.service:type_name -> did.v1.ServiceInfo + 11, // 2: did.v1.QueryResponse.params:type_name -> did.v1.Params + 11, // 3: did.v1.QueryParamsResponse.params:type_name -> did.v1.Params + 12, // 4: did.v1.QueryParamsAssetsResponse.assets:type_name -> did.v1.AssetInfo + 8, // 5: did.v1.QueryParamsKeysResponse.keys:type_name -> did.v1.QueryParamsKeysResponse.KeysEntry + 13, // 6: did.v1.QueryParamsByKeyResponse.key:type_name -> did.v1.KeyInfo + 12, // 7: did.v1.QueryParamsByAssetResponse.asset:type_name -> did.v1.AssetInfo + 13, // 8: did.v1.QueryParamsKeysResponse.KeysEntry.value:type_name -> did.v1.KeyInfo + 0, // 9: did.v1.Query.Params:input_type -> did.v1.QueryRequest + 0, // 10: did.v1.Query.ParamsAssets:input_type -> did.v1.QueryRequest + 0, // 11: did.v1.Query.ParamsByAsset:input_type -> did.v1.QueryRequest + 0, // 12: did.v1.Query.ParamsKeys:input_type -> did.v1.QueryRequest + 0, // 13: did.v1.Query.ParamsByKey:input_type -> did.v1.QueryRequest + 0, // 14: did.v1.Query.RegistrationOptionsByKey:input_type -> did.v1.QueryRequest + 0, // 15: did.v1.Query.Resolve:input_type -> did.v1.QueryRequest + 0, // 16: did.v1.Query.Service:input_type -> did.v1.QueryRequest + 2, // 17: did.v1.Query.Params:output_type -> did.v1.QueryParamsResponse + 1, // 18: did.v1.Query.ParamsAssets:output_type -> did.v1.QueryResponse + 1, // 19: did.v1.Query.ParamsByAsset:output_type -> did.v1.QueryResponse + 1, // 20: did.v1.Query.ParamsKeys:output_type -> did.v1.QueryResponse + 1, // 21: did.v1.Query.ParamsByKey:output_type -> did.v1.QueryResponse + 1, // 22: did.v1.Query.RegistrationOptionsByKey:output_type -> did.v1.QueryResponse + 1, // 23: did.v1.Query.Resolve:output_type -> did.v1.QueryResponse + 1, // 24: did.v1.Query.Service:output_type -> did.v1.QueryResponse + 17, // [17:25] is the sub-list for method output_type + 9, // [9:17] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name var file_did_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_did_v1_query_proto_goTypes = []interface{}{ (*QueryParamsRequest)(nil), // 0: did.v1.QueryParamsRequest @@ -6070,10 +5457,11 @@ func file_did_v1_query_proto_init() { return } file_did_v1_genesis_proto_init() + file_did_v1_models_proto_init() file_did_v1_types_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryParamsRequest); i { + switch v := v.(*QueryRequest); i { case 0: return &v.state case 1: @@ -6085,7 +5473,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryParamsResponse); i { + switch v := v.(*QueryResponse); i { case 0: return &v.state case 1: @@ -6097,6 +5485,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { switch v := v.(*QueryAccountsRequest); i { case 0: return &v.state @@ -6109,6 +5498,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsAssetsResponse); i { switch v := v.(*QueryAccountsResponse); i { case 0: return &v.state @@ -6121,6 +5511,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsKeysResponse); i { switch v := v.(*QueryCredentialsRequest); i { case 0: return &v.state @@ -6133,6 +5524,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsByKeyResponse); i { switch v := v.(*QueryCredentialsResponse); i { case 0: return &v.state @@ -6145,6 +5537,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsByAssetResponse); i { switch v := v.(*QueryIdentitiesRequest); i { case 0: return &v.state @@ -6157,6 +5550,7 @@ func file_did_v1_query_proto_init() { } } file_did_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRegistrationOptionsByKeyResponse); i { switch v := v.(*QueryIdentitiesResponse); i { case 0: return &v.state @@ -6223,6 +5617,7 @@ func file_did_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_query_proto_rawDesc, NumEnums: 0, + NumMessages: 9, NumMessages: 13, NumExtensions: 0, NumServices: 1, diff --git a/api/did/v1/query_grpc.pb.go b/api/did/v1/query_grpc.pb.go index d51ed3c02..553f71c68 100644 --- a/api/did/v1/query_grpc.pb.go +++ b/api/did/v1/query_grpc.pb.go @@ -19,12 +19,14 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_Params_FullMethodName = "/did.v1.Query/Params" - Query_Accounts_FullMethodName = "/did.v1.Query/Accounts" - Query_Credentials_FullMethodName = "/did.v1.Query/Credentials" - Query_Identities_FullMethodName = "/did.v1.Query/Identities" - Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" - Query_Service_FullMethodName = "/did.v1.Query/Service" + Query_Params_FullMethodName = "/did.v1.Query/Params" + Query_ParamsAssets_FullMethodName = "/did.v1.Query/ParamsAssets" + Query_ParamsByAsset_FullMethodName = "/did.v1.Query/ParamsByAsset" + Query_ParamsKeys_FullMethodName = "/did.v1.Query/ParamsKeys" + Query_ParamsByKey_FullMethodName = "/did.v1.Query/ParamsByKey" + Query_RegistrationOptionsByKey_FullMethodName = "/did.v1.Query/RegistrationOptionsByKey" + Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" + Query_Service_FullMethodName = "/did.v1.Query/Service" ) // QueryClient is the client API for Query service. @@ -32,17 +34,23 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type QueryClient interface { // Params queries all parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Accounts returns associated wallet accounts with the DID. - Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) - // Credentials returns associated credentials with the DID and Service Origin. - Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) - // Identities returns associated identity with the DID. - Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error) + Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // ParamsAssets queries all parameters of the module. + ParamsAssets(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByAsset(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // ParamsKeys queries all parameters of the module. + ParamsKeys(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + RegistrationOptionsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) // Resolve queries the DID document by its id. - Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) + Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) // Service returns associated ServiceInfo for a given Origin - Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) + // if the servie is not found, a fingerprint is generated to be used + // as a TXT record in DNS. v=sonr, o=origin, p=protocol + Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) } type queryClient struct { @@ -53,7 +61,7 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { return &queryClient{cc} } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { +func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) if err != nil { @@ -62,35 +70,53 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) { - out := new(QueryAccountsResponse) - err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, opts...) +func (c *queryClient) ParamsAssets(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Query_ParamsAssets_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) { - out := new(QueryCredentialsResponse) - err := c.cc.Invoke(ctx, Query_Credentials_FullMethodName, in, out, opts...) +func (c *queryClient) ParamsByAsset(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Query_ParamsByAsset_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error) { - out := new(QueryIdentitiesResponse) - err := c.cc.Invoke(ctx, Query_Identities_FullMethodName, in, out, opts...) +func (c *queryClient) ParamsKeys(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Query_ParamsKeys_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) { - out := new(QueryResolveResponse) +func (c *queryClient) ParamsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Query_ParamsByKey_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RegistrationOptionsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, Query_RegistrationOptionsByKey_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) err := c.cc.Invoke(ctx, Query_Resolve_FullMethodName, in, out, opts...) if err != nil { return nil, err @@ -98,8 +124,8 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryResolveRequest, opts return out, nil } -func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) { - out := new(QueryServiceResponse) +func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) err := c.cc.Invoke(ctx, Query_Service_FullMethodName, in, out, opts...) if err != nil { return nil, err @@ -112,17 +138,23 @@ func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts // for forward compatibility type QueryServer interface { // Params queries all parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Accounts returns associated wallet accounts with the DID. - Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) - // Credentials returns associated credentials with the DID and Service Origin. - Credentials(context.Context, *QueryCredentialsRequest) (*QueryCredentialsResponse, error) - // Identities returns associated identity with the DID. - Identities(context.Context, *QueryIdentitiesRequest) (*QueryIdentitiesResponse, error) + Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) + // ParamsAssets queries all parameters of the module. + ParamsAssets(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByAsset(context.Context, *QueryRequest) (*QueryResponse, error) + // ParamsKeys queries all parameters of the module. + ParamsKeys(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByKey(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + RegistrationOptionsByKey(context.Context, *QueryRequest) (*QueryResponse, error) // Resolve queries the DID document by its id. - Resolve(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) + Resolve(context.Context, *QueryRequest) (*QueryResponse, error) // Service returns associated ServiceInfo for a given Origin - Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error) + // if the servie is not found, a fingerprint is generated to be used + // as a TXT record in DNS. v=sonr, o=origin, p=protocol + Service(context.Context, *QueryRequest) (*QueryResponse, error) mustEmbedUnimplementedQueryServer() } @@ -130,22 +162,28 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { +func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented") +func (UnimplementedQueryServer) ParamsAssets(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsAssets not implemented") } -func (UnimplementedQueryServer) Credentials(context.Context, *QueryCredentialsRequest) (*QueryCredentialsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Credentials not implemented") +func (UnimplementedQueryServer) ParamsByAsset(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsByAsset not implemented") } -func (UnimplementedQueryServer) Identities(context.Context, *QueryIdentitiesRequest) (*QueryIdentitiesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Identities not implemented") +func (UnimplementedQueryServer) ParamsKeys(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsKeys not implemented") } -func (UnimplementedQueryServer) Resolve(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) { +func (UnimplementedQueryServer) ParamsByKey(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsByKey not implemented") +} +func (UnimplementedQueryServer) RegistrationOptionsByKey(context.Context, *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegistrationOptionsByKey not implemented") +} +func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") } -func (UnimplementedQueryServer) Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error) { +func (UnimplementedQueryServer) Service(context.Context, *QueryRequest) (*QueryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Service not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} @@ -162,7 +200,7 @@ func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { } func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) + in := new(QueryRequest) if err := dec(in); err != nil { return nil, err } @@ -174,67 +212,103 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf FullMethod: Query_Params_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + return srv.(QueryServer).Params(ctx, req.(*QueryRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAccountsRequest) +func _Query_ParamsAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Accounts(ctx, in) + return srv.(QueryServer).ParamsAssets(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_Accounts_FullMethodName, + FullMethod: Query_ParamsAssets_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Accounts(ctx, req.(*QueryAccountsRequest)) + return srv.(QueryServer).ParamsAssets(ctx, req.(*QueryRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Credentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryCredentialsRequest) +func _Query_ParamsByAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Credentials(ctx, in) + return srv.(QueryServer).ParamsByAsset(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_Credentials_FullMethodName, + FullMethod: Query_ParamsByAsset_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Credentials(ctx, req.(*QueryCredentialsRequest)) + return srv.(QueryServer).ParamsByAsset(ctx, req.(*QueryRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Identities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryIdentitiesRequest) +func _Query_ParamsKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Identities(ctx, in) + return srv.(QueryServer).ParamsKeys(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_Identities_FullMethodName, + FullMethod: Query_ParamsKeys_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Identities(ctx, req.(*QueryIdentitiesRequest)) + return srv.(QueryServer).ParamsKeys(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ParamsByKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsByKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ParamsByKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsByKey(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RegistrationOptionsByKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RegistrationOptionsByKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_RegistrationOptionsByKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RegistrationOptionsByKey(ctx, req.(*QueryRequest)) } return interceptor(ctx, in, info, handler) } func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryResolveRequest) + in := new(QueryRequest) if err := dec(in); err != nil { return nil, err } @@ -246,13 +320,13 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter FullMethod: Query_Resolve_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Resolve(ctx, req.(*QueryResolveRequest)) + return srv.(QueryServer).Resolve(ctx, req.(*QueryRequest)) } return interceptor(ctx, in, info, handler) } func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryServiceRequest) + in := new(QueryRequest) if err := dec(in); err != nil { return nil, err } @@ -264,7 +338,7 @@ func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(inter FullMethod: Query_Service_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Service(ctx, req.(*QueryServiceRequest)) + return srv.(QueryServer).Service(ctx, req.(*QueryRequest)) } return interceptor(ctx, in, info, handler) } @@ -281,16 +355,24 @@ var Query_ServiceDesc = grpc.ServiceDesc{ Handler: _Query_Params_Handler, }, { - MethodName: "Accounts", - Handler: _Query_Accounts_Handler, + MethodName: "ParamsAssets", + Handler: _Query_ParamsAssets_Handler, }, { - MethodName: "Credentials", - Handler: _Query_Credentials_Handler, + MethodName: "ParamsByAsset", + Handler: _Query_ParamsByAsset_Handler, }, { - MethodName: "Identities", - Handler: _Query_Identities_Handler, + MethodName: "ParamsKeys", + Handler: _Query_ParamsKeys_Handler, + }, + { + MethodName: "ParamsByKey", + Handler: _Query_ParamsByKey_Handler, + }, + { + MethodName: "RegistrationOptionsByKey", + Handler: _Query_RegistrationOptionsByKey_Handler, }, { MethodName: "Resolve", diff --git a/api/did/v1/state.cosmos_orm.go b/api/did/v1/state.cosmos_orm.go index 5a7d36468..1c83123cd 100644 --- a/api/did/v1/state.cosmos_orm.go +++ b/api/did/v1/state.cosmos_orm.go @@ -9,13 +9,27 @@ import ( ormerrors "cosmossdk.io/orm/types/ormerrors" ) -type AliasesTable interface { - Insert(ctx context.Context, aliases *Aliases) error - Update(ctx context.Context, aliases *Aliases) error - Save(ctx context.Context, aliases *Aliases) error - Delete(ctx context.Context, aliases *Aliases) error +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 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, id string) (*Account, error) + HasByControllerLabel(ctx context.Context, controller string, label string) (found bool, err error) + // GetByControllerLabel returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByControllerLabel(ctx context.Context, controller string, label string) (*Account, error) + HasByControllerAddress(ctx context.Context, controller string, address string) (found bool, err error) + // GetByControllerAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByControllerAddress(ctx context.Context, controller string, address string) (*Account, error) + HasByControllerChainCodeIndex(ctx context.Context, controller string, chain_code uint32, index uint32) (found bool, err error) + // GetByControllerChainCodeIndex returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByControllerChainCodeIndex(ctx context.Context, controller string, chain_code uint32, index uint32) (*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 Get(ctx context.Context, id string) (*Aliases, error) HasBySubject(ctx context.Context, subject string) (found bool, err error) // GetBySubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. @@ -28,38 +42,48 @@ type AliasesTable interface { doNotImplement() } -type AliasesIterator struct { +type AccountIterator struct { ormtable.Iterator } -func (i AliasesIterator) Value() (*Aliases, error) { - var aliases Aliases - err := i.UnmarshalMessage(&aliases) - return &aliases, err +func (i AccountIterator) Value() (*Account, error) { + var account Account + err := i.UnmarshalMessage(&account) + return &account, err } -type AliasesIndexKey interface { +type AccountIndexKey interface { id() uint32 values() []interface{} - aliasesIndexKey() + accountIndexKey() } // primary key starting index.. -type AliasesPrimaryKey = AliasesIdIndexKey +type AccountPrimaryKey = AccountIdIndexKey -type AliasesIdIndexKey struct { +type AccountIdIndexKey struct { vs []interface{} } -func (x AliasesIdIndexKey) id() uint32 { return 0 } -func (x AliasesIdIndexKey) values() []interface{} { return x.vs } -func (x AliasesIdIndexKey) aliasesIndexKey() {} +func (x AccountIdIndexKey) id() uint32 { return 0 } +func (x AccountIdIndexKey) values() []interface{} { return x.vs } +func (x AccountIdIndexKey) accountIndexKey() {} -func (this AliasesIdIndexKey) WithId(id string) AliasesIdIndexKey { +func (this AccountIdIndexKey) WithId(id string) AccountIdIndexKey { this.vs = []interface{}{id} return this } +type AccountControllerLabelIndexKey struct { + vs []interface{} +} + +func (x AccountControllerLabelIndexKey) id() uint32 { return 1 } +func (x AccountControllerLabelIndexKey) values() []interface{} { return x.vs } +func (x AccountControllerLabelIndexKey) accountIndexKey() {} + +func (this AccountControllerLabelIndexKey) WithController(controller string) AccountControllerLabelIndexKey { + this.vs = []interface{}{controller} type AliasesSubjectIndexKey struct { vs []interface{} } @@ -73,42 +97,100 @@ func (this AliasesSubjectIndexKey) WithSubject(subject string) AliasesSubjectInd return this } -type aliasesTable struct { +func (this AccountControllerLabelIndexKey) WithControllerLabel(controller string, label string) AccountControllerLabelIndexKey { + this.vs = []interface{}{controller, label} + return this +} + +type AccountControllerAddressIndexKey struct { + vs []interface{} +} + +func (x AccountControllerAddressIndexKey) id() uint32 { return 2 } +func (x AccountControllerAddressIndexKey) values() []interface{} { return x.vs } +func (x AccountControllerAddressIndexKey) accountIndexKey() {} + +func (this AccountControllerAddressIndexKey) WithController(controller string) AccountControllerAddressIndexKey { + this.vs = []interface{}{controller} + return this +} + +func (this AccountControllerAddressIndexKey) WithControllerAddress(controller string, address string) AccountControllerAddressIndexKey { + this.vs = []interface{}{controller, address} + return this +} + +type AccountControllerChainCodeIndexIndexKey struct { + vs []interface{} +} + +func (x AccountControllerChainCodeIndexIndexKey) id() uint32 { return 3 } +func (x AccountControllerChainCodeIndexIndexKey) values() []interface{} { return x.vs } +func (x AccountControllerChainCodeIndexIndexKey) accountIndexKey() {} + +func (this AccountControllerChainCodeIndexIndexKey) WithController(controller string) AccountControllerChainCodeIndexIndexKey { + this.vs = []interface{}{controller} + return this +} + +func (this AccountControllerChainCodeIndexIndexKey) WithControllerChainCode(controller string, chain_code uint32) AccountControllerChainCodeIndexIndexKey { + this.vs = []interface{}{controller, chain_code} + return this +} + +func (this AccountControllerChainCodeIndexIndexKey) WithControllerChainCodeIndex(controller string, chain_code uint32, index uint32) AccountControllerChainCodeIndexIndexKey { + this.vs = []interface{}{controller, chain_code, index} + return this +} + +type accountTable struct { table ormtable.Table } -func (this aliasesTable) Insert(ctx context.Context, aliases *Aliases) error { - return this.table.Insert(ctx, aliases) +func (this accountTable) Insert(ctx context.Context, account *Account) error { + return this.table.Insert(ctx, account) } -func (this aliasesTable) Update(ctx context.Context, aliases *Aliases) error { - return this.table.Update(ctx, aliases) +func (this accountTable) Update(ctx context.Context, account *Account) error { + return this.table.Update(ctx, account) } -func (this aliasesTable) Save(ctx context.Context, aliases *Aliases) error { - return this.table.Save(ctx, aliases) +func (this accountTable) Save(ctx context.Context, account *Account) error { + return this.table.Save(ctx, account) } -func (this aliasesTable) Delete(ctx context.Context, aliases *Aliases) error { - return this.table.Delete(ctx, aliases) +func (this accountTable) Delete(ctx context.Context, account *Account) error { + return this.table.Delete(ctx, account) } -func (this aliasesTable) Has(ctx context.Context, id string) (found bool, err error) { +func (this accountTable) Has(ctx context.Context, id string) (found bool, err error) { return this.table.PrimaryKey().Has(ctx, id) } -func (this aliasesTable) Get(ctx context.Context, id string) (*Aliases, error) { - var aliases Aliases - found, err := this.table.PrimaryKey().Get(ctx, &aliases, id) +func (this accountTable) Get(ctx context.Context, id string) (*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 &aliases, nil + return &account, nil } +func (this accountTable) HasByControllerLabel(ctx context.Context, controller string, label string) (found bool, err error) { + return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, + controller, + label, + ) +} + +func (this accountTable) GetByControllerLabel(ctx context.Context, controller string, label string) (*Account, error) { + var account Account + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &account, + controller, + label, func (this aliasesTable) HasBySubject(ctx context.Context, subject string) (found bool, err error) { return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, subject, @@ -126,265 +208,83 @@ func (this aliasesTable) GetBySubject(ctx context.Context, subject string) (*Ali if !found { return nil, ormerrors.NotFound } - return &aliases, nil + return &account, nil } -func (this aliasesTable) List(ctx context.Context, prefixKey AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return AliasesIterator{it}, err +func (this accountTable) HasByControllerAddress(ctx context.Context, controller string, address string) (found bool, err error) { + return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, + controller, + address, + ) } -func (this aliasesTable) ListRange(ctx context.Context, from, to AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return AliasesIterator{it}, err -} - -func (this aliasesTable) DeleteBy(ctx context.Context, prefixKey AliasesIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this aliasesTable) DeleteRange(ctx context.Context, from, to AliasesIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this aliasesTable) doNotImplement() {} - -var _ AliasesTable = aliasesTable{} - -func NewAliasesTable(db ormtable.Schema) (AliasesTable, error) { - table := db.GetTable(&Aliases{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Aliases{}).ProtoReflect().Descriptor().FullName())) - } - return aliasesTable{table}, nil -} - -type AssertionTable interface { - Insert(ctx context.Context, assertion *Assertion) error - Update(ctx context.Context, assertion *Assertion) error - Save(ctx context.Context, assertion *Assertion) error - Delete(ctx context.Context, assertion *Assertion) error - Has(ctx context.Context, id 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, id string) (*Assertion, error) - List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) - ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) - DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error - DeleteRange(ctx context.Context, from, to AssertionIndexKey) error - - doNotImplement() -} - -type AssertionIterator struct { - ormtable.Iterator -} - -func (i AssertionIterator) Value() (*Assertion, error) { - var assertion Assertion - err := i.UnmarshalMessage(&assertion) - return &assertion, err -} - -type AssertionIndexKey interface { - id() uint32 - values() []interface{} - assertionIndexKey() -} - -// primary key starting index.. -type AssertionPrimaryKey = AssertionIdIndexKey - -type AssertionIdIndexKey struct { - vs []interface{} -} - -func (x AssertionIdIndexKey) id() uint32 { return 0 } -func (x AssertionIdIndexKey) values() []interface{} { return x.vs } -func (x AssertionIdIndexKey) assertionIndexKey() {} - -func (this AssertionIdIndexKey) WithId(id string) AssertionIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type assertionTable struct { - table ormtable.Table -} - -func (this assertionTable) Insert(ctx context.Context, assertion *Assertion) error { - return this.table.Insert(ctx, assertion) -} - -func (this assertionTable) Update(ctx context.Context, assertion *Assertion) error { - return this.table.Update(ctx, assertion) -} - -func (this assertionTable) Save(ctx context.Context, assertion *Assertion) error { - return this.table.Save(ctx, assertion) -} - -func (this assertionTable) Delete(ctx context.Context, assertion *Assertion) error { - return this.table.Delete(ctx, assertion) -} - -func (this assertionTable) Has(ctx context.Context, id string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this assertionTable) Get(ctx context.Context, id string) (*Assertion, error) { - var assertion Assertion - found, err := this.table.PrimaryKey().Get(ctx, &assertion, id) +func (this accountTable) GetByControllerAddress(ctx context.Context, controller string, address string) (*Account, error) { + var account Account + found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &account, + controller, + address, + ) if err != nil { return nil, err } if !found { return nil, ormerrors.NotFound } - return &assertion, nil + return &account, nil } -func (this assertionTable) List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return AssertionIterator{it}, err +func (this accountTable) HasByControllerChainCodeIndex(ctx context.Context, controller string, chain_code uint32, index uint32) (found bool, err error) { + return this.table.GetIndexByID(3).(ormtable.UniqueIndex).Has(ctx, + controller, + chain_code, + index, + ) } -func (this assertionTable) ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return AssertionIterator{it}, err -} - -func (this assertionTable) DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this assertionTable) DeleteRange(ctx context.Context, from, to AssertionIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this assertionTable) doNotImplement() {} - -var _ AssertionTable = assertionTable{} - -func NewAssertionTable(db ormtable.Schema) (AssertionTable, error) { - table := db.GetTable(&Assertion{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Assertion{}).ProtoReflect().Descriptor().FullName())) - } - return assertionTable{table}, nil -} - -type AttestationTable interface { - Insert(ctx context.Context, attestation *Attestation) error - Update(ctx context.Context, attestation *Attestation) error - Save(ctx context.Context, attestation *Attestation) error - Delete(ctx context.Context, attestation *Attestation) error - Has(ctx context.Context, id 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, id string) (*Attestation, error) - List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) - ListRange(ctx context.Context, from, to AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) - DeleteBy(ctx context.Context, prefixKey AttestationIndexKey) error - DeleteRange(ctx context.Context, from, to AttestationIndexKey) error - - doNotImplement() -} - -type AttestationIterator struct { - ormtable.Iterator -} - -func (i AttestationIterator) Value() (*Attestation, error) { - var attestation Attestation - err := i.UnmarshalMessage(&attestation) - return &attestation, err -} - -type AttestationIndexKey interface { - id() uint32 - values() []interface{} - attestationIndexKey() -} - -// primary key starting index.. -type AttestationPrimaryKey = AttestationIdIndexKey - -type AttestationIdIndexKey struct { - vs []interface{} -} - -func (x AttestationIdIndexKey) id() uint32 { return 0 } -func (x AttestationIdIndexKey) values() []interface{} { return x.vs } -func (x AttestationIdIndexKey) attestationIndexKey() {} - -func (this AttestationIdIndexKey) WithId(id string) AttestationIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type attestationTable struct { - table ormtable.Table -} - -func (this attestationTable) Insert(ctx context.Context, attestation *Attestation) error { - return this.table.Insert(ctx, attestation) -} - -func (this attestationTable) Update(ctx context.Context, attestation *Attestation) error { - return this.table.Update(ctx, attestation) -} - -func (this attestationTable) Save(ctx context.Context, attestation *Attestation) error { - return this.table.Save(ctx, attestation) -} - -func (this attestationTable) Delete(ctx context.Context, attestation *Attestation) error { - return this.table.Delete(ctx, attestation) -} - -func (this attestationTable) Has(ctx context.Context, id string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this attestationTable) Get(ctx context.Context, id string) (*Attestation, error) { - var attestation Attestation - found, err := this.table.PrimaryKey().Get(ctx, &attestation, id) +func (this accountTable) GetByControllerChainCodeIndex(ctx context.Context, controller string, chain_code uint32, index uint32) (*Account, error) { + var account Account + found, err := this.table.GetIndexByID(3).(ormtable.UniqueIndex).Get(ctx, &account, + controller, + chain_code, + index, + ) if err != nil { return nil, err } if !found { return nil, ormerrors.NotFound } - return &attestation, nil + return &account, nil } -func (this attestationTable) List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) { +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 AttestationIterator{it}, err + return AccountIterator{it}, err } -func (this attestationTable) ListRange(ctx context.Context, from, to AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) { +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 AttestationIterator{it}, err + return AccountIterator{it}, err } -func (this attestationTable) DeleteBy(ctx context.Context, prefixKey AttestationIndexKey) error { +func (this accountTable) DeleteBy(ctx context.Context, prefixKey AccountIndexKey) error { return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) } -func (this attestationTable) DeleteRange(ctx context.Context, from, to AttestationIndexKey) error { +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 attestationTable) doNotImplement() {} +func (this accountTable) doNotImplement() {} -var _ AttestationTable = attestationTable{} +var _ AccountTable = accountTable{} -func NewAttestationTable(db ormtable.Schema) (AttestationTable, error) { - table := db.GetTable(&Attestation{}) +func NewAccountTable(db ormtable.Schema) (AccountTable, error) { + table := db.GetTable(&Account{}) if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Attestation{}).ProtoReflect().Descriptor().FullName())) + return nil, ormerrors.TableNotFound.Wrap(string((&Account{}).ProtoReflect().Descriptor().FullName())) } - return attestationTable{table}, nil + return accountTable{table}, nil } type ControllerTable interface { @@ -395,6 +295,12 @@ type ControllerTable interface { Has(ctx context.Context, id 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, id string) (*Controller, error) + HasByAddress(ctx context.Context, address string) (found bool, err error) + // GetByAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByAddress(ctx context.Context, address string) (*Controller, error) + HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error) + // GetByVaultCid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error) List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) ListRange(ctx context.Context, from, to ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) DeleteBy(ctx context.Context, prefixKey ControllerIndexKey) error @@ -435,6 +341,32 @@ func (this ControllerIdIndexKey) WithId(id string) ControllerIdIndexKey { return this } +type ControllerAddressIndexKey struct { + vs []interface{} +} + +func (x ControllerAddressIndexKey) id() uint32 { return 1 } +func (x ControllerAddressIndexKey) values() []interface{} { return x.vs } +func (x ControllerAddressIndexKey) controllerIndexKey() {} + +func (this ControllerAddressIndexKey) WithAddress(address string) ControllerAddressIndexKey { + this.vs = []interface{}{address} + return this +} + +type ControllerVaultCidIndexKey struct { + vs []interface{} +} + +func (x ControllerVaultCidIndexKey) id() uint32 { return 2 } +func (x ControllerVaultCidIndexKey) values() []interface{} { return x.vs } +func (x ControllerVaultCidIndexKey) controllerIndexKey() {} + +func (this ControllerVaultCidIndexKey) WithVaultCid(vault_cid string) ControllerVaultCidIndexKey { + this.vs = []interface{}{vault_cid} + return this +} + type controllerTable struct { table ormtable.Table } @@ -471,6 +403,46 @@ func (this controllerTable) Get(ctx context.Context, id string) (*Controller, er return &controller, nil } +func (this controllerTable) HasByAddress(ctx context.Context, address string) (found bool, err error) { + return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, + address, + ) +} + +func (this controllerTable) GetByAddress(ctx context.Context, address string) (*Controller, error) { + var controller Controller + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &controller, + address, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &controller, nil +} + +func (this controllerTable) HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error) { + return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, + vault_cid, + ) +} + +func (this controllerTable) GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error) { + var controller Controller + found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &controller, + vault_cid, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &controller, nil +} + func (this controllerTable) List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) { it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) return ControllerIterator{it}, err @@ -501,276 +473,570 @@ func NewControllerTable(db ormtable.Schema) (ControllerTable, error) { return controllerTable{table}, nil } -type DelegationTable interface { - Insert(ctx context.Context, delegation *Delegation) error - Update(ctx context.Context, delegation *Delegation) error - Save(ctx context.Context, delegation *Delegation) error - Delete(ctx context.Context, delegation *Delegation) error +type ProofTable interface { + Insert(ctx context.Context, proof *Proof) error + Update(ctx context.Context, proof *Proof) error + Save(ctx context.Context, proof *Proof) error + Delete(ctx context.Context, proof *Proof) error Has(ctx context.Context, id 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, id string) (*Delegation, error) - List(ctx context.Context, prefixKey DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error) - ListRange(ctx context.Context, from, to DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error) - DeleteBy(ctx context.Context, prefixKey DelegationIndexKey) error - DeleteRange(ctx context.Context, from, to DelegationIndexKey) error + Get(ctx context.Context, id string) (*Proof, error) + HasByControllerIssuerProperty(ctx context.Context, controller string, issuer string, property string) (found bool, err error) + // GetByControllerIssuerProperty returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByControllerIssuerProperty(ctx context.Context, controller string, issuer string, property string) (*Proof, error) + List(ctx context.Context, prefixKey ProofIndexKey, opts ...ormlist.Option) (ProofIterator, error) + ListRange(ctx context.Context, from, to ProofIndexKey, opts ...ormlist.Option) (ProofIterator, error) + DeleteBy(ctx context.Context, prefixKey ProofIndexKey) error + DeleteRange(ctx context.Context, from, to ProofIndexKey) error doNotImplement() } -type DelegationIterator struct { +type ProofIterator struct { ormtable.Iterator } -func (i DelegationIterator) Value() (*Delegation, error) { - var delegation Delegation - err := i.UnmarshalMessage(&delegation) - return &delegation, err +func (i ProofIterator) Value() (*Proof, error) { + var proof Proof + err := i.UnmarshalMessage(&proof) + return &proof, err } -type DelegationIndexKey interface { +type ProofIndexKey interface { id() uint32 values() []interface{} - delegationIndexKey() + proofIndexKey() } // primary key starting index.. -type DelegationPrimaryKey = DelegationIdIndexKey +type ProofPrimaryKey = ProofIdIndexKey -type DelegationIdIndexKey struct { +type ProofIdIndexKey struct { vs []interface{} } -func (x DelegationIdIndexKey) id() uint32 { return 0 } -func (x DelegationIdIndexKey) values() []interface{} { return x.vs } -func (x DelegationIdIndexKey) delegationIndexKey() {} +func (x ProofIdIndexKey) id() uint32 { return 0 } +func (x ProofIdIndexKey) values() []interface{} { return x.vs } +func (x ProofIdIndexKey) proofIndexKey() {} -func (this DelegationIdIndexKey) WithId(id string) DelegationIdIndexKey { +func (this ProofIdIndexKey) WithId(id string) ProofIdIndexKey { this.vs = []interface{}{id} return this } -type delegationTable struct { +type ProofControllerIssuerPropertyIndexKey struct { + vs []interface{} +} + +func (x ProofControllerIssuerPropertyIndexKey) id() uint32 { return 1 } +func (x ProofControllerIssuerPropertyIndexKey) values() []interface{} { return x.vs } +func (x ProofControllerIssuerPropertyIndexKey) proofIndexKey() {} + +func (this ProofControllerIssuerPropertyIndexKey) WithController(controller string) ProofControllerIssuerPropertyIndexKey { + this.vs = []interface{}{controller} + return this +} + +func (this ProofControllerIssuerPropertyIndexKey) WithControllerIssuer(controller string, issuer string) ProofControllerIssuerPropertyIndexKey { + this.vs = []interface{}{controller, issuer} + return this +} + +func (this ProofControllerIssuerPropertyIndexKey) WithControllerIssuerProperty(controller string, issuer string, property string) ProofControllerIssuerPropertyIndexKey { + this.vs = []interface{}{controller, issuer, property} + return this +} + +type proofTable struct { table ormtable.Table } -func (this delegationTable) Insert(ctx context.Context, delegation *Delegation) error { - return this.table.Insert(ctx, delegation) +func (this proofTable) Insert(ctx context.Context, proof *Proof) error { + return this.table.Insert(ctx, proof) } -func (this delegationTable) Update(ctx context.Context, delegation *Delegation) error { - return this.table.Update(ctx, delegation) +func (this proofTable) Update(ctx context.Context, proof *Proof) error { + return this.table.Update(ctx, proof) } -func (this delegationTable) Save(ctx context.Context, delegation *Delegation) error { - return this.table.Save(ctx, delegation) +func (this proofTable) Save(ctx context.Context, proof *Proof) error { + return this.table.Save(ctx, proof) } -func (this delegationTable) Delete(ctx context.Context, delegation *Delegation) error { - return this.table.Delete(ctx, delegation) +func (this proofTable) Delete(ctx context.Context, proof *Proof) error { + return this.table.Delete(ctx, proof) } -func (this delegationTable) Has(ctx context.Context, id string) (found bool, err error) { +func (this proofTable) Has(ctx context.Context, id string) (found bool, err error) { return this.table.PrimaryKey().Has(ctx, id) } -func (this delegationTable) Get(ctx context.Context, id string) (*Delegation, error) { - var delegation Delegation - found, err := this.table.PrimaryKey().Get(ctx, &delegation, id) +func (this proofTable) Get(ctx context.Context, id string) (*Proof, error) { + var proof Proof + found, err := this.table.PrimaryKey().Get(ctx, &proof, id) if err != nil { return nil, err } if !found { return nil, ormerrors.NotFound } - return &delegation, nil + return &proof, nil } -func (this delegationTable) List(ctx context.Context, prefixKey DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return DelegationIterator{it}, err +func (this proofTable) HasByControllerIssuerProperty(ctx context.Context, controller string, issuer string, property string) (found bool, err error) { + return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, + controller, + issuer, + property, + ) } -func (this delegationTable) ListRange(ctx context.Context, from, to DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return DelegationIterator{it}, err -} - -func (this delegationTable) DeleteBy(ctx context.Context, prefixKey DelegationIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this delegationTable) DeleteRange(ctx context.Context, from, to DelegationIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this delegationTable) doNotImplement() {} - -var _ DelegationTable = delegationTable{} - -func NewDelegationTable(db ormtable.Schema) (DelegationTable, error) { - table := db.GetTable(&Delegation{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Delegation{}).ProtoReflect().Descriptor().FullName())) - } - return delegationTable{table}, nil -} - -type ServiceTable interface { - Insert(ctx context.Context, service *Service) error - Update(ctx context.Context, service *Service) error - Save(ctx context.Context, service *Service) error - Delete(ctx context.Context, service *Service) error - Has(ctx context.Context, id 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, id string) (*Service, error) - List(ctx context.Context, prefixKey ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error) - ListRange(ctx context.Context, from, to ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error) - DeleteBy(ctx context.Context, prefixKey ServiceIndexKey) error - DeleteRange(ctx context.Context, from, to ServiceIndexKey) error - - doNotImplement() -} - -type ServiceIterator struct { - ormtable.Iterator -} - -func (i ServiceIterator) Value() (*Service, error) { - var service Service - err := i.UnmarshalMessage(&service) - return &service, err -} - -type ServiceIndexKey interface { - id() uint32 - values() []interface{} - serviceIndexKey() -} - -// primary key starting index.. -type ServicePrimaryKey = ServiceIdIndexKey - -type ServiceIdIndexKey struct { - vs []interface{} -} - -func (x ServiceIdIndexKey) id() uint32 { return 0 } -func (x ServiceIdIndexKey) values() []interface{} { return x.vs } -func (x ServiceIdIndexKey) serviceIndexKey() {} - -func (this ServiceIdIndexKey) WithId(id string) ServiceIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type serviceTable struct { - table ormtable.Table -} - -func (this serviceTable) Insert(ctx context.Context, service *Service) error { - return this.table.Insert(ctx, service) -} - -func (this serviceTable) Update(ctx context.Context, service *Service) error { - return this.table.Update(ctx, service) -} - -func (this serviceTable) Save(ctx context.Context, service *Service) error { - return this.table.Save(ctx, service) -} - -func (this serviceTable) Delete(ctx context.Context, service *Service) error { - return this.table.Delete(ctx, service) -} - -func (this serviceTable) Has(ctx context.Context, id string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this serviceTable) Get(ctx context.Context, id string) (*Service, error) { - var service Service - found, err := this.table.PrimaryKey().Get(ctx, &service, id) +func (this proofTable) GetByControllerIssuerProperty(ctx context.Context, controller string, issuer string, property string) (*Proof, error) { + var proof Proof + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &proof, + controller, + issuer, + property, + ) if err != nil { return nil, err } if !found { return nil, ormerrors.NotFound } - return &service, nil + return &proof, nil } -func (this serviceTable) List(ctx context.Context, prefixKey ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error) { +func (this proofTable) List(ctx context.Context, prefixKey ProofIndexKey, opts ...ormlist.Option) (ProofIterator, error) { it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ServiceIterator{it}, err + return ProofIterator{it}, err } -func (this serviceTable) ListRange(ctx context.Context, from, to ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error) { +func (this proofTable) ListRange(ctx context.Context, from, to ProofIndexKey, opts ...ormlist.Option) (ProofIterator, error) { it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ServiceIterator{it}, err + return ProofIterator{it}, err } -func (this serviceTable) DeleteBy(ctx context.Context, prefixKey ServiceIndexKey) error { +func (this proofTable) DeleteBy(ctx context.Context, prefixKey ProofIndexKey) error { return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) } -func (this serviceTable) DeleteRange(ctx context.Context, from, to ServiceIndexKey) error { +func (this proofTable) DeleteRange(ctx context.Context, from, to ProofIndexKey) error { return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) } -func (this serviceTable) doNotImplement() {} +func (this proofTable) doNotImplement() {} -var _ ServiceTable = serviceTable{} +var _ ProofTable = proofTable{} -func NewServiceTable(db ormtable.Schema) (ServiceTable, error) { - table := db.GetTable(&Service{}) +func NewProofTable(db ormtable.Schema) (ProofTable, error) { + table := db.GetTable(&Proof{}) if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Service{}).ProtoReflect().Descriptor().FullName())) + return nil, ormerrors.TableNotFound.Wrap(string((&Proof{}).ProtoReflect().Descriptor().FullName())) } - return serviceTable{table}, nil + return proofTable{table}, nil +} + +type ServiceRecordTable interface { + Insert(ctx context.Context, serviceRecord *ServiceRecord) error + Update(ctx context.Context, serviceRecord *ServiceRecord) error + Save(ctx context.Context, serviceRecord *ServiceRecord) error + Delete(ctx context.Context, serviceRecord *ServiceRecord) error + Has(ctx context.Context, id 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, id string) (*ServiceRecord, error) + HasByOrigin(ctx context.Context, origin string) (found bool, err error) + // GetByOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByOrigin(ctx context.Context, origin string) (*ServiceRecord, error) + HasByAuthorityOrigin(ctx context.Context, authority string, origin string) (found bool, err error) + // GetByAuthorityOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByAuthorityOrigin(ctx context.Context, authority string, origin string) (*ServiceRecord, error) + List(ctx context.Context, prefixKey ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) + ListRange(ctx context.Context, from, to ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) + DeleteBy(ctx context.Context, prefixKey ServiceRecordIndexKey) error + DeleteRange(ctx context.Context, from, to ServiceRecordIndexKey) error + + doNotImplement() +} + +type ServiceRecordIterator struct { + ormtable.Iterator +} + +func (i ServiceRecordIterator) Value() (*ServiceRecord, error) { + var serviceRecord ServiceRecord + err := i.UnmarshalMessage(&serviceRecord) + return &serviceRecord, err +} + +type ServiceRecordIndexKey interface { + id() uint32 + values() []interface{} + serviceRecordIndexKey() +} + +// primary key starting index.. +type ServiceRecordPrimaryKey = ServiceRecordIdIndexKey + +type ServiceRecordIdIndexKey struct { + vs []interface{} +} + +func (x ServiceRecordIdIndexKey) id() uint32 { return 0 } +func (x ServiceRecordIdIndexKey) values() []interface{} { return x.vs } +func (x ServiceRecordIdIndexKey) serviceRecordIndexKey() {} + +func (this ServiceRecordIdIndexKey) WithId(id string) ServiceRecordIdIndexKey { + this.vs = []interface{}{id} + return this +} + +type ServiceRecordOriginIndexKey struct { + vs []interface{} +} + +func (x ServiceRecordOriginIndexKey) id() uint32 { return 1 } +func (x ServiceRecordOriginIndexKey) values() []interface{} { return x.vs } +func (x ServiceRecordOriginIndexKey) serviceRecordIndexKey() {} + +func (this ServiceRecordOriginIndexKey) WithOrigin(origin string) ServiceRecordOriginIndexKey { + this.vs = []interface{}{origin} + return this +} + +type ServiceRecordAuthorityOriginIndexKey struct { + vs []interface{} +} + +func (x ServiceRecordAuthorityOriginIndexKey) id() uint32 { return 2 } +func (x ServiceRecordAuthorityOriginIndexKey) values() []interface{} { return x.vs } +func (x ServiceRecordAuthorityOriginIndexKey) serviceRecordIndexKey() {} + +func (this ServiceRecordAuthorityOriginIndexKey) WithAuthority(authority string) ServiceRecordAuthorityOriginIndexKey { + this.vs = []interface{}{authority} + return this +} + +func (this ServiceRecordAuthorityOriginIndexKey) WithAuthorityOrigin(authority string, origin string) ServiceRecordAuthorityOriginIndexKey { + this.vs = []interface{}{authority, origin} + return this +} + +type serviceRecordTable struct { + table ormtable.Table +} + +func (this serviceRecordTable) Insert(ctx context.Context, serviceRecord *ServiceRecord) error { + return this.table.Insert(ctx, serviceRecord) +} + +func (this serviceRecordTable) Update(ctx context.Context, serviceRecord *ServiceRecord) error { + return this.table.Update(ctx, serviceRecord) +} + +func (this serviceRecordTable) Save(ctx context.Context, serviceRecord *ServiceRecord) error { + return this.table.Save(ctx, serviceRecord) +} + +func (this serviceRecordTable) Delete(ctx context.Context, serviceRecord *ServiceRecord) error { + return this.table.Delete(ctx, serviceRecord) +} + +func (this serviceRecordTable) Has(ctx context.Context, id string) (found bool, err error) { + return this.table.PrimaryKey().Has(ctx, id) +} + +func (this serviceRecordTable) Get(ctx context.Context, id string) (*ServiceRecord, error) { + var serviceRecord ServiceRecord + found, err := this.table.PrimaryKey().Get(ctx, &serviceRecord, id) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &serviceRecord, nil +} + +func (this serviceRecordTable) HasByOrigin(ctx context.Context, origin string) (found bool, err error) { + return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, + origin, + ) +} + +func (this serviceRecordTable) GetByOrigin(ctx context.Context, origin string) (*ServiceRecord, error) { + var serviceRecord ServiceRecord + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &serviceRecord, + origin, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &serviceRecord, nil +} + +func (this serviceRecordTable) HasByAuthorityOrigin(ctx context.Context, authority string, origin string) (found bool, err error) { + return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx, + authority, + origin, + ) +} + +func (this serviceRecordTable) GetByAuthorityOrigin(ctx context.Context, authority string, origin string) (*ServiceRecord, error) { + var serviceRecord ServiceRecord + found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &serviceRecord, + authority, + origin, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &serviceRecord, nil +} + +func (this serviceRecordTable) List(ctx context.Context, prefixKey ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) { + it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) + return ServiceRecordIterator{it}, err +} + +func (this serviceRecordTable) ListRange(ctx context.Context, from, to ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) { + it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) + return ServiceRecordIterator{it}, err +} + +func (this serviceRecordTable) DeleteBy(ctx context.Context, prefixKey ServiceRecordIndexKey) error { + return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) +} + +func (this serviceRecordTable) DeleteRange(ctx context.Context, from, to ServiceRecordIndexKey) error { + return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) +} + +func (this serviceRecordTable) doNotImplement() {} + +var _ ServiceRecordTable = serviceRecordTable{} + +func NewServiceRecordTable(db ormtable.Schema) (ServiceRecordTable, error) { + table := db.GetTable(&ServiceRecord{}) + if table == nil { + return nil, ormerrors.TableNotFound.Wrap(string((&ServiceRecord{}).ProtoReflect().Descriptor().FullName())) + } + return serviceRecordTable{table}, nil +} + +type VerificationMethodTable interface { + Insert(ctx context.Context, verificationMethod *VerificationMethod) error + Update(ctx context.Context, verificationMethod *VerificationMethod) error + Save(ctx context.Context, verificationMethod *VerificationMethod) error + Delete(ctx context.Context, verificationMethod *VerificationMethod) error + Has(ctx context.Context, id 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, id string) (*VerificationMethod, error) + HasByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (found bool, err error) + // GetByControllerMethodIssuerSubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. + GetByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (*VerificationMethod, error) + List(ctx context.Context, prefixKey VerificationMethodIndexKey, opts ...ormlist.Option) (VerificationMethodIterator, error) + ListRange(ctx context.Context, from, to VerificationMethodIndexKey, opts ...ormlist.Option) (VerificationMethodIterator, error) + DeleteBy(ctx context.Context, prefixKey VerificationMethodIndexKey) error + DeleteRange(ctx context.Context, from, to VerificationMethodIndexKey) error + + doNotImplement() +} + +type VerificationMethodIterator struct { + ormtable.Iterator +} + +func (i VerificationMethodIterator) Value() (*VerificationMethod, error) { + var verificationMethod VerificationMethod + err := i.UnmarshalMessage(&verificationMethod) + return &verificationMethod, err +} + +type VerificationMethodIndexKey interface { + id() uint32 + values() []interface{} + verificationMethodIndexKey() +} + +// primary key starting index.. +type VerificationMethodPrimaryKey = VerificationMethodIdIndexKey + +type VerificationMethodIdIndexKey struct { + vs []interface{} +} + +func (x VerificationMethodIdIndexKey) id() uint32 { return 0 } +func (x VerificationMethodIdIndexKey) values() []interface{} { return x.vs } +func (x VerificationMethodIdIndexKey) verificationMethodIndexKey() {} + +func (this VerificationMethodIdIndexKey) WithId(id string) VerificationMethodIdIndexKey { + this.vs = []interface{}{id} + return this +} + +type VerificationMethodControllerMethodIssuerSubjectIndexKey struct { + vs []interface{} +} + +func (x VerificationMethodControllerMethodIssuerSubjectIndexKey) id() uint32 { return 1 } +func (x VerificationMethodControllerMethodIssuerSubjectIndexKey) values() []interface{} { return x.vs } +func (x VerificationMethodControllerMethodIssuerSubjectIndexKey) verificationMethodIndexKey() {} + +func (this VerificationMethodControllerMethodIssuerSubjectIndexKey) WithController(controller string) VerificationMethodControllerMethodIssuerSubjectIndexKey { + this.vs = []interface{}{controller} + return this +} + +func (this VerificationMethodControllerMethodIssuerSubjectIndexKey) WithControllerMethod(controller string, method DIDNamespace) VerificationMethodControllerMethodIssuerSubjectIndexKey { + this.vs = []interface{}{controller, method} + return this +} + +func (this VerificationMethodControllerMethodIssuerSubjectIndexKey) WithControllerMethodIssuer(controller string, method DIDNamespace, issuer string) VerificationMethodControllerMethodIssuerSubjectIndexKey { + this.vs = []interface{}{controller, method, issuer} + return this +} + +func (this VerificationMethodControllerMethodIssuerSubjectIndexKey) WithControllerMethodIssuerSubject(controller string, method DIDNamespace, issuer string, subject string) VerificationMethodControllerMethodIssuerSubjectIndexKey { + this.vs = []interface{}{controller, method, issuer, subject} + return this +} + +type verificationMethodTable struct { + table ormtable.Table +} + +func (this verificationMethodTable) Insert(ctx context.Context, verificationMethod *VerificationMethod) error { + return this.table.Insert(ctx, verificationMethod) +} + +func (this verificationMethodTable) Update(ctx context.Context, verificationMethod *VerificationMethod) error { + return this.table.Update(ctx, verificationMethod) +} + +func (this verificationMethodTable) Save(ctx context.Context, verificationMethod *VerificationMethod) error { + return this.table.Save(ctx, verificationMethod) +} + +func (this verificationMethodTable) Delete(ctx context.Context, verificationMethod *VerificationMethod) error { + return this.table.Delete(ctx, verificationMethod) +} + +func (this verificationMethodTable) Has(ctx context.Context, id string) (found bool, err error) { + return this.table.PrimaryKey().Has(ctx, id) +} + +func (this verificationMethodTable) Get(ctx context.Context, id string) (*VerificationMethod, error) { + var verificationMethod VerificationMethod + found, err := this.table.PrimaryKey().Get(ctx, &verificationMethod, id) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &verificationMethod, nil +} + +func (this verificationMethodTable) HasByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (found bool, err error) { + return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, + controller, + method, + issuer, + subject, + ) +} + +func (this verificationMethodTable) GetByControllerMethodIssuerSubject(ctx context.Context, controller string, method DIDNamespace, issuer string, subject string) (*VerificationMethod, error) { + var verificationMethod VerificationMethod + found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &verificationMethod, + controller, + method, + issuer, + subject, + ) + if err != nil { + return nil, err + } + if !found { + return nil, ormerrors.NotFound + } + return &verificationMethod, nil +} + +func (this verificationMethodTable) List(ctx context.Context, prefixKey VerificationMethodIndexKey, opts ...ormlist.Option) (VerificationMethodIterator, error) { + it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) + return VerificationMethodIterator{it}, err +} + +func (this verificationMethodTable) ListRange(ctx context.Context, from, to VerificationMethodIndexKey, opts ...ormlist.Option) (VerificationMethodIterator, error) { + it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) + return VerificationMethodIterator{it}, err +} + +func (this verificationMethodTable) DeleteBy(ctx context.Context, prefixKey VerificationMethodIndexKey) error { + return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) +} + +func (this verificationMethodTable) DeleteRange(ctx context.Context, from, to VerificationMethodIndexKey) error { + return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) +} + +func (this verificationMethodTable) doNotImplement() {} + +var _ VerificationMethodTable = verificationMethodTable{} + +func NewVerificationMethodTable(db ormtable.Schema) (VerificationMethodTable, error) { + table := db.GetTable(&VerificationMethod{}) + if table == nil { + return nil, ormerrors.TableNotFound.Wrap(string((&VerificationMethod{}).ProtoReflect().Descriptor().FullName())) + } + return verificationMethodTable{table}, nil } type StateStore interface { - AliasesTable() AliasesTable - AssertionTable() AssertionTable - AttestationTable() AttestationTable + AccountTable() AccountTable ControllerTable() ControllerTable - DelegationTable() DelegationTable - ServiceTable() ServiceTable + ProofTable() ProofTable + ServiceRecordTable() ServiceRecordTable + VerificationMethodTable() VerificationMethodTable doNotImplement() } type stateStore struct { - aliases AliasesTable - assertion AssertionTable - attestation AttestationTable - controller ControllerTable - delegation DelegationTable - service ServiceTable + account AccountTable + controller ControllerTable + proof ProofTable + serviceRecord ServiceRecordTable + verificationMethod VerificationMethodTable } -func (x stateStore) AliasesTable() AliasesTable { - return x.aliases -} - -func (x stateStore) AssertionTable() AssertionTable { - return x.assertion -} - -func (x stateStore) AttestationTable() AttestationTable { - return x.attestation +func (x stateStore) AccountTable() AccountTable { + return x.account } func (x stateStore) ControllerTable() ControllerTable { return x.controller } -func (x stateStore) DelegationTable() DelegationTable { - return x.delegation +func (x stateStore) ProofTable() ProofTable { + return x.proof } -func (x stateStore) ServiceTable() ServiceTable { - return x.service +func (x stateStore) ServiceRecordTable() ServiceRecordTable { + return x.serviceRecord +} + +func (x stateStore) VerificationMethodTable() VerificationMethodTable { + return x.verificationMethod } func (stateStore) doNotImplement() {} @@ -778,17 +1044,7 @@ func (stateStore) doNotImplement() {} var _ StateStore = stateStore{} func NewStateStore(db ormtable.Schema) (StateStore, error) { - aliasesTable, err := NewAliasesTable(db) - if err != nil { - return nil, err - } - - assertionTable, err := NewAssertionTable(db) - if err != nil { - return nil, err - } - - attestationTable, err := NewAttestationTable(db) + accountTable, err := NewAccountTable(db) if err != nil { return nil, err } @@ -798,22 +1054,26 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) { return nil, err } - delegationTable, err := NewDelegationTable(db) + proofTable, err := NewProofTable(db) if err != nil { return nil, err } - serviceTable, err := NewServiceTable(db) + serviceRecordTable, err := NewServiceRecordTable(db) + if err != nil { + return nil, err + } + + verificationMethodTable, err := NewVerificationMethodTable(db) if err != nil { return nil, err } return stateStore{ - aliasesTable, - assertionTable, - attestationTable, + accountTable, controllerTable, - delegationTable, - serviceTable, + proofTable, + serviceRecordTable, + verificationMethodTable, }, nil } diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index 1029d7a66..c9f92430a 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -14,7 +14,62 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_Account_8_list)(nil) + +type _Account_8_list struct { + list *[]string +} + +func (x *_Account_8_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Account_8_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Account_8_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Account_8_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Account_8_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Account at list field Chains as it is not of Message kind")) +} + +func (x *_Account_8_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Account_8_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Account_8_list) IsValid() bool { + return x.list != nil +} + var ( + md_Account protoreflect.MessageDescriptor + fd_Account_id protoreflect.FieldDescriptor + fd_Account_controller protoreflect.FieldDescriptor + fd_Account_public_key protoreflect.FieldDescriptor + fd_Account_address protoreflect.FieldDescriptor + fd_Account_label protoreflect.FieldDescriptor + fd_Account_chain_code protoreflect.FieldDescriptor + fd_Account_index protoreflect.FieldDescriptor + fd_Account_chains protoreflect.FieldDescriptor md_Aliases protoreflect.MessageDescriptor fd_Aliases_id protoreflect.FieldDescriptor fd_Aliases_origin protoreflect.FieldDescriptor @@ -25,6 +80,15 @@ var ( func init() { file_did_v1_state_proto_init() + md_Account = File_did_v1_state_proto.Messages().ByName("Account") + fd_Account_id = md_Account.Fields().ByName("id") + fd_Account_controller = md_Account.Fields().ByName("controller") + fd_Account_public_key = md_Account.Fields().ByName("public_key") + fd_Account_address = md_Account.Fields().ByName("address") + fd_Account_label = md_Account.Fields().ByName("label") + fd_Account_chain_code = md_Account.Fields().ByName("chain_code") + fd_Account_index = md_Account.Fields().ByName("index") + fd_Account_chains = md_Account.Fields().ByName("chains") md_Aliases = File_did_v1_state_proto.Messages().ByName("Aliases") fd_Aliases_id = md_Aliases.Fields().ByName("id") fd_Aliases_origin = md_Aliases.Fields().ByName("origin") @@ -33,15 +97,15 @@ func init() { fd_Aliases_expiration = md_Aliases.Fields().ByName("expiration") } -var _ protoreflect.Message = (*fastReflection_Aliases)(nil) +var _ protoreflect.Message = (*fastReflection_Account)(nil) -type fastReflection_Aliases Aliases +type fastReflection_Account Account -func (x *Aliases) ProtoReflect() protoreflect.Message { - return (*fastReflection_Aliases)(x) +func (x *Account) ProtoReflect() protoreflect.Message { + return (*fastReflection_Account)(x) } -func (x *Aliases) slowProtoReflect() protoreflect.Message { +func (x *Account) slowProtoReflect() protoreflect.Message { mi := &file_did_v1_state_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -53,43 +117,43 @@ func (x *Aliases) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Aliases_messageType fastReflection_Aliases_messageType -var _ protoreflect.MessageType = fastReflection_Aliases_messageType{} +var _fastReflection_Account_messageType fastReflection_Account_messageType +var _ protoreflect.MessageType = fastReflection_Account_messageType{} -type fastReflection_Aliases_messageType struct{} +type fastReflection_Account_messageType struct{} -func (x fastReflection_Aliases_messageType) Zero() protoreflect.Message { - return (*fastReflection_Aliases)(nil) +func (x fastReflection_Account_messageType) Zero() protoreflect.Message { + return (*fastReflection_Account)(nil) } -func (x fastReflection_Aliases_messageType) New() protoreflect.Message { - return new(fastReflection_Aliases) +func (x fastReflection_Account_messageType) New() protoreflect.Message { + return new(fastReflection_Account) } -func (x fastReflection_Aliases_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Aliases +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_Aliases) Descriptor() protoreflect.MessageDescriptor { - return md_Aliases +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_Aliases) Type() protoreflect.MessageType { - return _fastReflection_Aliases_messageType +func (x *fastReflection_Account) Type() protoreflect.MessageType { + return _fastReflection_Account_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Aliases) New() protoreflect.Message { - return new(fastReflection_Aliases) +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_Aliases) Interface() protoreflect.ProtoMessage { - return (*Aliases)(x) +func (x *fastReflection_Account) Interface() protoreflect.ProtoMessage { + return (*Account)(x) } // Range iterates over every populated field in an undefined order, @@ -97,9 +161,10 @@ func (x *fastReflection_Aliases) 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_Aliases) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_Account) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Id != "" { value := protoreflect.ValueOfString(x.Id) + if !f(fd_Account_id, value) { if !f(fd_Aliases_id, value) { return } @@ -118,13 +183,43 @@ func (x *fastReflection_Aliases) Range(f func(protoreflect.FieldDescriptor, prot } if x.Controller != "" { value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Aliases_controller, value) { + if !f(fd_Account_controller, value) { return } } - if x.Expiration != uint64(0) { - value := protoreflect.ValueOfUint64(x.Expiration) - if !f(fd_Aliases_expiration, value) { + if x.PublicKey != nil { + value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) + if !f(fd_Account_public_key, value) { + return + } + } + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_Account_address, value) { + return + } + } + if x.Label != "" { + value := protoreflect.ValueOfString(x.Label) + if !f(fd_Account_label, value) { + return + } + } + if x.ChainCode != uint32(0) { + value := protoreflect.ValueOfUint32(x.ChainCode) + if !f(fd_Account_chain_code, value) { + return + } + } + if x.Index != uint32(0) { + value := protoreflect.ValueOfUint32(x.Index) + if !f(fd_Account_index, value) { + return + } + } + if len(x.Chains) != 0 { + value := protoreflect.ValueOfList(&_Account_8_list{list: &x.Chains}) + if !f(fd_Account_chains, value) { return } } @@ -141,23 +236,34 @@ func (x *fastReflection_Aliases) Range(f func(protoreflect.FieldDescriptor, prot // 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_Aliases) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Account) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Aliases.id": + case "did.v1.Account.id": return x.Id != "" + case "did.v1.Account.controller": case "did.v1.Aliases.origin": return x.Origin != "" case "did.v1.Aliases.subject": return x.Subject != "" case "did.v1.Aliases.controller": return x.Controller != "" - case "did.v1.Aliases.expiration": - return x.Expiration != uint64(0) + case "did.v1.Account.public_key": + return x.PublicKey != nil + case "did.v1.Account.address": + return x.Address != "" + case "did.v1.Account.label": + return x.Label != "" + case "did.v1.Account.chain_code": + return x.ChainCode != uint32(0) + case "did.v1.Account.index": + return x.Index != uint32(0) + case "did.v1.Account.chains": + return len(x.Chains) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) } - panic(fmt.Errorf("message did.v1.Aliases does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Account does not contain field %s", fd.FullName())) } } @@ -167,23 +273,34 @@ func (x *fastReflection_Aliases) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Aliases) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Account) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Aliases.id": + case "did.v1.Account.id": x.Id = "" + case "did.v1.Account.controller": case "did.v1.Aliases.origin": x.Origin = "" case "did.v1.Aliases.subject": x.Subject = "" case "did.v1.Aliases.controller": x.Controller = "" - case "did.v1.Aliases.expiration": - x.Expiration = uint64(0) + case "did.v1.Account.public_key": + x.PublicKey = nil + case "did.v1.Account.address": + x.Address = "" + case "did.v1.Account.label": + x.Label = "" + case "did.v1.Account.chain_code": + x.ChainCode = uint32(0) + case "did.v1.Account.index": + x.Index = uint32(0) + case "did.v1.Account.chains": + x.Chains = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) } - panic(fmt.Errorf("message did.v1.Aliases does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Account does not contain field %s", fd.FullName())) } } @@ -193,11 +310,12 @@ func (x *fastReflection_Aliases) 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_Aliases) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Account) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Aliases.id": + case "did.v1.Account.id": value := x.Id return protoreflect.ValueOfString(value) + case "did.v1.Account.controller": case "did.v1.Aliases.origin": value := x.Origin return protoreflect.ValueOfString(value) @@ -207,14 +325,32 @@ func (x *fastReflection_Aliases) Get(descriptor protoreflect.FieldDescriptor) pr case "did.v1.Aliases.controller": value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.Aliases.expiration": - value := x.Expiration - return protoreflect.ValueOfUint64(value) + case "did.v1.Account.public_key": + value := x.PublicKey + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.Account.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "did.v1.Account.label": + value := x.Label + return protoreflect.ValueOfString(value) + case "did.v1.Account.chain_code": + value := x.ChainCode + return protoreflect.ValueOfUint32(value) + case "did.v1.Account.index": + value := x.Index + return protoreflect.ValueOfUint32(value) + case "did.v1.Account.chains": + if len(x.Chains) == 0 { + return protoreflect.ValueOfList(&_Account_8_list{}) + } + listValue := &_Account_8_list{list: &x.Chains} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) } - panic(fmt.Errorf("message did.v1.Aliases does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.Account does not contain field %s", descriptor.FullName())) } } @@ -228,23 +364,36 @@ func (x *fastReflection_Aliases) Get(descriptor protoreflect.FieldDescriptor) pr // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Aliases) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Account) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Aliases.id": + case "did.v1.Account.id": x.Id = value.Interface().(string) + case "did.v1.Account.controller": case "did.v1.Aliases.origin": x.Origin = value.Interface().(string) case "did.v1.Aliases.subject": x.Subject = value.Interface().(string) case "did.v1.Aliases.controller": x.Controller = value.Interface().(string) - case "did.v1.Aliases.expiration": - x.Expiration = value.Uint() + case "did.v1.Account.public_key": + x.PublicKey = value.Message().Interface().(*PubKey) + case "did.v1.Account.address": + x.Address = value.Interface().(string) + case "did.v1.Account.label": + x.Label = value.Interface().(string) + case "did.v1.Account.chain_code": + x.ChainCode = uint32(value.Uint()) + case "did.v1.Account.index": + x.Index = uint32(value.Uint()) + case "did.v1.Account.chains": + lv := value.List() + clv := lv.(*_Account_8_list) + x.Chains = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) } - panic(fmt.Errorf("message did.v1.Aliases does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Account does not contain field %s", fd.FullName())) } } @@ -258,8 +407,31 @@ func (x *fastReflection_Aliases) Set(fd protoreflect.FieldDescriptor, value prot // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Aliases) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Account) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.Account.public_key": + if x.PublicKey == nil { + x.PublicKey = new(PubKey) + } + return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) + case "did.v1.Account.chains": + if x.Chains == nil { + x.Chains = []string{} + } + value := &_Account_8_list{list: &x.Chains} + return protoreflect.ValueOfList(value) + case "did.v1.Account.id": + panic(fmt.Errorf("field id of message did.v1.Account is not mutable")) + case "did.v1.Account.controller": + panic(fmt.Errorf("field controller of message did.v1.Account is not mutable")) + case "did.v1.Account.address": + panic(fmt.Errorf("field address of message did.v1.Account is not mutable")) + case "did.v1.Account.label": + panic(fmt.Errorf("field label of message did.v1.Account is not mutable")) + case "did.v1.Account.chain_code": + panic(fmt.Errorf("field chain_code of message did.v1.Account is not mutable")) + case "did.v1.Account.index": + panic(fmt.Errorf("field index of message did.v1.Account is not mutable")) case "did.v1.Aliases.id": panic(fmt.Errorf("field id of message did.v1.Aliases is not mutable")) case "did.v1.Aliases.origin": @@ -272,42 +444,51 @@ func (x *fastReflection_Aliases) Mutable(fd protoreflect.FieldDescriptor) protor panic(fmt.Errorf("field expiration of message did.v1.Aliases is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) } - panic(fmt.Errorf("message did.v1.Aliases does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.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_Aliases) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Account) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Aliases.id": + case "did.v1.Account.id": return protoreflect.ValueOfString("") - case "did.v1.Aliases.origin": + case "did.v1.Account.controller": return protoreflect.ValueOfString("") + case "did.v1.Account.public_key": + m := new(PubKey) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.Account.address": case "did.v1.Aliases.subject": return protoreflect.ValueOfString("") - case "did.v1.Aliases.controller": + case "did.v1.Account.label": return protoreflect.ValueOfString("") - case "did.v1.Aliases.expiration": - return protoreflect.ValueOfUint64(uint64(0)) + case "did.v1.Account.chain_code": + return protoreflect.ValueOfUint32(uint32(0)) + case "did.v1.Account.index": + return protoreflect.ValueOfUint32(uint32(0)) + case "did.v1.Account.chains": + list := []string{} + return protoreflect.ValueOfList(&_Account_8_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Aliases")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Account")) } - panic(fmt.Errorf("message did.v1.Aliases does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.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_Aliases) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Account) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Aliases", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.Account", d.FullName())) } panic("unreachable") } @@ -315,7 +496,7 @@ func (x *fastReflection_Aliases) WhichOneof(d protoreflect.OneofDescriptor) prot // 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_Aliases) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Account) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -326,7 +507,7 @@ func (x *fastReflection_Aliases) 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_Aliases) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Account) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -338,7 +519,7 @@ func (x *fastReflection_Aliases) SetUnknown(fields protoreflect.RawFields) { // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_Aliases) IsValid() bool { +func (x *fastReflection_Account) IsValid() bool { return x != nil } @@ -348,9 +529,9 @@ func (x *fastReflection_Aliases) 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_Aliases) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Account) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Aliases) + x := input.Message.Interface().(*Account) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -378,8 +559,29 @@ func (x *fastReflection_Aliases) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Expiration != 0 { - n += 1 + runtime.Sov(uint64(x.Expiration)) + if x.PublicKey != nil { + l = options.Size(x.PublicKey) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Label) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ChainCode != 0 { + n += 1 + runtime.Sov(uint64(x.ChainCode)) + } + if x.Index != 0 { + n += 1 + runtime.Sov(uint64(x.Index)) + } + if len(x.Chains) > 0 { + for _, s := range x.Chains { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -391,7 +593,7 @@ func (x *fastReflection_Aliases) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Aliases) + x := input.Message.Interface().(*Account) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -410,10 +612,52 @@ func (x *fastReflection_Aliases) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Expiration != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Expiration)) + if len(x.Chains) > 0 { + for iNdEx := len(x.Chains) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Chains[iNdEx]) + copy(dAtA[i:], x.Chains[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Chains[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if x.Index != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Index)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x38 + } + if x.ChainCode != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ChainCode)) + i-- + dAtA[i] = 0x30 + } + if len(x.Label) > 0 { + i -= len(x.Label) + copy(dAtA[i:], x.Label) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Label))) + i-- + dAtA[i] = 0x2a + } + 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] = 0x22 + } + if x.PublicKey != nil { + encoded, err := options.Marshal(x.PublicKey) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a } if len(x.Controller) > 0 { i -= len(x.Controller) @@ -454,7 +698,7 @@ func (x *fastReflection_Aliases) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Aliases) + x := input.Message.Interface().(*Account) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -486,10 +730,10 @@ func (x *fastReflection_Aliases) 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: Aliases: wiretype end group for non-group") + 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: Aliases: illegal tag %d (wire type %d)", fieldNum, wire) + 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: @@ -620,787 +864,9 @@ func (x *fastReflection_Aliases) ProtoMethods() *protoiface.Methods { } x.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) - } - x.Expiration = 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.Expiration |= 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 _ protoreflect.Map = (*_Assertion_4_map)(nil) - -type _Assertion_4_map struct { - m *map[string]string -} - -func (x *_Assertion_4_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_Assertion_4_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 *_Assertion_4_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 *_Assertion_4_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_Assertion_4_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 *_Assertion_4_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 *_Assertion_4_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 *_Assertion_4_map) NewValue() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Assertion_4_map) IsValid() bool { - return x.m != nil -} - -var ( - md_Assertion protoreflect.MessageDescriptor - fd_Assertion_id protoreflect.FieldDescriptor - fd_Assertion_key_type protoreflect.FieldDescriptor - fd_Assertion_credential protoreflect.FieldDescriptor - fd_Assertion_metadata protoreflect.FieldDescriptor - fd_Assertion_controller protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_state_proto_init() - md_Assertion = File_did_v1_state_proto.Messages().ByName("Assertion") - fd_Assertion_id = md_Assertion.Fields().ByName("id") - fd_Assertion_key_type = md_Assertion.Fields().ByName("key_type") - fd_Assertion_credential = md_Assertion.Fields().ByName("credential") - fd_Assertion_metadata = md_Assertion.Fields().ByName("metadata") - fd_Assertion_controller = md_Assertion.Fields().ByName("controller") -} - -var _ protoreflect.Message = (*fastReflection_Assertion)(nil) - -type fastReflection_Assertion Assertion - -func (x *Assertion) ProtoReflect() protoreflect.Message { - return (*fastReflection_Assertion)(x) -} - -func (x *Assertion) slowProtoReflect() protoreflect.Message { - mi := &file_did_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_Assertion_messageType fastReflection_Assertion_messageType -var _ protoreflect.MessageType = fastReflection_Assertion_messageType{} - -type fastReflection_Assertion_messageType struct{} - -func (x fastReflection_Assertion_messageType) Zero() protoreflect.Message { - return (*fastReflection_Assertion)(nil) -} -func (x fastReflection_Assertion_messageType) New() protoreflect.Message { - return new(fastReflection_Assertion) -} -func (x fastReflection_Assertion_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Assertion -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Assertion) Descriptor() protoreflect.MessageDescriptor { - return md_Assertion -} - -// 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_Assertion) Type() protoreflect.MessageType { - return _fastReflection_Assertion_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Assertion) New() protoreflect.Message { - return new(fastReflection_Assertion) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Assertion) Interface() protoreflect.ProtoMessage { - return (*Assertion)(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_Assertion) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Assertion_id, value) { - return - } - } - if x.KeyType != "" { - value := protoreflect.ValueOfString(x.KeyType) - if !f(fd_Assertion_key_type, value) { - return - } - } - if len(x.Credential) != 0 { - value := protoreflect.ValueOfBytes(x.Credential) - if !f(fd_Assertion_credential, value) { - return - } - } - if len(x.Metadata) != 0 { - value := protoreflect.ValueOfMap(&_Assertion_4_map{m: &x.Metadata}) - if !f(fd_Assertion_metadata, value) { - return - } - } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Assertion_controller, 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_Assertion) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Assertion.id": - return x.Id != "" - case "did.v1.Assertion.key_type": - return x.KeyType != "" - case "did.v1.Assertion.credential": - return len(x.Credential) != 0 - case "did.v1.Assertion.metadata": - return len(x.Metadata) != 0 - case "did.v1.Assertion.controller": - return x.Controller != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) - } - panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Assertion.id": - x.Id = "" - case "did.v1.Assertion.key_type": - x.KeyType = "" - case "did.v1.Assertion.credential": - x.Credential = nil - case "did.v1.Assertion.metadata": - x.Metadata = nil - case "did.v1.Assertion.controller": - x.Controller = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) - } - panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Assertion.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "did.v1.Assertion.key_type": - value := x.KeyType - return protoreflect.ValueOfString(value) - case "did.v1.Assertion.credential": - value := x.Credential - return protoreflect.ValueOfBytes(value) - case "did.v1.Assertion.metadata": - if len(x.Metadata) == 0 { - return protoreflect.ValueOfMap(&_Assertion_4_map{}) - } - mapValue := &_Assertion_4_map{m: &x.Metadata} - return protoreflect.ValueOfMap(mapValue) - case "did.v1.Assertion.controller": - value := x.Controller - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) - } - panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Assertion.id": - x.Id = value.Interface().(string) - case "did.v1.Assertion.key_type": - x.KeyType = value.Interface().(string) - case "did.v1.Assertion.credential": - x.Credential = value.Bytes() - case "did.v1.Assertion.metadata": - mv := value.Map() - cmv := mv.(*_Assertion_4_map) - x.Metadata = *cmv.m - case "did.v1.Assertion.controller": - x.Controller = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) - } - panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Assertion.metadata": - if x.Metadata == nil { - x.Metadata = make(map[string]string) - } - value := &_Assertion_4_map{m: &x.Metadata} - return protoreflect.ValueOfMap(value) - case "did.v1.Assertion.id": - panic(fmt.Errorf("field id of message did.v1.Assertion is not mutable")) - case "did.v1.Assertion.key_type": - panic(fmt.Errorf("field key_type of message did.v1.Assertion is not mutable")) - case "did.v1.Assertion.credential": - panic(fmt.Errorf("field credential of message did.v1.Assertion is not mutable")) - case "did.v1.Assertion.controller": - panic(fmt.Errorf("field controller of message did.v1.Assertion is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) - } - panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Assertion.id": - return protoreflect.ValueOfString("") - case "did.v1.Assertion.key_type": - return protoreflect.ValueOfString("") - case "did.v1.Assertion.credential": - return protoreflect.ValueOfBytes(nil) - case "did.v1.Assertion.metadata": - m := make(map[string]string) - return protoreflect.ValueOfMap(&_Assertion_4_map{m: &m}) - case "did.v1.Assertion.controller": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Assertion")) - } - panic(fmt.Errorf("message did.v1.Assertion 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_Assertion) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Assertion", 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_Assertion) 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_Assertion) 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_Assertion) 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_Assertion) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Assertion) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Id) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.KeyType) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Credential) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Metadata) > 0 { - SiZeMaP := func(k string, v string) { - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v))) - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.Metadata)) - for k := range x.Metadata { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Metadata[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Metadata { - SiZeMaP(k, v) - } - } - } - l = len(x.Controller) - 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().(*Assertion) - 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.Controller) > 0 { - i -= len(x.Controller) - copy(dAtA[i:], x.Controller) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) - i-- - dAtA[i] = 0x2a - } - if len(x.Metadata) > 0 { - MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForMetadata := make([]string, 0, len(x.Metadata)) - for k := range x.Metadata { - keysForMetadata = append(keysForMetadata, string(k)) - } - sort.Slice(keysForMetadata, func(i, j int) bool { - return keysForMetadata[i] < keysForMetadata[j] - }) - for iNdEx := len(keysForMetadata) - 1; iNdEx >= 0; iNdEx-- { - v := x.Metadata[string(keysForMetadata[iNdEx])] - out, err := MaRsHaLmAp(keysForMetadata[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Metadata { - v := x.Metadata[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - if len(x.Credential) > 0 { - i -= len(x.Credential) - copy(dAtA[i:], x.Credential) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Credential))) - 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.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Assertion) - 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: Assertion: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Assertion: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field 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 Credential", 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.Credential = append(x.Credential[:0], dAtA[iNdEx:postIndex]...) - if x.Credential == nil { - x.Credential = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1427,751 +893,16 @@ func (x *fastReflection_Assertion) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Metadata == nil { - x.Metadata = make(map[string]string) + if x.PublicKey == nil { + x.PublicKey = &PubKey{} } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapkey > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapvalue > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - x.Metadata[mapkey] = mapvalue - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Controller = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); 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_Attestation protoreflect.MessageDescriptor - fd_Attestation_id protoreflect.FieldDescriptor - fd_Attestation_key_type protoreflect.FieldDescriptor - fd_Attestation_value protoreflect.FieldDescriptor - fd_Attestation_proof protoreflect.FieldDescriptor - fd_Attestation_controller protoreflect.FieldDescriptor -) - -func init() { - file_did_v1_state_proto_init() - md_Attestation = File_did_v1_state_proto.Messages().ByName("Attestation") - fd_Attestation_id = md_Attestation.Fields().ByName("id") - fd_Attestation_key_type = md_Attestation.Fields().ByName("key_type") - fd_Attestation_value = md_Attestation.Fields().ByName("value") - fd_Attestation_proof = md_Attestation.Fields().ByName("proof") - fd_Attestation_controller = md_Attestation.Fields().ByName("controller") -} - -var _ protoreflect.Message = (*fastReflection_Attestation)(nil) - -type fastReflection_Attestation Attestation - -func (x *Attestation) ProtoReflect() protoreflect.Message { - return (*fastReflection_Attestation)(x) -} - -func (x *Attestation) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Attestation_messageType fastReflection_Attestation_messageType -var _ protoreflect.MessageType = fastReflection_Attestation_messageType{} - -type fastReflection_Attestation_messageType struct{} - -func (x fastReflection_Attestation_messageType) Zero() protoreflect.Message { - return (*fastReflection_Attestation)(nil) -} -func (x fastReflection_Attestation_messageType) New() protoreflect.Message { - return new(fastReflection_Attestation) -} -func (x fastReflection_Attestation_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Attestation -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Attestation) Descriptor() protoreflect.MessageDescriptor { - return md_Attestation -} - -// 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_Attestation) Type() protoreflect.MessageType { - return _fastReflection_Attestation_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Attestation) New() protoreflect.Message { - return new(fastReflection_Attestation) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Attestation) Interface() protoreflect.ProtoMessage { - return (*Attestation)(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_Attestation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Attestation_id, value) { - return - } - } - if x.KeyType != "" { - value := protoreflect.ValueOfString(x.KeyType) - if !f(fd_Attestation_key_type, value) { - return - } - } - if x.Value != "" { - value := protoreflect.ValueOfString(x.Value) - if !f(fd_Attestation_value, value) { - return - } - } - if x.Proof != "" { - value := protoreflect.ValueOfString(x.Proof) - if !f(fd_Attestation_proof, value) { - return - } - } - if x.Controller != "" { - value := protoreflect.ValueOfString(x.Controller) - if !f(fd_Attestation_controller, 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_Attestation) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "did.v1.Attestation.id": - return x.Id != "" - case "did.v1.Attestation.key_type": - return x.KeyType != "" - case "did.v1.Attestation.value": - return x.Value != "" - case "did.v1.Attestation.proof": - return x.Proof != "" - case "did.v1.Attestation.controller": - return x.Controller != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) - } - panic(fmt.Errorf("message did.v1.Attestation 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_Attestation) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "did.v1.Attestation.id": - x.Id = "" - case "did.v1.Attestation.key_type": - x.KeyType = "" - case "did.v1.Attestation.value": - x.Value = "" - case "did.v1.Attestation.proof": - x.Proof = "" - case "did.v1.Attestation.controller": - x.Controller = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) - } - panic(fmt.Errorf("message did.v1.Attestation 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_Attestation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "did.v1.Attestation.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "did.v1.Attestation.key_type": - value := x.KeyType - return protoreflect.ValueOfString(value) - case "did.v1.Attestation.value": - value := x.Value - return protoreflect.ValueOfString(value) - case "did.v1.Attestation.proof": - value := x.Proof - return protoreflect.ValueOfString(value) - case "did.v1.Attestation.controller": - value := x.Controller - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) - } - panic(fmt.Errorf("message did.v1.Attestation 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_Attestation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "did.v1.Attestation.id": - x.Id = value.Interface().(string) - case "did.v1.Attestation.key_type": - x.KeyType = value.Interface().(string) - case "did.v1.Attestation.value": - x.Value = value.Interface().(string) - case "did.v1.Attestation.proof": - x.Proof = value.Interface().(string) - case "did.v1.Attestation.controller": - x.Controller = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) - } - panic(fmt.Errorf("message did.v1.Attestation 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_Attestation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Attestation.id": - panic(fmt.Errorf("field id of message did.v1.Attestation is not mutable")) - case "did.v1.Attestation.key_type": - panic(fmt.Errorf("field key_type of message did.v1.Attestation is not mutable")) - case "did.v1.Attestation.value": - panic(fmt.Errorf("field value of message did.v1.Attestation is not mutable")) - case "did.v1.Attestation.proof": - panic(fmt.Errorf("field proof of message did.v1.Attestation is not mutable")) - case "did.v1.Attestation.controller": - panic(fmt.Errorf("field controller of message did.v1.Attestation is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) - } - panic(fmt.Errorf("message did.v1.Attestation 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_Attestation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "did.v1.Attestation.id": - return protoreflect.ValueOfString("") - case "did.v1.Attestation.key_type": - return protoreflect.ValueOfString("") - case "did.v1.Attestation.value": - return protoreflect.ValueOfString("") - case "did.v1.Attestation.proof": - return protoreflect.ValueOfString("") - case "did.v1.Attestation.controller": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Attestation")) - } - panic(fmt.Errorf("message did.v1.Attestation 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_Attestation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Attestation", 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_Attestation) 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_Attestation) 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_Attestation) 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_Attestation) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Attestation) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Id) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.KeyType) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Value) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Proof) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Controller) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if 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().(*Attestation) - 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.Controller) > 0 { - i -= len(x.Controller) - copy(dAtA[i:], x.Controller) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) - i-- - dAtA[i] = 0x2a - } - if len(x.Proof) > 0 { - i -= len(x.Proof) - copy(dAtA[i:], x.Proof) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Proof))) - i-- - dAtA[i] = 0x22 - } - if len(x.Value) > 0 { - i -= len(x.Value) - copy(dAtA[i:], x.Value) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) - 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.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Attestation) - 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: Attestation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Attestation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field 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 Value", 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.Value = 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 Proof", wireType) + 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 { @@ -2199,11 +930,11 @@ func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Proof = string(dAtA[iNdEx:postIndex]) + x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2231,7 +962,77 @@ func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Controller = string(dAtA[iNdEx:postIndex]) + x.Label = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainCode", wireType) + } + x.ChainCode = 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.ChainCode |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + 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 |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Chains", 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.Chains = append(x.Chains, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -2268,23 +1069,127 @@ func (x *fastReflection_Attestation) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_Controller_3_list)(nil) + +type _Controller_3_list struct { + list *[]*Alias +} + +func (x *_Controller_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Controller_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Controller_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Alias) + (*x.list)[i] = concreteValue +} + +func (x *_Controller_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Alias) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Controller_3_list) AppendMutable() protoreflect.Value { + v := new(Alias) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Controller_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Controller_3_list) NewElement() protoreflect.Value { + v := new(Alias) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Controller_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Controller_6_list)(nil) + +type _Controller_6_list struct { + list *[]*Credential +} + +func (x *_Controller_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Controller_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Controller_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Credential) + (*x.list)[i] = concreteValue +} + +func (x *_Controller_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Credential) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Controller_6_list) AppendMutable() protoreflect.Value { + v := new(Credential) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Controller_6_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Controller_6_list) NewElement() protoreflect.Value { + v := new(Credential) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Controller_6_list) IsValid() bool { + return x.list != nil +} + var ( - md_Controller protoreflect.MessageDescriptor - fd_Controller_id protoreflect.FieldDescriptor - fd_Controller_did protoreflect.FieldDescriptor - fd_Controller_public_key_multibase protoreflect.FieldDescriptor - fd_Controller_vault_cid protoreflect.FieldDescriptor - fd_Controller_fingerprint protoreflect.FieldDescriptor + md_Controller protoreflect.MessageDescriptor + fd_Controller_id protoreflect.FieldDescriptor + fd_Controller_address protoreflect.FieldDescriptor + fd_Controller_aliases protoreflect.FieldDescriptor + fd_Controller_public_key protoreflect.FieldDescriptor + fd_Controller_vault_cid protoreflect.FieldDescriptor + fd_Controller_authentication protoreflect.FieldDescriptor ) func init() { file_did_v1_state_proto_init() md_Controller = File_did_v1_state_proto.Messages().ByName("Controller") fd_Controller_id = md_Controller.Fields().ByName("id") - fd_Controller_did = md_Controller.Fields().ByName("did") - fd_Controller_public_key_multibase = md_Controller.Fields().ByName("public_key_multibase") + fd_Controller_address = md_Controller.Fields().ByName("address") + fd_Controller_aliases = md_Controller.Fields().ByName("aliases") + fd_Controller_public_key = md_Controller.Fields().ByName("public_key") fd_Controller_vault_cid = md_Controller.Fields().ByName("vault_cid") - fd_Controller_fingerprint = md_Controller.Fields().ByName("fingerprint") + fd_Controller_authentication = md_Controller.Fields().ByName("authentication") } var _ protoreflect.Message = (*fastReflection_Controller)(nil) @@ -2296,7 +1201,7 @@ func (x *Controller) ProtoReflect() protoreflect.Message { } func (x *Controller) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[3] + mi := &file_did_v1_state_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2358,15 +1263,21 @@ func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, p return } } - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_Controller_did, value) { + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_Controller_address, value) { return } } - if x.PublicKeyMultibase != "" { - value := protoreflect.ValueOfString(x.PublicKeyMultibase) - if !f(fd_Controller_public_key_multibase, value) { + if len(x.Aliases) != 0 { + value := protoreflect.ValueOfList(&_Controller_3_list{list: &x.Aliases}) + if !f(fd_Controller_aliases, value) { + return + } + } + if x.PublicKey != nil { + value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) + if !f(fd_Controller_public_key, value) { return } } @@ -2376,9 +1287,9 @@ func (x *fastReflection_Controller) Range(f func(protoreflect.FieldDescriptor, p return } } - if len(x.Fingerprint) != 0 { - value := protoreflect.ValueOfBytes(x.Fingerprint) - if !f(fd_Controller_fingerprint, value) { + if len(x.Authentication) != 0 { + value := protoreflect.ValueOfList(&_Controller_6_list{list: &x.Authentication}) + if !f(fd_Controller_authentication, value) { return } } @@ -2399,14 +1310,16 @@ func (x *fastReflection_Controller) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "did.v1.Controller.id": return x.Id != "" - case "did.v1.Controller.did": - return x.Did != "" - case "did.v1.Controller.public_key_multibase": - return x.PublicKeyMultibase != "" + case "did.v1.Controller.address": + return x.Address != "" + case "did.v1.Controller.aliases": + return len(x.Aliases) != 0 + case "did.v1.Controller.public_key": + return x.PublicKey != nil case "did.v1.Controller.vault_cid": return x.VaultCid != "" - case "did.v1.Controller.fingerprint": - return len(x.Fingerprint) != 0 + case "did.v1.Controller.authentication": + return len(x.Authentication) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -2425,14 +1338,16 @@ func (x *fastReflection_Controller) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.Controller.id": x.Id = "" - case "did.v1.Controller.did": - x.Did = "" - case "did.v1.Controller.public_key_multibase": - x.PublicKeyMultibase = "" + case "did.v1.Controller.address": + x.Address = "" + case "did.v1.Controller.aliases": + x.Aliases = nil + case "did.v1.Controller.public_key": + x.PublicKey = nil case "did.v1.Controller.vault_cid": x.VaultCid = "" - case "did.v1.Controller.fingerprint": - x.Fingerprint = nil + case "did.v1.Controller.authentication": + x.Authentication = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -2452,18 +1367,27 @@ func (x *fastReflection_Controller) Get(descriptor protoreflect.FieldDescriptor) case "did.v1.Controller.id": value := x.Id return protoreflect.ValueOfString(value) - case "did.v1.Controller.did": - value := x.Did - return protoreflect.ValueOfString(value) - case "did.v1.Controller.public_key_multibase": - value := x.PublicKeyMultibase + case "did.v1.Controller.address": + value := x.Address return protoreflect.ValueOfString(value) + case "did.v1.Controller.aliases": + if len(x.Aliases) == 0 { + return protoreflect.ValueOfList(&_Controller_3_list{}) + } + listValue := &_Controller_3_list{list: &x.Aliases} + return protoreflect.ValueOfList(listValue) + case "did.v1.Controller.public_key": + value := x.PublicKey + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "did.v1.Controller.vault_cid": value := x.VaultCid return protoreflect.ValueOfString(value) - case "did.v1.Controller.fingerprint": - value := x.Fingerprint - return protoreflect.ValueOfBytes(value) + case "did.v1.Controller.authentication": + if len(x.Authentication) == 0 { + return protoreflect.ValueOfList(&_Controller_6_list{}) + } + listValue := &_Controller_6_list{list: &x.Authentication} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -2486,14 +1410,20 @@ func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value p switch fd.FullName() { case "did.v1.Controller.id": x.Id = value.Interface().(string) - case "did.v1.Controller.did": - x.Did = value.Interface().(string) - case "did.v1.Controller.public_key_multibase": - x.PublicKeyMultibase = value.Interface().(string) + case "did.v1.Controller.address": + x.Address = value.Interface().(string) + case "did.v1.Controller.aliases": + lv := value.List() + clv := lv.(*_Controller_3_list) + x.Aliases = *clv.list + case "did.v1.Controller.public_key": + x.PublicKey = value.Message().Interface().(*PubKey) case "did.v1.Controller.vault_cid": x.VaultCid = value.Interface().(string) - case "did.v1.Controller.fingerprint": - x.Fingerprint = value.Bytes() + case "did.v1.Controller.authentication": + lv := value.List() + clv := lv.(*_Controller_6_list) + x.Authentication = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -2514,16 +1444,29 @@ func (x *fastReflection_Controller) Set(fd protoreflect.FieldDescriptor, value p // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Controller) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.Controller.aliases": + if x.Aliases == nil { + x.Aliases = []*Alias{} + } + value := &_Controller_3_list{list: &x.Aliases} + return protoreflect.ValueOfList(value) + case "did.v1.Controller.public_key": + if x.PublicKey == nil { + x.PublicKey = new(PubKey) + } + return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) + case "did.v1.Controller.authentication": + if x.Authentication == nil { + x.Authentication = []*Credential{} + } + value := &_Controller_6_list{list: &x.Authentication} + return protoreflect.ValueOfList(value) case "did.v1.Controller.id": panic(fmt.Errorf("field id of message did.v1.Controller is not mutable")) - case "did.v1.Controller.did": - panic(fmt.Errorf("field did of message did.v1.Controller is not mutable")) - case "did.v1.Controller.public_key_multibase": - panic(fmt.Errorf("field public_key_multibase of message did.v1.Controller is not mutable")) + case "did.v1.Controller.address": + panic(fmt.Errorf("field address of message did.v1.Controller is not mutable")) case "did.v1.Controller.vault_cid": panic(fmt.Errorf("field vault_cid of message did.v1.Controller is not mutable")) - case "did.v1.Controller.fingerprint": - panic(fmt.Errorf("field fingerprint of message did.v1.Controller is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -2539,14 +1482,19 @@ func (x *fastReflection_Controller) NewField(fd protoreflect.FieldDescriptor) pr switch fd.FullName() { case "did.v1.Controller.id": return protoreflect.ValueOfString("") - case "did.v1.Controller.did": - return protoreflect.ValueOfString("") - case "did.v1.Controller.public_key_multibase": + case "did.v1.Controller.address": return protoreflect.ValueOfString("") + case "did.v1.Controller.aliases": + list := []*Alias{} + return protoreflect.ValueOfList(&_Controller_3_list{list: &list}) + case "did.v1.Controller.public_key": + m := new(PubKey) + return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.Controller.vault_cid": return protoreflect.ValueOfString("") - case "did.v1.Controller.fingerprint": - return protoreflect.ValueOfBytes(nil) + case "did.v1.Controller.authentication": + list := []*Credential{} + return protoreflect.ValueOfList(&_Controller_6_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Controller")) @@ -2620,21 +1568,29 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Did) + l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.PublicKeyMultibase) - if l > 0 { + if len(x.Aliases) > 0 { + for _, e := range x.Aliases { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.PublicKey != nil { + l = options.Size(x.PublicKey) n += 1 + l + runtime.Sov(uint64(l)) } l = len(x.VaultCid) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Fingerprint) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.Authentication) > 0 { + for _, e := range x.Authentication { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -2665,31 +1621,63 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Fingerprint) > 0 { - i -= len(x.Fingerprint) - copy(dAtA[i:], x.Fingerprint) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Fingerprint))) - i-- - dAtA[i] = 0x2a + if len(x.Authentication) > 0 { + for iNdEx := len(x.Authentication) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Authentication[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] = 0x32 + } } if len(x.VaultCid) > 0 { i -= len(x.VaultCid) copy(dAtA[i:], x.VaultCid) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.VaultCid))) i-- + dAtA[i] = 0x2a + } + if x.PublicKey != nil { + encoded, err := options.Marshal(x.PublicKey) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- dAtA[i] = 0x22 } - if len(x.PublicKeyMultibase) > 0 { - i -= len(x.PublicKeyMultibase) - copy(dAtA[i:], x.PublicKeyMultibase) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKeyMultibase))) - i-- - dAtA[i] = 0x1a + if len(x.Aliases) > 0 { + for iNdEx := len(x.Aliases) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Aliases[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } } - if len(x.Did) > 0 { - i -= len(x.Did) - copy(dAtA[i:], x.Did) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + 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 } @@ -2783,7 +1771,7 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + 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 { @@ -2811,13 +1799,13 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Did = string(dAtA[iNdEx:postIndex]) + x.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 PublicKeyMultibase", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2827,25 +1815,63 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.PublicKeyMultibase = string(dAtA[iNdEx:postIndex]) + x.Aliases = append(x.Aliases, &Alias{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Aliases[len(x.Aliases)-1]); 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 PublicKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.PublicKey == nil { + x.PublicKey = &PubKey{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VaultCid", wireType) } @@ -2877,11 +1903,11 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } x.VaultCid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Fingerprint", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2891,24 +1917,24 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + 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.Fingerprint = append(x.Fingerprint[:0], dAtA[iNdEx:postIndex]...) - if x.Fingerprint == nil { - x.Fingerprint = []byte{} + x.Authentication = append(x.Authentication, &Credential{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Authentication[len(x.Authentication)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex default: @@ -2946,123 +1972,37 @@ func (x *fastReflection_Controller) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.Map = (*_Delegation_7_map)(nil) - -type _Delegation_7_map struct { - m *map[string]string -} - -func (x *_Delegation_7_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_Delegation_7_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 *_Delegation_7_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 *_Delegation_7_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_Delegation_7_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 *_Delegation_7_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 *_Delegation_7_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 *_Delegation_7_map) NewValue() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Delegation_7_map) IsValid() bool { - return x.m != nil -} - var ( - md_Delegation protoreflect.MessageDescriptor - fd_Delegation_id protoreflect.FieldDescriptor - fd_Delegation_did protoreflect.FieldDescriptor - fd_Delegation_chain_type protoreflect.FieldDescriptor - fd_Delegation_chain_address protoreflect.FieldDescriptor - fd_Delegation_controller_did protoreflect.FieldDescriptor - fd_Delegation_public_key_multibase protoreflect.FieldDescriptor - fd_Delegation_public_key_jwks protoreflect.FieldDescriptor - fd_Delegation_channel_id protoreflect.FieldDescriptor + md_Proof protoreflect.MessageDescriptor + fd_Proof_id protoreflect.FieldDescriptor + fd_Proof_controller protoreflect.FieldDescriptor + fd_Proof_issuer protoreflect.FieldDescriptor + fd_Proof_property protoreflect.FieldDescriptor + fd_Proof_accumulator protoreflect.FieldDescriptor + fd_Proof_key protoreflect.FieldDescriptor ) func init() { file_did_v1_state_proto_init() - md_Delegation = File_did_v1_state_proto.Messages().ByName("Delegation") - fd_Delegation_id = md_Delegation.Fields().ByName("id") - fd_Delegation_did = md_Delegation.Fields().ByName("did") - fd_Delegation_chain_type = md_Delegation.Fields().ByName("chain_type") - fd_Delegation_chain_address = md_Delegation.Fields().ByName("chain_address") - fd_Delegation_controller_did = md_Delegation.Fields().ByName("controller_did") - fd_Delegation_public_key_multibase = md_Delegation.Fields().ByName("public_key_multibase") - fd_Delegation_public_key_jwks = md_Delegation.Fields().ByName("public_key_jwks") - fd_Delegation_channel_id = md_Delegation.Fields().ByName("channel_id") + md_Proof = File_did_v1_state_proto.Messages().ByName("Proof") + fd_Proof_id = md_Proof.Fields().ByName("id") + fd_Proof_controller = md_Proof.Fields().ByName("controller") + fd_Proof_issuer = md_Proof.Fields().ByName("issuer") + fd_Proof_property = md_Proof.Fields().ByName("property") + fd_Proof_accumulator = md_Proof.Fields().ByName("accumulator") + fd_Proof_key = md_Proof.Fields().ByName("key") } -var _ protoreflect.Message = (*fastReflection_Delegation)(nil) +var _ protoreflect.Message = (*fastReflection_Proof)(nil) -type fastReflection_Delegation Delegation +type fastReflection_Proof Proof -func (x *Delegation) ProtoReflect() protoreflect.Message { - return (*fastReflection_Delegation)(x) +func (x *Proof) ProtoReflect() protoreflect.Message { + return (*fastReflection_Proof)(x) } -func (x *Delegation) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[4] +func (x *Proof) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_state_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3073,43 +2013,43 @@ func (x *Delegation) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Delegation_messageType fastReflection_Delegation_messageType -var _ protoreflect.MessageType = fastReflection_Delegation_messageType{} +var _fastReflection_Proof_messageType fastReflection_Proof_messageType +var _ protoreflect.MessageType = fastReflection_Proof_messageType{} -type fastReflection_Delegation_messageType struct{} +type fastReflection_Proof_messageType struct{} -func (x fastReflection_Delegation_messageType) Zero() protoreflect.Message { - return (*fastReflection_Delegation)(nil) +func (x fastReflection_Proof_messageType) Zero() protoreflect.Message { + return (*fastReflection_Proof)(nil) } -func (x fastReflection_Delegation_messageType) New() protoreflect.Message { - return new(fastReflection_Delegation) +func (x fastReflection_Proof_messageType) New() protoreflect.Message { + return new(fastReflection_Proof) } -func (x fastReflection_Delegation_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Delegation +func (x fastReflection_Proof_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Proof } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Delegation) Descriptor() protoreflect.MessageDescriptor { - return md_Delegation +func (x *fastReflection_Proof) Descriptor() protoreflect.MessageDescriptor { + return md_Proof } // 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_Delegation) Type() protoreflect.MessageType { - return _fastReflection_Delegation_messageType +func (x *fastReflection_Proof) Type() protoreflect.MessageType { + return _fastReflection_Proof_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Delegation) New() protoreflect.Message { - return new(fastReflection_Delegation) +func (x *fastReflection_Proof) New() protoreflect.Message { + return new(fastReflection_Proof) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Delegation) Interface() protoreflect.ProtoMessage { - return (*Delegation)(x) +func (x *fastReflection_Proof) Interface() protoreflect.ProtoMessage { + return (*Proof)(x) } // Range iterates over every populated field in an undefined order, @@ -3117,52 +2057,40 @@ func (x *fastReflection_Delegation) 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_Delegation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_Proof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Id != "" { value := protoreflect.ValueOfString(x.Id) - if !f(fd_Delegation_id, value) { + if !f(fd_Proof_id, value) { return } } - if x.Did != "" { - value := protoreflect.ValueOfString(x.Did) - if !f(fd_Delegation_did, value) { + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_Proof_controller, value) { return } } - if x.ChainType != "" { - value := protoreflect.ValueOfString(x.ChainType) - if !f(fd_Delegation_chain_type, value) { + if x.Issuer != "" { + value := protoreflect.ValueOfString(x.Issuer) + if !f(fd_Proof_issuer, value) { return } } - if x.ChainAddress != "" { - value := protoreflect.ValueOfString(x.ChainAddress) - if !f(fd_Delegation_chain_address, value) { + if x.Property != "" { + value := protoreflect.ValueOfString(x.Property) + if !f(fd_Proof_property, value) { return } } - if x.ControllerDid != "" { - value := protoreflect.ValueOfString(x.ControllerDid) - if !f(fd_Delegation_controller_did, value) { + if len(x.Accumulator) != 0 { + value := protoreflect.ValueOfBytes(x.Accumulator) + if !f(fd_Proof_accumulator, value) { return } } - if x.PublicKeyMultibase != "" { - value := protoreflect.ValueOfString(x.PublicKeyMultibase) - if !f(fd_Delegation_public_key_multibase, value) { - return - } - } - if len(x.PublicKeyJwks) != 0 { - value := protoreflect.ValueOfMap(&_Delegation_7_map{m: &x.PublicKeyJwks}) - if !f(fd_Delegation_public_key_jwks, value) { - return - } - } - if x.ChannelId != uint64(0) { - value := protoreflect.ValueOfUint64(x.ChannelId) - if !f(fd_Delegation_channel_id, value) { + if len(x.Key) != 0 { + value := protoreflect.ValueOfBytes(x.Key) + if !f(fd_Proof_key, value) { return } } @@ -3179,29 +2107,25 @@ func (x *fastReflection_Delegation) Range(f func(protoreflect.FieldDescriptor, p // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_Delegation) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Proof) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Delegation.id": + case "did.v1.Proof.id": return x.Id != "" - case "did.v1.Delegation.did": - return x.Did != "" - case "did.v1.Delegation.chain_type": - return x.ChainType != "" - case "did.v1.Delegation.chain_address": - return x.ChainAddress != "" - case "did.v1.Delegation.controller_did": - return x.ControllerDid != "" - case "did.v1.Delegation.public_key_multibase": - return x.PublicKeyMultibase != "" - case "did.v1.Delegation.public_key_jwks": - return len(x.PublicKeyJwks) != 0 - case "did.v1.Delegation.channel_id": - return x.ChannelId != uint64(0) + case "did.v1.Proof.controller": + return x.Controller != "" + case "did.v1.Proof.issuer": + return x.Issuer != "" + case "did.v1.Proof.property": + return x.Property != "" + case "did.v1.Proof.accumulator": + return len(x.Accumulator) != 0 + case "did.v1.Proof.key": + return len(x.Key) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Delegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) } - panic(fmt.Errorf("message did.v1.Delegation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Proof does not contain field %s", fd.FullName())) } } @@ -3211,29 +2135,25 @@ func (x *fastReflection_Delegation) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Delegation) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Proof) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Delegation.id": + case "did.v1.Proof.id": x.Id = "" - case "did.v1.Delegation.did": - x.Did = "" - case "did.v1.Delegation.chain_type": - x.ChainType = "" - case "did.v1.Delegation.chain_address": - x.ChainAddress = "" - case "did.v1.Delegation.controller_did": - x.ControllerDid = "" - case "did.v1.Delegation.public_key_multibase": - x.PublicKeyMultibase = "" - case "did.v1.Delegation.public_key_jwks": - x.PublicKeyJwks = nil - case "did.v1.Delegation.channel_id": - x.ChannelId = uint64(0) + case "did.v1.Proof.controller": + x.Controller = "" + case "did.v1.Proof.issuer": + x.Issuer = "" + case "did.v1.Proof.property": + x.Property = "" + case "did.v1.Proof.accumulator": + x.Accumulator = nil + case "did.v1.Proof.key": + x.Key = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Delegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) } - panic(fmt.Errorf("message did.v1.Delegation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Proof does not contain field %s", fd.FullName())) } } @@ -3243,40 +2163,31 @@ func (x *fastReflection_Delegation) 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_Delegation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Proof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Delegation.id": + case "did.v1.Proof.id": value := x.Id return protoreflect.ValueOfString(value) - case "did.v1.Delegation.did": - value := x.Did + case "did.v1.Proof.controller": + value := x.Controller return protoreflect.ValueOfString(value) - case "did.v1.Delegation.chain_type": - value := x.ChainType + case "did.v1.Proof.issuer": + value := x.Issuer return protoreflect.ValueOfString(value) - case "did.v1.Delegation.chain_address": - value := x.ChainAddress + case "did.v1.Proof.property": + value := x.Property return protoreflect.ValueOfString(value) - case "did.v1.Delegation.controller_did": - value := x.ControllerDid - return protoreflect.ValueOfString(value) - case "did.v1.Delegation.public_key_multibase": - value := x.PublicKeyMultibase - return protoreflect.ValueOfString(value) - case "did.v1.Delegation.public_key_jwks": - if len(x.PublicKeyJwks) == 0 { - return protoreflect.ValueOfMap(&_Delegation_7_map{}) - } - mapValue := &_Delegation_7_map{m: &x.PublicKeyJwks} - return protoreflect.ValueOfMap(mapValue) - case "did.v1.Delegation.channel_id": - value := x.ChannelId - return protoreflect.ValueOfUint64(value) + case "did.v1.Proof.accumulator": + value := x.Accumulator + return protoreflect.ValueOfBytes(value) + case "did.v1.Proof.key": + value := x.Key + return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Delegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) } - panic(fmt.Errorf("message did.v1.Delegation does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.Proof does not contain field %s", descriptor.FullName())) } } @@ -3290,31 +2201,25 @@ func (x *fastReflection_Delegation) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Delegation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Proof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Delegation.id": + case "did.v1.Proof.id": x.Id = value.Interface().(string) - case "did.v1.Delegation.did": - x.Did = value.Interface().(string) - case "did.v1.Delegation.chain_type": - x.ChainType = value.Interface().(string) - case "did.v1.Delegation.chain_address": - x.ChainAddress = value.Interface().(string) - case "did.v1.Delegation.controller_did": - x.ControllerDid = value.Interface().(string) - case "did.v1.Delegation.public_key_multibase": - x.PublicKeyMultibase = value.Interface().(string) - case "did.v1.Delegation.public_key_jwks": - mv := value.Map() - cmv := mv.(*_Delegation_7_map) - x.PublicKeyJwks = *cmv.m - case "did.v1.Delegation.channel_id": - x.ChannelId = value.Uint() + case "did.v1.Proof.controller": + x.Controller = value.Interface().(string) + case "did.v1.Proof.issuer": + x.Issuer = value.Interface().(string) + case "did.v1.Proof.property": + x.Property = value.Interface().(string) + case "did.v1.Proof.accumulator": + x.Accumulator = value.Bytes() + case "did.v1.Proof.key": + x.Key = value.Bytes() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Delegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) } - panic(fmt.Errorf("message did.v1.Delegation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Proof does not contain field %s", fd.FullName())) } } @@ -3328,73 +2233,60 @@ func (x *fastReflection_Delegation) Set(fd protoreflect.FieldDescriptor, value p // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Delegation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Proof) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Delegation.public_key_jwks": - if x.PublicKeyJwks == nil { - x.PublicKeyJwks = make(map[string]string) - } - value := &_Delegation_7_map{m: &x.PublicKeyJwks} - return protoreflect.ValueOfMap(value) - case "did.v1.Delegation.id": - panic(fmt.Errorf("field id of message did.v1.Delegation is not mutable")) - case "did.v1.Delegation.did": - panic(fmt.Errorf("field did of message did.v1.Delegation is not mutable")) - case "did.v1.Delegation.chain_type": - panic(fmt.Errorf("field chain_type of message did.v1.Delegation is not mutable")) - case "did.v1.Delegation.chain_address": - panic(fmt.Errorf("field chain_address of message did.v1.Delegation is not mutable")) - case "did.v1.Delegation.controller_did": - panic(fmt.Errorf("field controller_did of message did.v1.Delegation is not mutable")) - case "did.v1.Delegation.public_key_multibase": - panic(fmt.Errorf("field public_key_multibase of message did.v1.Delegation is not mutable")) - case "did.v1.Delegation.channel_id": - panic(fmt.Errorf("field channel_id of message did.v1.Delegation is not mutable")) + case "did.v1.Proof.id": + panic(fmt.Errorf("field id of message did.v1.Proof is not mutable")) + case "did.v1.Proof.controller": + panic(fmt.Errorf("field controller of message did.v1.Proof is not mutable")) + case "did.v1.Proof.issuer": + panic(fmt.Errorf("field issuer of message did.v1.Proof is not mutable")) + case "did.v1.Proof.property": + panic(fmt.Errorf("field property of message did.v1.Proof is not mutable")) + case "did.v1.Proof.accumulator": + panic(fmt.Errorf("field accumulator of message did.v1.Proof is not mutable")) + case "did.v1.Proof.key": + panic(fmt.Errorf("field key of message did.v1.Proof is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Delegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) } - panic(fmt.Errorf("message did.v1.Delegation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Proof 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_Delegation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Proof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Delegation.id": + case "did.v1.Proof.id": return protoreflect.ValueOfString("") - case "did.v1.Delegation.did": + case "did.v1.Proof.controller": return protoreflect.ValueOfString("") - case "did.v1.Delegation.chain_type": + case "did.v1.Proof.issuer": return protoreflect.ValueOfString("") - case "did.v1.Delegation.chain_address": + case "did.v1.Proof.property": return protoreflect.ValueOfString("") - case "did.v1.Delegation.controller_did": - return protoreflect.ValueOfString("") - case "did.v1.Delegation.public_key_multibase": - return protoreflect.ValueOfString("") - case "did.v1.Delegation.public_key_jwks": - m := make(map[string]string) - return protoreflect.ValueOfMap(&_Delegation_7_map{m: &m}) - case "did.v1.Delegation.channel_id": - return protoreflect.ValueOfUint64(uint64(0)) + case "did.v1.Proof.accumulator": + return protoreflect.ValueOfBytes(nil) + case "did.v1.Proof.key": + return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Delegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Proof")) } - panic(fmt.Errorf("message did.v1.Delegation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.Proof 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_Delegation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Proof) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Delegation", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.Proof", d.FullName())) } panic("unreachable") } @@ -3402,7 +2294,7 @@ func (x *fastReflection_Delegation) WhichOneof(d protoreflect.OneofDescriptor) p // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Delegation) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Proof) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -3413,7 +2305,7 @@ func (x *fastReflection_Delegation) 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_Delegation) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Proof) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -3425,7 +2317,7 @@ func (x *fastReflection_Delegation) SetUnknown(fields protoreflect.RawFields) { // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_Delegation) IsValid() bool { +func (x *fastReflection_Proof) IsValid() bool { return x != nil } @@ -3435,9 +2327,9 @@ func (x *fastReflection_Delegation) 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_Delegation) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Proof) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Delegation) + x := input.Message.Interface().(*Proof) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3453,50 +2345,26 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Did) + l = len(x.Controller) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.ChainType) + l = len(x.Issuer) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.ChainAddress) + l = len(x.Property) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.ControllerDid) + l = len(x.Accumulator) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.PublicKeyMultibase) + l = len(x.Key) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.PublicKeyJwks) > 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.PublicKeyJwks)) - for k := range x.PublicKeyJwks { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.PublicKeyJwks[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.PublicKeyJwks { - SiZeMaP(k, v) - } - } - } - if x.ChannelId != 0 { - n += 1 + runtime.Sov(uint64(x.ChannelId)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -3507,7 +2375,7 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Delegation) + x := input.Message.Interface().(*Proof) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3526,86 +2394,38 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.ChannelId != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ChannelId)) - i-- - dAtA[i] = 0x40 - } - if len(x.PublicKeyJwks) > 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] = 0x3a - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForPublicKeyJwks := make([]string, 0, len(x.PublicKeyJwks)) - for k := range x.PublicKeyJwks { - keysForPublicKeyJwks = append(keysForPublicKeyJwks, string(k)) - } - sort.Slice(keysForPublicKeyJwks, func(i, j int) bool { - return keysForPublicKeyJwks[i] < keysForPublicKeyJwks[j] - }) - for iNdEx := len(keysForPublicKeyJwks) - 1; iNdEx >= 0; iNdEx-- { - v := x.PublicKeyJwks[string(keysForPublicKeyJwks[iNdEx])] - out, err := MaRsHaLmAp(keysForPublicKeyJwks[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.PublicKeyJwks { - v := x.PublicKeyJwks[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - if len(x.PublicKeyMultibase) > 0 { - i -= len(x.PublicKeyMultibase) - copy(dAtA[i:], x.PublicKeyMultibase) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKeyMultibase))) + 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] = 0x32 } - if len(x.ControllerDid) > 0 { - i -= len(x.ControllerDid) - copy(dAtA[i:], x.ControllerDid) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ControllerDid))) + if len(x.Accumulator) > 0 { + i -= len(x.Accumulator) + copy(dAtA[i:], x.Accumulator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Accumulator))) i-- dAtA[i] = 0x2a } - if len(x.ChainAddress) > 0 { - i -= len(x.ChainAddress) - copy(dAtA[i:], x.ChainAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainAddress))) + if len(x.Property) > 0 { + i -= len(x.Property) + copy(dAtA[i:], x.Property) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Property))) i-- dAtA[i] = 0x22 } - if len(x.ChainType) > 0 { - i -= len(x.ChainType) - copy(dAtA[i:], x.ChainType) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainType))) + if len(x.Issuer) > 0 { + i -= len(x.Issuer) + copy(dAtA[i:], x.Issuer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Issuer))) i-- dAtA[i] = 0x1a } - if len(x.Did) > 0 { - i -= len(x.Did) - copy(dAtA[i:], x.Did) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) i-- dAtA[i] = 0x12 } @@ -3627,7 +2447,7 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Delegation) + x := input.Message.Interface().(*Proof) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -3659,10 +2479,10 @@ func (x *fastReflection_Delegation) 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: Delegation: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Proof: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Delegation: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3699,7 +2519,7 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3727,11 +2547,11 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Did = string(dAtA[iNdEx:postIndex]) + x.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainType", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Issuer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3759,11 +2579,11 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.ChainType = string(dAtA[iNdEx:postIndex]) + x.Issuer = 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 ChainAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Property", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3791,13 +2611,13 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.ChainAddress = string(dAtA[iNdEx:postIndex]) + x.Property = 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 ControllerDid", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accumulator", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3807,27 +2627,799 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + 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.ControllerDid = string(dAtA[iNdEx:postIndex]) + x.Accumulator = append(x.Accumulator[:0], dAtA[iNdEx:postIndex]...) + if x.Accumulator == nil { + x.Accumulator = []byte{} + } iNdEx = postIndex case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyMultibase", wireType) + 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, + } +} + +var _ protoreflect.Map = (*_ServiceRecord_6_map)(nil) + +type _ServiceRecord_6_map struct { + m *map[string]string +} + +func (x *_ServiceRecord_6_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_ServiceRecord_6_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfString(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_ServiceRecord_6_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_ServiceRecord_6_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_ServiceRecord_6_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfString(v) +} + +func (x *_ServiceRecord_6_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_ServiceRecord_6_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") +} + +func (x *_ServiceRecord_6_map) NewValue() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_ServiceRecord_6_map) IsValid() bool { + return x.m != nil +} + +var ( + md_ServiceRecord protoreflect.MessageDescriptor + fd_ServiceRecord_id protoreflect.FieldDescriptor + fd_ServiceRecord_service_type protoreflect.FieldDescriptor + fd_ServiceRecord_authority protoreflect.FieldDescriptor + fd_ServiceRecord_origin protoreflect.FieldDescriptor + fd_ServiceRecord_description protoreflect.FieldDescriptor + fd_ServiceRecord_service_endpoints protoreflect.FieldDescriptor + fd_ServiceRecord_permissions protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_state_proto_init() + md_ServiceRecord = File_did_v1_state_proto.Messages().ByName("ServiceRecord") + fd_ServiceRecord_id = md_ServiceRecord.Fields().ByName("id") + fd_ServiceRecord_service_type = md_ServiceRecord.Fields().ByName("service_type") + fd_ServiceRecord_authority = md_ServiceRecord.Fields().ByName("authority") + fd_ServiceRecord_origin = md_ServiceRecord.Fields().ByName("origin") + fd_ServiceRecord_description = md_ServiceRecord.Fields().ByName("description") + fd_ServiceRecord_service_endpoints = md_ServiceRecord.Fields().ByName("service_endpoints") + fd_ServiceRecord_permissions = md_ServiceRecord.Fields().ByName("permissions") +} + +var _ protoreflect.Message = (*fastReflection_ServiceRecord)(nil) + +type fastReflection_ServiceRecord ServiceRecord + +func (x *ServiceRecord) ProtoReflect() protoreflect.Message { + return (*fastReflection_ServiceRecord)(x) +} + +func (x *ServiceRecord) 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_ServiceRecord_messageType fastReflection_ServiceRecord_messageType +var _ protoreflect.MessageType = fastReflection_ServiceRecord_messageType{} + +type fastReflection_ServiceRecord_messageType struct{} + +func (x fastReflection_ServiceRecord_messageType) Zero() protoreflect.Message { + return (*fastReflection_ServiceRecord)(nil) +} +func (x fastReflection_ServiceRecord_messageType) New() protoreflect.Message { + return new(fastReflection_ServiceRecord) +} +func (x fastReflection_ServiceRecord_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ServiceRecord +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ServiceRecord) Descriptor() protoreflect.MessageDescriptor { + return md_ServiceRecord +} + +// 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_ServiceRecord) Type() protoreflect.MessageType { + return _fastReflection_ServiceRecord_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ServiceRecord) New() protoreflect.Message { + return new(fastReflection_ServiceRecord) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ServiceRecord) Interface() protoreflect.ProtoMessage { + return (*ServiceRecord)(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_ServiceRecord) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_ServiceRecord_id, value) { + return + } + } + if x.ServiceType != "" { + value := protoreflect.ValueOfString(x.ServiceType) + if !f(fd_ServiceRecord_service_type, value) { + return + } + } + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_ServiceRecord_authority, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_ServiceRecord_origin, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_ServiceRecord_description, value) { + return + } + } + if len(x.ServiceEndpoints) != 0 { + value := protoreflect.ValueOfMap(&_ServiceRecord_6_map{m: &x.ServiceEndpoints}) + if !f(fd_ServiceRecord_service_endpoints, value) { + return + } + } + if x.Permissions != nil { + value := protoreflect.ValueOfMessage(x.Permissions.ProtoReflect()) + if !f(fd_ServiceRecord_permissions, 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_ServiceRecord) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.ServiceRecord.id": + return x.Id != "" + case "did.v1.ServiceRecord.service_type": + return x.ServiceType != "" + case "did.v1.ServiceRecord.authority": + return x.Authority != "" + case "did.v1.ServiceRecord.origin": + return x.Origin != "" + case "did.v1.ServiceRecord.description": + return x.Description != "" + case "did.v1.ServiceRecord.service_endpoints": + return len(x.ServiceEndpoints) != 0 + case "did.v1.ServiceRecord.permissions": + return x.Permissions != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) + } + panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.ServiceRecord.id": + x.Id = "" + case "did.v1.ServiceRecord.service_type": + x.ServiceType = "" + case "did.v1.ServiceRecord.authority": + x.Authority = "" + case "did.v1.ServiceRecord.origin": + x.Origin = "" + case "did.v1.ServiceRecord.description": + x.Description = "" + case "did.v1.ServiceRecord.service_endpoints": + x.ServiceEndpoints = nil + case "did.v1.ServiceRecord.permissions": + x.Permissions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) + } + panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.ServiceRecord.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "did.v1.ServiceRecord.service_type": + value := x.ServiceType + return protoreflect.ValueOfString(value) + case "did.v1.ServiceRecord.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "did.v1.ServiceRecord.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.ServiceRecord.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "did.v1.ServiceRecord.service_endpoints": + if len(x.ServiceEndpoints) == 0 { + return protoreflect.ValueOfMap(&_ServiceRecord_6_map{}) + } + mapValue := &_ServiceRecord_6_map{m: &x.ServiceEndpoints} + return protoreflect.ValueOfMap(mapValue) + case "did.v1.ServiceRecord.permissions": + value := x.Permissions + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) + } + panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.ServiceRecord.id": + x.Id = value.Interface().(string) + case "did.v1.ServiceRecord.service_type": + x.ServiceType = value.Interface().(string) + case "did.v1.ServiceRecord.authority": + x.Authority = value.Interface().(string) + case "did.v1.ServiceRecord.origin": + x.Origin = value.Interface().(string) + case "did.v1.ServiceRecord.description": + x.Description = value.Interface().(string) + case "did.v1.ServiceRecord.service_endpoints": + mv := value.Map() + cmv := mv.(*_ServiceRecord_6_map) + x.ServiceEndpoints = *cmv.m + case "did.v1.ServiceRecord.permissions": + x.Permissions = value.Message().Interface().(*Permissions) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) + } + panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ServiceRecord.service_endpoints": + if x.ServiceEndpoints == nil { + x.ServiceEndpoints = make(map[string]string) + } + value := &_ServiceRecord_6_map{m: &x.ServiceEndpoints} + return protoreflect.ValueOfMap(value) + case "did.v1.ServiceRecord.permissions": + if x.Permissions == nil { + x.Permissions = new(Permissions) + } + return protoreflect.ValueOfMessage(x.Permissions.ProtoReflect()) + case "did.v1.ServiceRecord.id": + panic(fmt.Errorf("field id of message did.v1.ServiceRecord is not mutable")) + case "did.v1.ServiceRecord.service_type": + panic(fmt.Errorf("field service_type of message did.v1.ServiceRecord is not mutable")) + case "did.v1.ServiceRecord.authority": + panic(fmt.Errorf("field authority of message did.v1.ServiceRecord is not mutable")) + case "did.v1.ServiceRecord.origin": + panic(fmt.Errorf("field origin of message did.v1.ServiceRecord is not mutable")) + case "did.v1.ServiceRecord.description": + panic(fmt.Errorf("field description of message did.v1.ServiceRecord is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) + } + panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.ServiceRecord.id": + return protoreflect.ValueOfString("") + case "did.v1.ServiceRecord.service_type": + return protoreflect.ValueOfString("") + case "did.v1.ServiceRecord.authority": + return protoreflect.ValueOfString("") + case "did.v1.ServiceRecord.origin": + return protoreflect.ValueOfString("") + case "did.v1.ServiceRecord.description": + return protoreflect.ValueOfString("") + case "did.v1.ServiceRecord.service_endpoints": + m := make(map[string]string) + return protoreflect.ValueOfMap(&_ServiceRecord_6_map{m: &m}) + case "did.v1.ServiceRecord.permissions": + m := new(Permissions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.ServiceRecord")) + } + panic(fmt.Errorf("message did.v1.ServiceRecord 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_ServiceRecord) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.ServiceRecord", 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_ServiceRecord) 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_ServiceRecord) 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_ServiceRecord) 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_ServiceRecord) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ServiceRecord) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ServiceType) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ServiceEndpoints) > 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.ServiceEndpoints)) + for k := range x.ServiceEndpoints { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.ServiceEndpoints[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.ServiceEndpoints { + SiZeMaP(k, v) + } + } + } + if x.Permissions != nil { + l = options.Size(x.Permissions) + 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().(*ServiceRecord) + 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.Permissions != nil { + encoded, err := options.Marshal(x.Permissions) + 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] = 0x3a + } + if len(x.ServiceEndpoints) > 0 { + MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) { + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = runtime.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForServiceEndpoints := make([]string, 0, len(x.ServiceEndpoints)) + for k := range x.ServiceEndpoints { + keysForServiceEndpoints = append(keysForServiceEndpoints, string(k)) + } + sort.Slice(keysForServiceEndpoints, func(i, j int) bool { + return keysForServiceEndpoints[i] < keysForServiceEndpoints[j] + }) + for iNdEx := len(keysForServiceEndpoints) - 1; iNdEx >= 0; iNdEx-- { + v := x.ServiceEndpoints[string(keysForServiceEndpoints[iNdEx])] + out, err := MaRsHaLmAp(keysForServiceEndpoints[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.ServiceEndpoints { + v := x.ServiceEndpoints[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x2a + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x22 + } + 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] = 0x1a + } + if len(x.ServiceType) > 0 { + i -= len(x.ServiceType) + copy(dAtA[i:], x.ServiceType) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceType))) + i-- + dAtA[i] = 0x12 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ServiceRecord) + 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: ServiceRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ServiceRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3855,11 +3447,139 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.PublicKeyMultibase = string(dAtA[iNdEx:postIndex]) + x.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyJwks", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceType", 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.ServiceType = 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 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 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = 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 ServiceEndpoints", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3886,8 +3606,8 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.PublicKeyJwks == nil { - x.PublicKeyJwks = make(map[string]string) + if x.ServiceEndpoints == nil { + x.ServiceEndpoints = make(map[string]string) } var mapkey string var mapvalue string @@ -3982,13 +3702,13 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { iNdEx += skippy } } - x.PublicKeyJwks[mapkey] = mapvalue + x.ServiceEndpoints[mapkey] = mapvalue iNdEx = postIndex - case 8: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } - x.ChannelId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -3998,11 +3718,28 @@ func (x *fastReflection_Delegation) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.ChannelId |= uint64(b&0x7F) << shift + 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.Permissions == nil { + x.Permissions = &Permissions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Permissions); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4167,6 +3904,13 @@ func (x *_Service_6_list) IsValid() bool { } var ( + md_VerificationMethod protoreflect.MessageDescriptor + fd_VerificationMethod_id protoreflect.FieldDescriptor + fd_VerificationMethod_controller protoreflect.FieldDescriptor + fd_VerificationMethod_method protoreflect.FieldDescriptor + fd_VerificationMethod_issuer protoreflect.FieldDescriptor + fd_VerificationMethod_subject protoreflect.FieldDescriptor + fd_VerificationMethod_public_key protoreflect.FieldDescriptor md_Service protoreflect.MessageDescriptor fd_Service_id protoreflect.FieldDescriptor fd_Service_service_type protoreflect.FieldDescriptor @@ -4178,6 +3922,13 @@ var ( func init() { file_did_v1_state_proto_init() + md_VerificationMethod = File_did_v1_state_proto.Messages().ByName("VerificationMethod") + fd_VerificationMethod_id = md_VerificationMethod.Fields().ByName("id") + fd_VerificationMethod_controller = md_VerificationMethod.Fields().ByName("controller") + fd_VerificationMethod_method = md_VerificationMethod.Fields().ByName("method") + fd_VerificationMethod_issuer = md_VerificationMethod.Fields().ByName("issuer") + fd_VerificationMethod_subject = md_VerificationMethod.Fields().ByName("subject") + fd_VerificationMethod_public_key = md_VerificationMethod.Fields().ByName("public_key") md_Service = File_did_v1_state_proto.Messages().ByName("Service") fd_Service_id = md_Service.Fields().ByName("id") fd_Service_service_type = md_Service.Fields().ByName("service_type") @@ -4187,16 +3938,16 @@ func init() { fd_Service_scopes = md_Service.Fields().ByName("scopes") } -var _ protoreflect.Message = (*fastReflection_Service)(nil) +var _ protoreflect.Message = (*fastReflection_VerificationMethod)(nil) -type fastReflection_Service Service +type fastReflection_VerificationMethod VerificationMethod -func (x *Service) ProtoReflect() protoreflect.Message { - return (*fastReflection_Service)(x) +func (x *VerificationMethod) ProtoReflect() protoreflect.Message { + return (*fastReflection_VerificationMethod)(x) } -func (x *Service) slowProtoReflect() protoreflect.Message { - mi := &file_did_v1_state_proto_msgTypes[5] +func (x *VerificationMethod) 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 { @@ -4207,43 +3958,43 @@ func (x *Service) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Service_messageType fastReflection_Service_messageType -var _ protoreflect.MessageType = fastReflection_Service_messageType{} +var _fastReflection_VerificationMethod_messageType fastReflection_VerificationMethod_messageType +var _ protoreflect.MessageType = fastReflection_VerificationMethod_messageType{} -type fastReflection_Service_messageType struct{} +type fastReflection_VerificationMethod_messageType struct{} -func (x fastReflection_Service_messageType) Zero() protoreflect.Message { - return (*fastReflection_Service)(nil) +func (x fastReflection_VerificationMethod_messageType) Zero() protoreflect.Message { + return (*fastReflection_VerificationMethod)(nil) } -func (x fastReflection_Service_messageType) New() protoreflect.Message { - return new(fastReflection_Service) +func (x fastReflection_VerificationMethod_messageType) New() protoreflect.Message { + return new(fastReflection_VerificationMethod) } -func (x fastReflection_Service_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Service +func (x fastReflection_VerificationMethod_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_VerificationMethod } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Service) Descriptor() protoreflect.MessageDescriptor { - return md_Service +func (x *fastReflection_VerificationMethod) Descriptor() protoreflect.MessageDescriptor { + return md_VerificationMethod } // 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_Service) Type() protoreflect.MessageType { - return _fastReflection_Service_messageType +func (x *fastReflection_VerificationMethod) Type() protoreflect.MessageType { + return _fastReflection_VerificationMethod_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Service) New() protoreflect.Message { - return new(fastReflection_Service) +func (x *fastReflection_VerificationMethod) New() protoreflect.Message { + return new(fastReflection_VerificationMethod) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Service) Interface() protoreflect.ProtoMessage { - return (*Service)(x) +func (x *fastReflection_VerificationMethod) Interface() protoreflect.ProtoMessage { + return (*VerificationMethod)(x) } // Range iterates over every populated field in an undefined order, @@ -4251,19 +4002,40 @@ func (x *fastReflection_Service) 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_Service) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_VerificationMethod) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Id != "" { value := protoreflect.ValueOfString(x.Id) - if !f(fd_Service_id, value) { + if !f(fd_VerificationMethod_id, value) { return } } - if x.ServiceType != "" { - value := protoreflect.ValueOfString(x.ServiceType) - if !f(fd_Service_service_type, value) { + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_VerificationMethod_controller, value) { return } } + if x.Method != 0 { + value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Method)) + if !f(fd_VerificationMethod_method, value) { + return + } + } + if x.Issuer != "" { + value := protoreflect.ValueOfString(x.Issuer) + if !f(fd_VerificationMethod_issuer, value) { + return + } + } + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_VerificationMethod_subject, value) { + return + } + } + if x.PublicKey != nil { + value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) + if !f(fd_VerificationMethod_public_key, value) { if x.ControllerDid != "" { value := protoreflect.ValueOfString(x.ControllerDid) if !f(fd_Service_controller_did, value) { @@ -4301,10 +4073,20 @@ func (x *fastReflection_Service) Range(f func(protoreflect.FieldDescriptor, prot // 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_Service) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_VerificationMethod) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "did.v1.Service.id": + case "did.v1.VerificationMethod.id": return x.Id != "" + case "did.v1.VerificationMethod.controller": + return x.Controller != "" + case "did.v1.VerificationMethod.method": + return x.Method != 0 + case "did.v1.VerificationMethod.issuer": + return x.Issuer != "" + case "did.v1.VerificationMethod.subject": + return x.Subject != "" + case "did.v1.VerificationMethod.public_key": + return x.PublicKey != nil case "did.v1.Service.service_type": return x.ServiceType != "" case "did.v1.Service.controller_did": @@ -4317,9 +4099,9 @@ func (x *fastReflection_Service) Has(fd protoreflect.FieldDescriptor) bool { return len(x.Scopes) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) } - panic(fmt.Errorf("message did.v1.Service does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.VerificationMethod does not contain field %s", fd.FullName())) } } @@ -4329,10 +4111,20 @@ func (x *fastReflection_Service) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Service) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_VerificationMethod) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "did.v1.Service.id": + case "did.v1.VerificationMethod.id": x.Id = "" + case "did.v1.VerificationMethod.controller": + x.Controller = "" + case "did.v1.VerificationMethod.method": + x.Method = 0 + case "did.v1.VerificationMethod.issuer": + x.Issuer = "" + case "did.v1.VerificationMethod.subject": + x.Subject = "" + case "did.v1.VerificationMethod.public_key": + x.PublicKey = nil case "did.v1.Service.service_type": x.ServiceType = "" case "did.v1.Service.controller_did": @@ -4345,9 +4137,9 @@ func (x *fastReflection_Service) Clear(fd protoreflect.FieldDescriptor) { x.Scopes = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) } - panic(fmt.Errorf("message did.v1.Service does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.VerificationMethod does not contain field %s", fd.FullName())) } } @@ -4357,14 +4149,26 @@ func (x *fastReflection_Service) 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_Service) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_VerificationMethod) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "did.v1.Service.id": + case "did.v1.VerificationMethod.id": value := x.Id return protoreflect.ValueOfString(value) - case "did.v1.Service.service_type": - value := x.ServiceType + case "did.v1.VerificationMethod.controller": + value := x.Controller return protoreflect.ValueOfString(value) + case "did.v1.VerificationMethod.method": + value := x.Method + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "did.v1.VerificationMethod.issuer": + value := x.Issuer + return protoreflect.ValueOfString(value) + case "did.v1.VerificationMethod.subject": + value := x.Subject + return protoreflect.ValueOfString(value) + case "did.v1.VerificationMethod.public_key": + value := x.PublicKey + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "did.v1.Service.controller_did": value := x.ControllerDid return protoreflect.ValueOfString(value) @@ -4385,9 +4189,9 @@ func (x *fastReflection_Service) Get(descriptor protoreflect.FieldDescriptor) pr return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) } - panic(fmt.Errorf("message did.v1.Service does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message did.v1.VerificationMethod does not contain field %s", descriptor.FullName())) } } @@ -4401,10 +4205,20 @@ func (x *fastReflection_Service) Get(descriptor protoreflect.FieldDescriptor) pr // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Service) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_VerificationMethod) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "did.v1.Service.id": + case "did.v1.VerificationMethod.id": x.Id = value.Interface().(string) + case "did.v1.VerificationMethod.controller": + x.Controller = value.Interface().(string) + case "did.v1.VerificationMethod.method": + x.Method = (DIDNamespace)(value.Enum()) + case "did.v1.VerificationMethod.issuer": + x.Issuer = value.Interface().(string) + case "did.v1.VerificationMethod.subject": + x.Subject = value.Interface().(string) + case "did.v1.VerificationMethod.public_key": + x.PublicKey = value.Message().Interface().(*PubKey) case "did.v1.Service.service_type": x.ServiceType = value.Interface().(string) case "did.v1.Service.controller_did": @@ -4421,9 +4235,9 @@ func (x *fastReflection_Service) Set(fd protoreflect.FieldDescriptor, value prot x.Scopes = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) } - panic(fmt.Errorf("message did.v1.Service does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.VerificationMethod does not contain field %s", fd.FullName())) } } @@ -4437,8 +4251,23 @@ func (x *fastReflection_Service) Set(fd protoreflect.FieldDescriptor, value prot // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Service) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_VerificationMethod) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.VerificationMethod.public_key": + if x.PublicKey == nil { + x.PublicKey = new(PubKey) + } + return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect()) + case "did.v1.VerificationMethod.id": + panic(fmt.Errorf("field id of message did.v1.VerificationMethod is not mutable")) + case "did.v1.VerificationMethod.controller": + panic(fmt.Errorf("field controller of message did.v1.VerificationMethod is not mutable")) + case "did.v1.VerificationMethod.method": + panic(fmt.Errorf("field method of message did.v1.VerificationMethod is not mutable")) + case "did.v1.VerificationMethod.issuer": + panic(fmt.Errorf("field issuer of message did.v1.VerificationMethod is not mutable")) + case "did.v1.VerificationMethod.subject": + panic(fmt.Errorf("field subject of message did.v1.VerificationMethod is not mutable")) case "did.v1.Service.service_endpoints": if x.ServiceEndpoints == nil { x.ServiceEndpoints = make(map[string]string) @@ -4461,21 +4290,30 @@ func (x *fastReflection_Service) Mutable(fd protoreflect.FieldDescriptor) protor panic(fmt.Errorf("field origin_uri of message did.v1.Service is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) } - panic(fmt.Errorf("message did.v1.Service does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.VerificationMethod 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_Service) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_VerificationMethod) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "did.v1.Service.id": + case "did.v1.VerificationMethod.id": return protoreflect.ValueOfString("") - case "did.v1.Service.service_type": + case "did.v1.VerificationMethod.controller": return protoreflect.ValueOfString("") + case "did.v1.VerificationMethod.method": + return protoreflect.ValueOfEnum(0) + case "did.v1.VerificationMethod.issuer": + return protoreflect.ValueOfString("") + case "did.v1.VerificationMethod.subject": + return protoreflect.ValueOfString("") + case "did.v1.VerificationMethod.public_key": + m := new(PubKey) + return protoreflect.ValueOfMessage(m.ProtoReflect()) case "did.v1.Service.controller_did": return protoreflect.ValueOfString("") case "did.v1.Service.origin_uri": @@ -4488,19 +4326,19 @@ func (x *fastReflection_Service) NewField(fd protoreflect.FieldDescriptor) proto return protoreflect.ValueOfList(&_Service_6_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Service")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod")) } - panic(fmt.Errorf("message did.v1.Service does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message did.v1.VerificationMethod 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_Service) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_VerificationMethod) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in did.v1.Service", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in did.v1.VerificationMethod", d.FullName())) } panic("unreachable") } @@ -4508,7 +4346,7 @@ func (x *fastReflection_Service) WhichOneof(d protoreflect.OneofDescriptor) prot // 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_Service) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_VerificationMethod) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4519,7 +4357,7 @@ func (x *fastReflection_Service) 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_Service) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_VerificationMethod) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4531,7 +4369,7 @@ func (x *fastReflection_Service) SetUnknown(fields protoreflect.RawFields) { // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_Service) IsValid() bool { +func (x *fastReflection_VerificationMethod) IsValid() bool { return x != nil } @@ -4541,9 +4379,9 @@ func (x *fastReflection_Service) 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_Service) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Service) + x := input.Message.Interface().(*VerificationMethod) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4559,10 +4397,25 @@ func (x *fastReflection_Service) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.ServiceType) + l = len(x.Controller) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.Method != 0 { + n += 1 + runtime.Sov(uint64(x.Method)) + } + l = len(x.Issuer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Subject) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.PublicKey != nil { + l = options.Size(x.PublicKey) + n += 1 + l + runtime.Sov(uint64(l)) + } l = len(x.ControllerDid) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -4609,7 +4462,7 @@ func (x *fastReflection_Service) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Service) + x := input.Message.Interface().(*VerificationMethod) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4628,6 +4481,38 @@ func (x *fastReflection_Service) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.PublicKey != nil { + encoded, err := options.Marshal(x.PublicKey) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x32 + } + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) + i-- + dAtA[i] = 0x2a + } + if len(x.Issuer) > 0 { + i -= len(x.Issuer) + copy(dAtA[i:], x.Issuer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Issuer))) + i-- + dAtA[i] = 0x22 + } + if x.Method != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Method)) + i-- + dAtA[i] = 0x18 if len(x.Scopes) > 0 { var pksize2 int for _, num := range x.Scopes { @@ -4706,10 +4591,10 @@ func (x *fastReflection_Service) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x1a } - if len(x.ServiceType) > 0 { - i -= len(x.ServiceType) - copy(dAtA[i:], x.ServiceType) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceType))) + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) i-- dAtA[i] = 0x12 } @@ -4731,7 +4616,7 @@ func (x *fastReflection_Service) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Service) + x := input.Message.Interface().(*VerificationMethod) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4763,10 +4648,10 @@ func (x *fastReflection_Service) 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: Service: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VerificationMethod: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VerificationMethod: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4803,7 +4688,7 @@ func (x *fastReflection_Service) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceType", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4831,9 +4716,30 @@ func (x *fastReflection_Service) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.ServiceType = string(dAtA[iNdEx:postIndex]) + x.Controller = 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 Method", wireType) + } + x.Method = 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.Method |= DIDNamespace(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Issuer", wireType) if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ControllerDid", wireType) } @@ -4863,7 +4769,75 @@ func (x *fastReflection_Service) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.ControllerDid = string(dAtA[iNdEx:postIndex]) + x.Issuer = 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 Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.PublicKey == nil { + x.PublicKey = &PubKey{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex case 4: if wireType != 2 { @@ -5141,14 +5115,28 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Aliases represents the `alsoKnownAs` property associated with a DID Controller -type Aliases struct { +// Account represents a wallet account associated with a DID Controller +type Account struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The unique identifier of the alias + // The unique identifier of the account Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The controller of the account + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + // The value of the linked identifier + PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // The address of the account + Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` + // The label of the account + Label string `protobuf:"bytes,5,opt,name=label,proto3" json:"label,omitempty"` + // The bip32 chain code + ChainCode uint32 `protobuf:"varint,6,opt,name=chain_code,json=chainCode,proto3" json:"chain_code,omitempty"` + // The index of the account + Index uint32 `protobuf:"varint,7,opt,name=index,proto3" json:"index,omitempty"` + // The supported chains of the account + Chains []string `protobuf:"bytes,8,rep,name=chains,proto3" json:"chains,omitempty"` // Origin is the Alias provider Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` // Subject is the user defined alias @@ -5159,8 +5147,8 @@ type Aliases struct { Expiration uint64 `protobuf:"varint,5,opt,name=expiration,proto3" json:"expiration,omitempty"` } -func (x *Aliases) Reset() { - *x = Aliases{} +func (x *Account) Reset() { + *x = Account{} if protoimpl.UnsafeEnabled { mi := &file_did_v1_state_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5168,24 +5156,25 @@ func (x *Aliases) Reset() { } } -func (x *Aliases) String() string { +func (x *Account) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Aliases) ProtoMessage() {} +func (*Account) ProtoMessage() {} -// Deprecated: Use Aliases.ProtoReflect.Descriptor instead. -func (*Aliases) Descriptor() ([]byte, []int) { +// Deprecated: Use Account.ProtoReflect.Descriptor instead. +func (*Account) Descriptor() ([]byte, []int) { return file_did_v1_state_proto_rawDescGZIP(), []int{0} } -func (x *Aliases) GetId() string { +func (x *Account) GetId() string { if x != nil { return x.Id } return "" } +func (x *Account) GetController() string { func (x *Aliases) GetOrigin() string { if x != nil { return x.Origin @@ -5207,159 +5196,48 @@ func (x *Aliases) GetController() string { return "" } -func (x *Aliases) GetExpiration() uint64 { +func (x *Account) GetPublicKey() *PubKey { if x != nil { - return x.Expiration + return x.PublicKey + } + return nil +} + +func (x *Account) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Account) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *Account) GetChainCode() uint32 { + if x != nil { + return x.ChainCode } return 0 } -// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) -type Assertion struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The unique identifier of the attestation - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave") - KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` - // The value of the linked identifier - Credential []byte `protobuf:"bytes,3,opt,name=credential,proto3" json:"credential,omitempty"` - // Metadata is optional additional information about the assertion - Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // The controller of the attestation - Controller string `protobuf:"bytes,5,opt,name=controller,proto3" json:"controller,omitempty"` -} - -func (x *Assertion) Reset() { - *x = Assertion{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Assertion) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Assertion) ProtoMessage() {} - -// Deprecated: Use Assertion.ProtoReflect.Descriptor instead. -func (*Assertion) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{1} -} - -func (x *Assertion) GetId() string { +func (x *Account) GetIndex() uint32 { if x != nil { - return x.Id + return x.Index } - return "" + return 0 } -func (x *Assertion) GetKeyType() string { +func (x *Account) GetChains() []string { if x != nil { - return x.KeyType - } - return "" -} - -func (x *Assertion) GetCredential() []byte { - if x != nil { - return x.Credential + return x.Chains } return nil } -func (x *Assertion) GetMetadata() map[string]string { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *Assertion) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - -// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) -type Attestation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The unique identifier of the attestation - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The type of the linked identifier (e.g., "crypto", "github", "email", "phone") - KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` - // The value of the linked identifier - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - // The proof or verification method for this attestation - Proof string `protobuf:"bytes,4,opt,name=proof,proto3" json:"proof,omitempty"` - // The controller of the attestation - Controller string `protobuf:"bytes,5,opt,name=controller,proto3" json:"controller,omitempty"` -} - -func (x *Attestation) Reset() { - *x = Attestation{} - if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Attestation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Attestation) ProtoMessage() {} - -// Deprecated: Use Attestation.ProtoReflect.Descriptor instead. -func (*Attestation) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{2} -} - -func (x *Attestation) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Attestation) GetKeyType() string { - if x != nil { - return x.KeyType - } - return "" -} - -func (x *Attestation) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *Attestation) GetProof() string { - if x != nil { - return x.Proof - } - return "" -} - -func (x *Attestation) GetController() string { - if x != nil { - return x.Controller - } - return "" -} - // Controller represents a Sonr DWN Vault type Controller struct { state protoimpl.MessageState @@ -5369,19 +5247,21 @@ type Controller struct { // The unique identifier of the controller Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The DID of the controller - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` - // The public key of the controller - PublicKeyMultibase string `protobuf:"bytes,3,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // Aliases of the controller + Aliases []*Alias `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"` + // PubKey is the verification method + PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // The vault address or identifier - VaultCid string `protobuf:"bytes,4,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` - // Fingerprint is the Accumulator of discrete credential identifiers - Fingerprint []byte `protobuf:"bytes,5,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` + VaultCid string `protobuf:"bytes,5,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` + // The Authentications of the controller + Authentication []*Credential `protobuf:"bytes,6,rep,name=authentication,proto3" json:"authentication,omitempty"` } func (x *Controller) Reset() { *x = Controller{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[3] + mi := &file_did_v1_state_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5395,7 +5275,7 @@ func (*Controller) ProtoMessage() {} // Deprecated: Use Controller.ProtoReflect.Descriptor instead. func (*Controller) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{3} + return file_did_v1_state_proto_rawDescGZIP(), []int{1} } func (x *Controller) GetId() string { @@ -5405,18 +5285,25 @@ func (x *Controller) GetId() string { return "" } -func (x *Controller) GetDid() string { +func (x *Controller) GetAddress() string { if x != nil { - return x.Did + return x.Address } return "" } -func (x *Controller) GetPublicKeyMultibase() string { +func (x *Controller) GetAliases() []*Alias { if x != nil { - return x.PublicKeyMultibase + return x.Aliases } - return "" + return nil +} + +func (x *Controller) GetPublicKey() *PubKey { + if x != nil { + return x.PublicKey + } + return nil } func (x *Controller) GetVaultCid() string { @@ -5426,115 +5313,97 @@ func (x *Controller) GetVaultCid() string { return "" } -func (x *Controller) GetFingerprint() []byte { +func (x *Controller) GetAuthentication() []*Credential { if x != nil { - return x.Fingerprint + return x.Authentication } return nil } -// Delegation represents IBC Account Controllers for various chains (e.g., ETH, BTC) -type Delegation struct { +// Proof represents a verifiable credential +type Proof struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The unique identifier of the delegation + // The unique identifier of the proof Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The Decentralized Identifier of the delegated account - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` - // The chain type (e.g., "ETH", "BTC") - ChainType string `protobuf:"bytes,3,opt,name=chain_type,json=chainType,proto3" json:"chain_type,omitempty"` - // The address on the target chain - ChainAddress string `protobuf:"bytes,4,opt,name=chain_address,json=chainAddress,proto3" json:"chain_address,omitempty"` - // The controller DID - ControllerDid string `protobuf:"bytes,5,opt,name=controller_did,json=controllerDid,proto3" json:"controller_did,omitempty"` - // The delegation proof or verification method - PublicKeyMultibase string `protobuf:"bytes,6,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"` - // Public Key JWKS is a map of the associated public keys - PublicKeyJwks map[string]string `protobuf:"bytes,7,rep,name=public_key_jwks,json=publicKeyJwks,proto3" json:"public_key_jwks,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // IBC Channel ID - ChannelId uint64 `protobuf:"varint,8,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // The controller of the proof + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + // The value of the linked identifier + Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` + // The property of the proof + Property string `protobuf:"bytes,4,opt,name=property,proto3" json:"property,omitempty"` + // The accumulator of the proof + Accumulator []byte `protobuf:"bytes,5,opt,name=accumulator,proto3" json:"accumulator,omitempty"` + // The secret key of the proof + Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` } -func (x *Delegation) Reset() { - *x = Delegation{} +func (x *Proof) Reset() { + *x = Proof{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[4] + mi := &file_did_v1_state_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Delegation) String() string { +func (x *Proof) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Delegation) ProtoMessage() {} +func (*Proof) ProtoMessage() {} -// Deprecated: Use Delegation.ProtoReflect.Descriptor instead. -func (*Delegation) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{4} +// Deprecated: Use Proof.ProtoReflect.Descriptor instead. +func (*Proof) Descriptor() ([]byte, []int) { + return file_did_v1_state_proto_rawDescGZIP(), []int{2} } -func (x *Delegation) GetId() string { +func (x *Proof) GetId() string { if x != nil { return x.Id } return "" } -func (x *Delegation) GetDid() string { +func (x *Proof) GetController() string { if x != nil { - return x.Did + return x.Controller } return "" } -func (x *Delegation) GetChainType() string { +func (x *Proof) GetIssuer() string { if x != nil { - return x.ChainType + return x.Issuer } return "" } -func (x *Delegation) GetChainAddress() string { +func (x *Proof) GetProperty() string { if x != nil { - return x.ChainAddress + return x.Property } return "" } -func (x *Delegation) GetControllerDid() string { +func (x *Proof) GetAccumulator() []byte { if x != nil { - return x.ControllerDid - } - return "" -} - -func (x *Delegation) GetPublicKeyMultibase() string { - if x != nil { - return x.PublicKeyMultibase - } - return "" -} - -func (x *Delegation) GetPublicKeyJwks() map[string]string { - if x != nil { - return x.PublicKeyJwks + return x.Accumulator } return nil } -func (x *Delegation) GetChannelId() uint64 { +func (x *Proof) GetKey() []byte { if x != nil { - return x.ChannelId + return x.Key } - return 0 + return nil } -// Service represents a service in a DID Document -type Service struct { +// ServiceRecord represents a decentralized service in a DID Document +type ServiceRecord struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -5543,6 +5412,16 @@ type Service struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The type of the service ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` + // The authority DID of the service + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` + // The domain name of the service + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + // The description of the service + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + // The service endpoint + ServiceEndpoints map[string]string `protobuf:"bytes,6,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Scopes is the Authorization Grants of the service + Permissions *Permissions `protobuf:"bytes,7,opt,name=permissions,proto3" json:"permissions,omitempty"` // The controller DID of the service ControllerDid string `protobuf:"bytes,3,opt,name=controller_did,json=controllerDid,proto3" json:"controller_did,omitempty"` // The domain name of the service @@ -5553,47 +5432,58 @@ type Service struct { Scopes []PermissionScope `protobuf:"varint,6,rep,packed,name=scopes,proto3,enum=did.v1.PermissionScope" json:"scopes,omitempty"` } -func (x *Service) Reset() { - *x = Service{} +func (x *ServiceRecord) Reset() { + *x = ServiceRecord{} if protoimpl.UnsafeEnabled { - mi := &file_did_v1_state_proto_msgTypes[5] + mi := &file_did_v1_state_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Service) String() string { +func (x *ServiceRecord) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Service) ProtoMessage() {} +func (*ServiceRecord) ProtoMessage() {} -// Deprecated: Use Service.ProtoReflect.Descriptor instead. -func (*Service) Descriptor() ([]byte, []int) { - return file_did_v1_state_proto_rawDescGZIP(), []int{5} +// Deprecated: Use ServiceRecord.ProtoReflect.Descriptor instead. +func (*ServiceRecord) Descriptor() ([]byte, []int) { + return file_did_v1_state_proto_rawDescGZIP(), []int{3} } -func (x *Service) GetId() string { +func (x *ServiceRecord) GetId() string { if x != nil { return x.Id } return "" } -func (x *Service) GetServiceType() string { +func (x *ServiceRecord) GetServiceType() string { if x != nil { return x.ServiceType } return "" } -func (x *Service) GetControllerDid() string { +func (x *ServiceRecord) GetAuthority() string { if x != nil { - return x.ControllerDid + return x.Authority } return "" } +func (x *ServiceRecord) GetOrigin() string { +func (x *Service) GetControllerDid() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *ServiceRecord) GetDescription() string { + if x != nil { + return x.Description func (x *Service) GetOriginUri() string { if x != nil { return x.OriginUri @@ -5601,6 +5491,7 @@ func (x *Service) GetOriginUri() string { return "" } +func (x *ServiceRecord) GetServiceEndpoints() map[string]string { func (x *Service) GetServiceEndpoints() map[string]string { if x != nil { return x.ServiceEndpoints @@ -5608,6 +5499,91 @@ func (x *Service) GetServiceEndpoints() map[string]string { return nil } +func (x *ServiceRecord) GetPermissions() *Permissions { + if x != nil { + return x.Permissions + } + return nil +} + +// Verification reprsents a method of verifying membership in a DID +type VerificationMethod struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unique identifier of the verification + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The controller of the verification + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + // The DIDNamespace of the verification + Method DIDNamespace `protobuf:"varint,3,opt,name=method,proto3,enum=did.v1.DIDNamespace" json:"method,omitempty"` + // The value of the linked identifier + Issuer string `protobuf:"bytes,4,opt,name=issuer,proto3" json:"issuer,omitempty"` + // The subject of the verification + Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` + // The public key of the verification + PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +} + +func (x *VerificationMethod) Reset() { + *x = VerificationMethod{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_state_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerificationMethod) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerificationMethod) ProtoMessage() {} + +// Deprecated: Use VerificationMethod.ProtoReflect.Descriptor instead. +func (*VerificationMethod) Descriptor() ([]byte, []int) { + return file_did_v1_state_proto_rawDescGZIP(), []int{4} +} + +func (x *VerificationMethod) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *VerificationMethod) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *VerificationMethod) GetMethod() DIDNamespace { + if x != nil { + return x.Method + } + return DIDNamespace_DID_NAMESPACE_UNSPECIFIED +} + +func (x *VerificationMethod) GetIssuer() string { + if x != nil { + return x.Issuer + } + return "" +} + +func (x *VerificationMethod) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *VerificationMethod) GetPublicKey() *PubKey { + if x != nil { + return x.PublicKey func (x *Service) GetScopes() []PermissionScope { if x != nil { return x.Scopes @@ -5622,6 +5598,112 @@ var file_did_v1_state_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, + 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xca, 0x02, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x0a, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 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, 0x18, 0x0a, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x09, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x3a, 0x63, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x5d, + 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x10, 0x01, 0x18, 0x01, 0x12, 0x18, + 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x10, 0x02, 0x18, 0x01, 0x12, 0x21, 0x0a, 0x1b, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x64, + 0x65, 0x2c, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x10, 0x03, 0x18, 0x01, 0x18, 0x01, 0x22, 0x97, 0x02, + 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x27, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 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, 0x1b, + 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x0e, 0x61, + 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x2e, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x28, 0x0a, + 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x0d, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x10, 0x01, 0x18, 0x01, 0x12, 0x0f, 0x0a, 0x09, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x69, + 0x64, 0x10, 0x02, 0x18, 0x01, 0x18, 0x02, 0x22, 0xd1, 0x01, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x75, 0x6d, 0x75, 0x6c, + 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x75, + 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x3a, 0x30, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, + 0x2a, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x2c, 0x70, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x10, 0x01, 0x18, 0x01, 0x18, 0x04, 0x22, 0xa6, 0x03, 0x0a, 0x0d, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, + 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x73, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x70, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 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, 0x3a, 0x34, + 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x2e, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x0c, 0x0a, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x18, 0x01, 0x12, 0x16, 0x0a, 0x10, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x10, 0x02, + 0x18, 0x01, 0x18, 0x03, 0x22, 0x8b, 0x02, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x6d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x64, 0x69, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x52, 0x06, 0x6d, 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, 0x3a, 0x36, 0xf2, 0x9e, 0xd3, 0x8e, + 0x03, 0x30, 0x0a, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x69, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x2c, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x10, 0x01, 0x18, 0x01, + 0x18, 0x05, 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, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x01, 0x0a, 0x07, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, @@ -5741,6 +5823,34 @@ func file_did_v1_state_proto_rawDescGZIP() []byte { return file_did_v1_state_proto_rawDescData } +var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_did_v1_state_proto_goTypes = []interface{}{ + (*Account)(nil), // 0: did.v1.Account + (*Controller)(nil), // 1: did.v1.Controller + (*Proof)(nil), // 2: did.v1.Proof + (*ServiceRecord)(nil), // 3: did.v1.ServiceRecord + (*VerificationMethod)(nil), // 4: did.v1.VerificationMethod + nil, // 5: did.v1.ServiceRecord.ServiceEndpointsEntry + (*PubKey)(nil), // 6: did.v1.PubKey + (*Alias)(nil), // 7: did.v1.Alias + (*Credential)(nil), // 8: did.v1.Credential + (*Permissions)(nil), // 9: did.v1.Permissions + (DIDNamespace)(0), // 10: did.v1.DIDNamespace +} +var file_did_v1_state_proto_depIdxs = []int32{ + 6, // 0: did.v1.Account.public_key:type_name -> did.v1.PubKey + 7, // 1: did.v1.Controller.aliases:type_name -> did.v1.Alias + 6, // 2: did.v1.Controller.public_key:type_name -> did.v1.PubKey + 8, // 3: did.v1.Controller.authentication:type_name -> did.v1.Credential + 5, // 4: did.v1.ServiceRecord.service_endpoints:type_name -> did.v1.ServiceRecord.ServiceEndpointsEntry + 9, // 5: did.v1.ServiceRecord.permissions:type_name -> did.v1.Permissions + 10, // 6: did.v1.VerificationMethod.method:type_name -> did.v1.DIDNamespace + 6, // 7: did.v1.VerificationMethod.public_key:type_name -> did.v1.PubKey + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name var file_did_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_did_v1_state_proto_goTypes = []interface{}{ (*Aliases)(nil), // 0: did.v1.Aliases @@ -5772,10 +5882,11 @@ func file_did_v1_state_proto_init() { return } file_did_v1_genesis_proto_init() + file_did_v1_models_proto_init() file_did_v1_enums_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Aliases); i { + switch v := v.(*Account); i { case 0: return &v.state case 1: @@ -5787,30 +5898,6 @@ func file_did_v1_state_proto_init() { } } file_did_v1_state_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Assertion); 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[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Attestation); 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[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Controller); i { case 0: return &v.state @@ -5822,8 +5909,8 @@ func file_did_v1_state_proto_init() { return nil } } - file_did_v1_state_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Delegation); i { + file_did_v1_state_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Proof); i { case 0: return &v.state case 1: @@ -5834,8 +5921,20 @@ func file_did_v1_state_proto_init() { return nil } } - file_did_v1_state_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Service); i { + file_did_v1_state_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServiceRecord); 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.(*VerificationMethod); i { case 0: return &v.state case 1: @@ -5853,6 +5952,7 @@ func file_did_v1_state_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_state_proto_rawDesc, NumEnums: 0, + NumMessages: 6, NumMessages: 9, NumExtensions: 0, NumServices: 0, diff --git a/api/did/v1/tx.pulsar.go b/api/did/v1/tx.pulsar.go index b9b465148..acc75d754 100644 --- a/api/did/v1/tx.pulsar.go +++ b/api/did/v1/tx.pulsar.go @@ -20,6 +20,7 @@ var ( md_MsgUpdateParams protoreflect.MessageDescriptor fd_MsgUpdateParams_authority protoreflect.FieldDescriptor fd_MsgUpdateParams_params protoreflect.FieldDescriptor + fd_MsgUpdateParams_token protoreflect.FieldDescriptor ) func init() { @@ -27,6 +28,7 @@ func init() { md_MsgUpdateParams = File_did_v1_tx_proto.Messages().ByName("MsgUpdateParams") fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") + fd_MsgUpdateParams_token = md_MsgUpdateParams.Fields().ByName("token") } var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) @@ -106,6 +108,12 @@ func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescript return } } + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_MsgUpdateParams_token, value) { + return + } + } } // Has reports whether a field is populated. @@ -125,6 +133,8 @@ func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bo return x.Authority != "" case "did.v1.MsgUpdateParams.params": return x.Params != nil + case "did.v1.MsgUpdateParams.token": + return x.Token != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -145,6 +155,8 @@ func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) x.Authority = "" case "did.v1.MsgUpdateParams.params": x.Params = nil + case "did.v1.MsgUpdateParams.token": + x.Token = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -167,6 +179,9 @@ func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescri case "did.v1.MsgUpdateParams.params": value := x.Params return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.MsgUpdateParams.token": + value := x.Token + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -191,6 +206,8 @@ func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, va x.Authority = value.Interface().(string) case "did.v1.MsgUpdateParams.params": x.Params = value.Message().Interface().(*Params) + case "did.v1.MsgUpdateParams.token": + x.Token = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -218,6 +235,8 @@ func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) case "did.v1.MsgUpdateParams.authority": panic(fmt.Errorf("field authority of message did.v1.MsgUpdateParams is not mutable")) + case "did.v1.MsgUpdateParams.token": + panic(fmt.Errorf("field token of message did.v1.MsgUpdateParams is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -236,6 +255,8 @@ func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescripto case "did.v1.MsgUpdateParams.params": m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.MsgUpdateParams.token": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgUpdateParams")) @@ -313,6 +334,10 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.Token) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -342,6 +367,13 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) + i-- + dAtA[i] = 0x1a + } if x.Params != nil { encoded, err := options.Marshal(x.Params) if err != nil { @@ -480,6 +512,38 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -872,6 +936,10 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } var ( + md_MsgAllocateVault protoreflect.MessageDescriptor + fd_MsgAllocateVault_authority protoreflect.FieldDescriptor + fd_MsgAllocateVault_subject protoreflect.FieldDescriptor + fd_MsgAllocateVault_origin protoreflect.FieldDescriptor md_MsgAuthenticate protoreflect.MessageDescriptor fd_MsgAuthenticate_authority protoreflect.FieldDescriptor fd_MsgAuthenticate_controller protoreflect.FieldDescriptor @@ -881,6 +949,21 @@ var ( func init() { file_did_v1_tx_proto_init() + md_MsgAllocateVault = File_did_v1_tx_proto.Messages().ByName("MsgAllocateVault") + fd_MsgAllocateVault_authority = md_MsgAllocateVault.Fields().ByName("authority") + fd_MsgAllocateVault_subject = md_MsgAllocateVault.Fields().ByName("subject") + fd_MsgAllocateVault_origin = md_MsgAllocateVault.Fields().ByName("origin") +} + +var _ protoreflect.Message = (*fastReflection_MsgAllocateVault)(nil) + +type fastReflection_MsgAllocateVault MsgAllocateVault + +func (x *MsgAllocateVault) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgAllocateVault)(x) +} + +func (x *MsgAllocateVault) slowProtoReflect() protoreflect.Message { md_MsgAuthenticate = File_did_v1_tx_proto.Messages().ByName("MsgAuthenticate") fd_MsgAuthenticate_authority = md_MsgAuthenticate.Fields().ByName("authority") fd_MsgAuthenticate_controller = md_MsgAuthenticate.Fields().ByName("controller") @@ -908,6 +991,19 @@ func (x *MsgAuthenticate) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +var _fastReflection_MsgAllocateVault_messageType fastReflection_MsgAllocateVault_messageType +var _ protoreflect.MessageType = fastReflection_MsgAllocateVault_messageType{} + +type fastReflection_MsgAllocateVault_messageType struct{} + +func (x fastReflection_MsgAllocateVault_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgAllocateVault)(nil) +} +func (x fastReflection_MsgAllocateVault_messageType) New() protoreflect.Message { + return new(fastReflection_MsgAllocateVault) +} +func (x fastReflection_MsgAllocateVault_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAllocateVault var _fastReflection_MsgAuthenticate_messageType fastReflection_MsgAuthenticate_messageType var _ protoreflect.MessageType = fastReflection_MsgAuthenticate_messageType{} @@ -925,6 +1021,8 @@ func (x fastReflection_MsgAuthenticate_messageType) Descriptor() protoreflect.Me // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. +func (x *fastReflection_MsgAllocateVault) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAllocateVault func (x *fastReflection_MsgAuthenticate) Descriptor() protoreflect.MessageDescriptor { return md_MsgAuthenticate } @@ -932,6 +1030,13 @@ func (x *fastReflection_MsgAuthenticate) Descriptor() protoreflect.MessageDescri // 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_MsgAllocateVault) Type() protoreflect.MessageType { + return _fastReflection_MsgAllocateVault_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgAllocateVault) New() protoreflect.Message { + return new(fastReflection_MsgAllocateVault) func (x *fastReflection_MsgAuthenticate) Type() protoreflect.MessageType { return _fastReflection_MsgAuthenticate_messageType } @@ -943,6 +1048,8 @@ func (x *fastReflection_MsgAuthenticate) New() protoreflect.Message { // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgAllocateVault) Interface() protoreflect.ProtoMessage { + return (*MsgAllocateVault)(x) func (x *fastReflection_MsgAuthenticate) Interface() protoreflect.ProtoMessage { return (*MsgAuthenticate)(x) } @@ -952,6 +1059,16 @@ func (x *fastReflection_MsgAuthenticate) 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_MsgAllocateVault) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgAllocateVault_authority, value) { + return + } + } + if x.Subject != "" { + value := protoreflect.ValueOfString(x.Subject) + if !f(fd_MsgAllocateVault_subject, value) { func (x *fastReflection_MsgAuthenticate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Authority != "" { value := protoreflect.ValueOfString(x.Authority) @@ -973,6 +1090,7 @@ func (x *fastReflection_MsgAuthenticate) Range(f func(protoreflect.FieldDescript } if x.Origin != "" { value := protoreflect.ValueOfString(x.Origin) + if !f(fd_MsgAllocateVault_origin, value) { if !f(fd_MsgAuthenticate_origin, value) { return } @@ -990,6 +1108,19 @@ func (x *fastReflection_MsgAuthenticate) Range(f func(protoreflect.FieldDescript // 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_MsgAllocateVault) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgAllocateVault.authority": + return x.Authority != "" + case "did.v1.MsgAllocateVault.subject": + return x.Subject != "" + case "did.v1.MsgAllocateVault.origin": + return x.Origin != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", fd.FullName())) func (x *fastReflection_MsgAuthenticate) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "did.v1.MsgAuthenticate.authority": @@ -1014,6 +1145,19 @@ func (x *fastReflection_MsgAuthenticate) Has(fd protoreflect.FieldDescriptor) bo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVault) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgAllocateVault.authority": + x.Authority = "" + case "did.v1.MsgAllocateVault.subject": + x.Subject = "" + case "did.v1.MsgAllocateVault.origin": + x.Origin = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", fd.FullName())) func (x *fastReflection_MsgAuthenticate) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "did.v1.MsgAuthenticate.authority": @@ -1038,6 +1182,15 @@ func (x *fastReflection_MsgAuthenticate) 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_MsgAllocateVault) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgAllocateVault.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "did.v1.MsgAllocateVault.subject": + value := x.Subject + return protoreflect.ValueOfString(value) + case "did.v1.MsgAllocateVault.origin": func (x *fastReflection_MsgAuthenticate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "did.v1.MsgAuthenticate.authority": @@ -1054,6 +1207,9 @@ func (x *fastReflection_MsgAuthenticate) Get(descriptor protoreflect.FieldDescri return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", descriptor.FullName())) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthenticate")) } panic(fmt.Errorf("message did.v1.MsgAuthenticate does not contain field %s", descriptor.FullName())) @@ -1070,6 +1226,19 @@ func (x *fastReflection_MsgAuthenticate) Get(descriptor protoreflect.FieldDescri // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVault) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgAllocateVault.authority": + x.Authority = value.Interface().(string) + case "did.v1.MsgAllocateVault.subject": + x.Subject = value.Interface().(string) + case "did.v1.MsgAllocateVault.origin": + x.Origin = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", fd.FullName())) func (x *fastReflection_MsgAuthenticate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "did.v1.MsgAuthenticate.authority": @@ -1098,6 +1267,19 @@ func (x *fastReflection_MsgAuthenticate) Set(fd protoreflect.FieldDescriptor, va // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVault) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgAllocateVault.authority": + panic(fmt.Errorf("field authority of message did.v1.MsgAllocateVault is not mutable")) + case "did.v1.MsgAllocateVault.subject": + panic(fmt.Errorf("field subject of message did.v1.MsgAllocateVault is not mutable")) + case "did.v1.MsgAllocateVault.origin": + panic(fmt.Errorf("field origin of message did.v1.MsgAllocateVault is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", fd.FullName())) func (x *fastReflection_MsgAuthenticate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "did.v1.MsgAuthenticate.authority": @@ -1119,6 +1301,19 @@ func (x *fastReflection_MsgAuthenticate) Mutable(fd protoreflect.FieldDescriptor // 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_MsgAllocateVault) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgAllocateVault.authority": + return protoreflect.ValueOfString("") + case "did.v1.MsgAllocateVault.subject": + return protoreflect.ValueOfString("") + case "did.v1.MsgAllocateVault.origin": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVault")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVault does not contain field %s", fd.FullName())) func (x *fastReflection_MsgAuthenticate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "did.v1.MsgAuthenticate.authority": @@ -1140,6 +1335,10 @@ func (x *fastReflection_MsgAuthenticate) NewField(fd protoreflect.FieldDescripto // 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_MsgAllocateVault) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgAllocateVault", d.FullName())) func (x *fastReflection_MsgAuthenticate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: @@ -1151,6 +1350,7 @@ func (x *fastReflection_MsgAuthenticate) WhichOneof(d protoreflect.OneofDescript // 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_MsgAllocateVault) GetUnknown() protoreflect.RawFields { func (x *fastReflection_MsgAuthenticate) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1162,6 +1362,7 @@ func (x *fastReflection_MsgAuthenticate) 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_MsgAllocateVault) SetUnknown(fields protoreflect.RawFields) { func (x *fastReflection_MsgAuthenticate) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1174,6 +1375,7 @@ func (x *fastReflection_MsgAuthenticate) SetUnknown(fields protoreflect.RawField // 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_MsgAllocateVault) IsValid() bool { func (x *fastReflection_MsgAuthenticate) IsValid() bool { return x != nil } @@ -1184,6 +1386,9 @@ func (x *fastReflection_MsgAuthenticate) 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_MsgAllocateVault) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgAllocateVault) func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*MsgAuthenticate) @@ -1202,11 +1407,7 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Controller) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Address) + l = len(x.Subject) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1224,6 +1425,7 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgAllocateVault) x := input.Message.Interface().(*MsgAuthenticate) if x == nil { return protoiface.MarshalOutput{ @@ -1248,19 +1450,12 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.Origin) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) i-- - dAtA[i] = 0x22 - } - 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] = 0x1a } - if len(x.Controller) > 0 { - i -= len(x.Controller) - copy(dAtA[i:], x.Controller) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + if len(x.Subject) > 0 { + i -= len(x.Subject) + copy(dAtA[i:], x.Subject) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Subject))) i-- dAtA[i] = 0x12 } @@ -1282,6 +1477,7 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgAllocateVault) x := input.Message.Interface().(*MsgAuthenticate) if x == nil { return protoiface.UnmarshalOutput{ @@ -1314,6 +1510,10 @@ func (x *fastReflection_MsgAuthenticate) 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: MsgAllocateVault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVault: illegal tag %d (wire type %d)", fieldNum, wire) return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAuthenticate: wiretype end group for non-group") } if fieldNum <= 0 { @@ -1354,7 +1554,7 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1382,41 +1582,9 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Controller = string(dAtA[iNdEx:postIndex]) + x.Subject = 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 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 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) } @@ -1484,11 +1652,32 @@ func (x *fastReflection_MsgAuthenticate) ProtoMethods() *protoiface.Methods { } var ( + md_MsgAllocateVaultResponse protoreflect.MessageDescriptor + fd_MsgAllocateVaultResponse_cid protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_expiry_block protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_registration_options protoreflect.FieldDescriptor + fd_MsgAllocateVaultResponse_localhost protoreflect.FieldDescriptor md_MsgAuthenticateResponse protoreflect.MessageDescriptor ) func init() { file_did_v1_tx_proto_init() + md_MsgAllocateVaultResponse = File_did_v1_tx_proto.Messages().ByName("MsgAllocateVaultResponse") + fd_MsgAllocateVaultResponse_cid = md_MsgAllocateVaultResponse.Fields().ByName("cid") + fd_MsgAllocateVaultResponse_expiry_block = md_MsgAllocateVaultResponse.Fields().ByName("expiry_block") + fd_MsgAllocateVaultResponse_registration_options = md_MsgAllocateVaultResponse.Fields().ByName("registration_options") + fd_MsgAllocateVaultResponse_localhost = md_MsgAllocateVaultResponse.Fields().ByName("localhost") +} + +var _ protoreflect.Message = (*fastReflection_MsgAllocateVaultResponse)(nil) + +type fastReflection_MsgAllocateVaultResponse MsgAllocateVaultResponse + +func (x *MsgAllocateVaultResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgAllocateVaultResponse)(x) +} + +func (x *MsgAllocateVaultResponse) slowProtoReflect() protoreflect.Message { md_MsgAuthenticateResponse = File_did_v1_tx_proto.Messages().ByName("MsgAuthenticateResponse") } @@ -1512,6 +1701,19 @@ func (x *MsgAuthenticateResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } +var _fastReflection_MsgAllocateVaultResponse_messageType fastReflection_MsgAllocateVaultResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgAllocateVaultResponse_messageType{} + +type fastReflection_MsgAllocateVaultResponse_messageType struct{} + +func (x fastReflection_MsgAllocateVaultResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgAllocateVaultResponse)(nil) +} +func (x fastReflection_MsgAllocateVaultResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgAllocateVaultResponse) +} +func (x fastReflection_MsgAllocateVaultResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAllocateVaultResponse var _fastReflection_MsgAuthenticateResponse_messageType fastReflection_MsgAuthenticateResponse_messageType var _ protoreflect.MessageType = fastReflection_MsgAuthenticateResponse_messageType{} @@ -1529,6 +1731,8 @@ func (x fastReflection_MsgAuthenticateResponse_messageType) Descriptor() protore // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. +func (x *fastReflection_MsgAllocateVaultResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAllocateVaultResponse func (x *fastReflection_MsgAuthenticateResponse) Descriptor() protoreflect.MessageDescriptor { return md_MsgAuthenticateResponse } @@ -1536,6 +1740,13 @@ func (x *fastReflection_MsgAuthenticateResponse) Descriptor() protoreflect.Messa // 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_MsgAllocateVaultResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgAllocateVaultResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgAllocateVaultResponse) New() protoreflect.Message { + return new(fastReflection_MsgAllocateVaultResponse) func (x *fastReflection_MsgAuthenticateResponse) Type() protoreflect.MessageType { return _fastReflection_MsgAuthenticateResponse_messageType } @@ -1547,6 +1758,8 @@ func (x *fastReflection_MsgAuthenticateResponse) New() protoreflect.Message { // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgAllocateVaultResponse) Interface() protoreflect.ProtoMessage { + return (*MsgAllocateVaultResponse)(x) func (x *fastReflection_MsgAuthenticateResponse) Interface() protoreflect.ProtoMessage { return (*MsgAuthenticateResponse)(x) } @@ -1556,6 +1769,31 @@ func (x *fastReflection_MsgAuthenticateResponse) Interface() protoreflect.ProtoM // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. +func (x *fastReflection_MsgAllocateVaultResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Cid != "" { + value := protoreflect.ValueOfString(x.Cid) + if !f(fd_MsgAllocateVaultResponse_cid, value) { + return + } + } + if x.ExpiryBlock != int64(0) { + value := protoreflect.ValueOfInt64(x.ExpiryBlock) + if !f(fd_MsgAllocateVaultResponse_expiry_block, value) { + return + } + } + if x.RegistrationOptions != "" { + value := protoreflect.ValueOfString(x.RegistrationOptions) + if !f(fd_MsgAllocateVaultResponse_registration_options, value) { + return + } + } + if x.Localhost != false { + value := protoreflect.ValueOfBool(x.Localhost) + if !f(fd_MsgAllocateVaultResponse_localhost, value) { + return + } + } func (x *fastReflection_MsgAuthenticateResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } @@ -1570,10 +1808,22 @@ func (x *fastReflection_MsgAuthenticateResponse) Range(f func(protoreflect.Field // 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_MsgAllocateVaultResponse) Has(fd protoreflect.FieldDescriptor) bool { func (x *fastReflection_MsgAuthenticateResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "did.v1.MsgAllocateVaultResponse.cid": + return x.Cid != "" + case "did.v1.MsgAllocateVaultResponse.expiry_block": + return x.ExpiryBlock != int64(0) + case "did.v1.MsgAllocateVaultResponse.registration_options": + return x.RegistrationOptions != "" + case "did.v1.MsgAllocateVaultResponse.localhost": + return x.Localhost != false default: if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthenticateResponse")) } panic(fmt.Errorf("message did.v1.MsgAuthenticateResponse does not contain field %s", fd.FullName())) @@ -1586,10 +1836,22 @@ func (x *fastReflection_MsgAuthenticateResponse) Has(fd protoreflect.FieldDescri // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVaultResponse) Clear(fd protoreflect.FieldDescriptor) { func (x *fastReflection_MsgAuthenticateResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "did.v1.MsgAllocateVaultResponse.cid": + x.Cid = "" + case "did.v1.MsgAllocateVaultResponse.expiry_block": + x.ExpiryBlock = int64(0) + case "did.v1.MsgAllocateVaultResponse.registration_options": + x.RegistrationOptions = "" + case "did.v1.MsgAllocateVaultResponse.localhost": + x.Localhost = false default: if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthenticateResponse")) } panic(fmt.Errorf("message did.v1.MsgAuthenticateResponse does not contain field %s", fd.FullName())) @@ -1602,10 +1864,26 @@ func (x *fastReflection_MsgAuthenticateResponse) Clear(fd protoreflect.FieldDesc // 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_MsgAllocateVaultResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { func (x *fastReflection_MsgAuthenticateResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "did.v1.MsgAllocateVaultResponse.cid": + value := x.Cid + return protoreflect.ValueOfString(value) + case "did.v1.MsgAllocateVaultResponse.expiry_block": + value := x.ExpiryBlock + return protoreflect.ValueOfInt64(value) + case "did.v1.MsgAllocateVaultResponse.registration_options": + value := x.RegistrationOptions + return protoreflect.ValueOfString(value) + case "did.v1.MsgAllocateVaultResponse.localhost": + value := x.Localhost + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", descriptor.FullName())) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthenticateResponse")) } panic(fmt.Errorf("message did.v1.MsgAuthenticateResponse does not contain field %s", descriptor.FullName())) @@ -1622,10 +1900,22 @@ func (x *fastReflection_MsgAuthenticateResponse) Get(descriptor protoreflect.Fie // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVaultResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { func (x *fastReflection_MsgAuthenticateResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "did.v1.MsgAllocateVaultResponse.cid": + x.Cid = value.Interface().(string) + case "did.v1.MsgAllocateVaultResponse.expiry_block": + x.ExpiryBlock = value.Int() + case "did.v1.MsgAllocateVaultResponse.registration_options": + x.RegistrationOptions = value.Interface().(string) + case "did.v1.MsgAllocateVaultResponse.localhost": + x.Localhost = value.Bool() default: if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthenticateResponse")) } panic(fmt.Errorf("message did.v1.MsgAuthenticateResponse does not contain field %s", fd.FullName())) @@ -1642,10 +1932,22 @@ func (x *fastReflection_MsgAuthenticateResponse) Set(fd protoreflect.FieldDescri // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVaultResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { func (x *fastReflection_MsgAuthenticateResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.MsgAllocateVaultResponse.cid": + panic(fmt.Errorf("field cid of message did.v1.MsgAllocateVaultResponse is not mutable")) + case "did.v1.MsgAllocateVaultResponse.expiry_block": + panic(fmt.Errorf("field expiry_block of message did.v1.MsgAllocateVaultResponse is not mutable")) + case "did.v1.MsgAllocateVaultResponse.registration_options": + panic(fmt.Errorf("field registration_options of message did.v1.MsgAllocateVaultResponse is not mutable")) + case "did.v1.MsgAllocateVaultResponse.localhost": + panic(fmt.Errorf("field localhost of message did.v1.MsgAllocateVaultResponse is not mutable")) default: if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthenticateResponse")) } panic(fmt.Errorf("message did.v1.MsgAuthenticateResponse does not contain field %s", fd.FullName())) @@ -1655,10 +1957,22 @@ func (x *fastReflection_MsgAuthenticateResponse) Mutable(fd protoreflect.FieldDe // 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_MsgAllocateVaultResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { func (x *fastReflection_MsgAuthenticateResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "did.v1.MsgAllocateVaultResponse.cid": + return protoreflect.ValueOfString("") + case "did.v1.MsgAllocateVaultResponse.expiry_block": + return protoreflect.ValueOfInt64(int64(0)) + case "did.v1.MsgAllocateVaultResponse.registration_options": + return protoreflect.ValueOfString("") + case "did.v1.MsgAllocateVaultResponse.localhost": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAllocateVaultResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAllocateVaultResponse does not contain field %s", fd.FullName())) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthenticateResponse")) } panic(fmt.Errorf("message did.v1.MsgAuthenticateResponse does not contain field %s", fd.FullName())) @@ -1668,6 +1982,10 @@ func (x *fastReflection_MsgAuthenticateResponse) NewField(fd protoreflect.FieldD // 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_MsgAllocateVaultResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgAllocateVaultResponse", d.FullName())) func (x *fastReflection_MsgAuthenticateResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: @@ -1679,6 +1997,7 @@ func (x *fastReflection_MsgAuthenticateResponse) WhichOneof(d protoreflect.Oneof // 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_MsgAllocateVaultResponse) GetUnknown() protoreflect.RawFields { func (x *fastReflection_MsgAuthenticateResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1690,6 +2009,7 @@ func (x *fastReflection_MsgAuthenticateResponse) GetUnknown() protoreflect.RawFi // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgAllocateVaultResponse) SetUnknown(fields protoreflect.RawFields) { func (x *fastReflection_MsgAuthenticateResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1702,6 +2022,7 @@ func (x *fastReflection_MsgAuthenticateResponse) SetUnknown(fields protoreflect. // 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_MsgAllocateVaultResponse) IsValid() bool { func (x *fastReflection_MsgAuthenticateResponse) IsValid() bool { return x != nil } @@ -1712,6 +2033,9 @@ func (x *fastReflection_MsgAuthenticateResponse) 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_MsgAllocateVaultResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgAllocateVaultResponse) func (x *fastReflection_MsgAuthenticateResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { x := input.Message.Interface().(*MsgAuthenticateResponse) @@ -1726,6 +2050,20 @@ func (x *fastReflection_MsgAuthenticateResponse) ProtoMethods() *protoiface.Meth var n int var l int _ = l + l = len(x.Cid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.ExpiryBlock != 0 { + n += 1 + runtime.Sov(uint64(x.ExpiryBlock)) + } + l = len(x.RegistrationOptions) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Localhost { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1736,6 +2074,7 @@ func (x *fastReflection_MsgAuthenticateResponse) ProtoMethods() *protoiface.Meth } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgAllocateVaultResponse) x := input.Message.Interface().(*MsgAuthenticateResponse) if x == nil { return protoiface.MarshalOutput{ @@ -1755,6 +2094,35 @@ func (x *fastReflection_MsgAuthenticateResponse) ProtoMethods() *protoiface.Meth i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Localhost { + i-- + if x.Localhost { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(x.RegistrationOptions) > 0 { + i -= len(x.RegistrationOptions) + copy(dAtA[i:], x.RegistrationOptions) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RegistrationOptions))) + i-- + dAtA[i] = 0x1a + } + if x.ExpiryBlock != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ExpiryBlock)) + i-- + dAtA[i] = 0x10 + } + if len(x.Cid) > 0 { + i -= len(x.Cid) + copy(dAtA[i:], x.Cid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cid))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -1766,6 +2134,7 @@ func (x *fastReflection_MsgAuthenticateResponse) ProtoMethods() *protoiface.Meth }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgAllocateVaultResponse) x := input.Message.Interface().(*MsgAuthenticateResponse) if x == nil { return protoiface.UnmarshalOutput{ @@ -1798,12 +2167,5629 @@ func (x *fastReflection_MsgAuthenticateResponse) ProtoMethods() *protoiface.Meth fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVaultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAllocateVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAuthenticateResponse: wiretype end group for non-group") } if fieldNum <= 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAuthenticateResponse: 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 Cid", 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.Cid = 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 ExpiryBlock", wireType) + } + x.ExpiryBlock = 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.ExpiryBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RegistrationOptions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.RegistrationOptions = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Localhost", 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.Localhost = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgProveWitness protoreflect.MessageDescriptor + fd_MsgProveWitness_authority protoreflect.FieldDescriptor + fd_MsgProveWitness_property protoreflect.FieldDescriptor + fd_MsgProveWitness_witness protoreflect.FieldDescriptor + fd_MsgProveWitness_token protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgProveWitness = File_did_v1_tx_proto.Messages().ByName("MsgProveWitness") + fd_MsgProveWitness_authority = md_MsgProveWitness.Fields().ByName("authority") + fd_MsgProveWitness_property = md_MsgProveWitness.Fields().ByName("property") + fd_MsgProveWitness_witness = md_MsgProveWitness.Fields().ByName("witness") + fd_MsgProveWitness_token = md_MsgProveWitness.Fields().ByName("token") +} + +var _ protoreflect.Message = (*fastReflection_MsgProveWitness)(nil) + +type fastReflection_MsgProveWitness MsgProveWitness + +func (x *MsgProveWitness) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgProveWitness)(x) +} + +func (x *MsgProveWitness) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_tx_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_MsgProveWitness_messageType fastReflection_MsgProveWitness_messageType +var _ protoreflect.MessageType = fastReflection_MsgProveWitness_messageType{} + +type fastReflection_MsgProveWitness_messageType struct{} + +func (x fastReflection_MsgProveWitness_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgProveWitness)(nil) +} +func (x fastReflection_MsgProveWitness_messageType) New() protoreflect.Message { + return new(fastReflection_MsgProveWitness) +} +func (x fastReflection_MsgProveWitness_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgProveWitness +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgProveWitness) Descriptor() protoreflect.MessageDescriptor { + return md_MsgProveWitness +} + +// 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_MsgProveWitness) Type() protoreflect.MessageType { + return _fastReflection_MsgProveWitness_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgProveWitness) New() protoreflect.Message { + return new(fastReflection_MsgProveWitness) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgProveWitness) Interface() protoreflect.ProtoMessage { + return (*MsgProveWitness)(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_MsgProveWitness) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgProveWitness_authority, value) { + return + } + } + if x.Property != "" { + value := protoreflect.ValueOfString(x.Property) + if !f(fd_MsgProveWitness_property, value) { + return + } + } + if len(x.Witness) != 0 { + value := protoreflect.ValueOfBytes(x.Witness) + if !f(fd_MsgProveWitness_witness, value) { + return + } + } + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_MsgProveWitness_token, 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_MsgProveWitness) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgProveWitness.authority": + return x.Authority != "" + case "did.v1.MsgProveWitness.property": + return x.Property != "" + case "did.v1.MsgProveWitness.witness": + return len(x.Witness) != 0 + case "did.v1.MsgProveWitness.token": + return x.Token != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitness 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_MsgProveWitness) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgProveWitness.authority": + x.Authority = "" + case "did.v1.MsgProveWitness.property": + x.Property = "" + case "did.v1.MsgProveWitness.witness": + x.Witness = nil + case "did.v1.MsgProveWitness.token": + x.Token = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitness 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_MsgProveWitness) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgProveWitness.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "did.v1.MsgProveWitness.property": + value := x.Property + return protoreflect.ValueOfString(value) + case "did.v1.MsgProveWitness.witness": + value := x.Witness + return protoreflect.ValueOfBytes(value) + case "did.v1.MsgProveWitness.token": + value := x.Token + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitness 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_MsgProveWitness) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgProveWitness.authority": + x.Authority = value.Interface().(string) + case "did.v1.MsgProveWitness.property": + x.Property = value.Interface().(string) + case "did.v1.MsgProveWitness.witness": + x.Witness = value.Bytes() + case "did.v1.MsgProveWitness.token": + x.Token = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitness 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_MsgProveWitness) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgProveWitness.authority": + panic(fmt.Errorf("field authority of message did.v1.MsgProveWitness is not mutable")) + case "did.v1.MsgProveWitness.property": + panic(fmt.Errorf("field property of message did.v1.MsgProveWitness is not mutable")) + case "did.v1.MsgProveWitness.witness": + panic(fmt.Errorf("field witness of message did.v1.MsgProveWitness is not mutable")) + case "did.v1.MsgProveWitness.token": + panic(fmt.Errorf("field token of message did.v1.MsgProveWitness is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitness 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_MsgProveWitness) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgProveWitness.authority": + return protoreflect.ValueOfString("") + case "did.v1.MsgProveWitness.property": + return protoreflect.ValueOfString("") + case "did.v1.MsgProveWitness.witness": + return protoreflect.ValueOfBytes(nil) + case "did.v1.MsgProveWitness.token": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitness")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitness 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_MsgProveWitness) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgProveWitness", 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_MsgProveWitness) 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_MsgProveWitness) 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_MsgProveWitness) 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_MsgProveWitness) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgProveWitness) + 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)) + } + l = len(x.Property) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Witness) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Token) + 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().(*MsgProveWitness) + 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.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) + i-- + dAtA[i] = 0x22 + } + if len(x.Witness) > 0 { + i -= len(x.Witness) + copy(dAtA[i:], x.Witness) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Witness))) + i-- + dAtA[i] = 0x1a + } + if len(x.Property) > 0 { + i -= len(x.Property) + copy(dAtA[i:], x.Property) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Property))) + 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().(*MsgProveWitness) + 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: MsgProveWitness: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgProveWitness: 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 Property", 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.Property = 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 Witness", 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.Witness = append(x.Witness[:0], dAtA[iNdEx:postIndex]...) + if x.Witness == nil { + x.Witness = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token = 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_MsgProveWitnessResponse protoreflect.MessageDescriptor + fd_MsgProveWitnessResponse_success protoreflect.FieldDescriptor + fd_MsgProveWitnessResponse_property protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgProveWitnessResponse = File_did_v1_tx_proto.Messages().ByName("MsgProveWitnessResponse") + fd_MsgProveWitnessResponse_success = md_MsgProveWitnessResponse.Fields().ByName("success") + fd_MsgProveWitnessResponse_property = md_MsgProveWitnessResponse.Fields().ByName("property") +} + +var _ protoreflect.Message = (*fastReflection_MsgProveWitnessResponse)(nil) + +type fastReflection_MsgProveWitnessResponse MsgProveWitnessResponse + +func (x *MsgProveWitnessResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgProveWitnessResponse)(x) +} + +func (x *MsgProveWitnessResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_tx_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_MsgProveWitnessResponse_messageType fastReflection_MsgProveWitnessResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgProveWitnessResponse_messageType{} + +type fastReflection_MsgProveWitnessResponse_messageType struct{} + +func (x fastReflection_MsgProveWitnessResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgProveWitnessResponse)(nil) +} +func (x fastReflection_MsgProveWitnessResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgProveWitnessResponse) +} +func (x fastReflection_MsgProveWitnessResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgProveWitnessResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgProveWitnessResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgProveWitnessResponse +} + +// 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_MsgProveWitnessResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgProveWitnessResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgProveWitnessResponse) New() protoreflect.Message { + return new(fastReflection_MsgProveWitnessResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgProveWitnessResponse) Interface() protoreflect.ProtoMessage { + return (*MsgProveWitnessResponse)(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_MsgProveWitnessResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_MsgProveWitnessResponse_success, value) { + return + } + } + if x.Property != "" { + value := protoreflect.ValueOfString(x.Property) + if !f(fd_MsgProveWitnessResponse_property, 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_MsgProveWitnessResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgProveWitnessResponse.success": + return x.Success != false + case "did.v1.MsgProveWitnessResponse.property": + return x.Property != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitnessResponse")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitnessResponse 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_MsgProveWitnessResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgProveWitnessResponse.success": + x.Success = false + case "did.v1.MsgProveWitnessResponse.property": + x.Property = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitnessResponse")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitnessResponse 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_MsgProveWitnessResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgProveWitnessResponse.success": + value := x.Success + return protoreflect.ValueOfBool(value) + case "did.v1.MsgProveWitnessResponse.property": + value := x.Property + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitnessResponse")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitnessResponse 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_MsgProveWitnessResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgProveWitnessResponse.success": + x.Success = value.Bool() + case "did.v1.MsgProveWitnessResponse.property": + x.Property = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitnessResponse")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitnessResponse 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_MsgProveWitnessResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgProveWitnessResponse.success": + panic(fmt.Errorf("field success of message did.v1.MsgProveWitnessResponse is not mutable")) + case "did.v1.MsgProveWitnessResponse.property": + panic(fmt.Errorf("field property of message did.v1.MsgProveWitnessResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitnessResponse")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitnessResponse 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_MsgProveWitnessResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgProveWitnessResponse.success": + return protoreflect.ValueOfBool(false) + case "did.v1.MsgProveWitnessResponse.property": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgProveWitnessResponse")) + } + panic(fmt.Errorf("message did.v1.MsgProveWitnessResponse 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_MsgProveWitnessResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgProveWitnessResponse", 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_MsgProveWitnessResponse) 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_MsgProveWitnessResponse) 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_MsgProveWitnessResponse) 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_MsgProveWitnessResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgProveWitnessResponse) + 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.Property) + 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().(*MsgProveWitnessResponse) + 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.Property) > 0 { + i -= len(x.Property) + copy(dAtA[i:], x.Property) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Property))) + 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().(*MsgProveWitnessResponse) + 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: MsgProveWitnessResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgProveWitnessResponse: 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 Property", 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.Property = 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_MsgSyncController protoreflect.MessageDescriptor + fd_MsgSyncController_controller protoreflect.FieldDescriptor + fd_MsgSyncController_token protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgSyncController = File_did_v1_tx_proto.Messages().ByName("MsgSyncController") + fd_MsgSyncController_controller = md_MsgSyncController.Fields().ByName("controller") + fd_MsgSyncController_token = md_MsgSyncController.Fields().ByName("token") +} + +var _ protoreflect.Message = (*fastReflection_MsgSyncController)(nil) + +type fastReflection_MsgSyncController MsgSyncController + +func (x *MsgSyncController) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSyncController)(x) +} + +func (x *MsgSyncController) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_tx_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_MsgSyncController_messageType fastReflection_MsgSyncController_messageType +var _ protoreflect.MessageType = fastReflection_MsgSyncController_messageType{} + +type fastReflection_MsgSyncController_messageType struct{} + +func (x fastReflection_MsgSyncController_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSyncController)(nil) +} +func (x fastReflection_MsgSyncController_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSyncController) +} +func (x fastReflection_MsgSyncController_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSyncController +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSyncController) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSyncController +} + +// 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_MsgSyncController) Type() protoreflect.MessageType { + return _fastReflection_MsgSyncController_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSyncController) New() protoreflect.Message { + return new(fastReflection_MsgSyncController) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSyncController) Interface() protoreflect.ProtoMessage { + return (*MsgSyncController)(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_MsgSyncController) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_MsgSyncController_controller, value) { + return + } + } + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_MsgSyncController_token, 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_MsgSyncController) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgSyncController.controller": + return x.Controller != "" + case "did.v1.MsgSyncController.token": + return x.Token != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) + } + panic(fmt.Errorf("message did.v1.MsgSyncController 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_MsgSyncController) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgSyncController.controller": + x.Controller = "" + case "did.v1.MsgSyncController.token": + x.Token = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) + } + panic(fmt.Errorf("message did.v1.MsgSyncController 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_MsgSyncController) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgSyncController.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + case "did.v1.MsgSyncController.token": + value := x.Token + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) + } + panic(fmt.Errorf("message did.v1.MsgSyncController 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_MsgSyncController) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgSyncController.controller": + x.Controller = value.Interface().(string) + case "did.v1.MsgSyncController.token": + x.Token = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) + } + panic(fmt.Errorf("message did.v1.MsgSyncController 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_MsgSyncController) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgSyncController.controller": + panic(fmt.Errorf("field controller of message did.v1.MsgSyncController is not mutable")) + case "did.v1.MsgSyncController.token": + panic(fmt.Errorf("field token of message did.v1.MsgSyncController is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) + } + panic(fmt.Errorf("message did.v1.MsgSyncController 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_MsgSyncController) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgSyncController.controller": + return protoreflect.ValueOfString("") + case "did.v1.MsgSyncController.token": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncController")) + } + panic(fmt.Errorf("message did.v1.MsgSyncController 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_MsgSyncController) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgSyncController", 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_MsgSyncController) 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_MsgSyncController) 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_MsgSyncController) 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_MsgSyncController) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSyncController) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Token) + 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().(*MsgSyncController) + 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.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) + i-- + dAtA[i] = 0x1a + } + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + i-- + dAtA[i] = 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().(*MsgSyncController) + 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: MsgSyncController: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSyncController: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token = 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_MsgSyncControllerResponse protoreflect.MessageDescriptor + fd_MsgSyncControllerResponse_success protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgSyncControllerResponse = File_did_v1_tx_proto.Messages().ByName("MsgSyncControllerResponse") + fd_MsgSyncControllerResponse_success = md_MsgSyncControllerResponse.Fields().ByName("success") +} + +var _ protoreflect.Message = (*fastReflection_MsgSyncControllerResponse)(nil) + +type fastReflection_MsgSyncControllerResponse MsgSyncControllerResponse + +func (x *MsgSyncControllerResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSyncControllerResponse)(x) +} + +func (x *MsgSyncControllerResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_tx_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_MsgSyncControllerResponse_messageType fastReflection_MsgSyncControllerResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgSyncControllerResponse_messageType{} + +type fastReflection_MsgSyncControllerResponse_messageType struct{} + +func (x fastReflection_MsgSyncControllerResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSyncControllerResponse)(nil) +} +func (x fastReflection_MsgSyncControllerResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSyncControllerResponse) +} +func (x fastReflection_MsgSyncControllerResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSyncControllerResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSyncControllerResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSyncControllerResponse +} + +// 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_MsgSyncControllerResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgSyncControllerResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSyncControllerResponse) New() protoreflect.Message { + return new(fastReflection_MsgSyncControllerResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSyncControllerResponse) Interface() protoreflect.ProtoMessage { + return (*MsgSyncControllerResponse)(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_MsgSyncControllerResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_MsgSyncControllerResponse_success, 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_MsgSyncControllerResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgSyncControllerResponse.success": + return x.Success != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncControllerResponse")) + } + panic(fmt.Errorf("message did.v1.MsgSyncControllerResponse 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_MsgSyncControllerResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgSyncControllerResponse.success": + x.Success = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncControllerResponse")) + } + panic(fmt.Errorf("message did.v1.MsgSyncControllerResponse 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_MsgSyncControllerResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgSyncControllerResponse.success": + value := x.Success + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncControllerResponse")) + } + panic(fmt.Errorf("message did.v1.MsgSyncControllerResponse 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_MsgSyncControllerResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgSyncControllerResponse.success": + x.Success = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncControllerResponse")) + } + panic(fmt.Errorf("message did.v1.MsgSyncControllerResponse 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_MsgSyncControllerResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgSyncControllerResponse.success": + panic(fmt.Errorf("field success of message did.v1.MsgSyncControllerResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncControllerResponse")) + } + panic(fmt.Errorf("message did.v1.MsgSyncControllerResponse 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_MsgSyncControllerResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgSyncControllerResponse.success": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgSyncControllerResponse")) + } + panic(fmt.Errorf("message did.v1.MsgSyncControllerResponse 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_MsgSyncControllerResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgSyncControllerResponse", 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_MsgSyncControllerResponse) 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_MsgSyncControllerResponse) 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_MsgSyncControllerResponse) 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_MsgSyncControllerResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSyncControllerResponse) + 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 + } + 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().(*MsgSyncControllerResponse) + 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.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().(*MsgSyncControllerResponse) + 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: MsgSyncControllerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSyncControllerResponse: 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) + 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_MsgRegisterController protoreflect.MessageDescriptor + fd_MsgRegisterController_authority protoreflect.FieldDescriptor + fd_MsgRegisterController_cid protoreflect.FieldDescriptor + fd_MsgRegisterController_origin protoreflect.FieldDescriptor + fd_MsgRegisterController_credential_creation_response 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_cid = md_MsgRegisterController.Fields().ByName("cid") + fd_MsgRegisterController_origin = md_MsgRegisterController.Fields().ByName("origin") + fd_MsgRegisterController_credential_creation_response = md_MsgRegisterController.Fields().ByName("credential_creation_response") +} + +var _ protoreflect.Message = (*fastReflection_MsgRegisterController)(nil) + +type fastReflection_MsgRegisterController MsgRegisterController + +func (x *MsgRegisterController) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRegisterController)(x) +} + +func (x *MsgRegisterController) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_tx_proto_msgTypes[8] + 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_MsgRegisterController_messageType fastReflection_MsgRegisterController_messageType +var _ protoreflect.MessageType = fastReflection_MsgRegisterController_messageType{} + +type fastReflection_MsgRegisterController_messageType struct{} + +func (x fastReflection_MsgRegisterController_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRegisterController)(nil) +} +func (x fastReflection_MsgRegisterController_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRegisterController) +} +func (x fastReflection_MsgRegisterController_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterController +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRegisterController) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterController +} + +// 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_MsgRegisterController) Type() protoreflect.MessageType { + return _fastReflection_MsgRegisterController_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRegisterController) New() protoreflect.Message { + return new(fastReflection_MsgRegisterController) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRegisterController) Interface() protoreflect.ProtoMessage { + return (*MsgRegisterController)(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_MsgRegisterController) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgRegisterController_authority, value) { + return + } + } + if x.Cid != "" { + value := protoreflect.ValueOfString(x.Cid) + if !f(fd_MsgRegisterController_cid, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_MsgRegisterController_origin, value) { + return + } + } + if x.CredentialCreationResponse != "" { + value := protoreflect.ValueOfString(x.CredentialCreationResponse) + if !f(fd_MsgRegisterController_credential_creation_response, 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_MsgRegisterController) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgRegisterController.authority": + return x.Authority != "" + case "did.v1.MsgRegisterController.cid": + return x.Cid != "" + case "did.v1.MsgRegisterController.origin": + return x.Origin != "" + case "did.v1.MsgRegisterController.credential_creation_response": + return x.CredentialCreationResponse != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterController 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_MsgRegisterController) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgRegisterController.authority": + x.Authority = "" + case "did.v1.MsgRegisterController.cid": + x.Cid = "" + case "did.v1.MsgRegisterController.origin": + x.Origin = "" + case "did.v1.MsgRegisterController.credential_creation_response": + x.CredentialCreationResponse = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterController 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_MsgRegisterController) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgRegisterController.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "did.v1.MsgRegisterController.cid": + value := x.Cid + return protoreflect.ValueOfString(value) + case "did.v1.MsgRegisterController.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.MsgRegisterController.credential_creation_response": + value := x.CredentialCreationResponse + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterController 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_MsgRegisterController) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgRegisterController.authority": + x.Authority = value.Interface().(string) + case "did.v1.MsgRegisterController.cid": + x.Cid = value.Interface().(string) + case "did.v1.MsgRegisterController.origin": + x.Origin = value.Interface().(string) + case "did.v1.MsgRegisterController.credential_creation_response": + x.CredentialCreationResponse = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterController 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_MsgRegisterController) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgRegisterController.authority": + panic(fmt.Errorf("field authority of message did.v1.MsgRegisterController is not mutable")) + case "did.v1.MsgRegisterController.cid": + panic(fmt.Errorf("field cid of message did.v1.MsgRegisterController is not mutable")) + case "did.v1.MsgRegisterController.origin": + panic(fmt.Errorf("field origin of message did.v1.MsgRegisterController is not mutable")) + case "did.v1.MsgRegisterController.credential_creation_response": + panic(fmt.Errorf("field credential_creation_response of message did.v1.MsgRegisterController is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterController 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_MsgRegisterController) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgRegisterController.authority": + return protoreflect.ValueOfString("") + case "did.v1.MsgRegisterController.cid": + return protoreflect.ValueOfString("") + case "did.v1.MsgRegisterController.origin": + return protoreflect.ValueOfString("") + case "did.v1.MsgRegisterController.credential_creation_response": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterController")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterController 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_MsgRegisterController) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgRegisterController", 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_MsgRegisterController) 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_MsgRegisterController) 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_MsgRegisterController) 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_MsgRegisterController) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRegisterController) + 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)) + } + l = len(x.Cid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CredentialCreationResponse) + 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().(*MsgRegisterController) + 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.CredentialCreationResponse) > 0 { + i -= len(x.CredentialCreationResponse) + copy(dAtA[i:], x.CredentialCreationResponse) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CredentialCreationResponse))) + i-- + dAtA[i] = 0x22 + } + if len(x.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x1a + } + if len(x.Cid) > 0 { + i -= len(x.Cid) + copy(dAtA[i:], x.Cid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Cid))) + i-- + dAtA[i] = 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().(*MsgRegisterController) + 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: MsgRegisterController: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterController: 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 Cid", 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.Cid = 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 Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CredentialCreationResponse", 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.CredentialCreationResponse = 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 _ 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() { + file_did_v1_tx_proto_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) + +type fastReflection_MsgRegisterControllerResponse MsgRegisterControllerResponse + +func (x *MsgRegisterControllerResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRegisterControllerResponse)(x) +} + +func (x *MsgRegisterControllerResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_tx_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgRegisterControllerResponse_messageType fastReflection_MsgRegisterControllerResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgRegisterControllerResponse_messageType{} + +type fastReflection_MsgRegisterControllerResponse_messageType struct{} + +func (x fastReflection_MsgRegisterControllerResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRegisterControllerResponse)(nil) +} +func (x fastReflection_MsgRegisterControllerResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRegisterControllerResponse) +} +func (x fastReflection_MsgRegisterControllerResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterControllerResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRegisterControllerResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterControllerResponse +} + +// 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_MsgRegisterControllerResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgRegisterControllerResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRegisterControllerResponse) New() protoreflect.Message { + return new(fastReflection_MsgRegisterControllerResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRegisterControllerResponse) Interface() protoreflect.ProtoMessage { + return (*MsgRegisterControllerResponse)(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_MsgRegisterControllerResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_MsgRegisterControllerResponse_success, value) { + return + } + } + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_MsgRegisterControllerResponse_controller, value) { + 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. +// +// 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_MsgRegisterControllerResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgRegisterControllerResponse.success": + 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")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterControllerResponse 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_MsgRegisterControllerResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgRegisterControllerResponse.success": + 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")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterControllerResponse 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_MsgRegisterControllerResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgRegisterControllerResponse.success": + value := x.Success + return protoreflect.ValueOfBool(value) + 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")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterControllerResponse 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_MsgRegisterControllerResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgRegisterControllerResponse.success": + 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")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterControllerResponse 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_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": + panic(fmt.Errorf("field controller of message did.v1.MsgRegisterControllerResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterControllerResponse")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterControllerResponse 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_MsgRegisterControllerResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgRegisterControllerResponse.success": + 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")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterControllerResponse 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_MsgRegisterControllerResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgRegisterControllerResponse", 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_MsgRegisterControllerResponse) 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_MsgRegisterControllerResponse) 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_MsgRegisterControllerResponse) 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_MsgRegisterControllerResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRegisterControllerResponse) + 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.Controller) + 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) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgRegisterControllerResponse) + 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.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) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + 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().(*MsgRegisterControllerResponse) + 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: MsgRegisterControllerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterControllerResponse: 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 Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field 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:]) + 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_MsgAuthorizeService protoreflect.MessageDescriptor + fd_MsgAuthorizeService_controller protoreflect.FieldDescriptor + fd_MsgAuthorizeService_origin protoreflect.FieldDescriptor + fd_MsgAuthorizeService_scopes protoreflect.FieldDescriptor + fd_MsgAuthorizeService_token protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgAuthorizeService = File_did_v1_tx_proto.Messages().ByName("MsgAuthorizeService") + fd_MsgAuthorizeService_controller = md_MsgAuthorizeService.Fields().ByName("controller") + fd_MsgAuthorizeService_origin = md_MsgAuthorizeService.Fields().ByName("origin") + fd_MsgAuthorizeService_scopes = md_MsgAuthorizeService.Fields().ByName("scopes") + fd_MsgAuthorizeService_token = md_MsgAuthorizeService.Fields().ByName("token") +} + +var _ protoreflect.Message = (*fastReflection_MsgAuthorizeService)(nil) + +type fastReflection_MsgAuthorizeService MsgAuthorizeService + +func (x *MsgAuthorizeService) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgAuthorizeService)(x) +} + +func (x *MsgAuthorizeService) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_tx_proto_msgTypes[10] + 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_MsgAuthorizeService_messageType fastReflection_MsgAuthorizeService_messageType +var _ protoreflect.MessageType = fastReflection_MsgAuthorizeService_messageType{} + +type fastReflection_MsgAuthorizeService_messageType struct{} + +func (x fastReflection_MsgAuthorizeService_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgAuthorizeService)(nil) +} +func (x fastReflection_MsgAuthorizeService_messageType) New() protoreflect.Message { + return new(fastReflection_MsgAuthorizeService) +} +func (x fastReflection_MsgAuthorizeService_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAuthorizeService +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgAuthorizeService) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAuthorizeService +} + +// 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_MsgAuthorizeService) Type() protoreflect.MessageType { + return _fastReflection_MsgAuthorizeService_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgAuthorizeService) New() protoreflect.Message { + return new(fastReflection_MsgAuthorizeService) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgAuthorizeService) Interface() protoreflect.ProtoMessage { + return (*MsgAuthorizeService)(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_MsgAuthorizeService) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_MsgAuthorizeService_controller, value) { + return + } + } + if x.Origin != "" { + value := protoreflect.ValueOfString(x.Origin) + if !f(fd_MsgAuthorizeService_origin, value) { + return + } + } + if x.Scopes != nil { + value := protoreflect.ValueOfMessage(x.Scopes.ProtoReflect()) + if !f(fd_MsgAuthorizeService_scopes, value) { + return + } + } + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_MsgAuthorizeService_token, 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_MsgAuthorizeService) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgAuthorizeService.controller": + return x.Controller != "" + case "did.v1.MsgAuthorizeService.origin": + return x.Origin != "" + case "did.v1.MsgAuthorizeService.scopes": + return x.Scopes != nil + case "did.v1.MsgAuthorizeService.token": + return x.Token != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeService 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_MsgAuthorizeService) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgAuthorizeService.controller": + x.Controller = "" + case "did.v1.MsgAuthorizeService.origin": + x.Origin = "" + case "did.v1.MsgAuthorizeService.scopes": + x.Scopes = nil + case "did.v1.MsgAuthorizeService.token": + x.Token = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeService 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_MsgAuthorizeService) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgAuthorizeService.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + case "did.v1.MsgAuthorizeService.origin": + value := x.Origin + return protoreflect.ValueOfString(value) + case "did.v1.MsgAuthorizeService.scopes": + value := x.Scopes + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.MsgAuthorizeService.token": + value := x.Token + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeService 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_MsgAuthorizeService) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgAuthorizeService.controller": + x.Controller = value.Interface().(string) + case "did.v1.MsgAuthorizeService.origin": + x.Origin = value.Interface().(string) + case "did.v1.MsgAuthorizeService.scopes": + x.Scopes = value.Message().Interface().(*Permissions) + case "did.v1.MsgAuthorizeService.token": + x.Token = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeService 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_MsgAuthorizeService) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgAuthorizeService.scopes": + if x.Scopes == nil { + x.Scopes = new(Permissions) + } + return protoreflect.ValueOfMessage(x.Scopes.ProtoReflect()) + case "did.v1.MsgAuthorizeService.controller": + panic(fmt.Errorf("field controller of message did.v1.MsgAuthorizeService is not mutable")) + case "did.v1.MsgAuthorizeService.origin": + panic(fmt.Errorf("field origin of message did.v1.MsgAuthorizeService is not mutable")) + case "did.v1.MsgAuthorizeService.token": + panic(fmt.Errorf("field token of message did.v1.MsgAuthorizeService is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeService 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_MsgAuthorizeService) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgAuthorizeService.controller": + return protoreflect.ValueOfString("") + case "did.v1.MsgAuthorizeService.origin": + return protoreflect.ValueOfString("") + case "did.v1.MsgAuthorizeService.scopes": + m := new(Permissions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.MsgAuthorizeService.token": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeService")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeService 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_MsgAuthorizeService) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgAuthorizeService", 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_MsgAuthorizeService) 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_MsgAuthorizeService) 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_MsgAuthorizeService) 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_MsgAuthorizeService) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgAuthorizeService) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Origin) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Scopes != nil { + l = options.Size(x.Scopes) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Token) + 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().(*MsgAuthorizeService) + 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.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) + i-- + dAtA[i] = 0x22 + } + if x.Scopes != nil { + encoded, err := options.Marshal(x.Scopes) + 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.Origin) > 0 { + i -= len(x.Origin) + copy(dAtA[i:], x.Origin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(x.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgAuthorizeService) + 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: MsgAuthorizeService: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAuthorizeService: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Scopes", 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.Scopes == nil { + x.Scopes = &Permissions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Scopes); 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 Token", 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.Token = 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_MsgAuthorizeServiceResponse protoreflect.MessageDescriptor + fd_MsgAuthorizeServiceResponse_success protoreflect.FieldDescriptor + fd_MsgAuthorizeServiceResponse_token protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgAuthorizeServiceResponse = File_did_v1_tx_proto.Messages().ByName("MsgAuthorizeServiceResponse") + fd_MsgAuthorizeServiceResponse_success = md_MsgAuthorizeServiceResponse.Fields().ByName("success") + fd_MsgAuthorizeServiceResponse_token = md_MsgAuthorizeServiceResponse.Fields().ByName("token") +} + +var _ protoreflect.Message = (*fastReflection_MsgAuthorizeServiceResponse)(nil) + +type fastReflection_MsgAuthorizeServiceResponse MsgAuthorizeServiceResponse + +func (x *MsgAuthorizeServiceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgAuthorizeServiceResponse)(x) +} + +func (x *MsgAuthorizeServiceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_tx_proto_msgTypes[11] + 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_MsgAuthorizeServiceResponse_messageType fastReflection_MsgAuthorizeServiceResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgAuthorizeServiceResponse_messageType{} + +type fastReflection_MsgAuthorizeServiceResponse_messageType struct{} + +func (x fastReflection_MsgAuthorizeServiceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgAuthorizeServiceResponse)(nil) +} +func (x fastReflection_MsgAuthorizeServiceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgAuthorizeServiceResponse) +} +func (x fastReflection_MsgAuthorizeServiceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAuthorizeServiceResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgAuthorizeServiceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgAuthorizeServiceResponse +} + +// 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_MsgAuthorizeServiceResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgAuthorizeServiceResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgAuthorizeServiceResponse) New() protoreflect.Message { + return new(fastReflection_MsgAuthorizeServiceResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgAuthorizeServiceResponse) Interface() protoreflect.ProtoMessage { + return (*MsgAuthorizeServiceResponse)(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_MsgAuthorizeServiceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_MsgAuthorizeServiceResponse_success, value) { + return + } + } + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_MsgAuthorizeServiceResponse_token, 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_MsgAuthorizeServiceResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgAuthorizeServiceResponse.success": + return x.Success != false + case "did.v1.MsgAuthorizeServiceResponse.token": + return x.Token != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeServiceResponse 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_MsgAuthorizeServiceResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgAuthorizeServiceResponse.success": + x.Success = false + case "did.v1.MsgAuthorizeServiceResponse.token": + x.Token = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeServiceResponse 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_MsgAuthorizeServiceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgAuthorizeServiceResponse.success": + value := x.Success + return protoreflect.ValueOfBool(value) + case "did.v1.MsgAuthorizeServiceResponse.token": + value := x.Token + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeServiceResponse 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_MsgAuthorizeServiceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgAuthorizeServiceResponse.success": + x.Success = value.Bool() + case "did.v1.MsgAuthorizeServiceResponse.token": + x.Token = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeServiceResponse 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_MsgAuthorizeServiceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgAuthorizeServiceResponse.success": + panic(fmt.Errorf("field success of message did.v1.MsgAuthorizeServiceResponse is not mutable")) + case "did.v1.MsgAuthorizeServiceResponse.token": + panic(fmt.Errorf("field token of message did.v1.MsgAuthorizeServiceResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeServiceResponse 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_MsgAuthorizeServiceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgAuthorizeServiceResponse.success": + return protoreflect.ValueOfBool(false) + case "did.v1.MsgAuthorizeServiceResponse.token": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgAuthorizeServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgAuthorizeServiceResponse 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_MsgAuthorizeServiceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgAuthorizeServiceResponse", 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_MsgAuthorizeServiceResponse) 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_MsgAuthorizeServiceResponse) 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_MsgAuthorizeServiceResponse) 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_MsgAuthorizeServiceResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgAuthorizeServiceResponse) + 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.Token) + 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().(*MsgAuthorizeServiceResponse) + 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.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) + 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().(*MsgAuthorizeServiceResponse) + 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: MsgAuthorizeServiceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgAuthorizeServiceResponse: 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 Token", 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.Token = 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_MsgRegisterService protoreflect.MessageDescriptor + fd_MsgRegisterService_controller protoreflect.FieldDescriptor + fd_MsgRegisterService_service protoreflect.FieldDescriptor + fd_MsgRegisterService_token protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgRegisterService = File_did_v1_tx_proto.Messages().ByName("MsgRegisterService") + fd_MsgRegisterService_controller = md_MsgRegisterService.Fields().ByName("controller") + fd_MsgRegisterService_service = md_MsgRegisterService.Fields().ByName("service") + fd_MsgRegisterService_token = md_MsgRegisterService.Fields().ByName("token") +} + +var _ protoreflect.Message = (*fastReflection_MsgRegisterService)(nil) + +type fastReflection_MsgRegisterService MsgRegisterService + +func (x *MsgRegisterService) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRegisterService)(x) +} + +func (x *MsgRegisterService) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_tx_proto_msgTypes[12] + 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_MsgRegisterService_messageType fastReflection_MsgRegisterService_messageType +var _ protoreflect.MessageType = fastReflection_MsgRegisterService_messageType{} + +type fastReflection_MsgRegisterService_messageType struct{} + +func (x fastReflection_MsgRegisterService_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRegisterService)(nil) +} +func (x fastReflection_MsgRegisterService_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRegisterService) +} +func (x fastReflection_MsgRegisterService_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterService +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRegisterService) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterService +} + +// 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_MsgRegisterService) Type() protoreflect.MessageType { + return _fastReflection_MsgRegisterService_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRegisterService) New() protoreflect.Message { + return new(fastReflection_MsgRegisterService) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRegisterService) Interface() protoreflect.ProtoMessage { + return (*MsgRegisterService)(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_MsgRegisterService) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Controller != "" { + value := protoreflect.ValueOfString(x.Controller) + if !f(fd_MsgRegisterService_controller, value) { + return + } + } + if x.Service != nil { + value := protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + if !f(fd_MsgRegisterService_service, value) { + return + } + } + if x.Token != "" { + value := protoreflect.ValueOfString(x.Token) + if !f(fd_MsgRegisterService_token, 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_MsgRegisterService) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgRegisterService.controller": + return x.Controller != "" + case "did.v1.MsgRegisterService.service": + return x.Service != nil + case "did.v1.MsgRegisterService.token": + return x.Token != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterService 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_MsgRegisterService) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgRegisterService.controller": + x.Controller = "" + case "did.v1.MsgRegisterService.service": + x.Service = nil + case "did.v1.MsgRegisterService.token": + x.Token = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterService 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_MsgRegisterService) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgRegisterService.controller": + value := x.Controller + return protoreflect.ValueOfString(value) + case "did.v1.MsgRegisterService.service": + value := x.Service + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "did.v1.MsgRegisterService.token": + value := x.Token + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterService 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_MsgRegisterService) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgRegisterService.controller": + x.Controller = value.Interface().(string) + case "did.v1.MsgRegisterService.service": + x.Service = value.Message().Interface().(*Service) + case "did.v1.MsgRegisterService.token": + x.Token = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterService 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_MsgRegisterService) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgRegisterService.service": + if x.Service == nil { + x.Service = new(Service) + } + return protoreflect.ValueOfMessage(x.Service.ProtoReflect()) + case "did.v1.MsgRegisterService.controller": + panic(fmt.Errorf("field controller of message did.v1.MsgRegisterService is not mutable")) + case "did.v1.MsgRegisterService.token": + panic(fmt.Errorf("field token of message did.v1.MsgRegisterService is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterService 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_MsgRegisterService) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgRegisterService.controller": + return protoreflect.ValueOfString("") + case "did.v1.MsgRegisterService.service": + m := new(Service) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "did.v1.MsgRegisterService.token": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterService")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterService 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_MsgRegisterService) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgRegisterService", 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_MsgRegisterService) 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_MsgRegisterService) 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_MsgRegisterService) 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_MsgRegisterService) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRegisterService) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Controller) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Service != nil { + l = options.Size(x.Service) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Token) + 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().(*MsgRegisterService) + 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.Token) > 0 { + i -= len(x.Token) + copy(dAtA[i:], x.Token) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Token))) + i-- + dAtA[i] = 0x1a + } + if x.Service != nil { + encoded, err := options.Marshal(x.Service) + 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.Controller) > 0 { + i -= len(x.Controller) + copy(dAtA[i:], x.Controller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Controller))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgRegisterService) + 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: MsgRegisterService: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterService: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service == nil { + x.Service = &Service{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Service); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token = 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_MsgRegisterServiceResponse protoreflect.MessageDescriptor + fd_MsgRegisterServiceResponse_success protoreflect.FieldDescriptor + fd_MsgRegisterServiceResponse_did protoreflect.FieldDescriptor +) + +func init() { + file_did_v1_tx_proto_init() + md_MsgRegisterServiceResponse = File_did_v1_tx_proto.Messages().ByName("MsgRegisterServiceResponse") + fd_MsgRegisterServiceResponse_success = md_MsgRegisterServiceResponse.Fields().ByName("success") + fd_MsgRegisterServiceResponse_did = md_MsgRegisterServiceResponse.Fields().ByName("did") +} + +var _ protoreflect.Message = (*fastReflection_MsgRegisterServiceResponse)(nil) + +type fastReflection_MsgRegisterServiceResponse MsgRegisterServiceResponse + +func (x *MsgRegisterServiceResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRegisterServiceResponse)(x) +} + +func (x *MsgRegisterServiceResponse) slowProtoReflect() protoreflect.Message { + mi := &file_did_v1_tx_proto_msgTypes[13] + 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_MsgRegisterServiceResponse_messageType fastReflection_MsgRegisterServiceResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgRegisterServiceResponse_messageType{} + +type fastReflection_MsgRegisterServiceResponse_messageType struct{} + +func (x fastReflection_MsgRegisterServiceResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRegisterServiceResponse)(nil) +} +func (x fastReflection_MsgRegisterServiceResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRegisterServiceResponse) +} +func (x fastReflection_MsgRegisterServiceResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterServiceResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgRegisterServiceResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRegisterServiceResponse +} + +// 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_MsgRegisterServiceResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgRegisterServiceResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgRegisterServiceResponse) New() protoreflect.Message { + return new(fastReflection_MsgRegisterServiceResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgRegisterServiceResponse) Interface() protoreflect.ProtoMessage { + return (*MsgRegisterServiceResponse)(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_MsgRegisterServiceResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Success != false { + value := protoreflect.ValueOfBool(x.Success) + if !f(fd_MsgRegisterServiceResponse_success, value) { + return + } + } + if x.Did != "" { + value := protoreflect.ValueOfString(x.Did) + if !f(fd_MsgRegisterServiceResponse_did, 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_MsgRegisterServiceResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "did.v1.MsgRegisterServiceResponse.success": + return x.Success != false + case "did.v1.MsgRegisterServiceResponse.did": + return x.Did != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterServiceResponse 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_MsgRegisterServiceResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "did.v1.MsgRegisterServiceResponse.success": + x.Success = false + case "did.v1.MsgRegisterServiceResponse.did": + x.Did = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterServiceResponse 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_MsgRegisterServiceResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "did.v1.MsgRegisterServiceResponse.success": + value := x.Success + return protoreflect.ValueOfBool(value) + case "did.v1.MsgRegisterServiceResponse.did": + value := x.Did + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterServiceResponse 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_MsgRegisterServiceResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "did.v1.MsgRegisterServiceResponse.success": + x.Success = value.Bool() + case "did.v1.MsgRegisterServiceResponse.did": + x.Did = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterServiceResponse 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_MsgRegisterServiceResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgRegisterServiceResponse.success": + panic(fmt.Errorf("field success of message did.v1.MsgRegisterServiceResponse is not mutable")) + case "did.v1.MsgRegisterServiceResponse.did": + panic(fmt.Errorf("field did of message did.v1.MsgRegisterServiceResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterServiceResponse 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_MsgRegisterServiceResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "did.v1.MsgRegisterServiceResponse.success": + return protoreflect.ValueOfBool(false) + case "did.v1.MsgRegisterServiceResponse.did": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.MsgRegisterServiceResponse")) + } + panic(fmt.Errorf("message did.v1.MsgRegisterServiceResponse 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_MsgRegisterServiceResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in did.v1.MsgRegisterServiceResponse", 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_MsgRegisterServiceResponse) 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_MsgRegisterServiceResponse) 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_MsgRegisterServiceResponse) 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_MsgRegisterServiceResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgRegisterServiceResponse) + 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.Did) + 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().(*MsgRegisterServiceResponse) + 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.Did) > 0 { + i -= len(x.Did) + copy(dAtA[i:], x.Did) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did))) + i-- + dAtA[i] = 0x12 + } + if x.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().(*MsgRegisterServiceResponse) + 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: MsgRegisterServiceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRegisterServiceResponse: 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 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 default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -6431,9 +12417,9 @@ 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,omitempty"` + // token is the macron token to authenticate the operation. + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` } func (x *MsgUpdateParams) Reset() { @@ -6470,6 +12456,13 @@ func (x *MsgUpdateParams) GetParams() *Params { return nil } +func (x *MsgUpdateParams) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. // @@ -6500,6 +12493,127 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_did_v1_tx_proto_rawDescGZIP(), []int{1} } +// MsgAllocateVault is the message type for the AllocateVault RPC. +type MsgAllocateVault struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address of the service account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // subject is a unique human-defined identifier to associate with the vault. + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + // origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` +} + +func (x *MsgAllocateVault) Reset() { + *x = MsgAllocateVault{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgAllocateVault) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgAllocateVault) ProtoMessage() {} + +// Deprecated: Use MsgAllocateVault.ProtoReflect.Descriptor instead. +func (*MsgAllocateVault) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgAllocateVault) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgAllocateVault) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *MsgAllocateVault) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +// MsgAllocateVaultResponse is the response type for the AllocateVault RPC. +type MsgAllocateVaultResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // CID is the content identifier of the vault. + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` + // ExpiryBlock is the block number at which the vault will expire. + ExpiryBlock int64 `protobuf:"varint,2,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"` + // RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn + RegistrationOptions string `protobuf:"bytes,3,opt,name=registration_options,json=registrationOptions,proto3" json:"registration_options,omitempty"` + // IsLocalhost is a flag to indicate if the vault is localhost + Localhost bool `protobuf:"varint,4,opt,name=localhost,proto3" json:"localhost,omitempty"` +} + +func (x *MsgAllocateVaultResponse) Reset() { + *x = MsgAllocateVaultResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgAllocateVaultResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgAllocateVaultResponse) ProtoMessage() {} + +// Deprecated: Use MsgAllocateVaultResponse.ProtoReflect.Descriptor instead. +func (*MsgAllocateVaultResponse) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *MsgAllocateVaultResponse) GetCid() string { + if x != nil { + return x.Cid + } + return "" +} + +func (x *MsgAllocateVaultResponse) GetExpiryBlock() int64 { + if x != nil { + return x.ExpiryBlock + } + return 0 +} + +func (x *MsgAllocateVaultResponse) GetRegistrationOptions() string { + if x != nil { + return x.RegistrationOptions + } + return "" +} + +func (x *MsgAllocateVaultResponse) GetLocalhost() bool { + if x != nil { + return x.Localhost + } + return false +} + +// MsgProveWitness is the message type for the ProveWitness RPC. +type MsgProveWitness struct { // MsgAuthenticate is the message type for the Authenticate RPC. type MsgAuthenticate struct { state protoimpl.MessageState @@ -6508,12 +12622,12 @@ type MsgAuthenticate struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // Controller is the address of the controller to authenticate. - Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` - // Address is the address to authenticate. - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - // Origin is the origin of the request in wildcard form. - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + // property is key to prove. + Property string `protobuf:"bytes,2,opt,name=property,proto3" json:"property,omitempty"` + // Witness Value is the bytes of the witness. + Witness []byte `protobuf:"bytes,3,opt,name=witness,proto3" json:"witness,omitempty"` + // token is the macron token to authenticate the operation. + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` } func (x *MsgAuthenticate) Reset() { @@ -6646,6 +12760,13 @@ func (x *MsgProveWitness) GetWitness() []byte { return nil } +func (x *MsgProveWitness) GetToken() string { + if x != nil { + return x.Token + } + return nil +} + // MsgProveWitnessResponse is the response type for the ProveWitness RPC. type MsgProveWitnessResponse struct { state protoimpl.MessageState @@ -6690,6 +12811,8 @@ func (x *MsgProveWitnessResponse) GetProperty() string { return "" } +// MsgSyncController is the message type for the SyncController RPC. +type MsgSyncController struct { // MsgSyncVault is the message type for the SyncVault RPC. type MsgSyncVault struct { state protoimpl.MessageState @@ -6698,6 +12821,12 @@ type MsgSyncVault struct { // controller is the address of the controller to sync. Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + // Token is the public token to authenticate the operation. + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *MsgSyncController) Reset() { + *x = MsgSyncController{} // cid is the IPFS content identifier. Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` // Macroon is the public token to authenticate the operation. @@ -6713,6 +12842,18 @@ func (x *MsgSyncVault) Reset() { } } +func (x *MsgSyncController) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSyncController) ProtoMessage() {} + +// Deprecated: Use MsgSyncController.ProtoReflect.Descriptor instead. +func (*MsgSyncController) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgSyncController) GetController() string { func (x *MsgSyncVault) String() string { return protoimpl.X.MessageStringOf(x) } @@ -6731,6 +12872,9 @@ func (x *MsgSyncVault) GetController() string { return "" } +func (x *MsgSyncController) GetToken() string { + if x != nil { + return x.Token func (x *MsgSyncVault) GetCid() string { if x != nil { return x.Cid @@ -6738,6 +12882,8 @@ func (x *MsgSyncVault) GetCid() string { return "" } +// MsgSyncControllerResponse is the response type for the SyncController RPC. +type MsgSyncControllerResponse struct { func (x *MsgSyncVault) GetMacron() []byte { if x != nil { return x.Macron @@ -6754,6 +12900,8 @@ type MsgSyncVaultResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } +func (x *MsgSyncControllerResponse) Reset() { + *x = MsgSyncControllerResponse{} func (x *MsgSyncVaultResponse) Reset() { *x = MsgSyncVaultResponse{} if protoimpl.UnsafeEnabled { @@ -6763,6 +12911,18 @@ func (x *MsgSyncVaultResponse) Reset() { } } +func (x *MsgSyncControllerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSyncControllerResponse) ProtoMessage() {} + +// Deprecated: Use MsgSyncControllerResponse.ProtoReflect.Descriptor instead. +func (*MsgSyncControllerResponse) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{7} +} + +func (x *MsgSyncControllerResponse) GetSuccess() bool { func (x *MsgSyncVaultResponse) String() string { return protoimpl.X.MessageStringOf(x) } @@ -6790,6 +12950,11 @@ 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. + Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` + // Origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` + // Credential is the list of keyshares to initialize the controller with. + CredentialCreationResponse string `protobuf:"bytes,4,opt,name=credential_creation_response,json=credentialCreationResponse,proto3" json:"credential_creation_response,omitempty"` 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"` @@ -6824,6 +12989,25 @@ func (x *MsgRegisterController) GetAuthority() string { return "" } +func (x *MsgRegisterController) GetCid() string { + if x != nil { + return x.Cid + } + return "" +} + +func (x *MsgRegisterController) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *MsgRegisterController) GetCredentialCreationResponse() string { + if x != nil { + return x.CredentialCreationResponse + } + return "" func (x *MsgRegisterController) GetAssertions() [][]byte { if x != nil { return x.Assertions @@ -6851,6 +13035,12 @@ type MsgRegisterControllerResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Success returns true if the specified cid is valid and not already encrypted. + 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"` // Controller is the address of the initialized controller. Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` // Accounts are a Address Map and Supported coin Denoms for the controller @@ -6877,6 +13067,13 @@ func (*MsgRegisterControllerResponse) Descriptor() ([]byte, []int) { return file_did_v1_tx_proto_rawDescGZIP(), []int{9} } +func (x *MsgRegisterControllerResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + func (x *MsgRegisterControllerResponse) GetController() string { if x != nil { return x.Controller @@ -6891,6 +13088,114 @@ func (x *MsgRegisterControllerResponse) GetAccounts() map[string]string { return nil } +// MsgAuthorizeService is the message type for the AuthorizeService RPC. +type MsgAuthorizeService struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Controller is the address of the controller to authenticate. + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + // Origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + // Permissions is the scope of the service. + Scopes *Permissions `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` + // token is the macron token to authenticate the operation. + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *MsgAuthorizeService) Reset() { + *x = MsgAuthorizeService{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgAuthorizeService) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgAuthorizeService) ProtoMessage() {} + +// Deprecated: Use MsgAuthorizeService.ProtoReflect.Descriptor instead. +func (*MsgAuthorizeService) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{10} +} + +func (x *MsgAuthorizeService) GetController() string { + if x != nil { + return x.Controller + } + return "" +} + +func (x *MsgAuthorizeService) GetOrigin() string { + if x != nil { + return x.Origin + } + return "" +} + +func (x *MsgAuthorizeService) GetScopes() *Permissions { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *MsgAuthorizeService) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// MsgAuthorizeServiceResponse is the response type for the AuthorizeService RPC. +type MsgAuthorizeServiceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *MsgAuthorizeServiceResponse) Reset() { + *x = MsgAuthorizeServiceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgAuthorizeServiceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgAuthorizeServiceResponse) ProtoMessage() {} + +// Deprecated: Use MsgAuthorizeServiceResponse.ProtoReflect.Descriptor instead. +func (*MsgAuthorizeServiceResponse) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{11} +} + +func (x *MsgAuthorizeServiceResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *MsgAuthorizeServiceResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + // MsgRegisterService is the message type for the RegisterService RPC. type MsgRegisterService struct { state protoimpl.MessageState @@ -6898,6 +13203,11 @@ type MsgRegisterService struct { unknownFields protoimpl.UnknownFields // authority is the address of the governance account. + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + // origin is the origin of the request in wildcard form. Requires valid TXT record in DNS. + Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` + // token is the macron token to authenticate the operation. + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // origin is the origin of the request in wildcard form. OriginUri string `protobuf:"bytes,2,opt,name=origin_uri,json=originUri,proto3" json:"origin_uri,omitempty"` @@ -6908,6 +13218,7 @@ type MsgRegisterService struct { func (x *MsgRegisterService) Reset() { *x = MsgRegisterService{} if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[12] mi := &file_did_v1_tx_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) @@ -6922,6 +13233,12 @@ func (*MsgRegisterService) ProtoMessage() {} // Deprecated: Use MsgRegisterService.ProtoReflect.Descriptor instead. func (*MsgRegisterService) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{12} +} + +func (x *MsgRegisterService) GetController() string { + if x != nil { + return x.Controller return file_did_v1_tx_proto_rawDescGZIP(), []int{10} } @@ -6932,6 +13249,9 @@ func (x *MsgRegisterService) GetAuthority() string { return "" } +func (x *MsgRegisterService) GetService() *Service { + if x != nil { + return x.Service func (x *MsgRegisterService) GetOriginUri() string { if x != nil { return x.OriginUri @@ -6946,18 +13266,28 @@ func (x *MsgRegisterService) GetScopes() []PermissionScope { return nil } +func (x *MsgRegisterService) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + // MsgRegisterServiceResponse is the response type for the RegisterService RPC. type MsgRegisterServiceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` } func (x *MsgRegisterServiceResponse) Reset() { *x = MsgRegisterServiceResponse{} if protoimpl.UnsafeEnabled { + mi := &file_did_v1_tx_proto_msgTypes[13] mi := &file_did_v1_tx_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) @@ -6972,6 +13302,7 @@ func (*MsgRegisterServiceResponse) ProtoMessage() {} // Deprecated: Use MsgRegisterServiceResponse.ProtoReflect.Descriptor instead. func (*MsgRegisterServiceResponse) Descriptor() ([]byte, []int) { + return file_did_v1_tx_proto_rawDescGZIP(), []int{13} return file_did_v1_tx_proto_rawDescGZIP(), []int{11} } @@ -6982,12 +13313,183 @@ func (x *MsgRegisterServiceResponse) GetSuccess() bool { return false } +func (x *MsgRegisterServiceResponse) GetDid() string { + if x != nil { + return x.Did + } + return "" +} + var File_did_v1_tx_proto protoreflect.FileDescriptor var file_did_v1_tx_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 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, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x64, + 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 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, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x4d, 0x73, + 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x36, + 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xa0, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, + 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x79, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, + 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x22, 0xa5, 0x01, 0x0a, 0x0f, + 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x57, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x12, + 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x77, 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x22, 0x4f, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x57, + 0x69, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x22, 0x74, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x22, 0x35, 0x0a, 0x19, 0x4d, 0x73, + 0x67, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x22, 0xcb, 0x01, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x40, 0x0a, + 0x1c, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x1a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x3a, + 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, + 0x81, 0x02, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0xbb, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, + 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x22, 0x4d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0xa0, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x12, 0x29, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x3a, 0x0f, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x65, 0x72, 0x22, 0x48, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x32, 0xf8, 0x03, + 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x48, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x17, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1f, + 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x54, 0x0a, 0x10, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x1b, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x1a, 0x23, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, + 0x1a, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x6c, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0e, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x1a, + 0x21, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, + 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x1a, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x22, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x77, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, + 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, + 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, + 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x74, 0x6f, 0x1a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 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, @@ -7139,6 +13641,49 @@ 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, 15) +var file_did_v1_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: did.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: did.v1.MsgUpdateParamsResponse + (*MsgAllocateVault)(nil), // 2: did.v1.MsgAllocateVault + (*MsgAllocateVaultResponse)(nil), // 3: did.v1.MsgAllocateVaultResponse + (*MsgProveWitness)(nil), // 4: did.v1.MsgProveWitness + (*MsgProveWitnessResponse)(nil), // 5: did.v1.MsgProveWitnessResponse + (*MsgSyncController)(nil), // 6: did.v1.MsgSyncController + (*MsgSyncControllerResponse)(nil), // 7: did.v1.MsgSyncControllerResponse + (*MsgRegisterController)(nil), // 8: did.v1.MsgRegisterController + (*MsgRegisterControllerResponse)(nil), // 9: did.v1.MsgRegisterControllerResponse + (*MsgAuthorizeService)(nil), // 10: did.v1.MsgAuthorizeService + (*MsgAuthorizeServiceResponse)(nil), // 11: did.v1.MsgAuthorizeServiceResponse + (*MsgRegisterService)(nil), // 12: did.v1.MsgRegisterService + (*MsgRegisterServiceResponse)(nil), // 13: did.v1.MsgRegisterServiceResponse + nil, // 14: did.v1.MsgRegisterControllerResponse.AccountsEntry + (*Params)(nil), // 15: did.v1.Params + (*Permissions)(nil), // 16: did.v1.Permissions + (*Service)(nil), // 17: did.v1.Service +} +var file_did_v1_tx_proto_depIdxs = []int32{ + 15, // 0: did.v1.MsgUpdateParams.params:type_name -> did.v1.Params + 14, // 1: did.v1.MsgRegisterControllerResponse.accounts:type_name -> did.v1.MsgRegisterControllerResponse.AccountsEntry + 16, // 2: did.v1.MsgAuthorizeService.scopes:type_name -> did.v1.Permissions + 17, // 3: did.v1.MsgRegisterService.service:type_name -> did.v1.Service + 0, // 4: did.v1.Msg.UpdateParams:input_type -> did.v1.MsgUpdateParams + 10, // 5: did.v1.Msg.AuthorizeService:input_type -> did.v1.MsgAuthorizeService + 2, // 6: did.v1.Msg.AllocateVault:input_type -> did.v1.MsgAllocateVault + 6, // 7: did.v1.Msg.SyncController:input_type -> did.v1.MsgSyncController + 8, // 8: did.v1.Msg.RegisterController:input_type -> did.v1.MsgRegisterController + 12, // 9: did.v1.Msg.RegisterService:input_type -> did.v1.MsgRegisterService + 1, // 10: did.v1.Msg.UpdateParams:output_type -> did.v1.MsgUpdateParamsResponse + 11, // 11: did.v1.Msg.AuthorizeService:output_type -> did.v1.MsgAuthorizeServiceResponse + 3, // 12: did.v1.Msg.AllocateVault:output_type -> did.v1.MsgAllocateVaultResponse + 7, // 13: did.v1.Msg.SyncController:output_type -> did.v1.MsgSyncControllerResponse + 9, // 14: did.v1.Msg.RegisterController:output_type -> did.v1.MsgRegisterControllerResponse + 13, // 15: did.v1.Msg.RegisterService:output_type -> did.v1.MsgRegisterServiceResponse + 10, // [10:16] is the sub-list for method output_type + 4, // [4:10] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name var file_did_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_did_v1_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: did.v1.MsgUpdateParams @@ -7187,6 +13732,7 @@ func file_did_v1_tx_proto_init() { } file_did_v1_enums_proto_init() file_did_v1_genesis_proto_init() + file_did_v1_models_proto_init() if !protoimpl.UnsafeEnabled { file_did_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { @@ -7213,6 +13759,7 @@ func file_did_v1_tx_proto_init() { } } file_did_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgAllocateVault); i { switch v := v.(*MsgAuthenticate); i { case 0: return &v.state @@ -7225,6 +13772,7 @@ func file_did_v1_tx_proto_init() { } } file_did_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgAllocateVaultResponse); i { switch v := v.(*MsgAuthenticateResponse); i { case 0: return &v.state @@ -7261,6 +13809,7 @@ func file_did_v1_tx_proto_init() { } } file_did_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSyncController); i { switch v := v.(*MsgSyncVault); i { case 0: return &v.state @@ -7273,6 +13822,7 @@ func file_did_v1_tx_proto_init() { } } file_did_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSyncControllerResponse); i { switch v := v.(*MsgSyncVaultResponse); i { case 0: return &v.state @@ -7309,6 +13859,30 @@ func file_did_v1_tx_proto_init() { } } file_did_v1_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgAuthorizeService); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgAuthorizeServiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_did_v1_tx_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterService); i { case 0: return &v.state @@ -7320,6 +13894,7 @@ func file_did_v1_tx_proto_init() { return nil } } + file_did_v1_tx_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { file_did_v1_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterServiceResponse); i { case 0: @@ -7339,6 +13914,7 @@ func file_did_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_did_v1_tx_proto_rawDesc, NumEnums: 0, + NumMessages: 15, NumMessages: 13, NumExtensions: 0, NumServices: 1, diff --git a/api/did/v1/tx_grpc.pb.go b/api/did/v1/tx_grpc.pb.go index 29ad8109c..bde78d883 100644 --- a/api/did/v1/tx_grpc.pb.go +++ b/api/did/v1/tx_grpc.pb.go @@ -20,6 +20,9 @@ const _ = grpc.SupportPackageIsVersion7 const ( Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams" + Msg_AuthorizeService_FullMethodName = "/did.v1.Msg/AuthorizeService" + Msg_AllocateVault_FullMethodName = "/did.v1.Msg/AllocateVault" + Msg_SyncController_FullMethodName = "/did.v1.Msg/SyncController" Msg_Authenticate_FullMethodName = "/did.v1.Msg/Authenticate" Msg_ProveWitness_FullMethodName = "/did.v1.Msg/ProveWitness" Msg_SyncVault_FullMethodName = "/did.v1.Msg/SyncVault" @@ -35,6 +38,13 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // AuthorizeService asserts the given controller is the owner of the given address. + AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) + // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. + // this operation is called by services initiating a controller registration. + AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) + // SyncController synchronizes the controller with the Vault Motr DWN WASM Wallet. + SyncController(ctx context.Context, in *MsgSyncController, opts ...grpc.CallOption) (*MsgSyncControllerResponse, error) // Authenticate asserts the given controller is the owner of the given address. Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error) // ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators. @@ -64,6 +74,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) { + out := new(MsgAuthorizeServiceResponse) + err := c.cc.Invoke(ctx, Msg_AuthorizeService_FullMethodName, in, out, opts...) func (c *msgClient) Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error) { out := new(MsgAuthenticateResponse) err := c.cc.Invoke(ctx, Msg_Authenticate_FullMethodName, in, out, opts...) @@ -73,6 +86,9 @@ func (c *msgClient) Authenticate(ctx context.Context, in *MsgAuthenticate, opts return out, nil } +func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) { + out := new(MsgAllocateVaultResponse) + err := c.cc.Invoke(ctx, Msg_AllocateVault_FullMethodName, in, out, opts...) func (c *msgClient) ProveWitness(ctx context.Context, in *MsgProveWitness, opts ...grpc.CallOption) (*MsgProveWitnessResponse, error) { out := new(MsgProveWitnessResponse) err := c.cc.Invoke(ctx, Msg_ProveWitness_FullMethodName, in, out, opts...) @@ -82,6 +98,9 @@ func (c *msgClient) ProveWitness(ctx context.Context, in *MsgProveWitness, opts return out, nil } +func (c *msgClient) SyncController(ctx context.Context, in *MsgSyncController, opts ...grpc.CallOption) (*MsgSyncControllerResponse, error) { + out := new(MsgSyncControllerResponse) + err := c.cc.Invoke(ctx, Msg_SyncController_FullMethodName, in, out, opts...) func (c *msgClient) SyncVault(ctx context.Context, in *MsgSyncVault, opts ...grpc.CallOption) (*MsgSyncVaultResponse, error) { out := new(MsgSyncVaultResponse) err := c.cc.Invoke(ctx, Msg_SyncVault_FullMethodName, in, out, opts...) @@ -117,6 +136,13 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // AuthorizeService asserts the given controller is the owner of the given address. + AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) + // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. + // this operation is called by services initiating a controller registration. + AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) + // SyncController synchronizes the controller with the Vault Motr DWN WASM Wallet. + SyncController(context.Context, *MsgSyncController) (*MsgSyncControllerResponse, error) // Authenticate asserts the given controller is the owner of the given address. Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error) // ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators. @@ -137,6 +163,14 @@ type UnimplementedMsgServer struct { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (UnimplementedMsgServer) AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuthorizeService not implemented") +} +func (UnimplementedMsgServer) AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented") +} +func (UnimplementedMsgServer) SyncController(context.Context, *MsgSyncController) (*MsgSyncControllerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SyncController not implemented") func (UnimplementedMsgServer) Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented") } @@ -183,12 +217,22 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_AuthorizeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAuthorizeService) func _Msg_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgAuthenticate) if err := dec(in); err != nil { return nil, err } if interceptor == nil { + return srv.(MsgServer).AuthorizeService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_AuthorizeService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AuthorizeService(ctx, req.(*MsgAuthorizeService)) return srv.(MsgServer).Authenticate(ctx, in) } info := &grpc.UnaryServerInfo{ @@ -201,12 +245,22 @@ func _Msg_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAllocateVault) func _Msg_ProveWitness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgProveWitness) if err := dec(in); err != nil { return nil, err } if interceptor == nil { + return srv.(MsgServer).AllocateVault(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_AllocateVault_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault)) return srv.(MsgServer).ProveWitness(ctx, in) } info := &grpc.UnaryServerInfo{ @@ -219,12 +273,22 @@ func _Msg_ProveWitness_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_SyncController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSyncController) func _Msg_SyncVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgSyncVault) if err := dec(in); err != nil { return nil, err } if interceptor == nil { + return srv.(MsgServer).SyncController(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_SyncController_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SyncController(ctx, req.(*MsgSyncController)) return srv.(MsgServer).SyncVault(ctx, in) } info := &grpc.UnaryServerInfo{ @@ -285,6 +349,16 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ Handler: _Msg_UpdateParams_Handler, }, { + MethodName: "AuthorizeService", + Handler: _Msg_AuthorizeService_Handler, + }, + { + MethodName: "AllocateVault", + Handler: _Msg_AllocateVault_Handler, + }, + { + MethodName: "SyncController", + Handler: _Msg_SyncController_Handler, MethodName: "Authenticate", Handler: _Msg_Authenticate_Handler, }, diff --git a/api/oracle/module/v1/module.pulsar.go b/api/oracle/module/v1/module.pulsar.go deleted file mode 100644 index bc45ee5e8..000000000 --- a/api/oracle/module/v1/module.pulsar.go +++ /dev/null @@ -1,504 +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: onsonr.hway.oracle.module.v1.Module")) - } - panic(fmt.Errorf("message onsonr.hway.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: onsonr.hway.oracle.module.v1.Module")) - } - panic(fmt.Errorf("message onsonr.hway.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: onsonr.hway.oracle.module.v1.Module")) - } - panic(fmt.Errorf("message onsonr.hway.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: onsonr.hway.oracle.module.v1.Module")) - } - panic(fmt.Errorf("message onsonr.hway.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: onsonr.hway.oracle.module.v1.Module")) - } - panic(fmt.Errorf("message onsonr.hway.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: onsonr.hway.oracle.module.v1.Module")) - } - panic(fmt.Errorf("message onsonr.hway.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 onsonr.hway.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, - 0x1c, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x68, 0x77, 0x61, 0x79, 0x2e, 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, 0x68, 0x77, 0x61, 0x79, 0x42, 0xfa, 0x01, 0x0a, 0x20, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x68, 0x77, 0x61, 0x79, 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, 0x68, 0x77, 0x61, 0x79, 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, 0x04, 0x4f, 0x48, 0x4f, 0x4d, 0xaa, 0x02, 0x1c, 0x4f, 0x6e, 0x73, - 0x6f, 0x6e, 0x72, 0x2e, 0x48, 0x77, 0x61, 0x79, 0x2e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1c, 0x4f, 0x6e, 0x73, 0x6f, - 0x6e, 0x72, 0x5c, 0x48, 0x77, 0x61, 0x79, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x28, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, - 0x72, 0x5c, 0x48, 0x77, 0x61, 0x79, 0x5c, 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, 0x20, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x48, 0x77, - 0x61, 0x79, 0x3a, 0x3a, 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: onsonr.hway.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 149db8b0c..000000000 --- a/api/oracle/v1/genesis.pulsar.go +++ /dev/null @@ -1,493 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package oraclev1 - -import ( - 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 -) - -func init() { - file_oracle_v1_genesis_proto_init() - md_GenesisState = File_oracle_v1_genesis_proto.Messages().ByName("GenesisState") -} - -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) { -} - -// 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() { - 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() { - 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() { - 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() { - 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() { - 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() { - 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.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 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 { - 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 middlewares genesis state. -type GenesisState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -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} -} - -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, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0e, 0x0a, 0x0c, 0x47, 0x65, - 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 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, - 0x68, 0x77, 0x61, 0x79, 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, 1) -var file_oracle_v1_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: oracle.v1.GenesisState -} -var file_oracle_v1_genesis_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_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 - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_oracle_v1_genesis_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - 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 18e9372e9..000000000 --- a/api/oracle/v1/query.pulsar.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package oraclev1 - -import ( - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -// 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) -) - -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, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, - 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x68, 0x77, 0x61, 0x79, - 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_goTypes = []interface{}{} -var file_oracle_v1_query_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_query_proto_init() } -func file_oracle_v1_query_proto_init() { - if File_oracle_v1_query_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_oracle_v1_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_oracle_v1_query_proto_goTypes, - DependencyIndexes: file_oracle_v1_query_proto_depIdxs, - }.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/tx.pulsar.go b/api/oracle/v1/tx.pulsar.go deleted file mode 100644 index 1d63906ae..000000000 --- a/api/oracle/v1/tx.pulsar.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package oraclev1 - -import ( - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -// 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) -) - -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, - 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 0x68, 0x77, 0x61, 0x79, 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_goTypes = []interface{}{} -var file_oracle_v1_tx_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_tx_proto_init() } -func file_oracle_v1_tx_proto_init() { - if File_oracle_v1_tx_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_oracle_v1_tx_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_oracle_v1_tx_proto_goTypes, - DependencyIndexes: file_oracle_v1_tx_proto_depIdxs, - }.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/app/app.go b/app/app.go index 461d57bf0..45893a3e4 100644 --- a/app/app.go +++ b/app/app.go @@ -145,12 +145,9 @@ import ( tokenfactorykeeper "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/keeper" tokenfactorytypes "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types" - did "github.com/onsonr/hway/x/did" - didkeeper "github.com/onsonr/hway/x/did/keeper" - didtypes "github.com/onsonr/hway/x/did/types" - oracle "github.com/onsonr/hway/x/oracle" - oraclekeeper "github.com/onsonr/hway/x/oracle/keeper" - oracletypes "github.com/onsonr/hway/x/oracle/types" + did "github.com/onsonr/sonr/x/did" + didkeeper "github.com/onsonr/sonr/x/did/keeper" + didtypes "github.com/onsonr/sonr/x/did/types" ) const appName = "sonr" @@ -220,7 +217,6 @@ type SonrApp struct { NFTKeeper nftkeeper.Keeper AuthzKeeper authzkeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper - OracleKeeper oraclekeeper.Keeper interfaceRegistry types.InterfaceRegistry txConfig client.TxConfig appCodec codec.Codec @@ -361,7 +357,6 @@ func NewChainApp( poa.StoreKey, globalfeetypes.StoreKey, packetforwardtypes.StoreKey, - oracletypes.StoreKey, didtypes.StoreKey, ) @@ -616,17 +611,12 @@ func NewChainApp( appCodec, sdkruntime.NewKVStoreService(keys[didtypes.StoreKey]), app.AccountKeeper, + app.NFTKeeper, + app.StakingKeeper, logger, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - // Create the oracle Middleware Keeper - app.OracleKeeper = oraclekeeper.NewKeeper( - appCodec, - app.MsgServiceRouter(), - app.IBCKeeper.ChannelKeeper, - ) - // Create the globalfee keeper app.GlobalFeeKeeper = globalfeekeeper.NewKeeper( appCodec, @@ -882,9 +872,8 @@ func NewChainApp( app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName), ), - oracle.NewAppModule(app.OracleKeeper), - did.NewAppModule(appCodec, app.DidKeeper), + did.NewAppModule(appCodec, app.DidKeeper, app.NFTKeeper), ) // BasicModuleManager defines the module BasicManager is in charge of setting up basic, @@ -932,7 +921,6 @@ func NewChainApp( ibcfeetypes.ModuleName, tokenfactorytypes.ModuleName, packetforwardtypes.ModuleName, - oracletypes.ModuleName, didtypes.ModuleName, ) @@ -952,7 +940,6 @@ func NewChainApp( ibcfeetypes.ModuleName, tokenfactorytypes.ModuleName, packetforwardtypes.ModuleName, - oracletypes.ModuleName, didtypes.ModuleName, ) @@ -981,7 +968,6 @@ func NewChainApp( tokenfactorytypes.ModuleName, globalfeetypes.ModuleName, packetforwardtypes.ModuleName, - oracletypes.ModuleName, didtypes.ModuleName, } app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) @@ -1122,6 +1108,9 @@ func NewChainApp( _ = ctx } + + // Start the frontend + // go app.ServeFrontend() return app } @@ -1436,7 +1425,6 @@ func initParamsKeeper( paramsKeeper.Subspace(globalfee.ModuleName) paramsKeeper.Subspace(packetforwardtypes.ModuleName). WithKeyTable(packetforwardtypes.ParamKeyTable()) - paramsKeeper.Subspace(oracletypes.ModuleName) paramsKeeper.Subspace(didtypes.ModuleName) return paramsKeeper diff --git a/app/decorators/msg_filter_test.go b/app/decorators/msg_filter_test.go index bfbb2f4dc..e63e3cc83 100644 --- a/app/decorators/msg_filter_test.go +++ b/app/decorators/msg_filter_test.go @@ -10,8 +10,8 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/stretchr/testify/suite" - app "github.com/onsonr/hway/app" - "github.com/onsonr/hway/app/decorators" + app "github.com/onsonr/sonr/app" + "github.com/onsonr/sonr/app/decorators" ) type AnteTestSuite struct { diff --git a/app/encoding.go b/app/encoding.go index 59a270b87..4bd9bfbb9 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -9,7 +9,7 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - "github.com/onsonr/hway/app/params" + "github.com/onsonr/sonr/app/params" ) // MakeEncodingConfig creates a new EncodingConfig with all modules registered. For testing only diff --git a/app/local.go b/app/local.go deleted file mode 100644 index 522e95760..000000000 --- a/app/local.go +++ /dev/null @@ -1,36 +0,0 @@ -package app - -import ( - "github.com/ipfs/kubo/client/rpc" -) - -var ( - ChainID = "testnet" - ValAddr = "val1" -) - -// Initialize initializes the local configuration values -func init() { -} - -// SetLocalContextSessionID sets the session ID for the local context -func SetLocalValidatorAddress(address string) { - ValAddr = address -} - -// SetLocalContextChainID sets the chain ID for the local -func SetLocalChainID(id string) { - ChainID = id -} - -// IPFSClient is an interface for interacting with an IPFS node. -type IPFSClient = *rpc.HttpApi - -// NewLocalClient creates a new IPFS client that connects to the local IPFS node. -func GetIPFSClient() (IPFSClient, error) { - rpcClient, err := rpc.NewLocalApi() - if err != nil { - return nil, err - } - return rpcClient, nil -} diff --git a/app/upgrades.go b/app/upgrades.go index 3cecae42c..9855cab2e 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -5,8 +5,8 @@ import ( upgradetypes "cosmossdk.io/x/upgrade/types" - "github.com/onsonr/hway/app/upgrades" - "github.com/onsonr/hway/app/upgrades/noop" + "github.com/onsonr/sonr/app/upgrades" + "github.com/onsonr/sonr/app/upgrades/noop" ) // Upgrades list of chain upgrades @@ -22,6 +22,7 @@ func (app *SonrApp) RegisterUpgradeHandlers() { keepers := upgrades.AppKeepers{ AccountKeeper: &app.AccountKeeper, + DidKeeper: &app.DidKeeper, ParamsKeeper: &app.ParamsKeeper, ConsensusParamsKeeper: &app.ConsensusParamsKeeper, CapabilityKeeper: app.CapabilityKeeper, diff --git a/app/upgrades/noop/upgrades.go b/app/upgrades/noop/upgrades.go index e21f21d6d..cf67da610 100644 --- a/app/upgrades/noop/upgrades.go +++ b/app/upgrades/noop/upgrades.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" - "github.com/onsonr/hway/app/upgrades" + "github.com/onsonr/sonr/app/upgrades" ) // NewUpgrade constructor diff --git a/app/upgrades/types.go b/app/upgrades/types.go index 2ff71ce63..cd7d199ca 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -14,10 +14,12 @@ import ( authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + didkeeper "github.com/onsonr/sonr/x/did/keeper" ) type AppKeepers struct { AccountKeeper *authkeeper.AccountKeeper + DidKeeper *didkeeper.Keeper ParamsKeeper *paramskeeper.Keeper ConsensusParamsKeeper *consensusparamkeeper.Keeper Codec codec.Codec diff --git a/chains.yaml b/chains.yaml index 5b1bed1c0..262c9b928 100644 --- a/chains.yaml +++ b/chains.yaml @@ -1,7 +1,10 @@ # This file is used to create docker images using the heighliner binary. # see: https://github.com/strangelove-ventures/heighliner +# Sonr Node - Identity - name: sonr + github-organization: onsonr + github-repo: core dockerfile: cosmos build-target: make install binaries: @@ -9,3 +12,26 @@ build-env: - LEDGER_ENABLED=false - BUILD_TAGS=muslc + +# Ethereum Node - Web3 +- name: evmos + github-organization: tharsis + github-repo: evmos + dockerfile: cosmos + build-target: make install + binaries: + - /go/bin/evmosd + +# Bitcoin Node - Gold +- name: nomic + github-organization: nomic-io + github-repo: nomic + dockerfile: cargo + build-target: | + TOOLCHAIN=$(cat rust-toolchain.toml | grep channel | awk '{print $3}' | tr -d '"') + rustup component add rust-src --toolchain ${TOOLCHAIN}-$(uname -m)-unknown-linux-gnu + cargo install --locked --path . -Zbuild-std + binaries: + - /build/nomic/target/${ARCH}-unknown-linux-gnu/release/nomic + platforms: + - linux/amd64 diff --git a/cmd/dwn/main.go b/cmd/dwn/main.go new file mode 100644 index 000000000..51a42fc4c --- /dev/null +++ b/cmd/dwn/main.go @@ -0,0 +1,40 @@ +//go:build js && wasm +// +build js,wasm + +package main + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/vfs/wasm" + + "github.com/onsonr/sonr/internal/db" +) + +var dwn *DWN + +type DWN struct { + *echo.Echo + DB *db.DB +} + +func main() { + dwn = initRails() + wasm.Serve(dwn.Echo) +} + +// initRails initializes the Rails application +func initRails() *DWN { + // Open the database + e := echo.New() + db, err := db.New() + if err != nil { + panic(err.Error()) + } + db.ServeEcho(e.Group("/dwn")) + + // Initialize the htmx handler + return &DWN{ + Echo: e, + DB: db, + } +} diff --git a/cmd/motr/main.go b/cmd/motr/main.go new file mode 100644 index 000000000..8fdf0d6ba --- /dev/null +++ b/cmd/motr/main.go @@ -0,0 +1,61 @@ +//go:build wasm + +package main + +import ( + "github.com/labstack/echo/v4" + "github.com/syumai/workers" + + "github.com/onsonr/sonr/internal/db" + + "github.com/onsonr/sonr/internal/gui/views" + "github.com/onsonr/sonr/internal/mdw" + "github.com/onsonr/sonr/internal/svc" +) + +func main() { + // Configure the server + e := echo.New() + + // Use Middlewares + e.Use(mdw.UseSession) + + // Setup routes + registerFrontend(e) + registerOpenID(e.Group("/authorize")) + registerVault(e.Group("/vault")) + + // Serve Worker + workers.Serve(e) +} + +func registerFrontend(e *echo.Echo) { + // Add Public Pages + e.GET("/", views.HomeView) + e.GET("/login", views.LoginView) + e.POST("/login/:identifier", svc.HandleCredentialAssertion) + e.GET("/register", views.RegisterView) + e.POST("/register/:subject", svc.HandleCredentialCreation) + e.POST("/register/:subject/check", svc.CheckSubjectIsValid) + e.GET("/profile", views.ProfileView) +} + +func registerOpenID(g *echo.Group) { + // Add Authenticated Pages + g.Use(mdw.MacaroonMiddleware("test", "test")) + g.GET("/", views.AuthorizeView) + g.GET("/discovery", svc.GetDiscovery) + g.GET("/jwks", svc.GetJWKS) + g.GET("/token", svc.GetToken) + g.POST("/:origin/grant/:subject", svc.GrantAuthorization) +} + +func registerVault(g *echo.Group) { + // Add Authenticated Pages + g.Use(mdw.MacaroonMiddleware("test", "test")) + vault, err := db.New(db.WitDir("vault")) + if err != nil { + // panic(err) + } + vault.ServeEcho(g) +} diff --git a/cmd/motr/wrangler.toml b/cmd/motr/wrangler.toml new file mode 100644 index 000000000..10bce7926 --- /dev/null +++ b/cmd/motr/wrangler.toml @@ -0,0 +1,10 @@ +name = "sonr-id" +main = "./build/worker.mjs" +compatibility_date = "2024-07-26" + +[dev] +ip = "localhost" +port = 4202 + +[build] +command = "devbox run build:motr" diff --git a/cmd/sonrd/commands.go b/cmd/sonrd/commands.go index 6167e31c5..3f3d6ce7d 100644 --- a/cmd/sonrd/commands.go +++ b/cmd/sonrd/commands.go @@ -7,7 +7,7 @@ import ( cmtcfg "github.com/cometbft/cometbft/config" dbm "github.com/cosmos/cosmos-db" - "github.com/onsonr/hway/app" + "github.com/onsonr/sonr/app" "github.com/spf13/cast" "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/cmd/sonrd/main.go b/cmd/sonrd/main.go index 980000e08..fcca52569 100644 --- a/cmd/sonrd/main.go +++ b/cmd/sonrd/main.go @@ -6,11 +6,14 @@ import ( "cosmossdk.io/log" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" _ "github.com/joho/godotenv/autoload" - "github.com/onsonr/hway/app" + + "github.com/onsonr/sonr/app" + "github.com/onsonr/sonr/internal/tui" ) func main() { rootCmd := NewRootCmd() + tui.AddTUICmds(rootCmd) if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) diff --git a/cmd/sonrd/root.go b/cmd/sonrd/root.go index 981eec5ae..e2b7e32fb 100644 --- a/cmd/sonrd/root.go +++ b/cmd/sonrd/root.go @@ -3,11 +3,8 @@ package main import ( "os" - dbm "github.com/cosmos/cosmos-db" - "github.com/spf13/cobra" - "cosmossdk.io/log" - + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -19,11 +16,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/tx" txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/spf13/cobra" - "github.com/onsonr/hway/app" - "github.com/onsonr/hway/app/params" - // NewRootCmd creates a new root command for chain app. It is called once in the - // main function. + "github.com/onsonr/sonr/app" + "github.com/onsonr/sonr/app/params" ) func NewRootCmd() *cobra.Command { @@ -34,14 +30,14 @@ func NewRootCmd() *cobra.Command { cfg.Seal() // we "pre"-instantiate the application for getting the injected/configured encoding configuration // note, this is not necessary when using app wiring, as depinject can be directly used (see root_v2.go) - tempApp := app.NewChainApp( + preApp := app.NewChainApp( log.NewNopLogger(), dbm.NewMemDB(), nil, false, simtestutil.NewAppOptionsWithFlagHome(tempDir()), ) encodingConfig := params.EncodingConfig{ - InterfaceRegistry: tempApp.InterfaceRegistry(), - Codec: tempApp.AppCodec(), - TxConfig: tempApp.TxConfig(), - Amino: tempApp.LegacyAmino(), + InterfaceRegistry: preApp.InterfaceRegistry(), + Codec: preApp.AppCodec(), + TxConfig: preApp.TxConfig(), + Amino: preApp.LegacyAmino(), } initClientCtx := client.Context{}. @@ -99,8 +95,8 @@ func NewRootCmd() *cobra.Command { } // Set the context chain ID and validator address - app.SetLocalChainID(initClientCtx.ChainID) - app.SetLocalValidatorAddress(initClientCtx.FromAddress.String()) + // app.SetLocalChainID(initClientCtx.ChainID) + // app.SetLocalValidatorAddress(initClientCtx.FromAddress.String()) customAppTemplate, customAppConfig := initAppConfig() customCMTConfig := initCometBFTConfig() @@ -109,10 +105,10 @@ func NewRootCmd() *cobra.Command { }, } - initRootCmd(rootCmd, encodingConfig.TxConfig, encodingConfig.InterfaceRegistry, tempApp.BasicModuleManager) + initRootCmd(rootCmd, encodingConfig.TxConfig, encodingConfig.InterfaceRegistry, preApp.BasicModuleManager) // add keyring to autocli opts - autoCliOpts := tempApp.AutoCliOpts() + autoCliOpts := preApp.AutoCliOpts() initClientCtx, _ = config.ReadFromClientConfig(initClientCtx) autoCliOpts.Keyring, _ = keyring.NewAutoCLIKeyring(initClientCtx.Keyring) autoCliOpts.ClientCtx = initClientCtx diff --git a/cmd/sonrd/testnet.go b/cmd/sonrd/testnet.go index 9c3d44466..0a86f0411 100644 --- a/cmd/sonrd/testnet.go +++ b/cmd/sonrd/testnet.go @@ -39,7 +39,7 @@ import ( genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/onsonr/hway/app" + "github.com/onsonr/sonr/app" ) var ( diff --git a/devbox.json b/devbox.json index a542b85f0..72dabf8f9 100644 --- a/devbox.json +++ b/devbox.json @@ -1,12 +1,54 @@ { "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json", + "packages": [ + "go@1.22", + "templ@latest", + "go-task@latest", + "templ@latest", + "bun@latest", + "ipfs-cluster@latest", + "air@latest" + ], "packages": ["go@1.21"], "env": { "GOPATH": "$HOME/go", - "PATH": "$HOME/go/bin:$PATH" + "PATH": "$HOME/go/bin:$PATH", + "CHAIN_ID": "sonr-testnet-1", + "DENOM": "usnr", + "KEYRING": "test", + "MONIKER": "florence" }, "shell": { "scripts": { + "install": [ + "make install" + ], + "build": [ + "make build", + "make local-image" + ], + "build:dwn": [ + "templ generate", + "make dwn" + ], + "build:motr": [ + "templ generate", + "make motr" + ], + "gen:proto": [ + "make proto-gen" + ], + "gen:pkl": [ + "go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/oidc.pkl", + "go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/orm.pkl", + "go run github.com/apple/pkl-go/cmd/pkl-gen-go ./pkl/txns.pkl" + ], + "dev": [ + "air" + ], + "testnet": [ + "devbox services up" + ] "install": ["make install"], "gen": ["make proto-gen"], "build": [ diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 000000000..9b7687ed8 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,30 @@ +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 06a70b71c..266cd90bf 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,17 @@ -module github.com/onsonr/hway +module github.com/onsonr/sonr -go 1.22 +go 1.22.5 // overrides replace ( cosmossdk.io/core => cosmossdk.io/core v0.11.0 + github.com/ChainSafe/go-schnorrkel => github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d + github.com/ChainSafe/go-schnorrkel/1 => github.com/ChainSafe/go-schnorrkel v1.0.0 + github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.18.0 github.com/prometheus/common => github.com/prometheus/common v0.47.0 github.com/spf13/viper => github.com/spf13/viper v1.17.0 // v1.18+ breaks app overrides + github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7 ) replace ( @@ -42,8 +46,15 @@ require ( cosmossdk.io/x/nft v0.1.0 cosmossdk.io/x/tx v0.13.3 cosmossdk.io/x/upgrade v0.1.1 + github.com/a-h/templ v0.2.771 + github.com/apple/pkl-go v0.8.0 github.com/btcsuite/btcd/btcec/v2 v2.3.3 + github.com/charmbracelet/bubbles v0.19.0 + github.com/charmbracelet/bubbletea v1.1.0 + github.com/charmbracelet/huh v0.5.3 + github.com/charmbracelet/lipgloss v0.13.0 github.com/cometbft/cometbft v0.38.8 + github.com/cosmos/btcutil v1.0.5 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.5 @@ -51,13 +62,22 @@ require ( github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2-0.20240228211029-91e486ec4dbb github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ibc-go/v8 v8.2.0 + github.com/donseba/go-htmx v1.10.0 + github.com/ethereum/go-ethereum v1.14.6 github.com/go-webauthn/webauthn v0.10.2 github.com/golang/protobuf v1.5.4 - github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/hack-pad/go-indexeddb v0.3.2 + github.com/ipfs/boxo v0.21.0 github.com/ipfs/kubo v0.29.0 github.com/joho/godotenv v1.5.1 - github.com/onsonr/crypto v1.5.0 + github.com/labstack/echo/v4 v4.10.2 + github.com/mr-tron/base58 v1.2.0 + github.com/ncruces/go-sqlite3 v0.18.2 + github.com/ncruces/go-sqlite3/gormlite v0.18.0 + github.com/nlepage/go-js-promise v1.0.0 + github.com/onsonr/crypto v1.29.0 + github.com/segmentio/ksuid v1.0.4 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 @@ -66,10 +86,16 @@ require ( github.com/strangelove-ventures/poa v0.50.0 github.com/strangelove-ventures/tokenfactory v0.50.0 github.com/stretchr/testify v1.9.0 - golang.org/x/crypto v0.25.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 google.golang.org/protobuf v1.34.2 + gopkg.in/macaroon-bakery.v2 v2.3.0 + gopkg.in/macaroon.v2 v2.1.0 + gorm.io/gorm v1.25.11 + lukechampine.com/adiantum v1.1.1 + lukechampine.com/blake3 v1.3.0 ) require ( @@ -78,12 +104,15 @@ require ( cloud.google.com/go/iam v1.1.6 // indirect cloud.google.com/go/storage v1.38.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect + git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect + github.com/atotto/clipboard v0.1.4 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect @@ -92,9 +121,13 @@ require ( github.com/btcsuite/btcd/btcutil v1.1.5 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/bwesterb/go-ristretto v1.2.3 // indirect + github.com/catppuccin/go v0.2.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/charmbracelet/x/ansi v0.2.3 // indirect + github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect + github.com/charmbracelet/x/term v0.2.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.11.3 // indirect @@ -106,7 +139,6 @@ require ( github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect - github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.1.2 // indirect @@ -123,9 +155,10 @@ require ( github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect + github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/emicklei/dot v1.6.1 // indirect - github.com/ethereum/go-ethereum v1.14.6 // indirect + github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -156,9 +189,12 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/handlers v1.5.2 // indirect + github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect + github.com/gtank/merlin v0.1.1 // indirect + github.com/hack-pad/safejs v0.1.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect @@ -174,13 +210,13 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/holiman/uint256 v1.2.4 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/ipfs/bbloom v0.0.4 // indirect - github.com/ipfs/boxo v0.21.0 // indirect github.com/ipfs/go-bitfield v1.1.0 // indirect github.com/ipfs/go-block-format v0.2.0 // indirect github.com/ipfs/go-cid v0.4.1 // indirect @@ -200,12 +236,15 @@ require ( github.com/ipld/go-codec-dagpb v1.6.0 // indirect github.com/ipld/go-ipld-prime v0.21.0 // indirect github.com/jbenet/goprocess v0.1.4 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.17.9 // indirect 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 @@ -218,19 +257,26 @@ require ( github.com/libp2p/go-msgio v0.3.0 // indirect github.com/libp2p/go-netroute v0.2.1 // indirect github.com/linxGnu/grocksdb v1.8.14 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-localereader v0.0.1 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/miekg/dns v1.1.61 // indirect + github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect - github.com/mr-tron/base58 v1.2.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect + github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a // indirect github.com/multiformats/go-base32 v0.1.0 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect github.com/multiformats/go-multiaddr v0.12.4 // indirect @@ -240,6 +286,7 @@ require ( github.com/multiformats/go-multihash v0.2.3 // indirect github.com/multiformats/go-multistream v0.5.0 // indirect github.com/multiformats/go-varint v0.0.7 // indirect + github.com/ncruces/julianday v1.0.0 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/onsi/ginkgo v1.16.5 // indirect @@ -257,6 +304,7 @@ require ( github.com/prometheus/common v0.54.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.11.0 // indirect github.com/rs/zerolog v1.32.0 // indirect @@ -270,8 +318,13 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect + github.com/tetratelabs/wazero v1.8.0 // indirect github.com/tidwall/btree v1.7.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasttemplate v1.2.2 // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 // indirect github.com/whyrusleeping/cbor-gen v0.1.2 // indirect @@ -290,25 +343,25 @@ require ( go.uber.org/zap v1.27.0 // indirect go4.org v0.0.0-20230225012048-214862532bf5 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/term v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.18.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.24.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gonum.org/v1/gonum v0.15.0 // indirect google.golang.org/api v0.169.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect + gopkg.in/errgo.v1 v1.0.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect - lukechampine.com/blake3 v1.3.0 // indirect nhooyr.io/websocket v1.8.10 // indirect pgregory.net/rapid v1.1.0 // indirect rsc.io/tmplfunc v0.0.3 // indirect diff --git a/go.sum b/go.sum index b962d0444..e40ecf31a 100644 --- a/go.sum +++ b/go.sum @@ -803,6 +803,9 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= +git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= +git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9 h1:Ahny8Ud1LjVMMAlt8utUFKhhxJtwBAualvsbc/Sk7cE= +git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= @@ -822,6 +825,8 @@ github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwS github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/Jorropo/jsync v1.0.1 h1:6HgRolFZnsdfzRUj+ImB9og1JYOxQoReSywkHOGSaUU= github.com/Jorropo/jsync v1.0.1/go.mod h1:jCOZj3vrBCri3bSU3ErUYvevKlnbssrXeCivybS5ABQ= +github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= +github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= @@ -830,6 +835,8 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/a-h/templ v0.2.771 h1:4KH5ykNigYGGpCe0fRJ7/hzwz72k3qFqIiiLLJskbSo= +github.com/a-h/templ v0.2.771/go.mod h1:lq48JXoUvuQrU0VThrK31yFwdRjTCnIE5bcPCM9IP1w= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -851,14 +858,22 @@ github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0I github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/PEd/zm8mDS9Vg= github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/apple/pkl-go v0.8.0 h1:GRcBvFWeXjT9rc7A5gHK89qrel2wGZ3/a7ge4rPlT5M= +github.com/apple/pkl-go v0.8.0/go.mod h1:5Hwil5tyZGrOekh7JXLZJvIAcGHb4gT19lnv4WEiKeI= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= +github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+RQ= github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= +github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8= +github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -903,6 +918,8 @@ github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28 github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/bwesterb/go-ristretto v1.2.3 h1:1w53tCkGhCQ5djbat3+MH0BAQ5Kfgbt56UZQ/JMzngw= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/catppuccin/go v0.2.0 h1:ktBeIrIP42b/8FGiScP9sgrWOss3lw0Z5SktRoithGA= +github.com/catppuccin/go v0.2.0/go.mod h1:8IHJuMGaUUjQM82qBrGNBv7LFq6JI3NnQCF6MOlZjpc= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -919,6 +936,22 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/charmbracelet/bubbles v0.19.0 h1:gKZkKXPP6GlDk6EcfujDK19PCQqRjaJZQ7QRERx1UF0= +github.com/charmbracelet/bubbles v0.19.0/go.mod h1:WILteEqZ+krG5c3ntGEMeG99nCupcuIk7V0/zOP0tOA= +github.com/charmbracelet/bubbletea v1.1.0 h1:FjAl9eAL3HBCHenhz/ZPjkKdScmaS5SK69JAK2YJK9c= +github.com/charmbracelet/bubbletea v1.1.0/go.mod h1:9Ogk0HrdbHolIKHdjfFpyXJmiCzGwy+FesYkZr7hYU4= +github.com/charmbracelet/huh v0.5.3 h1:3KLP4a/K1/S4dq4xFMTNMt3XWhgMl/yx8NYtygQ0bmg= +github.com/charmbracelet/huh v0.5.3/go.mod h1:OZC3lshuF+/y8laj//DoZdFSHxC51OrtXLJI8xWVouQ= +github.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA/SsA3cjw= +github.com/charmbracelet/lipgloss v0.13.0/go.mod h1:nw4zy0SBX/F/eAO1cWdcvy6qnkDUxr8Lw7dvFrAIbbY= +github.com/charmbracelet/x/ansi v0.2.3 h1:VfFN0NUpcjBRd4DnKfRaIRo53KRgey/nhOoEqosGDEY= +github.com/charmbracelet/x/ansi v0.2.3/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b h1:MnAMdlwSltxJyULnrYbkZpp4k58Co7Tah3ciKhSNo0Q= +github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= +github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 h1:qko3AQ4gK1MTS/de7F5hPGx6/k1u0w4TeYmBFwzYVP4= +github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ= +github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= +github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -1061,9 +1094,13 @@ github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/donseba/go-htmx v1.10.0 h1:ByeQd8frMPSX38vkjvsprSQ7+xTkHMDrkzBV0ljfYvA= +github.com/donseba/go-htmx v1.10.0/go.mod h1:8PTAYvNKf8+QYis+DpAsggKz+sa2qljtMgvdAeNBh5s= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 h1:I6KUy4CI6hHjqnyJLNCEi7YHVMkwwtfSr2k9splgdSM= +github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564/go.mod h1:yekO+3ZShy19S+bsmnERmznGy9Rfg6dWWWpiGJjNAz8= github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo= @@ -1090,6 +1127,8 @@ github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6Ni github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/ethereum/go-ethereum v1.14.6 h1:ZTxnErSopkDyxdvB8zW/KcK+/AVrdil/TzoWXVKaaC8= github.com/ethereum/go-ethereum v1.14.6/go.mod h1:hglUZo/5pVIYXNyYjWzsAUDpT/zI+WbWo/Nih7ot+G0= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= @@ -1110,6 +1149,10 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= +github.com/frankban/quicktest v1.0.0/go.mod h1:R98jIehRai+d1/3Hv2//jOVCTJhW1VBavT6B6CuGq2k= +github.com/frankban/quicktest v1.1.0/go.mod h1:R98jIehRai+d1/3Hv2//jOVCTJhW1VBavT6B6CuGq2k= +github.com/frankban/quicktest v1.2.2/go.mod h1:Qh/WofXFeiAFII1aEBu529AtJo6Zg2VHscnEsbBnJ20= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= @@ -1155,6 +1198,7 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-macaroon-bakery/macaroonpb v1.0.0/go.mod h1:UzrGOcbiwTXISFP2XDLDPjfhMINZa+fX/7A2lMd31zc= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -1186,10 +1230,6 @@ github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= @@ -1245,6 +1285,7 @@ github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.2.1-0.20190312032427-6f77996f0c42/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -1360,6 +1401,12 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1 github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= +github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= +github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= +github.com/hack-pad/go-indexeddb v0.3.2 h1:DTqeJJYc1usa45Q5r52t01KhvlSN02+Oq+tQbSBI91A= +github.com/hack-pad/go-indexeddb v0.3.2/go.mod h1:QvfTevpDVlkfomY498LhstjwbPW6QC4VC/lxYb0Kom0= +github.com/hack-pad/safejs v0.1.0 h1:qPS6vjreAqh2amUqj4WNG1zIw7qlRQJ9K10eDKMCnE8= +github.com/hack-pad/safejs v0.1.0/go.mod h1:HdS+bKF1NrE72VoXZeWzxFOVQVUSqZJAG0xNCnb+Tio= github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= github.com/hashicorp/consul/sdk v0.14.1/go.mod h1:vFt03juSzocLRFo59NkeQHHmQa6+g7oU0pfzdI1mUhg= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -1416,6 +1463,8 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= @@ -1541,6 +1590,10 @@ github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -1557,12 +1610,16 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/mgotest v1.0.1/go.mod h1:vTaDufYul+Ps8D7bgseHjq87X8eu0ivlKLp9mVc/Bfc= +github.com/juju/postgrestest v1.1.0/go.mod h1:/n17Y2T6iFozzXwSCO0JYJ5gSiz2caEtSwAjh/uLXDM= +github.com/juju/qthttptest v0.0.1/go.mod h1://LCf/Ls22/rPw2u1yWukUJvYtfPY4nYpWUl2uZhryo= +github.com/juju/schema v1.0.0/go.mod h1:Y+ThzXpUJ0E7NYYocAbuvJ7vTivXfrof/IfRPq/0abI= +github.com/juju/webbrowser v0.0.0-20160309143629-54b8c57083b4/go.mod h1:G6PCelgkM6cuvyD10iYJsjLBsSadVXtJ+nBxFAxE2BU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= @@ -1594,9 +1651,15 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/labstack/echo/v4 v4.10.2 h1:n1jAhnq/elIFTHr1EYpiYtyKgx4RW9ccVgkqByZaN2M= +github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k= +github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= +github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= @@ -1641,6 +1704,8 @@ github.com/libp2p/zeroconf/v2 v2.2.0 h1:Cup06Jv6u81HLhIj1KasuNM/RHHrJ8T7wOTS4+Tv github.com/libp2p/zeroconf/v2 v2.2.0/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= @@ -1655,6 +1720,7 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -1670,7 +1736,11 @@ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= +github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -1683,6 +1753,8 @@ github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUM github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b/go.mod h1:lxPUiZwKoFL8DUUmalo2yJJUCxbPKtm8OKfqr2/FTNU= github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc= github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= +github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= +github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= @@ -1698,6 +1770,8 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= +github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -1715,6 +1789,12 @@ github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= +github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a h1:2MaM6YC3mGu54x+RKAA6JiFFHlHDY1UbkxqppT7wYOg= +github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a/go.mod h1:hxSnBBYLK21Vtq/PHd0S2FYCxBXzBua8ov5s1RobyRQ= github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= @@ -1750,7 +1830,15 @@ github.com/nats-io/nats.go v1.30.2/go.mod h1:dcfhUgmQNN4GJEfIb2f9R7Fow+gzBF4emzD github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nkeys v0.4.5/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/ncruces/go-sqlite3 v0.18.2 h1:m7QXhBWIwXsp84HE11t+ze0n1v3LRU+zGFg4uHjBeFA= +github.com/ncruces/go-sqlite3 v0.18.2/go.mod h1:4sZHOm+b/FM8FJRVGN4TemkPPDq5JXGK/1EHIEWxsYo= +github.com/ncruces/go-sqlite3/gormlite v0.18.0 h1:KqP9a9wlX/Ba+yG+aeVX4pnNBNdaSO6xHdNDWzPxPnk= +github.com/ncruces/go-sqlite3/gormlite v0.18.0/go.mod h1:RXeT1hknrz3A0tBDL6IfluDHuNkHdJeImn5TBMQg9zc= +github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M= +github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nlepage/go-js-promise v1.0.0 h1:K7OmJ3+0BgWJ2LfXchg2sI6RDr7AW/KWR8182epFwGQ= +github.com/nlepage/go-js-promise v1.0.0/go.mod h1:bdOP0wObXu34euibyK39K1hoBCtlgTKXGc56AGflaRo= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= @@ -1773,8 +1861,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= -github.com/onsonr/crypto v1.5.0 h1:iAmjTdzuu6inJL48/gHsLcQsyq+GbnVaKSBxlkpkBnE= -github.com/onsonr/crypto v1.5.0/go.mod h1:g77+cbK6mD5qILg4dN6d2X9fNtYrEUAOQ6JIlj12Um0= +github.com/onsonr/crypto v1.29.0 h1:ontCN/XNNmpWv23N8VB6vsirLXcjxZaA67lLX9RNj0c= +github.com/onsonr/crypto v1.29.0/go.mod h1:NSfeCO6XoyQeSDEp6Jy42UGG5047GvzG6lW9lRnjrR0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= @@ -1884,8 +1972,14 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5X github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= +github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= +github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -1919,6 +2013,8 @@ github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXn github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= +github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= @@ -1983,8 +2079,12 @@ 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/tetratelabs/wazero v1.8.0 h1:iEKu0d4c2Pd+QSRieYbnQC9yiFlMS9D+Jr0LsRmcF4g= +github.com/tetratelabs/wazero v1.8.0/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -1996,6 +2096,15 @@ github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= +github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/warpfork/go-testmark v0.12.1 h1:rMgCpJfwy1sJ50x0M0NgyphxYYPMOODIJHhsXyEHU0s= github.com/warpfork/go-testmark v0.12.1/go.mod h1:kHwy7wfvGSPh1rQJYKayD4AbtNaeyZdcGi9tNJTaa5Y= github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0 h1:GDDkbFiaK8jsSDJfjId/PEGEShv6ugrt4kYsC5UIDaQ= @@ -2108,7 +2217,9 @@ go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZM go4.org v0.0.0-20230225012048-214862532bf5 h1:nifaUDeh+rPaBCMPMQHZmvJf+QdpLFnuQPwx+LxVmtc= go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEbFGHD4hhz6S1ZYeaU= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -2133,8 +2244,8 @@ golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98y golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2201,8 +2312,9 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20150829230318-ea47fc708ee3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2278,8 +2390,8 @@ golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2334,8 +2446,8 @@ golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2344,6 +2456,7 @@ golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2415,6 +2528,7 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2452,8 +2566,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2470,8 +2584,8 @@ golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= -golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2493,8 +2607,8 @@ golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2503,10 +2617,9 @@ golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181008205924-a2b3f7f249e9/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -2579,8 +2692,8 @@ golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2695,6 +2808,7 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -2930,10 +3044,20 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v1 v1.0.0/go.mod h1:CxwszS/Xz1C49Ucd2i6Zil5UToP1EmyrFhKaMVbg1mk= +gopkg.in/errgo.v1 v1.0.1 h1:oQFRXzZ7CkBGdm1XZm/EbQYaYNNEElNBOd09M6cqNso= +gopkg.in/errgo.v1 v1.0.1/go.mod h1:3NjfXwocQRYAPTq4/fzX+CwUhPRcR/azYRhj8G+LqMo= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/httprequest.v1 v1.2.0/go.mod h1:T61ZUaJLpMnzvoJDO03ZD8yRXD4nZzBeDoW5e9sffjg= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/juju/environschema.v1 v1.0.0/go.mod h1:WTgU3KXKCVoO9bMmG/4KHzoaRvLeoxfjArpgd1MGWFA= +gopkg.in/macaroon-bakery.v2 v2.3.0 h1:b40knPgPTke1QLTE8BSYeH7+R/hiIozB1A8CTLYN0Ic= +gopkg.in/macaroon-bakery.v2 v2.3.0/go.mod h1:/8YhtPARXeRzbpEPLmRB66+gQE8/pzBBkWwg7Vz/guc= +gopkg.in/macaroon.v2 v2.1.0 h1:HZcsjBCzq9t0eBPMKqTN/uSN6JOm78ZJ2INbqcBQOUI= +gopkg.in/macaroon.v2 v2.1.0/go.mod h1:OUb+TQP/OP0WOerC2Jp/3CwhIKyIa9kQjuc7H24e6/o= +gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -2950,6 +3074,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg= +gorm.io/gorm v1.25.11/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2960,6 +3086,8 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +lukechampine.com/adiantum v1.1.1 h1:4fp6gTxWCqpEbLy40ExiYDDED3oUNWx5cTqBCtPdZqA= +lukechampine.com/adiantum v1.1.1/go.mod h1:LrAYVnTYLnUtE/yMp5bQr0HstAf060YUF8nM0B6+rUw= lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= diff --git a/internal/db/actions.go b/internal/db/actions.go new file mode 100644 index 000000000..cf0354acf --- /dev/null +++ b/internal/db/actions.go @@ -0,0 +1,330 @@ +package db + +import ( + "fmt" + + "github.com/onsonr/sonr/internal/db/orm" + "gorm.io/gorm" +) + +// createInitialTables creates the initial tables in the database. +func createInitialTables(db *gorm.DB) (*DB, error) { + err := db.AutoMigrate( + &orm.Account{}, + &orm.Asset{}, + &orm.Credential{}, + &orm.Keyshare{}, + &orm.Permission{}, + &orm.Profile{}, + &orm.Property{}, + ) + if err != nil { + return nil, fmt.Errorf("failed to create table: %w", err) + } + + return &DB{db}, nil +} + +// AddAccount adds a new account to the database +func (db *DB) AddAccount(account *orm.Account) error { + tx := db.Create(account) + if tx.Error != nil { + return fmt.Errorf("failed to add account: %w", tx.Error) + } + + return nil +} + +// GetAccount gets an account from the database +func (db *DB) GetAccount(account *orm.Account) error { + tx := db.First(account) + if tx.Error != nil { + return fmt.Errorf("failed to get account: %w", tx.Error) + } + + return nil +} + +// UpdateAccount updates an existing account in the database +func (db *DB) UpdateAccount(account *orm.Account) error { + tx := db.Save(account) + if tx.Error != nil { + return fmt.Errorf("failed to update account: %w", tx.Error) + } + + return nil +} + +// DeleteAccount deletes an existing account from the database +func (db *DB) DeleteAccount(account *orm.Account) error { + tx := db.Delete(account) + if tx.Error != nil { + return fmt.Errorf("failed to delete account: %w", tx.Error) + } + + return nil +} + +// AddAsset adds a new asset to the database +func (db *DB) AddAsset(asset *orm.Asset) error { + tx := db.Create(asset) + + if tx.Error != nil { + return fmt.Errorf("failed to add asset: %w", tx.Error) + } + + return nil +} + +// GetAsset gets an asset from the database +func (db *DB) GetAsset(asset *orm.Asset) error { + tx := db.First(asset) + + if tx.Error != nil { + return fmt.Errorf("failed to get asset: %w", tx.Error) + } + + return nil +} + +// UpdateAsset updates an existing asset in the database +func (db *DB) UpdateAsset(asset *orm.Asset) error { + tx := db.Save(asset) + + if tx.Error != nil { + return fmt.Errorf("failed to update asset: %w", tx.Error) + } + + return nil +} + +// DeleteAsset deletes an existing asset from the database +func (db *DB) DeleteAsset(asset *orm.Asset) error { + tx := db.Delete(asset) + + if tx.Error != nil { + return fmt.Errorf("failed to delete asset: %w", tx.Error) + } + + return nil +} + +// AddCredential adds a new credential to the database +func (db *DB) AddCredential(credential *orm.Credential) error { + tx := db.Create(credential) + + if tx.Error != nil { + return fmt.Errorf("failed to add credential: %w", tx.Error) + } + + return nil +} + +// GetCredential gets an credential from the database +func (db *DB) GetCredential(credential *orm.Credential) error { + tx := db.First(credential) + + if tx.Error != nil { + return fmt.Errorf("failed to get credential: %w", tx.Error) + } + + return nil +} + +// UpdateCredential updates an existing credential in the database +func (db *DB) UpdateCredential(credential *orm.Credential) error { + tx := db.Save(credential) + + if tx.Error != nil { + return fmt.Errorf("failed to update credential: %w", tx.Error) + } + + return nil +} + +// DeleteCredential deletes an existing credential from the database +func (db *DB) DeleteCredential(credential *orm.Credential) error { + tx := db.Delete(credential) + + if tx.Error != nil { + return fmt.Errorf("failed to delete credential: %w", tx.Error) + } + + return nil +} + +// AddKeyshare adds a new keyshare to the database +func (db *DB) AddKeyshare(keyshare *orm.Keyshare) error { + tx := db.Create(keyshare) + + if tx.Error != nil { + return fmt.Errorf("failed to add keyshare: %w", tx.Error) + } + + return nil +} + +// GetKeyshare gets an keyshare from the database +func (db *DB) GetKeyshare(keyshare *orm.Keyshare) error { + tx := db.First(keyshare) + + if tx.Error != nil { + return fmt.Errorf("failed to get keyshare: %w", tx.Error) + } + + return nil +} + +// UpdateKeyshare updates an existing keyshare in the database +func (db *DB) UpdateKeyshare(keyshare *orm.Keyshare) error { + tx := db.Save(keyshare) + + if tx.Error != nil { + return fmt.Errorf("failed to update keyshare: %w", tx.Error) + } + + return nil +} + +// DeleteKeyshare deletes an existing keyshare from the database +func (db *DB) DeleteKeyshare(keyshare *orm.Keyshare) error { + tx := db.Delete(keyshare) + + if tx.Error != nil { + return fmt.Errorf("failed to delete keyshare: %w", tx.Error) + } + + return nil +} + +// AddPermission adds a new permission to the database +func (db *DB) AddPermission(permission *orm.Permission) error { + tx := db.Create(permission) + + if tx.Error != nil { + return fmt.Errorf("failed to add permission: %w", tx.Error) + } + + return nil +} + +// GetPermission gets an permission from the database +func (db *DB) GetPermission(permission *orm.Permission) error { + tx := db.First(permission) + + if tx.Error != nil { + return fmt.Errorf("failed to get permission: %w", tx.Error) + } + + return nil +} + +// UpdatePermission updates an existing permission in the database +func (db *DB) UpdatePermission(permission *orm.Permission) error { + tx := db.Save(permission) + + if tx.Error != nil { + return fmt.Errorf("failed to update permission: %w", tx.Error) + } + + return nil +} + +// DeletePermission deletes an existing permission from the database +func (db *DB) DeletePermission(permission *orm.Permission) error { + tx := db.Delete(permission) + + if tx.Error != nil { + return fmt.Errorf("failed to delete permission: %w", tx.Error) + } + + return nil +} + +// AddProfile adds a new profile to the database +func (db *DB) AddProfile(profile *orm.Profile) error { + tx := db.Create(profile) + + if tx.Error != nil { + return fmt.Errorf("failed to add profile: %w", tx.Error) + } + + return nil +} + +// GetProfile gets an profile from the database +func (db *DB) GetProfile(profile *orm.Profile) error { + tx := db.First(profile) + + if tx.Error != nil { + return fmt.Errorf("failed to get profile: %w", tx.Error) + } + + return nil +} + +// UpdateProfile updates an existing profile in the database +func (db *DB) UpdateProfile(profile *orm.Profile) error { + tx := db.Save(profile) + + if tx.Error != nil { + return fmt.Errorf("failed to update profile: %w", tx.Error) + } + + return nil +} + +// DeleteProfile deletes an existing profile from the database +func (db *DB) DeleteProfile(profile *orm.Profile) error { + tx := db.Delete(profile) + + if tx.Error != nil { + return fmt.Errorf("failed to delete profile: %w", tx.Error) + } + + return nil +} + +// AddProperty adds a new property to the database +func (db *DB) AddProperty(property *orm.Property) error { + tx := db.Create(property) + + if tx.Error != nil { + return fmt.Errorf("failed to add property: %w", tx.Error) + } + + return nil +} + +// GetProperty gets an property from the database +func (db *DB) GetProperty(property *orm.Property) error { + tx := db.First(property) + + if tx.Error != nil { + return fmt.Errorf("failed to get property: %w", tx.Error) + } + + return nil +} + +// UpdateProperty updates an existing property in the database +func (db *DB) UpdateProperty(property *orm.Property) error { + tx := db.Save(property) + + if tx.Error != nil { + return fmt.Errorf("failed to update property: %w", tx.Error) + } + + return nil +} + +// DeleteProperty deletes an existing property from the database +func (db *DB) DeleteProperty(property *orm.Property) error { + tx := db.Delete(property) + + if tx.Error != nil { + return fmt.Errorf("failed to delete property: %w", tx.Error) + } + + return nil +} diff --git a/internal/db/database.go b/internal/db/database.go new file mode 100644 index 000000000..12bb158ed --- /dev/null +++ b/internal/db/database.go @@ -0,0 +1,54 @@ +package db + +import ( + "crypto/rand" + + "github.com/ncruces/go-sqlite3/gormlite" + "golang.org/x/crypto/argon2" + "gorm.io/gorm" + "lukechampine.com/adiantum/hbsh" + "lukechampine.com/adiantum/hpolyc" +) + +type DB struct { + *gorm.DB +} + +func New(opts ...DBOption) (*DB, error) { + config := &DBConfig{ + fileName: "vault.db", + } + for _, opt := range opts { + opt(config) + } + gormdb, err := gorm.Open(gormlite.Open(config.ConnectionString())) + if err != nil { + return nil, err + } + db, err := createInitialTables(gormdb) + if err != nil { + return nil, err + } + return db, nil +} + +// HBSH creates an HBSH cipher given a key. +func (c *DB) HBSH(key []byte) *hbsh.HBSH { + if len(key) != 32 { + // Key is not appropriate, return nil. + return nil + } + return hpolyc.New(key) +} + +// KDF gets a key from a secret. +func (c *DB) KDF(secret string) []byte { + if secret == "" { + // No secret is given, generate a random key. + key := make([]byte, 32) + n, _ := rand.Read(key) + return key[:n] + } + // Hash the secret with a KDF. + return argon2.IDKey([]byte(secret), []byte("hpolyc"), 3, 64*1024, 4, 32) +} diff --git a/internal/db/handlers.go b/internal/db/handlers.go new file mode 100644 index 000000000..e4f739c77 --- /dev/null +++ b/internal/db/handlers.go @@ -0,0 +1,195 @@ +package db + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/db/orm" +) + +func (db *DB) ServeEcho(e *echo.Group) { + e.GET("/accounts", db.HandleAccount) + e.GET("/assets", db.HandleAsset) + e.GET("/credentials", db.HandleCredential) + e.GET("/keyshares", db.HandleKeyshare) + e.GET("/permissions", db.HandlePermission) + e.GET("/profiles", db.HandleProfile) + e.GET("/properties", db.HandleProperty) +} + +func (db *DB) HandleAccount(c echo.Context) error { + data := new(orm.Account) + if err := c.Bind(data); err != nil { + return err + } + // Check the method for GET, POST, PUT, DELETE + switch c.Request().Method { + case echo.POST: + + if err := db.AddAccount(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + + if err := db.UpdateAccount(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteAccount(data); err != nil { + return err + } + return c.JSON(200, nil) + } + return c.JSON(200, data) +} + +func (db *DB) HandleAsset(c echo.Context) error { + data := new(orm.Asset) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddAsset(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdateAsset(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteAsset(data); err != nil { + return err + } + return c.JSON(200, "OK") + } + return c.JSON(200, data) +} + +func (db *DB) HandleCredential(c echo.Context) error { + data := new(orm.Credential) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddCredential(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdateCredential(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteCredential(data); err != nil { + return err + } + } + return c.JSON(200, data) +} + +func (db *DB) HandleKeyshare(c echo.Context) error { + data := new(orm.Keyshare) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddKeyshare(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdateKeyshare(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteKeyshare(data); err != nil { + return err + } + } + return c.JSON(200, data) +} + +func (db *DB) HandlePermission(c echo.Context) error { + data := new(orm.Permission) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddPermission(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdatePermission(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeletePermission(data); err != nil { + return err + } + } + return c.JSON(200, data) +} + +func (db *DB) HandleProfile(c echo.Context) error { + data := new(orm.Profile) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddProfile(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdateProfile(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteProfile(data); err != nil { + return err + } + } + return c.JSON(200, data) +} + +func (db *DB) HandleProperty(c echo.Context) error { + data := new(orm.Property) + if err := c.Bind(data); err != nil { + return err + } + + switch c.Request().Method { + case echo.POST: + if err := db.AddProperty(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.PUT: + if err := db.UpdateProperty(data); err != nil { + return err + } + return c.JSON(200, "OK") + case echo.DELETE: + if err := db.DeleteProperty(data); err != nil { + return err + } + } + return c.JSON(200, data) +} diff --git a/internal/db/idb/idb.go b/internal/db/idb/idb.go new file mode 100644 index 000000000..5dab6c074 --- /dev/null +++ b/internal/db/idb/idb.go @@ -0,0 +1,131 @@ +//go:build js && wasm +// +build js,wasm + +package idb + +import ( + "context" + "encoding/json" + "errors" + "syscall/js" + + "github.com/hack-pad/go-indexeddb/idb" +) + +// Model is an interface that must be implemented by types used with Table +type Model interface { + Table() string +} + +// Table is a generic wrapper around IDB for easier database operations on a specific table +type Table[T Model] struct { + db *idb.Database + dbName string + keyPath string +} + +// NewTable creates a new Table instance +func NewTable[T Model](dbName string, version uint, keyPath string) (*Table[T], error) { + ctx := context.Background() + factory := idb.Global() + + var model T + tableName := model.Table() + + openRequest, err := factory.Open(ctx, dbName, version, func(db *idb.Database, oldVersion, newVersion uint) error { + _, err := db.CreateObjectStore(tableName, idb.ObjectStoreOptions{ + KeyPath: js.ValueOf(keyPath), + }) + return err + }) + if err != nil { + return nil, err + } + db, err := openRequest.Await(ctx) + if err != nil { + return nil, err + } + return &Table[T]{ + db: db, + dbName: dbName, + keyPath: keyPath, + }, nil +} + +// Insert adds a new record to the table +func (t *Table[T]) Insert(data T) error { + tx, err := t.db.Transaction(idb.TransactionReadWrite, data.Table()) + if err != nil { + return err + } + defer tx.Commit() + + objectStore, err := tx.ObjectStore(data.Table()) + if err != nil { + return err + } + + jsonData, err := json.Marshal(data) + if err != nil { + return err + } + + _, err = objectStore.Add(js.ValueOf(string(jsonData))) + return err +} + +// Query retrieves a record from the table based on a key +func (t *Table[T]) Query(key interface{}) (T, error) { + var result T + + tx, err := t.db.Transaction(idb.TransactionReadOnly, result.Table()) + if err != nil { + return result, err + } + defer tx.Commit() + + objectStore, err := tx.ObjectStore(result.Table()) + if err != nil { + return result, err + } + + request, err := objectStore.Get(js.ValueOf(key)) + if err != nil { + return result, err + } + + value, err := request.Await(context.Background()) + if err != nil { + return result, err + } + + if value.IsUndefined() || value.IsNull() { + return result, errors.New("record not found") + } + + err = json.Unmarshal([]byte(value.String()), &result) + return result, err +} + +// Delete removes a record from the table based on a key +func (t *Table[T]) Delete(key interface{}) error { + var model T + tx, err := t.db.Transaction(idb.TransactionReadWrite, model.Table()) + if err != nil { + return err + } + defer tx.Commit() + + objectStore, err := tx.ObjectStore(model.Table()) + if err != nil { + return err + } + + _, err = objectStore.Delete(js.ValueOf(key)) + return err +} + +// Close closes the database connection +func (t *Table[T]) Close() error { + return t.db.Close() +} diff --git a/internal/db/options.go b/internal/db/options.go new file mode 100644 index 000000000..47f2e1f31 --- /dev/null +++ b/internal/db/options.go @@ -0,0 +1,40 @@ +package db + +import ( + _ "github.com/ncruces/go-sqlite3/embed" + "github.com/onsonr/sonr/internal/db/orm" +) + +type DBOption func(config *DBConfig) + +func WitDir(dir string) DBOption { + return func(config *DBConfig) { + config.Dir = dir + } +} + +func WithSecretKey(secretKey string) DBOption { + return func(config *DBConfig) { + config.SecretKey = secretKey + } +} + +type DBConfig struct { + Dir string + SecretKey string + + fileName string + initialAccounts []*orm.Account + initialAssets []*orm.Asset + initialCredentials []*orm.Credential + initialKeyshares []*orm.Keyshare + initialPermissions []*orm.Permission + initialProfiles []*orm.Profile + initialProperties []*orm.Property +} + +func (config *DBConfig) ConnectionString() string { + connStr := "file:" + connStr += config.fileName + return connStr +} diff --git a/internal/db/orm/Account.pkl.go b/internal/db/orm/Account.pkl.go new file mode 100644 index 000000000..09a4e0b1a --- /dev/null +++ b/internal/db/orm/Account.pkl.go @@ -0,0 +1,14 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +type Account struct { + Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` + + Name string `pkl:"name" json:"name,omitempty" param:"name"` + + Address string `pkl:"address" json:"address,omitempty" param:"address"` + + PublicKey string `pkl:"publicKey" json:"publicKey,omitempty" param:"publicKey"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` +} diff --git a/internal/db/orm/Asset.pkl.go b/internal/db/orm/Asset.pkl.go new file mode 100644 index 000000000..fd28cc9f7 --- /dev/null +++ b/internal/db/orm/Asset.pkl.go @@ -0,0 +1,16 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +type Asset struct { + Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` + + Name string `pkl:"name" json:"name,omitempty" param:"name"` + + Symbol string `pkl:"symbol" json:"symbol,omitempty" param:"symbol"` + + Decimals int `pkl:"decimals" json:"decimals,omitempty" param:"decimals"` + + ChainId *int `pkl:"chainId" json:"chainId,omitempty" param:"chainId"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` +} diff --git a/internal/db/orm/Chain.pkl.go b/internal/db/orm/Chain.pkl.go new file mode 100644 index 000000000..6b3544d18 --- /dev/null +++ b/internal/db/orm/Chain.pkl.go @@ -0,0 +1,12 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +type Chain struct { + Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` + + Name string `pkl:"name" json:"name,omitempty" param:"name"` + + NetworkId string `pkl:"networkId" json:"networkId,omitempty" param:"networkId"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` +} diff --git a/internal/db/orm/Credential.pkl.go b/internal/db/orm/Credential.pkl.go new file mode 100644 index 000000000..b05f04c9b --- /dev/null +++ b/internal/db/orm/Credential.pkl.go @@ -0,0 +1,36 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +type Credential struct { + Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` + + Subject string `pkl:"subject" json:"subject,omitempty" param:"subject"` + + Controller string `pkl:"controller" json:"controller,omitempty" param:"controller"` + + AttestationType string `pkl:"attestationType" json:"attestationType,omitempty" param:"attestationType"` + + Origin string `pkl:"origin" json:"origin,omitempty" param:"origin"` + + CredentialId string `pkl:"credentialId" json:"credentialId,omitempty" param:"credentialId"` + + PublicKey string `pkl:"publicKey" json:"publicKey,omitempty" param:"publicKey"` + + Transport string `pkl:"transport" json:"transport,omitempty" param:"transport"` + + SignCount uint `pkl:"signCount" json:"signCount,omitempty" param:"signCount"` + + UserPresent bool `pkl:"userPresent" json:"userPresent,omitempty" param:"userPresent"` + + UserVerified bool `pkl:"userVerified" json:"userVerified,omitempty" param:"userVerified"` + + BackupEligible bool `pkl:"backupEligible" json:"backupEligible,omitempty" param:"backupEligible"` + + BackupState bool `pkl:"backupState" json:"backupState,omitempty" param:"backupState"` + + CloneWarning bool `pkl:"cloneWarning" json:"cloneWarning,omitempty" param:"cloneWarning"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` + + UpdatedAt *string `pkl:"updatedAt" json:"updatedAt,omitempty" param:"updatedAt"` +} diff --git a/internal/db/orm/Keyshare.pkl.go b/internal/db/orm/Keyshare.pkl.go new file mode 100644 index 000000000..ed51e7a94 --- /dev/null +++ b/internal/db/orm/Keyshare.pkl.go @@ -0,0 +1,12 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +type Keyshare struct { + Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` + + Data string `pkl:"data" json:"data,omitempty" param:"data"` + + Role int `pkl:"role" json:"role,omitempty" param:"role"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` +} diff --git a/internal/db/orm/Orm.pkl.go b/internal/db/orm/Orm.pkl.go new file mode 100644 index 000000000..8c2222fb0 --- /dev/null +++ b/internal/db/orm/Orm.pkl.go @@ -0,0 +1,36 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +import ( + "context" + + "github.com/apple/pkl-go/pkl" +) + +type Orm struct { +} + +// LoadFromPath loads the pkl module at the given path and evaluates it into a Orm +func LoadFromPath(ctx context.Context, path string) (ret *Orm, 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 Orm +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Orm, error) { + var ret Orm + if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { + return nil, err + } + return &ret, nil +} diff --git a/internal/db/orm/Permission.pkl.go b/internal/db/orm/Permission.pkl.go new file mode 100644 index 000000000..0e93df3c3 --- /dev/null +++ b/internal/db/orm/Permission.pkl.go @@ -0,0 +1,16 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +type Permission struct { + Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` + + ServiceId string `pkl:"serviceId" json:"serviceId,omitempty" param:"serviceId"` + + Grants string `pkl:"grants" json:"grants,omitempty" param:"grants"` + + Scopes string `pkl:"scopes" json:"scopes,omitempty" param:"scopes"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` + + UpdatedAt *string `pkl:"updatedAt" json:"updatedAt,omitempty" param:"updatedAt"` +} diff --git a/internal/db/orm/Profile.pkl.go b/internal/db/orm/Profile.pkl.go new file mode 100644 index 000000000..c0153cc3c --- /dev/null +++ b/internal/db/orm/Profile.pkl.go @@ -0,0 +1,20 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +type Profile struct { + Id string `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` + + Subject string `pkl:"subject" json:"subject,omitempty" param:"subject"` + + Controller string `pkl:"controller" json:"controller,omitempty" param:"controller"` + + OriginUri *string `pkl:"originUri" json:"originUri,omitempty" param:"originUri"` + + PublicMetadata *string `pkl:"publicMetadata" json:"publicMetadata,omitempty" param:"publicMetadata"` + + PrivateMetadata *string `pkl:"privateMetadata" json:"privateMetadata,omitempty" param:"privateMetadata"` + + CreatedAt *string `pkl:"createdAt" json:"createdAt,omitempty" param:"createdAt"` + + UpdatedAt *string `pkl:"updatedAt" json:"updatedAt,omitempty" param:"updatedAt"` +} diff --git a/internal/db/orm/Property.pkl.go b/internal/db/orm/Property.pkl.go new file mode 100644 index 000000000..937b6209a --- /dev/null +++ b/internal/db/orm/Property.pkl.go @@ -0,0 +1,14 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +type Property struct { + Id uint `pkl:"id" gorm:"primaryKey,autoIncrement" json:"id,omitempty" query:"id"` + + ProfileId string `pkl:"profileId" json:"profileId,omitempty" param:"profileId"` + + Key string `pkl:"key" json:"key,omitempty" param:"key"` + + Accumulator string `pkl:"accumulator" json:"accumulator,omitempty" param:"accumulator"` + + PropertyKey string `pkl:"propertyKey" json:"propertyKey,omitempty" param:"propertyKey"` +} diff --git a/internal/db/orm/init.pkl.go b/internal/db/orm/init.pkl.go new file mode 100644 index 000000000..817be2b7c --- /dev/null +++ b/internal/db/orm/init.pkl.go @@ -0,0 +1,16 @@ +// Code generated from Pkl module `orm`. DO NOT EDIT. +package orm + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("orm", Orm{}) + pkl.RegisterMapping("orm#Account", Account{}) + pkl.RegisterMapping("orm#Asset", Asset{}) + pkl.RegisterMapping("orm#Chain", Chain{}) + pkl.RegisterMapping("orm#Credential", Credential{}) + pkl.RegisterMapping("orm#Profile", Profile{}) + pkl.RegisterMapping("orm#Property", Property{}) + pkl.RegisterMapping("orm#Keyshare", Keyshare{}) + pkl.RegisterMapping("orm#Permission", Permission{}) +} diff --git a/internal/db/orm/orm.go b/internal/db/orm/orm.go new file mode 100644 index 000000000..1b1266bf1 --- /dev/null +++ b/internal/db/orm/orm.go @@ -0,0 +1,29 @@ +package orm + +func (a *Account) Table() string { + return "accounts" +} + +func (a *Asset) Table() string { + return "assets" +} + +func (a *Credential) Table() string { + return "credentials" +} + +func (a *Keyshare) Table() string { + return "keyshares" +} + +func (a *Permission) Table() string { + return "permissions" +} + +func (a *Profile) Table() string { + return "profiles" +} + +func (a *Property) Table() string { + return "properties" +} diff --git a/internal/gui/elements/alert.templ b/internal/gui/elements/alert.templ new file mode 100644 index 000000000..89f977aea --- /dev/null +++ b/internal/gui/elements/alert.templ @@ -0,0 +1,67 @@ +package elements + +func Alert(variant Variant, icon Icon, title, message string) templ.Component { + return alertElement(variant.Attributes(), title, message, icon.Render()) +} + +templ alertElement(attrs templ.Attributes, title, message string, icon templ.Component) { +
+ @icon +
{ title }
+
{ message }
+
+} + +type AlertVariant int + +const ( + AlertVariant_Default AlertVariant = iota + AlertVariant_Info + AlertVariant_Error + AlertVariant_Success + AlertVariant_Warning + AlertVariant_Subtle_Info + AlertVariant_Subtle_Error + AlertVariant_Subtle_Success + AlertVariant_Subtle_Warning +) + +func (v AlertVariant) Attributes() templ.Attributes { + switch v { + case AlertVariant_Info: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-blue-600 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", + } + case AlertVariant_Error: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-red-600 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", + } + case AlertVariant_Success: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-green-500 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", + } + case AlertVariant_Warning: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-yellow-500 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", + } + case AlertVariant_Subtle_Info: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-blue-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-blue-600", + } + case AlertVariant_Subtle_Error: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-red-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-red-600", + } + case AlertVariant_Subtle_Success: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-green-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-green-600", + } + case AlertVariant_Subtle_Warning: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-yellow-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-yellow-600", + } + } + return templ.Attributes{ + "class": "relative w-full rounded-lg border bg-white p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-neutral-900", + } +} diff --git a/internal/gui/elements/alert_templ.go b/internal/gui/elements/alert_templ.go new file mode 100644 index 000000000..9e21f5df5 --- /dev/null +++ b/internal/gui/elements/alert_templ.go @@ -0,0 +1,137 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Alert(variant Variant, icon Icon, title, message string) templ.Component { + return alertElement(variant.Attributes(), title, message, icon.Render()) +} + +func alertElement(attrs templ.Attributes, title, message string, icon templ.Component) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.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: `internal/gui/elements/alert.templ`, Line: 10, Col: 66} + } + _, 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(message) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/alert.templ`, Line: 11, Col: 43} + } + _, 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 + }) +} + +type AlertVariant int + +const ( + AlertVariant_Default AlertVariant = iota + AlertVariant_Info + AlertVariant_Error + AlertVariant_Success + AlertVariant_Warning + AlertVariant_Subtle_Info + AlertVariant_Subtle_Error + AlertVariant_Subtle_Success + AlertVariant_Subtle_Warning +) + +func (v AlertVariant) Attributes() templ.Attributes { + switch v { + case AlertVariant_Info: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-blue-600 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", + } + case AlertVariant_Error: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-red-600 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", + } + case AlertVariant_Success: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-green-500 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", + } + case AlertVariant_Warning: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-yellow-500 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-white", + } + case AlertVariant_Subtle_Info: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-blue-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-blue-600", + } + case AlertVariant_Subtle_Error: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-red-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-red-600", + } + case AlertVariant_Subtle_Success: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-green-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-green-600", + } + case AlertVariant_Subtle_Warning: + return templ.Attributes{ + "class": "relative w-full rounded-lg border border-transparent bg-yellow-50 p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-yellow-600", + } + } + return templ.Attributes{ + "class": "relative w-full rounded-lg border bg-white p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11 text-neutral-900", + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/animation.templ b/internal/gui/elements/animation.templ new file mode 100644 index 000000000..9d7f988ff --- /dev/null +++ b/internal/gui/elements/animation.templ @@ -0,0 +1,5 @@ +package elements + +templ Animation() { + +} diff --git a/internal/gui/elements/animation_templ.go b/internal/gui/elements/animation_templ.go new file mode 100644 index 000000000..facdbf620 --- /dev/null +++ b/internal/gui/elements/animation_templ.go @@ -0,0 +1,37 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Animation() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/badge.templ b/internal/gui/elements/badge.templ new file mode 100644 index 000000000..af512f4ac --- /dev/null +++ b/internal/gui/elements/badge.templ @@ -0,0 +1,59 @@ +package elements + +templ PoweredBySonr() { +
+
+
+ + Powered by + + + + + + +
+
+ sonr image +
+

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

+

+ + + + Joined June 2020 +

+
+
+
+
+
+
+} diff --git a/internal/gui/elements/badge_templ.go b/internal/gui/elements/badge_templ.go new file mode 100644 index 000000000..7d70a6e32 --- /dev/null +++ b/internal/gui/elements/badge_templ.go @@ -0,0 +1,37 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func PoweredBySonr() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Powered by
\"sonr

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

Joined June 2020

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/breadcrumbs.templ b/internal/gui/elements/breadcrumbs.templ new file mode 100644 index 000000000..45eed0d78 --- /dev/null +++ b/internal/gui/elements/breadcrumbs.templ @@ -0,0 +1,35 @@ +package elements + +templ Breadcrumbs() { + +} + +templ breadcrumbItem(title string, active bool) { + if (active) { +
  • { title }
  • + } else { +
  • { title }
  • + } +} + +templ breadcrumbIcon() { + + + + + +} diff --git a/internal/gui/elements/breadcrumbs_templ.go b/internal/gui/elements/breadcrumbs_templ.go new file mode 100644 index 000000000..fd10e29ed --- /dev/null +++ b/internal/gui/elements/breadcrumbs_templ.go @@ -0,0 +1,154 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Breadcrumbs() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func breadcrumbItem(title string, active bool) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if active { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/breadcrumbs.templ`, Line: 23, Col: 126} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/breadcrumbs.templ`, Line: 25, Col: 118} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return templ_7745c5c3_Err + }) +} + +func breadcrumbIcon() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/button.templ b/internal/gui/elements/button.templ new file mode 100644 index 000000000..12b58480b --- /dev/null +++ b/internal/gui/elements/button.templ @@ -0,0 +1,218 @@ +package elements + +type button struct { + variant Variant + hxGet string + hxPost string + hxTarget string + hxTrigger string + hxSwap string +} + +type ButtonOpt func(button *button) + +func PrimaryButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantPrimary + } +} + +func InfoButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantInfo + } +} + +func ErrorButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantError + } +} + +func SuccessButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantSuccess + } +} + +func WarningButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantWarning + } +} + +func GET(action string, target string) ButtonOpt { + return func(button *button) { + button.hxGet = action + button.hxTarget = target + button.hxTrigger = "click" + button.hxSwap = "outerHTML" + } +} + +func POST(action string, target string) ButtonOpt { + return func(button *button) { + button.hxPost = action + button.hxTarget = target + button.hxTrigger = "click" + button.hxSwap = "outerHTML" + } +} + +func Button(opts ...ButtonOpt) templ.Component { + button := button{ + variant: ButtonVariantDefault, + } + for _, opt := range opts { + opt(&button) + } + if button.hxGet != "" { + return renderHxGetButton(&button, button.variant.Attributes()) + } + + if button.hxPost != "" { + return renderHxPostButton(&button, button.variant.Attributes()) + } + return renderButton(button.variant.Attributes()) +} + +templ renderButton(attrs templ.Attributes) { + +} + +templ renderHxGetButton(c *button, attrs templ.Attributes) { + +} + +templ renderHxPostButton(c *button, attrs templ.Attributes) { + +} + +type ButtonVariant int + +const ( + ButtonVariantDefault ButtonVariant = iota + ButtonVariantPrimary + ButtonVariantInfo + ButtonVariantError + ButtonVariantSuccess + ButtonVariantWarning +) + +func (v ButtonVariant) Attributes() templ.Attributes { + switch v { + case ButtonVariantPrimary: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-neutral-950 hover:bg-neutral-900 focus:ring-2 focus:ring-offset-2 focus:ring-neutral-900 focus:shadow-outline focus:outline-none", + "type": "button", + } + case ButtonVariantInfo: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 bg-blue-600 rounded-md hover:bg-blue-700 focus:ring-2 focus:ring-offset-2 focus:ring-blue-700 focus:shadow-outline focus:outline-none", + "type": "button", + } + case ButtonVariantError: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-red-600 hover:bg-red-700 focus:ring-2 focus:ring-offset-2 focus:ring-red-700 focus:shadow-outline focus:outline-none", + "type": "button", + } + case ButtonVariantSuccess: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-green-600 hover:bg-green-700 focus:ring-2 focus:ring-offset-2 focus:ring-green-700 focus:shadow-outline focus:outline-none", + "type": "button", + } + case ButtonVariantWarning: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-yellow-600 hover:bg-yellow-700 focus:ring-2 focus:ring-offset-2 focus:ring-yellow-700 focus:shadow-outline focus:outline-none", + "type": "button", + } + } + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-200 bg-white border rounded-md text-neutral-500 hover:text-neutral-700 border-neutral-200/70 hover:bg-neutral-100 active:bg-white focus:bg-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-200/60 focus:shadow-outline", + "type": "button", + } +} + +type SubtleButtonVariant int + +const ( + SubtleButtonVariantDefault SubtleButtonVariant = iota + SubtleButtonVariantInfo + SubtleButtonVariantError + SubtleButtonVariantSuccess + SubtleButtonVariantWarning +) + +func (v SubtleButtonVariant) Attributes() templ.Attributes { + switch v { + case SubtleButtonVariantInfo: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-blue-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-blue-100 bg-blue-50 hover:text-blue-600 hover:bg-blue-100", + "type": "button", + } + case SubtleButtonVariantError: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-red-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-red-100 bg-red-50 hover:text-red-600 hover:bg-red-100", + "type": "button", + } + case SubtleButtonVariantSuccess: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-green-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-green-100 bg-green-50 hover:text-green-600 hover:bg-green-100", + "type": "button", + } + case SubtleButtonVariantWarning: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-yellow-600 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-yellow-100 bg-yellow-50 hover:text-yellow-700 hover:bg-yellow-100", + "type": "button", + } + } + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-100 rounded-md text-neutral-500 bg-neutral-50 focus:ring-2 focus:ring-offset-2 focus:ring-neutral-100 hover:text-neutral-600 hover:bg-neutral-100", + "type": "button", + } +} + +type OutlineButtonVariant int + +const ( + OutlineButtonVariantDefault OutlineButtonVariant = iota + OutlineButtonVariantInfo + OutlineButtonVariantError + OutlineButtonVariantSuccess + OutlineButtonVariantWarning +) + +func (v OutlineButtonVariant) Attributes() templ.Attributes { + switch v { + case OutlineButtonVariantInfo: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-blue-600 transition-colors duration-100 bg-white border-2 border-blue-600 rounded-md hover:text-white hover:bg-blue-600", + "type": "button", + } + case OutlineButtonVariantError: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-red-600 transition-colors duration-100 bg-white border-2 border-red-600 rounded-md hover:text-white hover:bg-red-600", + "type": "button", + } + case OutlineButtonVariantSuccess: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-green-600 transition-colors duration-100 bg-white border-2 border-green-600 rounded-md hover:text-white hover:bg-green-600", + "type": "button", + } + case OutlineButtonVariantWarning: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-yellow-600 transition-colors duration-100 bg-white border-2 border-yellow-500 rounded-md hover:text-white hover:bg-yellow-500", + "type": "button", + } + } + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-100 bg-white border-2 rounded-md text-neutral-900 hover:text-white border-neutral-900 hover:bg-neutral-900", + "type": "button", + } +} diff --git a/internal/gui/elements/button_templ.go b/internal/gui/elements/button_templ.go new file mode 100644 index 000000000..95f6f7533 --- /dev/null +++ b/internal/gui/elements/button_templ.go @@ -0,0 +1,440 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +type button struct { + variant Variant + hxGet string + hxPost string + hxTarget string + hxTrigger string + hxSwap string +} + +type ButtonOpt func(button *button) + +func PrimaryButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantPrimary + } +} + +func InfoButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantInfo + } +} + +func ErrorButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantError + } +} + +func SuccessButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantSuccess + } +} + +func WarningButtonStyle() ButtonOpt { + return func(button *button) { + button.variant = ButtonVariantWarning + } +} + +func GET(action string, target string) ButtonOpt { + return func(button *button) { + button.hxGet = action + button.hxTarget = target + button.hxTrigger = "click" + button.hxSwap = "outerHTML" + } +} + +func POST(action string, target string) ButtonOpt { + return func(button *button) { + button.hxPost = action + button.hxTarget = target + button.hxTrigger = "click" + button.hxSwap = "outerHTML" + } +} + +func Button(opts ...ButtonOpt) templ.Component { + button := button{ + variant: ButtonVariantDefault, + } + for _, opt := range opts { + opt(&button) + } + if button.hxGet != "" { + return renderHxGetButton(&button, button.variant.Attributes()) + } + + if button.hxPost != "" { + return renderHxPostButton(&button, button.variant.Attributes()) + } + return renderButton(button.variant.Attributes()) +} + +func renderButton(attrs templ.Attributes) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = 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 renderHxGetButton(c *button, attrs templ.Attributes) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +type ButtonVariant int + +const ( + ButtonVariantDefault ButtonVariant = iota + ButtonVariantPrimary + ButtonVariantInfo + ButtonVariantError + ButtonVariantSuccess + ButtonVariantWarning +) + +func (v ButtonVariant) Attributes() templ.Attributes { + switch v { + case ButtonVariantPrimary: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-neutral-950 hover:bg-neutral-900 focus:ring-2 focus:ring-offset-2 focus:ring-neutral-900 focus:shadow-outline focus:outline-none", + "type": "button", + } + case ButtonVariantInfo: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 bg-blue-600 rounded-md hover:bg-blue-700 focus:ring-2 focus:ring-offset-2 focus:ring-blue-700 focus:shadow-outline focus:outline-none", + "type": "button", + } + case ButtonVariantError: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-red-600 hover:bg-red-700 focus:ring-2 focus:ring-offset-2 focus:ring-red-700 focus:shadow-outline focus:outline-none", + "type": "button", + } + case ButtonVariantSuccess: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-green-600 hover:bg-green-700 focus:ring-2 focus:ring-offset-2 focus:ring-green-700 focus:shadow-outline focus:outline-none", + "type": "button", + } + case ButtonVariantWarning: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 rounded-md bg-yellow-600 hover:bg-yellow-700 focus:ring-2 focus:ring-offset-2 focus:ring-yellow-700 focus:shadow-outline focus:outline-none", + "type": "button", + } + } + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-200 bg-white border rounded-md text-neutral-500 hover:text-neutral-700 border-neutral-200/70 hover:bg-neutral-100 active:bg-white focus:bg-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-200/60 focus:shadow-outline", + "type": "button", + } +} + +type SubtleButtonVariant int + +const ( + SubtleButtonVariantDefault SubtleButtonVariant = iota + SubtleButtonVariantInfo + SubtleButtonVariantError + SubtleButtonVariantSuccess + SubtleButtonVariantWarning +) + +func (v SubtleButtonVariant) Attributes() templ.Attributes { + switch v { + case SubtleButtonVariantInfo: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-blue-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-blue-100 bg-blue-50 hover:text-blue-600 hover:bg-blue-100", + "type": "button", + } + case SubtleButtonVariantError: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-red-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-red-100 bg-red-50 hover:text-red-600 hover:bg-red-100", + "type": "button", + } + case SubtleButtonVariantSuccess: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-green-500 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-green-100 bg-green-50 hover:text-green-600 hover:bg-green-100", + "type": "button", + } + case SubtleButtonVariantWarning: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-yellow-600 transition-colors duration-100 rounded-md focus:ring-2 focus:ring-offset-2 focus:ring-yellow-100 bg-yellow-50 hover:text-yellow-700 hover:bg-yellow-100", + "type": "button", + } + } + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-100 rounded-md text-neutral-500 bg-neutral-50 focus:ring-2 focus:ring-offset-2 focus:ring-neutral-100 hover:text-neutral-600 hover:bg-neutral-100", + "type": "button", + } +} + +type OutlineButtonVariant int + +const ( + OutlineButtonVariantDefault OutlineButtonVariant = iota + OutlineButtonVariantInfo + OutlineButtonVariantError + OutlineButtonVariantSuccess + OutlineButtonVariantWarning +) + +func (v OutlineButtonVariant) Attributes() templ.Attributes { + switch v { + case OutlineButtonVariantInfo: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-blue-600 transition-colors duration-100 bg-white border-2 border-blue-600 rounded-md hover:text-white hover:bg-blue-600", + "type": "button", + } + case OutlineButtonVariantError: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-red-600 transition-colors duration-100 bg-white border-2 border-red-600 rounded-md hover:text-white hover:bg-red-600", + "type": "button", + } + case OutlineButtonVariantSuccess: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-green-600 transition-colors duration-100 bg-white border-2 border-green-600 rounded-md hover:text-white hover:bg-green-600", + "type": "button", + } + case OutlineButtonVariantWarning: + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-yellow-600 transition-colors duration-100 bg-white border-2 border-yellow-500 rounded-md hover:text-white hover:bg-yellow-500", + "type": "button", + } + } + return templ.Attributes{ + "class": "inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide transition-colors duration-100 bg-white border-2 rounded-md text-neutral-900 hover:text-white border-neutral-900 hover:bg-neutral-900", + "type": "button", + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/card.templ b/internal/gui/elements/card.templ new file mode 100644 index 000000000..59113a1a9 --- /dev/null +++ b/internal/gui/elements/card.templ @@ -0,0 +1,47 @@ +package elements + +func Card(id string, size Size) templ.Component { + return renderCard(id, size.CardAttributes()) +} + +templ renderCard(id string, attrs templ.Attributes) { +
    +
    +
    +
    + { children... } +
    +
    +
    +
    +} + +templ ProfileCard() { +
    + +
    +
    + +
    + +
    Adam Wathan
    + adamwathan +
    + +
    +
    +

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

    + +
    +
    +} diff --git a/internal/gui/elements/card_templ.go b/internal/gui/elements/card_templ.go new file mode 100644 index 000000000..9636e8d1f --- /dev/null +++ b/internal/gui/elements/card_templ.go @@ -0,0 +1,96 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Card(id string, size Size) templ.Component { + return renderCard(id, size.CardAttributes()) +} + +func renderCard(id string, attrs templ.Attributes) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + 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 = 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 ProfileCard() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

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

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/elements.go b/internal/gui/elements/elements.go new file mode 100644 index 000000000..a923c57c7 --- /dev/null +++ b/internal/gui/elements/elements.go @@ -0,0 +1,47 @@ +package elements + +import ( + "strings" + + "github.com/a-h/templ" +) + +type Icon interface { + Render() templ.Component +} + +type Variant interface { + Attributes() templ.Attributes +} + +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, + } +} diff --git a/internal/gui/elements/fonts.templ b/internal/gui/elements/fonts.templ new file mode 100644 index 000000000..f05d49f83 --- /dev/null +++ b/internal/gui/elements/fonts.templ @@ -0,0 +1,62 @@ +package elements + +func H1(content string) templ.Component { + return renderText(1, content) +} + +func H2(content string) templ.Component { + return renderText(2, content) +} + +func H3(content string) templ.Component { + return renderText(3, content) +} + +func Text(content string) templ.Component { + return renderText(0, content) +} + +templ renderText(level int, text string) { + switch level { + case 1: +

    + { text } +

    + case 2: +

    + { text } +

    + case 3: +

    + { text } +

    + default: +

    + { text } +

    + } +} + +templ renderLink(attrs templ.Attributes, text string) { + + { text } + +} + +templ renderStrong(attrs templ.Attributes, text string) { + + { text } + +} + +templ renderEmphasis(attrs templ.Attributes, text string) { + + { text } + +} + +templ renderCode(attrs templ.Attributes, text string) { + + { text } + +} diff --git a/internal/gui/elements/fonts_templ.go b/internal/gui/elements/fonts_templ.go new file mode 100644 index 000000000..c881cd20a --- /dev/null +++ b/internal/gui/elements/fonts_templ.go @@ -0,0 +1,311 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func H1(content string) templ.Component { + return renderText(1, content) +} + +func H2(content string) templ.Component { + return renderText(2, content) +} + +func H3(content string) templ.Component { + return renderText(3, content) +} + +func Text(content string) templ.Component { + return renderText(0, content) +} + +func renderText(level int, text string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + switch level { + case 1: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/fonts.templ`, Line: 23, Col: 10} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case 2: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/fonts.templ`, Line: 27, Col: 10} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case 3: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/fonts.templ`, Line: 31, Col: 10} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + default: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/fonts.templ`, Line: 35, Col: 10} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return templ_7745c5c3_Err + }) +} + +func renderLink(attrs templ.Attributes, text string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_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 + } + 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: `internal/gui/elements/fonts.templ`, Line: 42, Col: 8} + } + _, 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 + } + return templ_7745c5c3_Err + }) +} + +func renderStrong(attrs templ.Attributes, text string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_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 + } + 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: `internal/gui/elements/fonts.templ`, Line: 48, Col: 8} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + 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 renderEmphasis(attrs templ.Attributes, text string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = 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_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/fonts.templ`, Line: 54, Col: 8} + } + _, 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 + } + return templ_7745c5c3_Err + }) +} + +func renderCode(attrs templ.Attributes, text string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = 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_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(text) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gui/elements/fonts.templ`, Line: 60, Col: 8} + } + _, 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 + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/global.templ b/internal/gui/elements/global.templ new file mode 100644 index 000000000..3ae2a3c3a --- /dev/null +++ b/internal/gui/elements/global.templ @@ -0,0 +1,54 @@ +package elements + +templ Layout(title string) { + + + + @defaultStyles() + { title } + + +
    + { children... } +
    + + +} + +templ Spacer() { +
    +} + +templ ServiceWorker(path string) { + +} + +templ defaultStyles() { + + + + + + + + + +} + +templ Rows() { +
    + { children... } +
    +} + +templ Columns() { +
    + { children... } +
    +} + +css main() { + font-family: R-Flex, system-ui, Avenir, Helvetica, Arial, sans-serif; +} diff --git a/internal/gui/elements/global_templ.go b/internal/gui/elements/global_templ.go new file mode 100644 index 000000000..46606b039 --- /dev/null +++ b/internal/gui/elements/global_templ.go @@ -0,0 +1,222 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Layout(title string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = defaultStyles().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: `internal/gui/elements/global.templ`, Line: 8, 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 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 + 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 ServiceWorker(path string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_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 + }) +} + +func defaultStyles() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func Rows() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func Columns() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var7.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func main() templ.CSSClass { + templ_7745c5c3_CSSBuilder := templruntime.GetBuilder() + templ_7745c5c3_CSSBuilder.WriteString(`font-family:R-Flex, system-ui, Avenir, Helvetica, Arial, sans-serif;`) + templ_7745c5c3_CSSID := templ.CSSID(`main`, templ_7745c5c3_CSSBuilder.String()) + return templ.ComponentCSSClass{ + ID: templ_7745c5c3_CSSID, + Class: templ.SafeCSS(`.` + templ_7745c5c3_CSSID + `{` + templ_7745c5c3_CSSBuilder.String() + `}`), + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/icons.templ b/internal/gui/elements/icons.templ new file mode 100644 index 000000000..b13e3fd4a --- /dev/null +++ b/internal/gui/elements/icons.templ @@ -0,0 +1,31 @@ +package elements + +type Icons int + +const ( + Icons_Info Icons = iota + Icons_Error + Icons_Success + Icons_Warning +) + +func (v Icons) Render() templ.Component { + return renderIconVariant(v) +} + +templ renderIconVariant(v Icons) { + switch v { + case Icons_Info: + + case Icons_Error: + + case Icons_Success: + + case Icons_Warning: + + } + +} + +templ SonrIcon() { +} diff --git a/internal/gui/elements/icons_templ.go b/internal/gui/elements/icons_templ.go new file mode 100644 index 000000000..9bb3c551a --- /dev/null +++ b/internal/gui/elements/icons_templ.go @@ -0,0 +1,94 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +type Icons int + +const ( + Icons_Info Icons = iota + Icons_Error + Icons_Success + Icons_Warning +) + +func (v Icons) Render() templ.Component { + return renderIconVariant(v) +} + +func renderIconVariant(v Icons) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + switch v { + case Icons_Info: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case Icons_Error: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case Icons_Success: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case Icons_Warning: + _, 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 + } + return templ_7745c5c3_Err + }) +} + +func SonrIcon() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/inputs.templ b/internal/gui/elements/inputs.templ new file mode 100644 index 000000000..73227660a --- /dev/null +++ b/internal/gui/elements/inputs.templ @@ -0,0 +1,29 @@ +package elements + +type InputState int + +const ( + InputStateDefault InputState = iota + InputStateError + InputStateSuccess +) + +templ TextInput(state InputState, label string, placeholder string) { + switch (state) { + case InputStateDefault: +
    + + +
    + case InputStateError: +
    + + +
    + case InputStateSuccess: +
    + + +
    + } +} diff --git a/internal/gui/elements/inputs_templ.go b/internal/gui/elements/inputs_templ.go new file mode 100644 index 000000000..31088115b --- /dev/null +++ b/internal/gui/elements/inputs_templ.go @@ -0,0 +1,97 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +type InputState int + +const ( + InputStateDefault InputState = iota + InputStateError + InputStateSuccess +) + +func TextInput(state InputState, label string, placeholder string) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + switch state { + case InputStateDefault: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case InputStateError: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + case InputStateSuccess: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/radios.templ b/internal/gui/elements/radios.templ new file mode 100644 index 000000000..0200e04cd --- /dev/null +++ b/internal/gui/elements/radios.templ @@ -0,0 +1,37 @@ +package elements + +templ RadioGroup() { +
    + +
    +} diff --git a/internal/gui/elements/radios_templ.go b/internal/gui/elements/radios_templ.go new file mode 100644 index 000000000..5a91c9f7c --- /dev/null +++ b/internal/gui/elements/radios_templ.go @@ -0,0 +1,37 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func RadioGroup() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/sizes.templ b/internal/gui/elements/sizes.templ new file mode 100644 index 000000000..40e70998d --- /dev/null +++ b/internal/gui/elements/sizes.templ @@ -0,0 +1,61 @@ +package elements + +type Size int + +const ( + SizeDefault Size = iota + SizeSmall + SizeMedium + SizeLarge +) + +func (s Size) CardAttributes() templ.Attributes { + switch s { + case SizeSmall: + return templ.Attributes{ + "class": "max-w-lg bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + } + case SizeLarge: + return templ.Attributes{ + "class": "max-w-2xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + } + } + return templ.Attributes{ + "class": "max-w-xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + } +} + +func (s Size) SvgAttributes() templ.Attributes { + switch s { + case SizeSmall: + return templ.Attributes{ + "height": "16", + "width": "16", + } + case SizeLarge: + return templ.Attributes{ + "height": "32", + "width": "32", + } + } + return templ.Attributes{ + "height": "24", + "width": "24", + } +} + +func (s Size) TextAttributes() templ.Attributes { + switch s { + case SizeSmall: + return templ.Attributes{ + "class": "text-sm", + } + case SizeLarge: + return templ.Attributes{ + "class": "text-lg", + } + } + return templ.Attributes{ + "class": "text-md", + } +} diff --git a/internal/gui/elements/sizes_templ.go b/internal/gui/elements/sizes_templ.go new file mode 100644 index 000000000..20bc7d8b4 --- /dev/null +++ b/internal/gui/elements/sizes_templ.go @@ -0,0 +1,71 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +type Size int + +const ( + SizeDefault Size = iota + SizeSmall + SizeMedium + SizeLarge +) + +func (s Size) CardAttributes() templ.Attributes { + switch s { + case SizeSmall: + return templ.Attributes{ + "class": "max-w-lg bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + } + case SizeLarge: + return templ.Attributes{ + "class": "max-w-2xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + } + } + return templ.Attributes{ + "class": "max-w-xl bg-white border rounded-lg shadow-sm p-7 border-neutral-200/60", + } +} + +func (s Size) SvgAttributes() templ.Attributes { + switch s { + case SizeSmall: + return templ.Attributes{ + "height": "16", + "width": "16", + } + case SizeLarge: + return templ.Attributes{ + "height": "32", + "width": "32", + } + } + return templ.Attributes{ + "height": "24", + "width": "24", + } +} + +func (s Size) TextAttributes() templ.Attributes { + switch s { + case SizeSmall: + return templ.Attributes{ + "class": "text-sm", + } + case SizeLarge: + return templ.Attributes{ + "class": "text-lg", + } + } + return templ.Attributes{ + "class": "text-md", + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/elements/tabs.templ b/internal/gui/elements/tabs.templ new file mode 100644 index 000000000..8b478f482 --- /dev/null +++ b/internal/gui/elements/tabs.templ @@ -0,0 +1,109 @@ +package elements + +templ Tabs() { +
    +
    + + + +
    +
    +
    +
    + @Table() +
    +
    + And, this is the content for Tab2 +
    +
    + Finally, this is the content for Tab3 +
    +
    +
    +} + +templ Table() { +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameAgeAddressAction
    Richard Hendricks30Pied Piper HQ, Palo Alto + Edit +
    Erlich Bachman405230 Penfield Ave, Woodland Hills + Edit +
    Monica Hall352030 Stewart Drive, Sunnyvale + Edit +
    Dinesh Chugtai28Pied Piper HQ, Palo Alto + Edit +
    Gilfoyle32Pied Piper HQ, Palo Alto + Edit +
    +
    +
    +
    +
    +} diff --git a/internal/gui/elements/tabs_templ.go b/internal/gui/elements/tabs_templ.go new file mode 100644 index 000000000..a5ab4fc09 --- /dev/null +++ b/internal/gui/elements/tabs_templ.go @@ -0,0 +1,71 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package elements + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Tabs() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Table().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    And, this is the content for Tab2
    Finally, this is the content for Tab3
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +func Table() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    NameAgeAddressAction
    Richard Hendricks30Pied Piper HQ, Palo AltoEdit
    Erlich Bachman405230 Penfield Ave, Woodland HillsEdit
    Monica Hall352030 Stewart Drive, SunnyvaleEdit
    Dinesh Chugtai28Pied Piper HQ, Palo AltoEdit
    Gilfoyle32Pied Piper HQ, Palo AltoEdit
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/forms/forms.go b/internal/gui/forms/forms.go new file mode 100644 index 000000000..0b7e1ad5f --- /dev/null +++ b/internal/gui/forms/forms.go @@ -0,0 +1,41 @@ +package forms + +import ( + "bytes" + + "github.com/a-h/templ" + "github.com/labstack/echo/v4" +) + +func echoFormResponse(c echo.Context, cmp templ.Component, state FormState) error { + // Create a buffer to store the rendered HTML + buf := &bytes.Buffer{} + // Render the component to the buffer + err := cmp.Render(c.Request().Context(), buf) + if err != nil { + return err + } + + // Set the content type + c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML) + c.Response().Header().Set("X-Status", string(state)) + + // Write the buffered content to the response + _, err = c.Response().Write(buf.Bytes()) + return err +} + +type FormState string + +const ( + InitialForm FormState = "initial" + ErrorForm FormState = "error" + SuccessForm FormState = "success" + WarningForm FormState = "warning" +) + +type Form struct { + State FormState + Title string + Description string +} diff --git a/internal/gui/forms/register.templ b/internal/gui/forms/register.templ new file mode 100644 index 000000000..76b0c1d99 --- /dev/null +++ b/internal/gui/forms/register.templ @@ -0,0 +1,25 @@ +package forms + +import "github.com/labstack/echo/v4" + +templ BasicInfo(c echo.Context, state FormState) { + switch (state) { + default: +
    +
    +

    Account

    +

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

    +
    +
    +
    +
    +
    +
    + } +} + +templ CreateCredentials(state FormState) { +} + +templ PrivacyTerms(state FormState) { +} diff --git a/internal/gui/forms/register_templ.go b/internal/gui/forms/register_templ.go new file mode 100644 index 000000000..99dbc9976 --- /dev/null +++ b/internal/gui/forms/register_templ.go @@ -0,0 +1,86 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package forms + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "github.com/labstack/echo/v4" + +func BasicInfo(c echo.Context, state FormState) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + switch state { + default: + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

    Account

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

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return templ_7745c5c3_Err + }) +} + +func CreateCredentials(state FormState) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + return templ_7745c5c3_Err + }) +} + +func PrivacyTerms(state FormState) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/views/home.templ b/internal/gui/views/home.templ new file mode 100644 index 000000000..34b505522 --- /dev/null +++ b/internal/gui/views/home.templ @@ -0,0 +1,29 @@ +package views + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" +) + +func HomeView(c echo.Context) error { + return echoComponentResponse(c, renderHomeView()) +} + +templ renderHomeView() { + @elements.Layout("Sonr.ID") { + @elements.Card("home-view", elements.SizeLarge) { + @elements.H1("Sonr.ID") + @elements.Text("A Decentralized Web Node Client for the Sonr Network.") + @elements.Spacer() +
    + @elements.Button(elements.GET("/register", "#home-view"), elements.PrimaryButtonStyle()) { + @elements.Text("Get Started") + } + @elements.Button(elements.GET("/login", "#home-view")) { + @elements.Text("Login") + } +
    + @elements.PoweredBySonr() + } + } +} diff --git a/internal/gui/views/home_templ.go b/internal/gui/views/home_templ.go new file mode 100644 index 000000000..8259d8a94 --- /dev/null +++ b/internal/gui/views/home_templ.go @@ -0,0 +1,154 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package views + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" +) + +func HomeView(c echo.Context) error { + return echoComponentResponse(c, renderHomeView()) +} + +func renderHomeView() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = elements.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 = elements.Text("A Decentralized Web Node Client for the Sonr Network.").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = elements.Spacer().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = elements.Text("Get Started").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Button(elements.GET("/register", "#home-view"), elements.PrimaryButtonStyle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = elements.Text("Login").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Button(elements.GET("/login", "#home-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = elements.PoweredBySonr().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Card("home-view", elements.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Layout("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/views/login.templ b/internal/gui/views/login.templ new file mode 100644 index 000000000..601dc0aae --- /dev/null +++ b/internal/gui/views/login.templ @@ -0,0 +1,25 @@ +package views + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" +) + +func LoginView(c echo.Context) error { + return echoComponentResponse(c, renderLoginView()) +} + +templ renderLoginView() { + @elements.Layout("Login | Sonr.ID") { + @elements.Card("login-view", elements.SizeLarge) { + @elements.H1("Sonr.ID") + @elements.Text("Neo-tree is a file manager for NeoFS.") + @elements.Spacer() + @elements.RadioGroup() + @elements.Spacer() + @elements.Button(elements.GET("/", "#login-view")) { + @elements.Text("Cancel") + } + } + } +} diff --git a/internal/gui/views/login_templ.go b/internal/gui/views/login_templ.go new file mode 100644 index 000000000..7ec36e580 --- /dev/null +++ b/internal/gui/views/login_templ.go @@ -0,0 +1,140 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package views + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" +) + +func LoginView(c echo.Context) error { + return echoComponentResponse(c, renderLoginView()) +} + +func renderLoginView() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = elements.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 = elements.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = elements.Spacer().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = elements.RadioGroup().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = elements.Spacer().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = elements.Text("Cancel").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Button(elements.GET("/", "#login-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Card("login-view", elements.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Layout("Login | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/views/openid.templ b/internal/gui/views/openid.templ new file mode 100644 index 000000000..f09cdc270 --- /dev/null +++ b/internal/gui/views/openid.templ @@ -0,0 +1,19 @@ +package views + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" +) + +func AuthorizeView(c echo.Context) error { + return echoComponentResponse(c, renderAuthorizeView()) +} + +templ renderAuthorizeView() { + @elements.Layout("Login | Sonr.ID") { + @elements.Card("authorize-view", elements.SizeMedium) { + @elements.H1("Sonr.ID") + @elements.Text("Neo-tree is a file manager for NeoFS.") + } + } +} diff --git a/internal/gui/views/openid_templ.go b/internal/gui/views/openid_templ.go new file mode 100644 index 000000000..1f62a9b5d --- /dev/null +++ b/internal/gui/views/openid_templ.go @@ -0,0 +1,90 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package views + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" +) + +func AuthorizeView(c echo.Context) error { + return echoComponentResponse(c, renderAuthorizeView()) +} + +func renderAuthorizeView() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = elements.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 = elements.Text("Neo-tree is a file manager for NeoFS.").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Card("authorize-view", elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Layout("Login | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/views/profile.templ b/internal/gui/views/profile.templ new file mode 100644 index 000000000..25c272e99 --- /dev/null +++ b/internal/gui/views/profile.templ @@ -0,0 +1,19 @@ +package views + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" +) + +func ProfileView(c echo.Context) error { + return echoComponentResponse(c, renderProfileView()) +} + +templ renderProfileView() { + @elements.Layout("Profile | Sonr.ID") { + @elements.Card("profile-view", elements.SizeLarge) { + @elements.ProfileCard() + @elements.Tabs() + } + } +} diff --git a/internal/gui/views/profile_templ.go b/internal/gui/views/profile_templ.go new file mode 100644 index 000000000..189837b19 --- /dev/null +++ b/internal/gui/views/profile_templ.go @@ -0,0 +1,90 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package views + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" +) + +func ProfileView(c echo.Context) error { + return echoComponentResponse(c, renderProfileView()) +} + +func renderProfileView() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = elements.ProfileCard().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = elements.Tabs().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Card("profile-view", elements.SizeLarge).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Layout("Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/views/register.templ b/internal/gui/views/register.templ new file mode 100644 index 000000000..076d4d992 --- /dev/null +++ b/internal/gui/views/register.templ @@ -0,0 +1,26 @@ +package views + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" + "github.com/onsonr/sonr/internal/gui/forms" +) + +func RegisterView(c echo.Context) error { + return echoComponentResponse(c, renderRegisterView(c)) +} + +templ renderRegisterView(c echo.Context) { + @elements.Layout("Register | Sonr.ID") { + @elements.Card("register-view", elements.SizeMedium) { + @elements.H2("Account Registration") + @elements.Spacer() + @elements.Breadcrumbs() + @forms.BasicInfo(c, forms.InitialForm) + @elements.Spacer() + @elements.Button(elements.GET("/", "#register-view")) { + @elements.Text("Cancel") + } + } + } +} diff --git a/internal/gui/views/register_templ.go b/internal/gui/views/register_templ.go new file mode 100644 index 000000000..3a10827f4 --- /dev/null +++ b/internal/gui/views/register_templ.go @@ -0,0 +1,141 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.771 +package views + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/gui/elements" + "github.com/onsonr/sonr/internal/gui/forms" +) + +func RegisterView(c echo.Context) error { + return echoComponentResponse(c, renderRegisterView(c)) +} + +func renderRegisterView(c echo.Context) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = elements.H2("Account Registration").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = elements.Spacer().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = elements.Breadcrumbs().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = forms.BasicInfo(c, forms.InitialForm).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = elements.Spacer().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = elements.Text("Cancel").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Button(elements.GET("/", "#register-view")).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Card("register-view", elements.SizeMedium).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = elements.Layout("Register | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/internal/gui/views/views.go b/internal/gui/views/views.go new file mode 100644 index 000000000..cc62f7aed --- /dev/null +++ b/internal/gui/views/views.go @@ -0,0 +1,27 @@ +package views + +import ( + "bytes" + + "github.com/a-h/templ" + "github.com/labstack/echo/v4" +) + +// render renders a templ.Component +func echoComponentResponse(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/mdw/authz.go b/internal/mdw/authz.go new file mode 100644 index 000000000..c9fcc5153 --- /dev/null +++ b/internal/mdw/authz.go @@ -0,0 +1,95 @@ +package mdw + +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" +) + +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} + +func MacaroonMiddleware(secretKeyStr string, location string) echo.MiddlewareFunc { + secretKey := []byte(secretKeyStr) + return func(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + // Extract the macaroon from the Authorization header + auth := c.Request().Header.Get("Authorization") + if auth == "" { + return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Missing Authorization header"}) + } + + // Decode the macaroon + mac, err := macaroon.Base64Decode([]byte(auth)) + if err != nil { + return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon encoding"}) + } + + token, err := macaroon.New(secretKey, mac, location, macaroon.LatestVersion) + if err != nil { + return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon"}) + } + + // Verify the macaroon + err = token.Verify(secretKey, func(caveat string) error { + for _, c := range MacroonCaveats { + if c.String() == caveat { + return nil + } + } + return nil // Return nil if the caveat is valid + }, nil) + if err != nil { + return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Invalid macaroon"}) + } + + // Macaroon is valid, proceed to the next handler + return next(c) + } + } +} diff --git a/internal/mdw/client.go b/internal/mdw/client.go new file mode 100644 index 000000000..c7be79ac1 --- /dev/null +++ b/internal/mdw/client.go @@ -0,0 +1,3 @@ +package mdw + +type AuthClient struct{} diff --git a/internal/mdw/headers.go b/internal/mdw/headers.go new file mode 100644 index 000000000..68fa253ed --- /dev/null +++ b/internal/mdw/headers.go @@ -0,0 +1,55 @@ +package mdw + +type RequestHeaders struct { + Authorization *string `header:"Authorization"` + CacheControl *string `header:"Cache-Control"` + DeviceMemory *string `header:"Device-Memory"` + Forwarded *string `header:"Forwarded"` + From *string `header:"From"` + Host *string `header:"Host"` + Link *string `header:"Link"` + PermissionsPolicy *string `header:"Permissions-Policy"` + ProxyAuthorization *string `header:"Proxy-Authorization"` + Referer *string `header:"Referer"` + UserAgent *string `header:"User-Agent"` + ViewportWidth *string `header:"Viewport-Width"` + Width *string `header:"Width"` + WWWAuthenticate *string `header:"WWW-Authenticate"` + + // 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 ResponseHeaders 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"` + + // 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"` +} diff --git a/internal/mdw/session.go b/internal/mdw/session.go new file mode 100644 index 000000000..8907bc1e2 --- /dev/null +++ b/internal/mdw/session.go @@ -0,0 +1,72 @@ +package mdw + +import ( + "net/http" + "time" + + "github.com/donseba/go-htmx" + "github.com/labstack/echo/v4" + "github.com/onsonr/sonr/internal/db" + "github.com/segmentio/ksuid" +) + +type Session struct { + echo.Context + htmx *htmx.HTMX + dB *db.DB +} + +// GetSession returns the current Session +func GetSession(c echo.Context) *Session { + return c.(*Session) +} + +// UseSession establishes a Session Cookie. +func UseSession(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + sc := initSession(c) + headers := new(RequestHeaders) + sc.Bind(headers) + return next(sc) + } +} + +func (c *Session) DB() *db.DB { + return c.dB +} + +func (c *Session) Htmx() *htmx.HTMX { + return c.htmx +} + +func (c *Session) ID() string { + return readCookie(c, "session") +} + +func initSession(c echo.Context) *Session { + s := &Session{Context: c} + if val := readCookie(c, "session"); val == "" { + id := ksuid.New().String() + writeCookie(c, "session", id) + } + return s +} + +func readCookie(c echo.Context, key string) string { + cookie, err := c.Cookie(key) + if err != nil { + return "" + } + if cookie == nil { + return "" + } + return cookie.Value +} + +func writeCookie(c echo.Context, key string, value string) { + cookie := new(http.Cookie) + cookie.Name = key + cookie.Value = value + cookie.Expires = time.Now().Add(24 * time.Hour) + c.SetCookie(cookie) +} diff --git a/internal/svc/openid.go b/internal/svc/openid.go new file mode 100644 index 000000000..78b97119f --- /dev/null +++ b/internal/svc/openid.go @@ -0,0 +1,46 @@ +package svc + +import ( + "fmt" + + "github.com/labstack/echo/v4" + oidc "github.com/onsonr/sonr/x/did/types/oidc" +) + +func GrantAuthorization(e echo.Context) error { + // Implement authorization endpoint using passkey authentication + // Store session data in cache + return nil +} + +func GetJWKS(e echo.Context) error { + // Implement token endpoint + // Use cached session data for validation + return nil +} + +func GetToken(e echo.Context) error { + // Implement token endpoint + // Use cached session data for validation + return nil +} + +func GetDiscovery(e echo.Context) error { + baseURL := "https://" + e.Request().Host // Ensure this is the correct base URL for your service + discoveryDoc := &oidc.DiscoveryDocument{ + Issuer: baseURL, + AuthorizationEndpoint: fmt.Sprintf("%s/auth", baseURL), + TokenEndpoint: fmt.Sprintf("%s/token", baseURL), + UserinfoEndpoint: fmt.Sprintf("%s/userinfo", baseURL), + JwksUri: fmt.Sprintf("%s/jwks", baseURL), + RegistrationEndpoint: fmt.Sprintf("%s/register", baseURL), + ScopesSupported: []string{"openid", "profile", "email", "web3", "sonr"}, + ResponseTypesSupported: []string{"code"}, + ResponseModesSupported: []string{"query", "form_post"}, + GrantTypesSupported: []string{"authorization_code", "refresh_token"}, + AcrValuesSupported: []string{"passkey"}, + SubjectTypesSupported: []string{"public"}, + ClaimsSupported: []string{"sub", "iss", "name", "email"}, + } + return e.JSON(200, discoveryDoc) +} diff --git a/internal/svc/webauth.go b/internal/svc/webauth.go new file mode 100644 index 000000000..ac08255c7 --- /dev/null +++ b/internal/svc/webauth.go @@ -0,0 +1,43 @@ +package svc + +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/internal/tui/authmodel/authmodel.go b/internal/tui/authmodel/authmodel.go new file mode 100644 index 000000000..2f83c115f --- /dev/null +++ b/internal/tui/authmodel/authmodel.go @@ -0,0 +1,322 @@ +package txmodel + +import ( + "fmt" + "strings" + + tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/huh" + "github.com/charmbracelet/lipgloss" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +const maxWidth = 100 + +var ( + red = lipgloss.AdaptiveColor{Light: "#FE5F86", Dark: "#FE5F86"} + indigo = lipgloss.AdaptiveColor{Light: "#5A56E0", Dark: "#7571F9"} + green = lipgloss.AdaptiveColor{Light: "#02BA84", Dark: "#02BF87"} +) + +type Styles struct { + Base, + HeaderText, + Status, + StatusHeader, + Highlight, + ErrorHeaderText, + Help lipgloss.Style +} + +func NewStyles(lg *lipgloss.Renderer) *Styles { + s := Styles{} + s.Base = lg.NewStyle(). + Padding(1, 2, 0, 1) + s.HeaderText = lg.NewStyle(). + Foreground(indigo). + Bold(true). + Padding(0, 1, 0, 1) + s.Status = lg.NewStyle(). + Border(lipgloss.RoundedBorder()). + BorderForeground(indigo). + PaddingLeft(1). + MarginTop(1) + s.StatusHeader = lg.NewStyle(). + Foreground(green). + Bold(true) + s.Highlight = lg.NewStyle(). + Foreground(lipgloss.Color("212")) + s.ErrorHeaderText = s.HeaderText. + Foreground(red) + s.Help = lg.NewStyle(). + Foreground(lipgloss.Color("240")) + return &s +} + +type state int + +const ( + statusNormal state = iota + stateDone +) + +type Model struct { + state state + lg *lipgloss.Renderer + styles *Styles + form *huh.Form + width int + message *tx.TxBody +} + +func NewModel() Model { + m := Model{width: maxWidth} + m.lg = lipgloss.DefaultRenderer() + m.styles = NewStyles(m.lg) + + m.form = huh.NewForm( + huh.NewGroup( + huh.NewInput(). + Key("from"). + Title("From Address"). + Placeholder("cosmos1..."). + Validate(func(s string) error { + if !strings.HasPrefix(s, "cosmos1") { + return fmt.Errorf("invalid address format") + } + return nil + }), + + huh.NewInput(). + Key("to"). + Title("To Address"). + Placeholder("cosmos1..."). + Validate(func(s string) error { + if !strings.HasPrefix(s, "cosmos1") { + return fmt.Errorf("invalid address format") + } + return nil + }), + + huh.NewInput(). + Key("amount"). + Title("Amount"). + Placeholder("100"). + Validate(func(s string) error { + if _, err := sdk.ParseCoinNormalized(s + "atom"); err != nil { + return fmt.Errorf("invalid coin amount") + } + return nil + }), + + huh.NewSelect[string](). + Key("denom"). + Title("Denom"). + Options(huh.NewOptions("atom", "osmo", "usnr", "snr")...), + + huh.NewInput(). + Key("memo"). + Title("Memo"). + Placeholder("Optional"), + + huh.NewConfirm(). + Key("done"). + Title("Ready to convert?"). + Validate(func(v bool) error { + if !v { + return fmt.Errorf("Please confirm when you're ready to convert") + } + return nil + }). + Affirmative("Yes, convert!"). + Negative("Not yet"), + ), + ). + WithWidth(60). + WithShowHelp(false). + WithShowErrors(false) + + return m +} + +func (m Model) Init() tea.Cmd { + return m.form.Init() +} + +func min(x, y int) int { + if x > y { + return y + } + return x +} + +func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + switch msg := msg.(type) { + case tea.WindowSizeMsg: + m.width = min(msg.Width, maxWidth) - m.styles.Base.GetHorizontalFrameSize() + case tea.KeyMsg: + switch msg.String() { + case "esc", "ctrl+c", "q": + return m, tea.Quit + } + } + + var cmds []tea.Cmd + + form, cmd := m.form.Update(msg) + if f, ok := form.(*huh.Form); ok { + m.form = f + cmds = append(cmds, cmd) + } + + if m.form.State == huh.StateCompleted { + m.buildMessage() + cmds = append(cmds, tea.Quit) + } + + return m, tea.Batch(cmds...) +} + +func (m Model) View() string { + s := m.styles + + switch m.form.State { + case huh.StateCompleted: + pklCode := m.generatePkl() + messageView := m.getMessageView() + var b strings.Builder + fmt.Fprintf(&b, "Final Tx:\n\n%s\n\n%s", pklCode, messageView) + return s.Status.Margin(0, 1).Padding(1, 2).Width(80).Render(b.String()) + "\n\n" + default: + var schemaType string + if m.form.GetString("schemaType") != "" { + schemaType = "Schema Type: " + m.form.GetString("schemaType") + } + + v := strings.TrimSuffix(m.form.View(), "\n\n") + form := m.lg.NewStyle().Margin(1, 0).Render(v) + + var status string + { + preview := "(Preview will appear here)" + if m.form.GetString("schema") != "" { + preview = m.generatePkl() + } + + const statusWidth = 40 + statusMarginLeft := m.width - statusWidth - lipgloss.Width(form) - s.Status.GetMarginRight() + status = s.Status. + Height(lipgloss.Height(form)). + Width(statusWidth). + MarginLeft(statusMarginLeft). + Render(s.StatusHeader.Render("Pkl Preview") + "\n" + + schemaType + "\n\n" + + preview) + } + + errors := m.form.Errors() + header := m.appBoundaryView("Sonr TX Builder") + if len(errors) > 0 { + header = m.appErrorBoundaryView(m.errorView()) + } + body := lipgloss.JoinHorizontal(lipgloss.Top, form, status) + + footer := m.appBoundaryView(m.form.Help().ShortHelpView(m.form.KeyBinds())) + if len(errors) > 0 { + footer = m.appErrorBoundaryView("") + } + + return s.Base.Render(header + "\n" + body + "\n\n" + footer) + } +} + +func (m Model) errorView() string { + var s string + for _, err := range m.form.Errors() { + s += err.Error() + } + return s +} + +func (m Model) appBoundaryView(text string) string { + return lipgloss.PlaceHorizontal( + m.width, + lipgloss.Left, + m.styles.HeaderText.Render(text), + lipgloss.WithWhitespaceChars("="), + lipgloss.WithWhitespaceForeground(indigo), + ) +} + +func (m Model) appErrorBoundaryView(text string) string { + return lipgloss.PlaceHorizontal( + m.width, + lipgloss.Left, + m.styles.ErrorHeaderText.Render(text), + lipgloss.WithWhitespaceChars("="), + lipgloss.WithWhitespaceForeground(red), + ) +} + +func (m Model) generatePkl() string { + schemaType := m.form.GetString("schemaType") + schema := m.form.GetString("schema") + + // This is a placeholder for the actual conversion logic + // In a real implementation, you would parse the schema and generate Pkl code + return fmt.Sprintf("// Converted from %s\n\nclass ConvertedSchema {\n // TODO: Implement conversion from %s\n // Original schema:\n /*\n%s\n */\n}", schemaType, schemaType, schema) +} + +func (m *Model) buildMessage() { + from := m.form.GetString("from") + to := m.form.GetString("to") + amount := m.form.GetString("amount") + denom := m.form.GetString("denom") + memo := m.form.GetString("memo") + + coin, _ := sdk.ParseCoinNormalized(fmt.Sprintf("%s%s", amount, denom)) + sendMsg := &banktypes.MsgSend{ + FromAddress: from, + ToAddress: to, + Amount: sdk.NewCoins(coin), + } + + anyMsg, _ := codectypes.NewAnyWithValue(sendMsg) + m.message = &tx.TxBody{ + Messages: []*codectypes.Any{anyMsg}, + Memo: memo, + } +} + +func (m Model) getMessageView() string { + if m.message == nil { + return "Current Message: None" + } + + interfaceRegistry := codectypes.NewInterfaceRegistry() + marshaler := codec.NewProtoCodec(interfaceRegistry) + jsonBytes, _ := marshaler.MarshalJSON(m.message) + + return fmt.Sprintf("Current Message:\n%s", string(jsonBytes)) +} + +func RunTUIForm() (*tx.TxBody, error) { + m := NewModel() + p := tea.NewProgram(m) + + finalModel, err := p.Run() + if err != nil { + return nil, fmt.Errorf("failed to run program: %w", err) + } + + finalM, ok := finalModel.(Model) + if !ok || finalM.message == nil { + return nil, fmt.Errorf("form not completed") + } + + return finalM.message, nil +} diff --git a/internal/tui/dexmodel/dexmodel.go b/internal/tui/dexmodel/dexmodel.go new file mode 100644 index 000000000..c6a77a8d8 --- /dev/null +++ b/internal/tui/dexmodel/dexmodel.go @@ -0,0 +1,165 @@ +package dexmodel + +import ( + "fmt" + "time" + + "github.com/charmbracelet/bubbles/table" + tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/lipgloss" + "github.com/spf13/cobra" +) + +var ( + subtle = lipgloss.AdaptiveColor{Light: "#D9DCCF", Dark: "#383838"} + highlight = lipgloss.AdaptiveColor{Light: "#874BFD", Dark: "#7D56F4"} + special = lipgloss.AdaptiveColor{Light: "#43BF6D", Dark: "#73F59F"} + + titleStyle = lipgloss.NewStyle(). + MarginLeft(1). + MarginRight(5). + Padding(0, 1). + Italic(true). + Foreground(lipgloss.Color("#FFF7DB")). + SetString("Cosmos Block Explorer") + + infoStyle = lipgloss.NewStyle(). + BorderStyle(lipgloss.NormalBorder()). + BorderTop(true). + BorderForeground(subtle) +) + +type model struct { + blocks []string + transactionTable table.Model + stats map[string]string + width int + height int +} + +func initialModel() model { + columns := []table.Column{ + {Title: "Hash", Width: 10}, + {Title: "Type", Width: 15}, + {Title: "Height", Width: 10}, + {Title: "Time", Width: 20}, + } + + rows := []table.Row{ + {"abc123", "Transfer", "1000", time.Now().Format(time.RFC3339)}, + {"def456", "Delegate", "999", time.Now().Add(-1 * time.Minute).Format(time.RFC3339)}, + {"ghi789", "Vote", "998", time.Now().Add(-2 * time.Minute).Format(time.RFC3339)}, + } + + t := table.New( + table.WithColumns(columns), + table.WithRows(rows), + table.WithFocused(true), + table.WithHeight(7), + ) + + s := table.DefaultStyles() + s.Header = s.Header. + BorderStyle(lipgloss.NormalBorder()). + BorderForeground(lipgloss.Color("240")). + BorderBottom(true). + Bold(false) + s.Selected = s.Selected. + Foreground(lipgloss.Color("229")). + Background(lipgloss.Color("57")). + Bold(false) + t.SetStyles(s) + + return model{ + blocks: []string{"Block 1", "Block 2", "Block 3"}, + transactionTable: t, + stats: map[string]string{ + "Latest Block": "1000", + "Validators": "100", + "Bonded Tokens": "1,000,000", + }, + } +} + +func (m model) Init() tea.Cmd { + return tick +} + +func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + var cmd tea.Cmd + switch msg := msg.(type) { + case tea.KeyMsg: + switch msg.String() { + case "q", "ctrl+c": + return m, tea.Quit + case "enter": + return m, tea.Batch( + tea.Printf("Selected transaction: %s", m.transactionTable.SelectedRow()[0]), + ) + } + case tea.WindowSizeMsg: + m.height = msg.Height + m.width = msg.Width + case tickMsg: + // Update data here + m.blocks = append([]string{"New Block"}, m.blocks...) + if len(m.blocks) > 5 { + m.blocks = m.blocks[:5] + } + + // Add a new transaction to the table + newRow := table.Row{ + fmt.Sprintf("tx%d", time.Now().Unix()), + "NewTxType", + fmt.Sprintf("%d", 1000+len(m.transactionTable.Rows())), + time.Now().Format(time.RFC3339), + } + m.transactionTable.SetRows(append([]table.Row{newRow}, m.transactionTable.Rows()...)) + if len(m.transactionTable.Rows()) > 10 { + m.transactionTable.SetRows(m.transactionTable.Rows()[:10]) + } + + return m, tick + } + m.transactionTable, cmd = m.transactionTable.Update(msg) + return m, cmd +} + +func (m model) View() string { + s := titleStyle.Render("Cosmos Block Explorer") + s += "\n\n" + + // Blocks + s += lipgloss.NewStyle().Bold(true).Render("Recent Blocks") + "\n" + for _, block := range m.blocks { + s += "• " + block + "\n" + } + s += "\n" + + // Transactions + s += lipgloss.NewStyle().Bold(true).Render("Recent Transactions") + "\n" + s += m.transactionTable.View() + "\n\n" + + // Stats + s += lipgloss.NewStyle().Bold(true).Render("Network Statistics") + "\n" + for key, value := range m.stats { + s += fmt.Sprintf("%s: %s\n", key, value) + } + + return s +} + +type tickMsg time.Time + +func tick() tea.Msg { + time.Sleep(time.Second) + return tickMsg{} +} + +func RunExplorerTUI(cmd *cobra.Command, args []string) error { + p := tea.NewProgram(initialModel(), tea.WithAltScreen()) + if _, err := p.Run(); err != nil { + return fmt.Errorf("error running explorer: %v", err) + } + return nil +} diff --git a/internal/tui/tui.go b/internal/tui/tui.go new file mode 100644 index 000000000..0ac4d76c0 --- /dev/null +++ b/internal/tui/tui.go @@ -0,0 +1,49 @@ +package tui + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/onsonr/sonr/internal/tui/dexmodel" + "github.com/onsonr/sonr/internal/tui/txmodel" + "github.com/spf13/cobra" +) + +func AddTUICmds(rootCmd *cobra.Command) { + rootCmd.AddCommand(newBuildTxnTUICmd()) + rootCmd.AddCommand(newExplorerTUICmd()) +} + +func newBuildTxnTUICmd() *cobra.Command { + return &cobra.Command{ + Use: "dash", + Short: "TUI for managing the local Sonr validator node", + RunE: func(cmd *cobra.Command, args []string) error { + txBody, err := txmodel.RunBuildTxnTUI() + if err != nil { + return err + } + + interfaceRegistry := codectypes.NewInterfaceRegistry() + marshaler := codec.NewProtoCodec(interfaceRegistry) + jsonBytes, err := marshaler.MarshalJSON(txBody) + if err != nil { + return fmt.Errorf("failed to marshal tx body: %w", err) + } + + fmt.Println("Generated Protobuf Message (JSON format):") + fmt.Println(string(jsonBytes)) + + return nil + }, + } +} + +func newExplorerTUICmd() *cobra.Command { + return &cobra.Command{ + Use: "cosmos-explorer", + Short: "A terminal-based Cosmos blockchain explorer", + RunE: dexmodel.RunExplorerTUI, + } +} diff --git a/internal/tui/txmodel/txmodel.go b/internal/tui/txmodel/txmodel.go new file mode 100644 index 000000000..4c493ad24 --- /dev/null +++ b/internal/tui/txmodel/txmodel.go @@ -0,0 +1,322 @@ +package txmodel + +import ( + "fmt" + "strings" + + tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/huh" + "github.com/charmbracelet/lipgloss" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +const maxWidth = 100 + +var ( + red = lipgloss.AdaptiveColor{Light: "#FE5F86", Dark: "#FE5F86"} + indigo = lipgloss.AdaptiveColor{Light: "#5A56E0", Dark: "#7571F9"} + green = lipgloss.AdaptiveColor{Light: "#02BA84", Dark: "#02BF87"} +) + +type Styles struct { + Base, + HeaderText, + Status, + StatusHeader, + Highlight, + ErrorHeaderText, + Help lipgloss.Style +} + +func NewStyles(lg *lipgloss.Renderer) *Styles { + s := Styles{} + s.Base = lg.NewStyle(). + Padding(1, 2, 0, 1) + s.HeaderText = lg.NewStyle(). + Foreground(indigo). + Bold(true). + Padding(0, 1, 0, 1) + s.Status = lg.NewStyle(). + Border(lipgloss.RoundedBorder()). + BorderForeground(indigo). + PaddingLeft(1). + MarginTop(1) + s.StatusHeader = lg.NewStyle(). + Foreground(green). + Bold(true) + s.Highlight = lg.NewStyle(). + Foreground(lipgloss.Color("212")) + s.ErrorHeaderText = s.HeaderText. + Foreground(red) + s.Help = lg.NewStyle(). + Foreground(lipgloss.Color("240")) + return &s +} + +type state int + +const ( + statusNormal state = iota + stateDone +) + +type Model struct { + state state + lg *lipgloss.Renderer + styles *Styles + form *huh.Form + width int + message *tx.TxBody +} + +func NewModel() Model { + m := Model{width: maxWidth} + m.lg = lipgloss.DefaultRenderer() + m.styles = NewStyles(m.lg) + + m.form = huh.NewForm( + huh.NewGroup( + huh.NewInput(). + Key("from"). + Title("From Address"). + Placeholder("cosmos1..."). + Validate(func(s string) error { + if !strings.HasPrefix(s, "cosmos1") { + return fmt.Errorf("invalid address format") + } + return nil + }), + + huh.NewInput(). + Key("to"). + Title("To Address"). + Placeholder("cosmos1..."). + Validate(func(s string) error { + if !strings.HasPrefix(s, "cosmos1") { + return fmt.Errorf("invalid address format") + } + return nil + }), + + huh.NewInput(). + Key("amount"). + Title("Amount"). + Placeholder("100"). + Validate(func(s string) error { + if _, err := sdk.ParseCoinNormalized(s + "atom"); err != nil { + return fmt.Errorf("invalid coin amount") + } + return nil + }), + + huh.NewSelect[string](). + Key("denom"). + Title("Denom"). + Options(huh.NewOptions("atom", "osmo", "usnr", "snr")...), + + huh.NewInput(). + Key("memo"). + Title("Memo"). + Placeholder("Optional"), + + huh.NewConfirm(). + Key("done"). + Title("Ready to convert?"). + Validate(func(v bool) error { + if !v { + return fmt.Errorf("Please confirm when you're ready to convert") + } + return nil + }). + Affirmative("Yes, convert!"). + Negative("Not yet"), + ), + ). + WithWidth(60). + WithShowHelp(false). + WithShowErrors(false) + + return m +} + +func (m Model) Init() tea.Cmd { + return m.form.Init() +} + +func min(x, y int) int { + if x > y { + return y + } + return x +} + +func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + switch msg := msg.(type) { + case tea.WindowSizeMsg: + m.width = min(msg.Width, maxWidth) - m.styles.Base.GetHorizontalFrameSize() + case tea.KeyMsg: + switch msg.String() { + case "esc", "ctrl+c", "q": + return m, tea.Quit + } + } + + var cmds []tea.Cmd + + form, cmd := m.form.Update(msg) + if f, ok := form.(*huh.Form); ok { + m.form = f + cmds = append(cmds, cmd) + } + + if m.form.State == huh.StateCompleted { + m.buildMessage() + cmds = append(cmds, tea.Quit) + } + + return m, tea.Batch(cmds...) +} + +func (m Model) View() string { + s := m.styles + + switch m.form.State { + case huh.StateCompleted: + pklCode := m.generatePkl() + messageView := m.getMessageView() + var b strings.Builder + fmt.Fprintf(&b, "Final Tx:\n\n%s\n\n%s", pklCode, messageView) + return s.Status.Margin(0, 1).Padding(1, 2).Width(80).Render(b.String()) + "\n\n" + default: + var schemaType string + if m.form.GetString("schemaType") != "" { + schemaType = "Schema Type: " + m.form.GetString("schemaType") + } + + v := strings.TrimSuffix(m.form.View(), "\n\n") + form := m.lg.NewStyle().Margin(1, 0).Render(v) + + var status string + { + preview := "(Preview will appear here)" + if m.form.GetString("schema") != "" { + preview = m.generatePkl() + } + + const statusWidth = 40 + statusMarginLeft := m.width - statusWidth - lipgloss.Width(form) - s.Status.GetMarginRight() + status = s.Status. + Height(lipgloss.Height(form)). + Width(statusWidth). + MarginLeft(statusMarginLeft). + Render(s.StatusHeader.Render("Pkl Preview") + "\n" + + schemaType + "\n\n" + + preview) + } + + errors := m.form.Errors() + header := m.appBoundaryView("Sonr TX Builder") + if len(errors) > 0 { + header = m.appErrorBoundaryView(m.errorView()) + } + body := lipgloss.JoinHorizontal(lipgloss.Top, form, status) + + footer := m.appBoundaryView(m.form.Help().ShortHelpView(m.form.KeyBinds())) + if len(errors) > 0 { + footer = m.appErrorBoundaryView("") + } + + return s.Base.Render(header + "\n" + body + "\n\n" + footer) + } +} + +func (m Model) errorView() string { + var s string + for _, err := range m.form.Errors() { + s += err.Error() + } + return s +} + +func (m Model) appBoundaryView(text string) string { + return lipgloss.PlaceHorizontal( + m.width, + lipgloss.Left, + m.styles.HeaderText.Render(text), + lipgloss.WithWhitespaceChars("="), + lipgloss.WithWhitespaceForeground(indigo), + ) +} + +func (m Model) appErrorBoundaryView(text string) string { + return lipgloss.PlaceHorizontal( + m.width, + lipgloss.Left, + m.styles.ErrorHeaderText.Render(text), + lipgloss.WithWhitespaceChars("="), + lipgloss.WithWhitespaceForeground(red), + ) +} + +func (m Model) generatePkl() string { + schemaType := m.form.GetString("schemaType") + schema := m.form.GetString("schema") + + // This is a placeholder for the actual conversion logic + // In a real implementation, you would parse the schema and generate Pkl code + return fmt.Sprintf("// Converted from %s\n\nclass ConvertedSchema {\n // TODO: Implement conversion from %s\n // Original schema:\n /*\n%s\n */\n}", schemaType, schemaType, schema) +} + +func (m *Model) buildMessage() { + from := m.form.GetString("from") + to := m.form.GetString("to") + amount := m.form.GetString("amount") + denom := m.form.GetString("denom") + memo := m.form.GetString("memo") + + coin, _ := sdk.ParseCoinNormalized(fmt.Sprintf("%s%s", amount, denom)) + sendMsg := &banktypes.MsgSend{ + FromAddress: from, + ToAddress: to, + Amount: sdk.NewCoins(coin), + } + + anyMsg, _ := codectypes.NewAnyWithValue(sendMsg) + m.message = &tx.TxBody{ + Messages: []*codectypes.Any{anyMsg}, + Memo: memo, + } +} + +func (m Model) getMessageView() string { + if m.message == nil { + return "Current Message: None" + } + + interfaceRegistry := codectypes.NewInterfaceRegistry() + marshaler := codec.NewProtoCodec(interfaceRegistry) + jsonBytes, _ := marshaler.MarshalJSON(m.message) + + return fmt.Sprintf("Current Message:\n%s", string(jsonBytes)) +} + +func RunBuildTxnTUI() (*tx.TxBody, error) { + m := NewModel() + p := tea.NewProgram(m) + + finalModel, err := p.Run() + if err != nil { + return nil, fmt.Errorf("failed to run program: %w", err) + } + + finalM, ok := finalModel.(Model) + if !ok || finalM.message == nil { + return nil, fmt.Errorf("form not completed") + } + + return finalM.message, nil +} diff --git a/internal/vfs/assemble.go b/internal/vfs/assemble.go new file mode 100644 index 000000000..07545ebc7 --- /dev/null +++ b/internal/vfs/assemble.go @@ -0,0 +1,20 @@ +package vfs + +import ( + "github.com/ipfs/boxo/files" +) + +var ( + kServiceWorkerFileName = "server/sw.js" + kVaultFileName = "server/vault.wasm" + kIndexFileName = "index.html" +) + +func AssembleDirectory() files.Directory { + fileMap := map[string]files.Node{ + kVaultFileName: DWNWasmFile(), + kServiceWorkerFileName: SWJSFile(), + } + + return files.NewMapDirectory(fileMap) +} diff --git a/internal/vfs/dwn.wasm b/internal/vfs/dwn.wasm new file mode 100755 index 000000000..272ccbefa Binary files /dev/null and b/internal/vfs/dwn.wasm differ diff --git a/internal/vfs/embed.go b/internal/vfs/embed.go new file mode 100644 index 000000000..d7dcc4db6 --- /dev/null +++ b/internal/vfs/embed.go @@ -0,0 +1,22 @@ +package vfs + +import ( + _ "embed" + + "github.com/ipfs/boxo/files" +) + +//go:embed dwn.wasm +var dwnWasmData []byte + +//go:embed sw.js +var swJSData []byte + +func DWNWasmFile() files.Node { + return files.NewBytesFile(dwnWasmData) +} + +// Use ServiceWorkerJS template to generate the service worker file +func SWJSFile() files.Node { + return files.NewBytesFile(swJSData) +} diff --git a/internal/vfs/sw.js b/internal/vfs/sw.js new file mode 100644 index 000000000..a5654ed5d --- /dev/null +++ b/internal/vfs/sw.js @@ -0,0 +1,8 @@ +importScripts( + "https://cdn.jsdelivr.net/gh/golang/go@go1.18.4/misc/wasm/wasm_exec.js", + "https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js", + "https://cdn.jsdelivr.net/npm/htmx.org@1.9.12/dist/htmx.min.js", + "https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js", +); + +registerWasmHTTPListener("dwn.wasm"); diff --git a/internal/vfs/wasm/request.go b/internal/vfs/wasm/request.go new file mode 100644 index 000000000..c7aeb7d5a --- /dev/null +++ b/internal/vfs/wasm/request.go @@ -0,0 +1,37 @@ +//go:build js && wasm + +package wasm + +import ( + "bytes" + "net/http" + "net/http/httptest" + "syscall/js" + + promise "github.com/nlepage/go-js-promise" +) + +// 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"))) + body := make([]byte, jsBody.Get("length").Int()) + js.CopyBytesToGo(body, jsBody) + + req := httptest.NewRequest( + r.Get("method").String(), + r.Get("url").String(), + bytes.NewBuffer(body), + ) + + headersIt := r.Get("headers").Call("entries") + for { + e := headersIt.Call("next") + if e.Get("done").Bool() { + break + } + v := e.Get("value") + req.Header.Set(v.Index(0).String(), v.Index(1).String()) + } + + return req +} diff --git a/internal/vfs/wasm/response.go b/internal/vfs/wasm/response.go new file mode 100644 index 000000000..632538b87 --- /dev/null +++ b/internal/vfs/wasm/response.go @@ -0,0 +1,50 @@ +//go:build js && wasm + +package wasm + +import ( + "io" + "net/http/httptest" + "syscall/js" +) + +// ResponseRecorder uses httptest.ResponseRecorder to build a JS Response +type ResponseRecorder struct { + *httptest.ResponseRecorder +} + +// NewResponseRecorder returns a new ResponseRecorder +func NewResponseRecorder() ResponseRecorder { + return ResponseRecorder{httptest.NewRecorder()} +} + +// JSResponse builds and returns the equivalent JS Response +func (rr ResponseRecorder) JSResponse() js.Value { + res := rr.Result() + + body := js.Undefined() + if res.ContentLength != 0 { + b, err := io.ReadAll(res.Body) + if err != nil { + panic(err) + } + body = js.Global().Get("Uint8Array").New(len(b)) + js.CopyBytesToJS(body, b) + } + + init := make(map[string]interface{}, 2) + + if res.StatusCode != 0 { + init["status"] = res.StatusCode + } + + if len(res.Header) != 0 { + headers := make(map[string]interface{}, len(res.Header)) + for k := range res.Header { + headers[k] = res.Header.Get(k) + } + init["headers"] = headers + } + + return js.Global().Get("Response").New(body, init) +} diff --git a/internal/vfs/wasm/serve.go b/internal/vfs/wasm/serve.go new file mode 100644 index 000000000..846280928 --- /dev/null +++ b/internal/vfs/wasm/serve.go @@ -0,0 +1,59 @@ +//go:build js && wasm + +package wasm + +import ( + "fmt" + "net/http" + "strings" + "syscall/js" + + promise "github.com/nlepage/go-js-promise" +) + +// Serve serves HTTP requests using handler or http.DefaultServeMux if handler is nil. +func Serve(handler http.Handler) func() { + h := handler + if h == nil { + h = http.DefaultServeMux + } + + prefix := js.Global().Get("wasmhttp").Get("path").String() + for strings.HasSuffix(prefix, "/") { + prefix = strings.TrimSuffix(prefix, "/") + } + + if prefix != "" { + mux := http.NewServeMux() + mux.Handle(prefix+"/", http.StripPrefix(prefix, h)) + h = mux + } + + cb := js.FuncOf(func(_ js.Value, args []js.Value) interface{} { + resPromise, resolve, reject := promise.New() + + go func() { + defer func() { + if r := recover(); r != nil { + if err, ok := r.(error); ok { + reject(fmt.Sprintf("wasmhttp: panic: %+v\n", err)) + } else { + reject(fmt.Sprintf("wasmhttp: panic: %v\n", r)) + } + } + }() + + res := NewResponseRecorder() + + h.ServeHTTP(res, Request(args[0])) + + resolve(res.JSResponse()) + }() + + return resPromise + }) + + js.Global().Get("wasmhttp").Call("setHandler", cb) + + return cb.Release +} diff --git a/pkg/coins/defaults.go b/pkg/coins/defaults.go deleted file mode 100644 index f85b7e151..000000000 --- a/pkg/coins/defaults.go +++ /dev/null @@ -1,54 +0,0 @@ -package coins - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/types/bech32" -) - -type coin struct { - Name string `json:"name"` - Symbol string `json:"symbol"` - Hrp string `json:"hrp"` - Method string `json:"method"` - Index int64 `json:"index"` - Path uint32 `json:"path"` -} - -// FormatAddress formats the address based on the coin -func (c *coin) FormatAddress(pubKey []byte) (string, error) { - if c.Hrp != "" { - return bech32.ConvertAndEncode(c.Hrp, pubKey) - } - return "", fmt.Errorf("unsupported coin") -} - -// GetIndex returns the coin index -func (c *coin) GetIndex() int64 { - return c.Index -} - -// GetName returns the coin name -func (c *coin) GetName() string { - return c.Name -} - -// GetSymbol returns the coin symbol -func (c *coin) GetSymbol() string { - return c.Symbol -} - -// GetHrp returns the coin hrp -func (c *coin) GetHrp() string { - return c.Hrp -} - -// GetPath returns the coin path -func (c *coin) GetPath() uint32 { - return c.Path -} - -// GetMethod returns the DID method for the coin -func (c *coin) GetMethod() string { - return c.Method -} diff --git a/pkg/did/formatter.go b/pkg/did/formatter.go deleted file mode 100644 index 0cdc28307..000000000 --- a/pkg/did/formatter.go +++ /dev/null @@ -1,6 +0,0 @@ -package did - -// Format is the formatter to use for DIDs -var Format = formatter{} - -type formatter struct{} diff --git a/pkg/did/resolver.go b/pkg/did/resolver.go deleted file mode 100644 index 2bfcc86be..000000000 --- a/pkg/did/resolver.go +++ /dev/null @@ -1 +0,0 @@ -package did diff --git a/pkg/did/types.go b/pkg/did/types.go deleted file mode 100644 index 2c523a479..000000000 --- a/pkg/did/types.go +++ /dev/null @@ -1,9 +0,0 @@ -package did - -// VerificationMethod is an object that represents a verification method. -type VerificationMethod struct { - PublicKeyJwk map[string]interface{} `json:"publicKeyJwk"` - ID string `json:"id"` - Type string `json:"type"` - Controller string `json:"controller"` -} diff --git a/pkl/api.pkl b/pkl/api.pkl new file mode 100644 index 000000000..f18251ac6 --- /dev/null +++ b/pkl/api.pkl @@ -0,0 +1,37 @@ +@go.Package { name = "github.com/onsonr/sonr/motr/api" } + +module api + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + +class JsonField extends go.Field { + structTags { + ["json"] = "%{name},omitempty" + } +} + +abstract class Request { + route: String + method: String + headers: Map + origin: String? + userAgent: String? + body: Dynamic +} + +abstract class Response { + statusCode: Int + headers: Map + body: Dynamic +} + +class GetAccountsRequest extends Request { + route = "/accounts" + method = "GET" + headers = { + "Content-Type" = "application/json" + } + origin = null + userAgent = null + body = null +} diff --git a/pkl/bake.pkl b/pkl/bake.pkl new file mode 100644 index 000000000..927e5ea37 --- /dev/null +++ b/pkl/bake.pkl @@ -0,0 +1,30 @@ +@go.Package { name = "github.com/onsonr/sonr/motr/api/bake" } + +module bake + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + +class JsonField extends go.Field { + structTags { + ["json"] = "%{name},omitempty" + } +} + +abstract class Macroon { + id: String + location: String +} + +abstract class FirstPartyCaveats { + scope: String + exp: Int + cnf: String + aud: String +} + +abstract class ThirdPartyCaveats { + scope: String + exp: Int + cnf: String + aud: String +} diff --git a/pkl/oidc.pkl b/pkl/oidc.pkl new file mode 100644 index 000000000..2437be298 --- /dev/null +++ b/pkl/oidc.pkl @@ -0,0 +1,59 @@ +@go.Package { name = "github.com/onsonr/sonr/x/did/types/oidc" } + +module oidc + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + +class JsonField extends go.Field { + structTags { + ["json"] = "%{name},omitempty" + ["param"] = "%{name}" + } +} + +class DiscoveryDocument { + @JsonField + issuer: String + + @JsonField + authorization_endpoint: String + + @JsonField + token_endpoint: String + + @JsonField + userinfo_endpoint: String + + @JsonField + jwks_uri: String + + @JsonField + registration_endpoint: String + + @JsonField + scopes_supported: List + + @JsonField + response_types_supported: List + + @JsonField + response_modes_supported: List + + @JsonField + subject_types_supported: List + + @JsonField + id_token_signing_alg_values_supported: List + + @JsonField + claims_supported: List + + @JsonField + grant_types_supported: List + + @JsonField + acr_values_supported: List + + @JsonField + token_endpoint_auth_methods_supported: List +} diff --git a/pkl/orm.pkl b/pkl/orm.pkl new file mode 100644 index 000000000..86bc5e06f --- /dev/null +++ b/pkl/orm.pkl @@ -0,0 +1,227 @@ +@go.Package { name = "github.com/onsonr/sonr/internal/db/orm" } + +module orm + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + +class PrimaryKey extends go.Field { + structTags { + ["gorm"] = "primaryKey,autoIncrement" + ["json"] = "%{name},omitempty" + ["query"] = "%{name}" + } +} + +class Unique extends go.Field { + structTags { + ["gorm"] = "unique" + ["json"] = "%{name},omitempty" + } +} + +class Default extends go.Field { + defaultValue: String + structTags { + ["gorm"] = "default:%{defaultValue}" + ["json"] = "%{name},omitempty" + } +} + +class NotNull extends go.Field { + structTags { + ["gorm"] = "not null" + } +} + +class ForeignKey extends go.Field { + references: String + structTags { + ["gorm"] = "foreignKey:%{references}" + } +} + +class JsonField extends go.Field { + structTags { + ["json"] = "%{name},omitempty" + ["param"] = "%{name}" + } +} + +class Account { + @PrimaryKey + id: UInt + + @JsonField + name: String + + @JsonField + address: String + + @JsonField + publicKey: String + + @JsonField + createdAt: String? +} + +class Asset { + @PrimaryKey + id: UInt + + @JsonField + name: String + + @JsonField + symbol: String + + @JsonField + decimals: Int + + @JsonField + chainId: Int? + + @JsonField + createdAt: String? +} + +class Chain { + @PrimaryKey + id: UInt + + @JsonField + name: String + + @JsonField + networkId: String + + @JsonField + createdAt: String? +} + +class Credential { + @PrimaryKey + id: UInt + + @JsonField + subject: String + + @JsonField + controller: String + + @JsonField + attestationType: String + + @JsonField + origin: String + + @JsonField + credentialId: String + + @JsonField + publicKey: String + + @JsonField + transport: String + + @JsonField + signCount: UInt + + @JsonField + userPresent: Boolean + + @JsonField + userVerified: Boolean + + @JsonField + backupEligible: Boolean + + @JsonField + backupState: Boolean + + @JsonField + cloneWarning: Boolean + + @JsonField + createdAt: String? + + @JsonField + updatedAt: String? +} + +class Profile { + @PrimaryKey + id: String + + @JsonField + subject: String + + @JsonField + controller: String + + @JsonField + originUri: String? + + @JsonField + publicMetadata: String? + + @JsonField + privateMetadata: String? + + @JsonField + createdAt: String? + + @JsonField + updatedAt: String? +} + +class Property { + @PrimaryKey + id: UInt + + @JsonField + profileId: String + + @JsonField + key: String + + @JsonField + accumulator: String + + @JsonField + propertyKey: String +} + +class Keyshare { + @PrimaryKey + id: UInt + + @JsonField + data: String + + @JsonField + role: Int + + @JsonField + createdAt: String? +} + +class Permission { + @PrimaryKey + id: UInt + + @JsonField + serviceId: String + + @JsonField + grants: String + + @JsonField + scopes: String + + @JsonField + createdAt: String? + + @JsonField + updatedAt: String? +} + diff --git a/pkl/txns.pkl b/pkl/txns.pkl new file mode 100644 index 000000000..beda46381 --- /dev/null +++ b/pkl/txns.pkl @@ -0,0 +1,175 @@ +@go.Package { name = "github.com/onsonr/sonr/x/did/types/txns" } + +module txns + +import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" + +/// Common Cosmos SDK types +typealias Coin = Dynamic +typealias AccAddress = String +typealias ValAddress = String +typealias Timestamp = String + +/// Base class for all messages +abstract class Msg { + /// The type URL for the message + typeUrl: String +} + +/// Base class for all proposals +class Proposal { + /// The title of the proposal + title: String + + /// The description of the proposal + description: String +} + + +/// Gov module messages +class MsgGovSubmitProposal extends Msg { + typeUrl = "/cosmos.gov.v1beta1.MsgSubmitProposal" + content: Proposal + initialDeposit: List + proposer: AccAddress +} + +class MsgGovVote extends Msg { + typeUrl = "/cosmos.gov.v1beta1.MsgVote" + proposalId: Int + voter: AccAddress + option: Int +} + +class MsgGovDeposit extends Msg { + typeUrl = "/cosmos.gov.v1beta1.MsgDeposit" + proposalId: Int + depositor: AccAddress + amount: List +} + +/// Group module messages + class MsgGroupCreateGroup extends Msg { + typeUrl = "/cosmos.group.v1.MsgCreateGroup" + admin: AccAddress + members: List + metadata: String + } + + class MsgGroupSubmitProposal extends Msg { + typeUrl = "/cosmos.group.v1.MsgSubmitProposal" + groupPolicyAddress: AccAddress + proposers: List + metadata: String + messages: List + exec: Int + } + + class MsgGroupVote extends Msg { + typeUrl = "/cosmos.group.v1.MsgVote" + proposalId: Int + voter: AccAddress + option: Int + metadata: String + exec: Int + } + +/// Staking module messages + class MsgStakingCreateValidator extends Msg { + typeUrl = "/cosmos.staking.v1beta1.MsgCreateValidator" + description: Dynamic + commission: Dynamic + minSelfDelegation: String + delegatorAddress: AccAddress + validatorAddress: ValAddress + pubkey: Dynamic + value: Coin + } + + class MsgStakingDelegate extends Msg { + typeUrl = "/cosmos.staking.v1beta1.MsgDelegate" + delegatorAddress: AccAddress + validatorAddress: ValAddress + amount: Coin + } + + class MsgStakingUndelegate extends Msg { + typeUrl = "/cosmos.staking.v1beta1.MsgUndelegate" + delegatorAddress: AccAddress + validatorAddress: ValAddress + amount: Coin + } + + class MsgStakingBeginRedelegate extends Msg { + typeUrl = "/cosmos.staking.v1beta1.MsgBeginRedelegate" + delegatorAddress: AccAddress + validatorSrcAddress: ValAddress + validatorDstAddress: ValAddress + amount: Coin + } + class MsgDidUpdateParams extends Msg { + typeUrl = "/sonr.did.v1.MsgUpdateParams" + authority: AccAddress + params: Dynamic + token: Dynamic + } + + class MsgDidAllocateVault extends Msg { + typeUrl = "/sonr.did.v1.MsgAllocateVault" + authority: AccAddress + subject: String + token: Dynamic + } + + class MsgDidProveWitness extends Msg { + typeUrl = "/sonr.did.v1.MsgProveWitness" + authority: AccAddress + property: String + witness: Listing + token: Dynamic + } + + class MsgDidSyncVault extends Msg { + typeUrl = "/sonr.did.v1.MsgSyncVault" + controller: AccAddress + token: Dynamic + } + +class MsgDidRegisterController extends Msg { + typeUrl = "/sonr.did.v1.MsgRegisterController" + authority: AccAddress + cid: String + origin: String + authentication: List + token: Dynamic + } + +class MsgDidAuthorize extends Msg { + typeUrl = "/sonr.did.v1.MsgAuthorize" + authority: AccAddress + controller: AccAddress + address: AccAddress + origin: String + token: Dynamic + } + +class MsgDidRegisterService extends Msg { + typeUrl = "/sonr.did.v1.MsgRegisterService" + controller: AccAddress + originUri: String + scopes: Dynamic + description: String + serviceEndpoints: Map + metadata: Dynamic + token: Dynamic + } + +/// Represents a transaction body +class TxBody { + messages: List + memo: String? + timeoutHeight: Int? + extensionOptions: List? + nonCriticalExtensionOptions: List? +} + diff --git a/process-compose.yaml b/process-compose.yaml new file mode 100644 index 000000000..62f947ffe --- /dev/null +++ b/process-compose.yaml @@ -0,0 +1,18 @@ +version: "0.6" + +processes: + ipfs: + namespace: testnet + command: "ipfs-cluster-service init --consensus crdt && ipfs-cluster-service daemon" + background: true + availability: + restart: on_failure + max_restarts: 3 + + sonr: + namespace: testnet + command: "make sh-testnet" + restart: on_failure + max_restarts: 3 + depends: + - ipfs diff --git a/proto/buf.gen.pulsar.yaml b/proto/buf.gen.pulsar.yaml index 79be938c2..2f8e09621 100644 --- a/proto/buf.gen.pulsar.yaml +++ b/proto/buf.gen.pulsar.yaml @@ -2,7 +2,7 @@ version: v1 managed: enabled: true go_package_prefix: - default: github.com/onsonr/hway/api + default: github.com/onsonr/sonr/api except: - buf.build/googleapis/googleapis - buf.build/cosmos/gogo-proto diff --git a/proto/buf.yaml b/proto/buf.yaml index 068bc2bd5..6301a3b3f 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,5 +1,5 @@ version: v1 -name: buf.build/didao/sonr +name: buf.build/onsonr/sonr deps: - buf.build/cosmos/cosmos-sdk:9000fcc585a046c9881271d53dd40c34 - buf.build/cosmos/cosmos-proto:1935555c206d4afb9e94615dfd0fad31 diff --git a/proto/did/module/v1/module.proto b/proto/did/module/v1/module.proto index faa4c564a..49002f51f 100644 --- a/proto/did/module/v1/module.proto +++ b/proto/did/module/v1/module.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package onsonr.hway.did.module.v1; +package onsonr.sonr.did.module.v1; import "cosmos/app/v1alpha1/module.proto"; @@ -8,6 +8,6 @@ import "cosmos/app/v1alpha1/module.proto"; // Learn more: https://docs.cosmos.network/main/building-modules/depinject message Module { option (cosmos.app.v1alpha1.module) = { - go_import : "github.com/onsonr/hway" + go_import : "github.com/onsonr/sonr" }; } diff --git a/proto/did/v1/genesis.proto b/proto/did/v1/genesis.proto index 1b751a26e..45e8cde45 100644 --- a/proto/did/v1/genesis.proto +++ b/proto/did/v1/genesis.proto @@ -1,8 +1,10 @@ syntax = "proto3"; package did.v1; -import "gogoproto/gogo.proto"; import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/onsonr/sonr/x/did/types"; import "did/v1/types.proto"; option go_package = "github.com/onsonr/hway/x/did/types"; @@ -11,6 +13,17 @@ option go_package = "github.com/onsonr/hway/x/did/types"; message GenesisState { // Params defines all the parameters of the module. Params params = 1 [(gogoproto.nullable) = false]; + + // GlobalIntegrity defines a zkp integrity proof for the entire DID namespace + GlobalIntegrity global_integrity = 2; +} + +// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace +message GlobalIntegrity { + string controller = 1; + string seed = 2; + bytes accumulator = 3; + uint64 count = 4; } // Params defines the set of module parameters. @@ -19,11 +32,198 @@ message Params { option (gogoproto.equal) = true; option (gogoproto.goproto_stringer) = false; - // Whitelisted Assets + // Whitelisted Assets repeated AssetInfo whitelisted_assets = 1; - // Whitelisted Blockchains - repeated ChainInfo whitelisted_chains = 2; + // Whitelisted Key Types + map allowed_public_keys = 2; + + // IpfsActive is a flag to enable/disable ipfs + bool ipfs_active = 3; + + // Localhost Registration Enabled + bool localhost_registration_enabled = 4; + + // ConveyancePreference defines the conveyance preference + string conveyance_preference = 5; + + // AttestationFormats defines the attestation formats + repeated string attestation_formats = 6; } +// AssetInfo defines the asset info +message AssetInfo { + // 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 + AssetType asset_type = 4; + + // The name of the asset + string name = 5; + + // The icon url + string icon_url = 6; +} + +// KeyInfo defines information for accepted PubKey types +message KeyInfo { + KeyRole role = 1; + KeyAlgorithm algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K" + KeyEncoding encoding = 3; // e.g., "hex", "base64", "multibase" + KeyCurve curve = 4; // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1" + KeyType type = 5; // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC" +} + +// ValidatorInfo defines information for accepted Validator nodes +message ValidatorInfo { + string moniker = 1; + repeated Endpoint grpc_endpoints = 2; + repeated Endpoint rest_endpoints = 3; + ExplorerInfo explorer = 4; + FeeInfo fee_info = 5; + IBCChannel ibc_channel = 6; + + // Endpoint defines an endpoint + message Endpoint { + string url = 1; + bool is_primary = 2; + } + + // ExplorerInfo defines the explorer info + message ExplorerInfo { + string name = 1; + string url = 2; + } + + // FeeInfo defines a fee info + message FeeInfo { + string base_denom = 1; + repeated string fee_rates = 2; + int32 init_gas_limit = 3; + bool is_simulable = 4; + double gas_multiply = 5; + } + + // IBCChannel defines the IBC channel info + message IBCChannel { + string id = 1; + string port = 2; + } +} + +// +// [Constant Enumerations] +// + +// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified +enum AssetType { + ASSET_TYPE_UNSPECIFIED = 0; + ASSET_TYPE_NATIVE = 1; + ASSET_TYPE_WRAPPED = 2; + ASSET_TYPE_STAKING = 3; + ASSET_TYPE_POOL = 4; + ASSET_TYPE_IBC = 5; + ASSET_TYPE_CW20 = 6; +} + +// DIDNamespace define the different namespaces of DID +enum DIDNamespace { + DID_NAMESPACE_UNSPECIFIED = 0; + DID_NAMESPACE_IPFS = 1; + DID_NAMESPACE_SONR = 2; + DID_NAMESPACE_BITCOIN = 3; + DID_NAMESPACE_ETHEREUM = 4; + DID_NAMESPACE_IBC = 5; + DID_NAMESPACE_WEBAUTHN = 6; + DID_NAMESPACE_DWN = 7; + DID_NAMESPACE_SERVICE = 8; +} + +// KeyAlgorithm defines the key algorithm +enum KeyAlgorithm { + KEY_ALGORITHM_UNSPECIFIED = 0; + KEY_ALGORITHM_ES256 = 1; + KEY_ALGORITHM_ES384 = 2; + KEY_ALGORITHM_ES512 = 3; + KEY_ALGORITHM_EDDSA = 4; + KEY_ALGORITHM_ES256K = 5; + KEY_ALGORITHM_ECDSA = 6; // Fixed typo from EDCSA to ECDSA +} + +// KeyCurve defines the key curve +enum KeyCurve { + KEY_CURVE_UNSPECIFIED = 0; + KEY_CURVE_P256 = 1; // NIST P-256 + KEY_CURVE_P384 = 2; + KEY_CURVE_P521 = 3; + KEY_CURVE_X25519 = 4; + KEY_CURVE_X448 = 5; + KEY_CURVE_ED25519 = 6; + KEY_CURVE_ED448 = 7; + KEY_CURVE_SECP256K1 = 8; + KEY_CURVE_BLS12381 = 9; + KEY_CURVE_KECCAK256 = 10; +} + +// KeyEncoding defines the key encoding +enum KeyEncoding { + KEY_ENCODING_UNSPECIFIED = 0; + KEY_ENCODING_RAW = 1; + KEY_ENCODING_HEX = 2; + KEY_ENCODING_MULTIBASE = 3; +} + +// KeyRole defines the kind of key +enum KeyRole { + KEY_ROLE_UNSPECIFIED = 0; + KEY_ROLE_AUTHENTICATION = 1; // Passkeys and FIDO + KEY_ROLE_ASSERTION = 2; // Zk Identifiers + KEY_ROLE_DELEGATION = 3; // ETH,BTC,IBC addresses + KEY_ROLE_INVOCATION = 4; // DWN Controllers +} + +// KeyType defines the key type +enum KeyType { + KEY_TYPE_UNSPECIFIED = 0; + KEY_TYPE_OCTET = 1; + KEY_TYPE_ELLIPTIC = 2; + KEY_TYPE_RSA = 3; + KEY_TYPE_SYMMETRIC = 4; + KEY_TYPE_HMAC = 5; + KEY_TYPE_MPC = 6; + KEY_TYPE_ZK = 7; + KEY_TYPE_WEBAUTHN = 8; + KEY_TYPE_BIP32 = 9; +} + +enum KeyshareRole { + KEYSHARE_ROLE_UNSPECIFIED = 0; + KEYSHARE_ROLE_USER = 1; + KEYSHARE_ROLE_VALIDATOR = 2; +} + +// PermissionScope define the Capabilities Controllers can grant for Services +enum PermissionScope { + PERMISSION_SCOPE_UNSPECIFIED = 0; + PERMISSION_SCOPE_BASIC_INFO = 1; + PERMISSION_SCOPE_PERMISSIONS_READ = 2; + PERMISSION_SCOPE_PERMISSIONS_WRITE = 3; + PERMISSION_SCOPE_TRANSACTIONS_READ = 4; + PERMISSION_SCOPE_TRANSACTIONS_WRITE = 5; + PERMISSION_SCOPE_WALLETS_READ = 6; + PERMISSION_SCOPE_WALLETS_CREATE = 7; + PERMISSION_SCOPE_WALLETS_SUBSCRIBE = 8; + PERMISSION_SCOPE_WALLETS_UPDATE = 9; + PERMISSION_SCOPE_TRANSACTIONS_VERIFY = 10; + PERMISSION_SCOPE_TRANSACTIONS_BROADCAST = 11; + PERMISSION_SCOPE_ADMIN_USER = 12; + PERMISSION_SCOPE_ADMIN_VALIDATOR = 13; +} diff --git a/proto/did/v1/models.proto b/proto/did/v1/models.proto new file mode 100644 index 000000000..798784e36 --- /dev/null +++ b/proto/did/v1/models.proto @@ -0,0 +1,114 @@ +syntax = "proto3"; + +package did.v1; + +import "did/v1/genesis.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/onsonr/sonr/x/did/types"; + +// Alias defines a subject/origin pair +message Alias { + string subject = 1; + string origin = 2; + string controller = 3; +} + +message Credential { + string subject = 1; + string attestation_type = 2; + string origin = 3; + bytes credential_id = 4; + bytes public_key = 5; + repeated string transport = 6; + uint32 sign_count = 7; + bool user_present = 8; + bool user_verified = 9; + bool backup_eligible = 10; + bool backup_state = 11; + bool clone_warning = 12; +} + +// Document defines a DID document +message Document { + string id = 1; + string controller = 2; // The DID of the controller + repeated string authentication = 3; + repeated string assertion_method = 4; + repeated string capability_delegation = 5; + repeated string capability_invocation = 6; + repeated string service = 7; +} + +// Keyshare defines a keyshare from the MPC protocol +message Keyshare { + map metadata = 1; + map payloads = 2; + string protocol = 3; + bytes public_key = 4; + uint32 version = 5; + int32 role = 6; // 0 =none, 1 = validator, 2 = user +} + +// Permissions contains a list of grants and access control rules for +// a Service. +message Permissions { + repeated DIDNamespace grants = 1; + repeated PermissionScope scopes = 2; +} + +// PubKey defines a public key for a did +message PubKey { + KeyRole role = 1; + KeyAlgorithm algorithm = 2; + KeyEncoding encoding = 3; + KeyCurve curve = 4; + KeyType key_type = 5; + bytes raw = 6; + JWK jwk = 7; + + // JWK represents a JSON Web Key + message JWK { + 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) + } +} + +// Service defines a Decentralized Service on the Sonr Blockchain +message Service { + string id = 1; + string service_type = 2; + string authority = 3; + string origin = 4; + string description = 5; + map service_endpoints = 6; + Permissions permissions = 7; +} + +// ServicceInfo defines a Decentralized Service on the Sonr Blockchain +message ServiceInfo { + bool exists = 1; + string origin = 2; + string fingerprint = 3; + Service service = 4; +} + +// FirstPartyCaveat defines a first party caveat +message FirstPartyCaveat { + Permissions scope = 1; + int64 exp = 2; + string cnf = 3; + string aud = 4; +} + +// ThirdPartyCaveat defines a third party caveat +message ThirdPartyCaveat { + Permissions scope = 1; + int64 exp = 2; + string cnf = 3; + string aud = 4; +} diff --git a/proto/did/v1/query.proto b/proto/did/v1/query.proto index 2bd10adcd..4daf8ecd0 100644 --- a/proto/did/v1/query.proto +++ b/proto/did/v1/query.proto @@ -1,19 +1,82 @@ syntax = "proto3"; package did.v1; -import "google/api/annotations.proto"; import "did/v1/genesis.proto"; +import "did/v1/models.proto"; +import "google/api/annotations.proto"; import "did/v1/types.proto"; -option go_package = "github.com/onsonr/hway/x/did/types"; +option go_package = "github.com/onsonr/sonr/x/did/types"; // Query provides defines the gRPC querier service. service Query { - // Params queries all parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/did/params"; - } + // Params queries all parameters of the module. + rpc Params(QueryRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/params"; + } + // ParamsAssets queries all parameters of the module. + rpc ParamsAssets(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/params/assets"; + } + + // Params queries all parameters of the module. + rpc ParamsByAsset(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/params/assets/{asset}"; + } + + // ParamsKeys queries all parameters of the module. + rpc ParamsKeys(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/params/keys"; + } + + // Params queries all parameters of the module. + rpc ParamsByKey(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/params/keys/{key}"; + } + + // Params queries all parameters of the module. + rpc RegistrationOptionsByKey(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/params/keys/{key}/registration"; + } + + // Resolve queries the DID document by its id. + rpc Resolve(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/did/{did}"; + } + + // Service returns associated ServiceInfo for a given Origin + // if the servie is not found, a fingerprint is generated to be used + // as a TXT record in DNS. v=sonr, o=origin, p=protocol + rpc Service(QueryRequest) returns (QueryResponse) { + option (google.api.http).get = "/service/{origin}"; + } +} + +// Queryequest is the request type for the Query/Params RPC method. +message QueryRequest { + string did = 1; + string origin = 2; + string key = 3; + string asset = 4; +} + +// QueryResolveResponse is the response type for the Query/Resolve RPC method. +message QueryResponse { + bool success = 1; + string query = 2; + Document document = 3; + ServiceInfo service = 4; + Params params = 5; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + Params params = 1; +} + +message QueryParamsAssetsResponse { + repeated AssetInfo assets = 1; // Accounts returns associated wallet accounts with the DID. rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { option (google.api.http).get = "/did/{did}/accounts"; @@ -103,3 +166,18 @@ message QueryServiceResponse { string options = 1; } +message QueryParamsKeysResponse { + map keys = 1; +} + +message QueryParamsByKeyResponse { + KeyInfo key = 1; +} + +message QueryParamsByAssetResponse { + AssetInfo asset = 1; +} + +message QueryRegistrationOptionsByKeyResponse { + repeated string registration_options = 1; +} diff --git a/proto/did/v1/state.proto b/proto/did/v1/state.proto index 9eb487d27..08b340e4d 100644 --- a/proto/did/v1/state.proto +++ b/proto/did/v1/state.proto @@ -1,17 +1,34 @@ syntax = "proto3"; package did.v1; -option go_package = "github.com/onsonr/hway/x/did/types"; import "cosmos/orm/v1/orm.proto"; import "did/v1/genesis.proto"; +import "did/v1/models.proto"; import "did/v1/enums.proto"; -// Aliases represents the `alsoKnownAs` property associated with a DID Controller -message Aliases { +option go_package = "github.com/onsonr/sonr/x/did/types"; + +// Account represents a wallet account associated with a DID Controller +message Account { option (cosmos.orm.v1.table) = { id: 1 primary_key: {fields: "id"} + index: { + id: 1 + fields: "controller,label" + unique: true + } + index: { + id: 2 + fields: "controller,address" + unique: true + } + index: { + id: 3 + fields: "controller,chain_code,index" + unique: true + } index: { id: 1, fields: "subject", unique: true } }; @@ -38,107 +55,113 @@ message Assertion { primary_key: {fields: "id"} }; - // The unique identifier of the attestation + // The unique identifier of the account string id = 1; - // Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave") - string key_type = 2; + // The controller of the account + string controller = 2; // The value of the linked identifier - bytes credential = 3; + PubKey public_key = 3; - // Metadata is optional additional information about the assertion - map metadata = 4; + // The address of the account + string address = 4; - // The controller of the attestation - string controller = 5; + // The label of the account + string label = 5; + + // The bip32 chain code + uint32 chain_code = 6; + + // The index of the account + uint32 index = 7; + + // The supported chains of the account + repeated string chains = 8; } - -// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) -message Attestation { - option (cosmos.orm.v1.table) = { - id: 3 - primary_key: {fields: "id"} - }; - - // The unique identifier of the attestation - string id = 1; - - // The type of the linked identifier (e.g., "crypto", "github", "email", "phone") - string key_type = 2; - - // The value of the linked identifier - string value = 3; - - // The proof or verification method for this attestation - string proof = 4; - - // The controller of the attestation - string controller = 5; -} - - // Controller represents a Sonr DWN Vault message Controller { option (cosmos.orm.v1.table) = { - id: 4 + id: 2 primary_key: {fields: "id"} + index: { + id: 1 + fields: "address" + unique: true + } + index: { + id: 2 + fields: "vault_cid" + unique: true + } }; // The unique identifier of the controller string id = 1; // The DID of the controller - string did = 2; + string address = 2; - // The public key of the controller - string public_key_multibase = 3; + // Aliases of the controller + repeated Alias aliases = 3; + + // PubKey is the verification method + PubKey public_key = 4; // The vault address or identifier - string vault_cid = 4; + string vault_cid = 5; - // Fingerprint is the Accumulator of discrete credential identifiers - bytes fingerprint = 5; + // The Authentications of the controller + repeated Credential authentication = 6; } -// Delegation represents IBC Account Controllers for various chains (e.g., ETH, BTC) -message Delegation { +// Proof represents a verifiable credential +message Proof { option (cosmos.orm.v1.table) = { - id: 5 + id: 4 primary_key: {fields: "id"} + index: { + id: 1 + fields: "controller,issuer,property" + unique: true + } }; - // The unique identifier of the delegation + // The unique identifier of the proof string id = 1; - // The Decentralized Identifier of the delegated account - string did = 2; + // The controller of the proof + string controller = 2; - // The chain type (e.g., "ETH", "BTC") - string chain_type = 3; + // The value of the linked identifier + string issuer = 3; - // The address on the target chain - string chain_address = 4; + // The property of the proof + string property = 4; - // The controller DID - string controller_did = 5; + // The accumulator of the proof + bytes accumulator = 5; - // The delegation proof or verification method - string public_key_multibase = 6; - - // Public Key JWKS is a map of the associated public keys - map public_key_jwks = 7; - - // IBC Channel ID - uint64 channel_id = 8; + // The secret key of the proof + bytes key = 6; } -// Service represents a service in a DID Document -message Service { +// ServiceRecord represents a decentralized service in a DID Document +message ServiceRecord { option (cosmos.orm.v1.table) = { - id: 6 + id: 3 primary_key: {fields: "id"} + index: { + id: 1 + fields: "origin" + unique: true + } + index: { + id: 2 + fields: "authority,origin" + unique: true + } }; // The ID of the service @@ -147,6 +170,51 @@ message Service { // The type of the service string service_type = 2; + // The authority DID of the service + string authority = 3; + + // The domain name of the service + string origin = 4; + + // The description of the service + string description = 5; + + // The service endpoint + map service_endpoints = 6; + + // Scopes is the Authorization Grants of the service + Permissions permissions = 7; +} + +// Verification reprsents a method of verifying membership in a DID +message VerificationMethod { + option (cosmos.orm.v1.table) = { + id: 5 + primary_key: {fields: "id"} + index: { + id: 1 + fields: "controller,method,issuer,subject" + unique: true + } + }; + + // The unique identifier of the verification + string id = 1; + + // The controller of the verification + string controller = 2; + + // The DIDNamespace of the verification + DIDNamespace method = 3; + + // The value of the linked identifier + string issuer = 4; + + // The subject of the verification + string subject = 5; + + // The public key of the verification + PubKey public_key = 6; // The controller DID of the service string controller_did = 3; diff --git a/proto/did/v1/tx.proto b/proto/did/v1/tx.proto index 3ec2a6700..4a6084d57 100644 --- a/proto/did/v1/tx.proto +++ b/proto/did/v1/tx.proto @@ -7,16 +7,35 @@ import "did/v1/enums.proto"; import "did/v1/genesis.proto"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/onsonr/hway/x/did/types"; +import "did/v1/genesis.proto"; +import "did/v1/models.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/onsonr/sonr/x/did/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); + 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); + // AuthorizeService asserts the given controller is the owner of the given address. + rpc AuthorizeService(MsgAuthorizeService) returns (MsgAuthorizeServiceResponse); + + // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. + // this operation is called by services initiating a controller registration. + rpc AllocateVault(MsgAllocateVault) returns (MsgAllocateVaultResponse); + + // SyncController synchronizes the controller with the Vault Motr DWN WASM Wallet. + rpc SyncController(MsgSyncController) returns (MsgSyncControllerResponse); + + // RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. + rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse); + + // RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key. + rpc RegisterService(MsgRegisterService) returns (MsgRegisterServiceResponse); // Authenticate asserts the given controller is the owner of the given address. rpc Authenticate(MsgAuthenticate) returns (MsgAuthenticateResponse); @@ -43,9 +62,10 @@ message MsgUpdateParams { 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]; + + // token is the macron token to authenticate the operation. + string token = 3; } // MsgUpdateParamsResponse defines the response structure for executing a @@ -54,23 +74,79 @@ message MsgUpdateParams { // Since: cosmos-sdk 0.47 message MsgUpdateParamsResponse {} +// MsgAllocateVault is the message type for the AllocateVault RPC. +message MsgAllocateVault { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the service account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // subject is a unique human-defined identifier to associate with the vault. + string subject = 2; + + // origin is the origin of the request in wildcard form. + string origin = 3; +} + +// MsgAllocateVaultResponse is the response type for the AllocateVault RPC. +message MsgAllocateVaultResponse { + // CID is the content identifier of the vault. + string cid = 1; + + // ExpiryBlock is the block number at which the vault will expire. + int64 expiry_block = 2; + + // RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn + string registration_options = 3; + + // IsLocalhost is a flag to indicate if the vault is localhost + bool localhost = 4; +} + +// MsgProveWitness is the message type for the ProveWitness RPC. +message MsgProveWitness { + option (cosmos.msg.v1.signer) = "authority"; // MsgAuthenticate is the message type for the Authenticate RPC. message MsgAuthenticate { option (cosmos.msg.v1.signer) = "authority"; - // authority is the address of the governance account. - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // Controller is the address of the controller to authenticate. - string controller = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // property is key to prove. + string property = 2; - // Address is the address to authenticate. - string address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Witness Value is the bytes of the witness. + bytes witness = 3; - // Origin is the origin of the request in wildcard form. - string origin = 4; + // token is the macron token to authenticate the operation. + string token = 4; } +// MsgProveWitnessResponse is the response type for the ProveWitness RPC. +message MsgProveWitnessResponse { + bool success = 1; + string property = 2; +} + +// MsgSyncController is the message type for the SyncController RPC. +message MsgSyncController { + option (cosmos.msg.v1.signer) = "controller"; + + // controller is the address of the controller to sync. + string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // Token is the public token to authenticate the operation. + string token = 3; +} + +// MsgSyncControllerResponse is the response type for the SyncController RPC. +message MsgSyncControllerResponse { + bool success = 1; +} + +// MsgRegisterController is the message type for the InitializeController RPC. +message MsgRegisterController { // MsgAuthenticateResponse is the response type for the Authenticate RPC. message MsgAuthenticateResponse {} @@ -81,6 +157,14 @@ message MsgProveWitness { // authority is the address of the governance account. string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Assertions is the list of assertions to initialize the controller with. + string cid = 2; + + // Origin is the origin of the request in wildcard form. + string origin = 3; + + // Credential is the list of keyshares to initialize the controller with. + string credential_creation_response = 4; // property is key to prove. string property = 2; @@ -132,6 +216,37 @@ message MsgRegisterController { // MsgRegisterControllerResponse is the response type for the InitializeController RPC. message MsgRegisterControllerResponse { + // Success returns true if the specified cid is valid and not already encrypted. + 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; +} + +// MsgAuthorizeService is the message type for the AuthorizeService RPC. +message MsgAuthorizeService { + option (cosmos.msg.v1.signer) = "controller"; + + // Controller is the address of the controller to authenticate. + string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // Origin is the origin of the request in wildcard form. + string origin = 2; + + // Permissions is the scope of the service. + Permissions scopes = 3; + + // token is the macron token to authenticate the operation. + string token = 4; +} + +// MsgAuthorizeServiceResponse is the response type for the AuthorizeService RPC. +message MsgAuthorizeServiceResponse { + bool success = 1; + string token = 2; // Controller is the address of the initialized controller. string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -141,6 +256,16 @@ message MsgRegisterControllerResponse { // MsgRegisterService is the message type for the RegisterService RPC. message MsgRegisterService { + option (cosmos.msg.v1.signer) = "controller"; + + // authority is the address of the governance account. + string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // origin is the origin of the request in wildcard form. Requires valid TXT record in DNS. + Service service = 2; + + // token is the macron token to authenticate the operation. + string token = 3; option (cosmos.msg.v1.signer) = "authority"; // authority is the address of the governance account. @@ -156,4 +281,5 @@ message MsgRegisterService { // MsgRegisterServiceResponse is the response type for the RegisterService RPC. message MsgRegisterServiceResponse { bool success = 1; + string did = 2; } diff --git a/proto/oracle/module/v1/module.proto b/proto/oracle/module/v1/module.proto deleted file mode 100644 index cbcb8bba3..000000000 --- a/proto/oracle/module/v1/module.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -package onsonr.hway.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/hway" - }; -} diff --git a/proto/oracle/v1/genesis.proto b/proto/oracle/v1/genesis.proto deleted file mode 100644 index 435cfa50e..000000000 --- a/proto/oracle/v1/genesis.proto +++ /dev/null @@ -1,10 +0,0 @@ -syntax = "proto3"; - -package oracle.v1; - -option go_package = "github.com/onsonr/hway/x/oracle/types"; - -import "gogoproto/gogo.proto"; - -// GenesisState defines the middlewares genesis state. -message GenesisState {} diff --git a/proto/oracle/v1/query.proto b/proto/oracle/v1/query.proto deleted file mode 100644 index e1c61b044..000000000 --- a/proto/oracle/v1/query.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto3"; - -package oracle.v1; - -option go_package = "github.com/onsonr/hway/x/oracle/types"; - -import "gogoproto/gogo.proto"; \ No newline at end of file diff --git a/proto/oracle/v1/tx.proto b/proto/oracle/v1/tx.proto deleted file mode 100644 index e1c61b044..000000000 --- a/proto/oracle/v1/tx.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto3"; - -package oracle.v1; - -option go_package = "github.com/onsonr/hway/x/oracle/types"; - -import "gogoproto/gogo.proto"; \ No newline at end of file diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index bb57f7139..aeac42056 100644 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -2,7 +2,7 @@ set -e -GO_MOD_PACKAGE="github.com/onsonr/hway" +GO_MOD_PACKAGE="github.com/onsonr/sonr" echo "Generating gogo proto code" cd proto diff --git a/scripts/test_ics_node.sh b/scripts/test_ics_node.sh new file mode 100644 index 000000000..98f1589e0 --- /dev/null +++ b/scripts/test_ics_node.sh @@ -0,0 +1,152 @@ +#!/bin/bash +# Run this script to quickly install, setup, and run the current version of the network. +# +# Examples: +# CHAIN_ID="localchain-1" HOME_DIR="~/.simapp" BLOCK_TIME="1000ms" CLEAN=true sh scripts/test_ics_node.sh +# CHAIN_ID="localchain-2" HOME_DIR="~/.simapp" CLEAN=true RPC=36657 REST=2317 PROFF=6061 P2P=36656 GRPC=8090 GRPC_WEB=8091 ROSETTA=8081 BLOCK_TIME="500ms" sh scripts/test_ics_node.sh + +set -eu + +export KEY="acc0" +export KEY2="acc1" + +export CHAIN_ID=${CHAIN_ID:-"localchain-1"} +export MONIKER="localvalidator" +export KEYALGO="secp256k1" +export KEYRING=${KEYRING:-"test"} +export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.simapp"}") +export BINARY=${BINARY:-wasmd} +export DENOM=${DENOM:-token} + +export CLEAN=${CLEAN:-"false"} +export RPC=${RPC:-"26657"} +export REST=${REST:-"1317"} +export PROFF=${PROFF:-"6060"} +export P2P=${P2P:-"26656"} +export GRPC=${GRPC:-"9090"} +export GRPC_WEB=${GRPC_WEB:-"9091"} +export ROSETTA=${ROSETTA:-"8080"} +export BLOCK_TIME=${BLOCK_TIME:-"5s"} + +config_toml="${HOME_DIR}/config/config.toml" +client_toml="${HOME_DIR}/config/client.toml" +app_toml="${HOME_DIR}/config/app.toml" +genesis_json="${HOME_DIR}/config/genesis.json" + +# if which binary does not exist, install it +if [ -z $(which $BINARY) ]; then + make install + + if [ -z $(which $BINARY) ]; then + echo "Ensure $BINARY is installed and in your PATH" + exit 1 + fi +fi + +command -v $BINARY >/dev/null 2>&1 || { + echo >&2 "$BINARY command not found. Ensure this is setup / properly installed in your GOPATH (make install)." + exit 1 +} +command -v jq >/dev/null 2>&1 || { + echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/" + exit 1 +} + +set_config() { + $BINARY config set client chain-id $CHAIN_ID + $BINARY config set client keyring-backend $KEYRING +} +set_config + +from_scratch() { + # Fresh install on current branch + make install + + # remove existing daemon files. + if [ ${#HOME_DIR} -le 2 ]; then + echo "HOME_DIR must be more than 2 characters long" + return + fi + rm -rf $HOME_DIR && echo "Removed $HOME_DIR" + + # reset values if not set already after whipe + set_config + + add_key() { + key=$1 + mnemonic=$2 + echo $mnemonic | $BINARY keys add $key --home $HOME_DIR --keyring-backend $KEYRING --algo $KEYALGO --recover + } + + # cosmos1efd63aw40lxf3n4mhf7dzhjkr453axur6cpk92 + add_key $KEY "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry" + # cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr + add_key $KEY2 "wealth flavor believe regret funny network recall kiss grape useless pepper cram hint member few certain unveil rather brick bargain curious require crowd raise" + + $BINARY init $CHAIN_ID --chain-id $CHAIN_ID --overwrite --default-denom $DENOM --home $HOME_DIR + + update_test_genesis() { + cat $HOME_DIR/config/genesis.json | jq "$1" >$HOME_DIR/config/tmp_genesis.json && mv $HOME_DIR/config/tmp_genesis.json $HOME_DIR/config/genesis.json + } + + # === CORE MODULES === + # block + update_test_genesis '.consensus_params["block"]["max_gas"]="100000000"' + # crisis + update_test_genesis $(printf '.app_state["crisis"]["constant_fee"]={"denom":"%s","amount":"1000"}' $DENOM) + + # === CUSTOM MODULES === + # tokenfactory + update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[]' + update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_gas_consume"]=100000' + + $BINARY keys list --keyring-backend $KEYRING --home $HOME_DIR + + # Allocate genesis accounts + $BINARY genesis add-genesis-account $KEY 10000000$DENOM,900test --keyring-backend $KEYRING --home $HOME_DIR --append + $BINARY genesis add-genesis-account $KEY2 10000000$DENOM,800test --keyring-backend $KEYRING --home $HOME_DIR --append + + # ICS provider genesis hack + HACK_DIR=icshack-1 && echo $HACK_DIR + rm -rf $HACK_DIR + cp -r ${HOME_DIR} $HACK_DIR + + $BINARY add-consumer-section provider --home $HACK_DIR + ccvjson=$(jq '.app_state["ccvconsumer"]' $HACK_DIR/config/genesis.json) + echo $ccvjson + jq '.app_state["ccvconsumer"] = '"$ccvjson" ${HACK_DIR}/config/genesis.json >json.tmp && mv json.tmp $genesis_json + rm -rf $HACK_DIR + + update_test_genesis $(printf '.app_state["ccvconsumer"]["params"]["unbonding_period"]="%s"' "240s") +} + +# check if CLEAN is not set to false +if [ "$CLEAN" != "false" ]; then + echo "Starting from a clean state" + from_scratch +fi + +# Opens the RPC endpoint to outside connections +sed -i -e 's/laddr = "tcp:\/\/127.0.0.1:26657"/c\laddr = "tcp:\/\/0.0.0.0:'$RPC'"/g' $HOME_DIR/config/config.toml +sed -i -e 's/cors_allowed_origins = \[\]/cors_allowed_origins = \["\*"\]/g' $HOME_DIR/config/config.toml + +# REST endpoint +sed -i -e 's/address = "tcp:\/\/localhost:1317"/address = "tcp:\/\/0.0.0.0:'$REST'"/g' $HOME_DIR/config/app.toml +sed -i -e 's/enable = false/enable = true/g' $HOME_DIR/config/app.toml + +# peer exchange +sed -i -e 's/pprof_laddr = "localhost:6060"/pprof_laddr = "localhost:'$PROFF'"/g' $HOME_DIR/config/config.toml +sed -i -e 's/laddr = "tcp:\/\/0.0.0.0:26656"/laddr = "tcp:\/\/0.0.0.0:'$P2P'"/g' $HOME_DIR/config/config.toml + +# GRPC +sed -i -e 's/address = "localhost:9090"/address = "0.0.0.0:'$GRPC'"/g' $HOME_DIR/config/app.toml +sed -i -e 's/address = "localhost:9091"/address = "0.0.0.0:'$GRPC_WEB'"/g' $HOME_DIR/config/app.toml + +# Rosetta Api +sed -i -e 's/address = ":8080"/address = "0.0.0.0:'$ROSETTA'"/g' $HOME_DIR/config/app.toml + +# Faster blocks +sed -i -e 's/timeout_commit = "5s"/timeout_commit = "'$BLOCK_TIME'"/g' $HOME_DIR/config/config.toml + +# Start the daemon in the background +$BINARY start --pruning=nothing --minimum-gas-prices=0$DENOM --rpc.laddr="tcp://0.0.0.0:$RPC" --home $HOME_DIR diff --git a/scripts/test_node.sh b/scripts/test_node.sh index e17d0a923..45ad8f58c 100644 --- a/scripts/test_node.sh +++ b/scripts/test_node.sh @@ -8,15 +8,15 @@ export KEY="user1" export KEY2="user2" -export CHAIN_ID=${CHAIN_ID:-"local-1"} -export MONIKER="localvalidator" +export CHAIN_ID=${CHAIN_ID:-"sonr-testnet-1"} +export MONIKER="florence" export KEYALGO="secp256k1" export KEYRING=${KEYRING:-"test"} -export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.core"}") +export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.sonr"}") export BINARY=${BINARY:-sonrd} export DENOM=${DENOM:-usnr} -export CLEAN=${CLEAN:-"false"} +export CLEAN=${CLEAN:-"true"} export RPC=${RPC:-"26657"} export REST=${REST:-"1317"} export PROFF=${PROFF:-"6060"} @@ -106,8 +106,8 @@ from_scratch () { update_test_genesis '.app_state["poa"]["params"]["admins"]=["idx10d07y265gmmuvt4z0w9aw880jnsr700j9kqcfa"]' # Allocate genesis accounts - BINARY genesis add-genesis-account $KEY 10000000$DENOM,900test --keyring-backend $KEYRING - BINARY genesis add-genesis-account $KEY2 10000000$DENOM,800test --keyring-backend $KEYRING + BINARY genesis add-genesis-account $KEY 10000000$DENOM,900snr --keyring-backend $KEYRING + BINARY genesis add-genesis-account $KEY2 10000000$DENOM,800snr --keyring-backend $KEYRING # Sign genesis transaction BINARY genesis gentx $KEY 1000000$DENOM --keyring-backend $KEYRING --chain-id $CHAIN_ID @@ -153,4 +153,4 @@ sed -i 's/address = ":8080"/address = "0.0.0.0:'$ROSETTA'"/g' $HOME_DIR/config/a sed -i 's/timeout_commit = "5s"/timeout_commit = "'$BLOCK_TIME'"/g' $HOME_DIR/config/config.toml # Start the node with 0 gas fees -BINARY start --pruning=nothing --minimum-gas-prices=0$DENOM --rpc.laddr="tcp://0.0.0.0:$RPC" \ No newline at end of file +BINARY start --pruning=nothing --minimum-gas-prices=0$DENOM --rpc.laddr="tcp://0.0.0.0:$RPC" diff --git a/x/did/autocli.go b/x/did/autocli.go index bc41bbd28..194a615f9 100644 --- a/x/did/autocli.go +++ b/x/did/autocli.go @@ -3,7 +3,7 @@ package module import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - modulev1 "github.com/onsonr/hway/api/did/v1" + modulev1 "github.com/onsonr/sonr/api/did/v1" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. @@ -24,7 +24,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "UpdateParams", - Skip: false, // set to true if authority gated + Skip: true, // set to true if authority gated }, }, }, diff --git a/x/did/builder/api.go b/x/did/builder/api.go new file mode 100644 index 000000000..d042ba441 --- /dev/null +++ b/x/did/builder/api.go @@ -0,0 +1,251 @@ +package builder + +import ( + "encoding/base64" + "fmt" + + "github.com/go-webauthn/webauthn/protocol" + + "github.com/go-webauthn/webauthn/protocol/webauthncose" + didv1 "github.com/onsonr/sonr/api/did/v1" + "github.com/onsonr/sonr/x/did/types" +) + +func APIFormatDIDNamespace(namespace types.DIDNamespace) didv1.DIDNamespace { + return didv1.DIDNamespace(namespace) +} + +func APIFormatDIDNamespaces(namespaces []types.DIDNamespace) []didv1.DIDNamespace { + var s []didv1.DIDNamespace + for _, namespace := range namespaces { + s = append(s, APIFormatDIDNamespace(namespace)) + } + return s +} + +func APIFormatKeyRole(role types.KeyRole) didv1.KeyRole { + return didv1.KeyRole(role) +} + +func APIFormatKeyAlgorithm(algorithm types.KeyAlgorithm) didv1.KeyAlgorithm { + return didv1.KeyAlgorithm(algorithm) +} + +func APIFormatKeyEncoding(encoding types.KeyEncoding) didv1.KeyEncoding { + return didv1.KeyEncoding(encoding) +} + +func APIFormatKeyCurve(curve types.KeyCurve) didv1.KeyCurve { + return didv1.KeyCurve(curve) +} + +func APIFormatKeyType(keyType types.KeyType) didv1.KeyType { + return didv1.KeyType(keyType) +} + +func APIFormatPermissions(permissions *types.Permissions) *didv1.Permissions { + if permissions == nil { + return nil + } + p := didv1.Permissions{ + Grants: APIFormatDIDNamespaces(permissions.Grants), + Scopes: APIFormatPermissionScopes(permissions.Scopes), + } + return &p +} + +func APIFormatPermissionScope(scope types.PermissionScope) didv1.PermissionScope { + return didv1.PermissionScope(scope) +} + +func APIFormatPermissionScopes(scopes []types.PermissionScope) []didv1.PermissionScope { + var s []didv1.PermissionScope + for _, scope := range scopes { + s = append(s, APIFormatPermissionScope(scope)) + } + return s +} + +func APIFormatServiceRecord(service *types.Service) *didv1.ServiceRecord { + return &didv1.ServiceRecord{ + Id: service.Id, + ServiceType: service.ServiceType, + Authority: service.Authority, + Origin: service.Origin, + Description: service.Description, + ServiceEndpoints: service.ServiceEndpoints, + Permissions: APIFormatPermissions(service.Permissions), + } +} + +func APIFormatPubKeyJWK(jwk *types.PubKey_JWK) *didv1.PubKey_JWK { + return &didv1.PubKey_JWK{ + Kty: jwk.Kty, + Crv: jwk.Crv, + X: jwk.X, + Y: jwk.Y, + N: jwk.N, + E: jwk.E, + } +} + +func APIFormatPubKey(key *types.PubKey) *didv1.PubKey { + return &didv1.PubKey{ + Role: APIFormatKeyRole(key.GetRole()), + Algorithm: APIFormatKeyAlgorithm(key.GetAlgorithm()), + Encoding: APIFormatKeyEncoding(key.GetEncoding()), + Curve: APIFormatKeyCurve(key.GetCurve()), + KeyType: APIFormatKeyType(key.GetKeyType()), + Raw: key.GetRaw(), + } +} + +func FormatEC2PublicKey(key *webauthncose.EC2PublicKeyData) (*types.PubKey_JWK, error) { + curve, err := GetCOSECurveName(key.Curve) + if err != nil { + return nil, err + } + + jwkMap := map[string]interface{}{ + "kty": "EC", + "crv": curve, + "x": base64.RawURLEncoding.EncodeToString(key.XCoord), + "y": base64.RawURLEncoding.EncodeToString(key.YCoord), + } + + return MapToJWK(jwkMap) +} + +func FormatRSAPublicKey(key *webauthncose.RSAPublicKeyData) (*types.PubKey_JWK, error) { + jwkMap := map[string]interface{}{ + "kty": "RSA", + "n": base64.RawURLEncoding.EncodeToString(key.Modulus), + "e": base64.RawURLEncoding.EncodeToString(key.Exponent), + } + + return MapToJWK(jwkMap) +} + +func FormatOKPPublicKey(key *webauthncose.OKPPublicKeyData) (*types.PubKey_JWK, error) { + curve, err := GetOKPCurveName(key.Curve) + if err != nil { + return nil, err + } + + jwkMap := map[string]interface{}{ + "kty": "OKP", + "crv": curve, + "x": base64.RawURLEncoding.EncodeToString(key.XCoord), + } + + return MapToJWK(jwkMap) +} + +func MapToJWK(m map[string]interface{}) (*types.PubKey_JWK, error) { + jwk := &types.PubKey_JWK{} + for k, v := range m { + switch k { + case "kty": + jwk.Kty = v.(string) + case "crv": + jwk.Crv = v.(string) + case "x": + jwk.X = v.(string) + case "y": + jwk.Y = v.(string) + case "n": + jwk.N = v.(string) + case "e": + jwk.E = v.(string) + } + } + return jwk, nil +} + +func GetCOSECurveName(curveID int64) (string, error) { + switch curveID { + case int64(webauthncose.P256): + return "P-256", nil + case int64(webauthncose.P384): + return "P-384", nil + case int64(webauthncose.P521): + return "P-521", nil + default: + return "", fmt.Errorf("unknown curve ID: %d", curveID) + } +} + +func GetOKPCurveName(curveID int64) (string, error) { + switch curveID { + case int64(webauthncose.Ed25519): + return "Ed25519", nil + default: + return "", fmt.Errorf("unknown OKP curve ID: %d", curveID) + } +} + +// NormalizeTransports returns the transports as strings +func NormalizeTransports(transports []protocol.AuthenticatorTransport) []string { + tss := make([]string, len(transports)) + for i, t := range transports { + tss[i] = string(t) + } + return tss +} + +// GetTransports returns the protocol.AuthenticatorTransport +func ModuleTransportsToProtocol(transport []string) []protocol.AuthenticatorTransport { + tss := make([]protocol.AuthenticatorTransport, len(transport)) + for i, t := range transport { + tss[i] = protocol.AuthenticatorTransport(t) + } + return tss +} + +// ModuleFormatAPIServiceRecord formats a service record for the module +func ModuleFormatAPIServiceRecord(service *didv1.ServiceRecord) *types.Service { + return &types.Service{ + Id: service.Id, + ServiceType: service.ServiceType, + Authority: service.Authority, + Origin: service.Origin, + Description: service.Description, + ServiceEndpoints: service.ServiceEndpoints, + Permissions: ModuleFormatAPIPermissions(service.Permissions), + } +} + +func ModuleFormatAPIPermissions(permissions *didv1.Permissions) *types.Permissions { + if permissions == nil { + return nil + } + p := types.Permissions{ + Grants: ModuleFormatAPIDIDNamespaces(permissions.Grants), + Scopes: ModuleFormatAPIPermissionScopes(permissions.Scopes), + } + return &p +} + +func ModuleFormatAPIPermissionScope(scope didv1.PermissionScope) types.PermissionScope { + return types.PermissionScope(scope) +} + +func ModuleFormatAPIPermissionScopes(scopes []didv1.PermissionScope) []types.PermissionScope { + var s []types.PermissionScope + for _, scope := range scopes { + s = append(s, ModuleFormatAPIPermissionScope(scope)) + } + return s +} + +func ModuleFormatAPIDIDNamespace(namespace didv1.DIDNamespace) types.DIDNamespace { + return types.DIDNamespace(namespace) +} + +func ModuleFormatAPIDIDNamespaces(namespaces []didv1.DIDNamespace) []types.DIDNamespace { + var s []types.DIDNamespace + for _, namespace := range namespaces { + s = append(s, ModuleFormatAPIDIDNamespace(namespace)) + } + return s +} diff --git a/x/did/types/bip32.go b/x/did/builder/chains.go similarity index 73% rename from x/did/types/bip32.go rename to x/did/builder/chains.go index 9c54b6e2d..eb3cf805a 100644 --- a/x/did/types/bip32.go +++ b/x/did/builder/chains.go @@ -1,4 +1,4 @@ -package types +package builder import ( "crypto/hmac" @@ -8,17 +8,18 @@ import ( "math/big" "github.com/btcsuite/btcd/btcec/v2" + "github.com/onsonr/sonr/x/did/types" ) -// ComputePublicKey computes the public key of a child key given the extended public key, chain code, and index. -func ComputePublicKey(extPubKey []byte, chainCode uint32, index int) ([]byte, error) { +// ComputeAccountPublicKey computes the public key of a child key given the extended public key, chain code, and index. +func computeBip32AccountPublicKey(extPubKey PublicKey, chainCode types.ChainCode, index int) (*types.PubKey, error) { // Check if the index is a hardened child key if chainCode&0x80000000 != 0 && index < 0 { return nil, errors.New("invalid index") } // Serialize the public key - pubKey, err := btcec.ParsePubKey(extPubKey) + pubKey, err := btcec.ParsePubKey(extPubKey.GetRaw()) if err != nil { return nil, err } @@ -54,8 +55,11 @@ func ComputePublicKey(extPubKey []byte, chainCode uint32, index int) ([]byte, er // Create the child public key childPubKey := btcec.NewPublicKey(lx, ly) - childPubKeyBytes := childPubKey.SerializeCompressed() - return childPubKeyBytes, nil + pk, err := types.NewPublicKey(childPubKey.SerializeCompressed(), types.ChainCodeKeyInfos[chainCode]) + if err != nil { + return nil, err + } + return pk, nil } // newBigIntFieldVal creates a new field value from a big integer. diff --git a/x/did/builder/constants.go b/x/did/builder/constants.go new file mode 100644 index 000000000..be06402c8 --- /dev/null +++ b/x/did/builder/constants.go @@ -0,0 +1,334 @@ +package builder + +import ( + "github.com/onsonr/sonr/x/did/types" +) + +type ( + AuthenticatorAttachment string + AuthenticatorTransport string +) + +const ( + // Platform represents a platform authenticator is attached using a client device-specific transport, called + // platform attachment, and is usually not removable from the client device. A public key credential bound to a + // platform authenticator is called a platform credential. + Platform AuthenticatorAttachment = "platform" + + // CrossPlatform represents a roaming authenticator is attached using cross-platform transports, called + // cross-platform attachment. Authenticators of this class are removable from, and can "roam" among, client devices. + // A public key credential bound to a roaming authenticator is called a roaming credential. + CrossPlatform AuthenticatorAttachment = "cross-platform" +) + +func ParseAuthenticatorAttachment(s string) AuthenticatorAttachment { + switch s { + case "platform": + return Platform + default: + return CrossPlatform + } +} + +const ( + // USB indicates the respective authenticator can be contacted over removable USB. + USB AuthenticatorTransport = "usb" + + // NFC indicates the respective authenticator can be contacted over Near Field Communication (NFC). + NFC AuthenticatorTransport = "nfc" + + // BLE indicates the respective authenticator can be contacted over Bluetooth Smart (Bluetooth Low Energy / BLE). + BLE AuthenticatorTransport = "ble" + + // SmartCard indicates the respective authenticator can be contacted over ISO/IEC 7816 smart card with contacts. + // + // WebAuthn Level 3. + SmartCard AuthenticatorTransport = "smart-card" + + // Hybrid indicates the respective authenticator can be contacted using a combination of (often separate) + // data-transport and proximity mechanisms. This supports, for example, authentication on a desktop computer using + // a smartphone. + // + // WebAuthn Level 3. + Hybrid AuthenticatorTransport = "hybrid" + + // Internal indicates the respective authenticator is contacted using a client device-specific transport, i.e., it + // is a platform authenticator. These authenticators are not removable from the client device. + Internal AuthenticatorTransport = "internal" +) + +func ParseAuthenticatorTransport(s string) AuthenticatorTransport { + switch s { + case "usb": + return USB + case "nfc": + return NFC + case "ble": + return BLE + case "smart-card": + return SmartCard + case "hybrid": + return Hybrid + default: + return Internal + } +} + +type AuthenticatorFlags byte + +const ( + // FlagUserPresent Bit 00000001 in the byte sequence. Tells us if user is present. Also referred to as the UP flag. + FlagUserPresent AuthenticatorFlags = 1 << iota // Referred to as UP + + // FlagRFU1 is a reserved for future use flag. + FlagRFU1 + + // FlagUserVerified Bit 00000100 in the byte sequence. Tells us if user is verified + // by the authenticator using a biometric or PIN. Also referred to as the UV flag. + FlagUserVerified + + // FlagBackupEligible Bit 00001000 in the byte sequence. Tells us if a backup is eligible for device. Also referred + // to as the BE flag. + FlagBackupEligible // Referred to as BE + + // FlagBackupState Bit 00010000 in the byte sequence. Tells us if a backup state for device. Also referred to as the + // BS flag. + FlagBackupState + + // FlagRFU2 is a reserved for future use flag. + FlagRFU2 + + // FlagAttestedCredentialData Bit 01000000 in the byte sequence. Indicates whether + // the authenticator added attested credential data. Also referred to as the AT flag. + FlagAttestedCredentialData + + // FlagHasExtensions Bit 10000000 in the byte sequence. Indicates if the authenticator data has extensions. Also + // referred to as the ED flag. + FlagHasExtensions +) + +type AttestationFormat string + +const ( + // AttestationFormatPacked is the "packed" attestation statement format is a WebAuthn-optimized format for + // attestation. It uses a very compact but still extensible encoding method. This format is implementable by + // authenticators with limited resources (e.g., secure elements). + AttestationFormatPacked AttestationFormat = "packed" + + // AttestationFormatTPM is the TPM attestation statement format returns an attestation statement in the same format + // as the packed attestation statement format, although the rawData and signature fields are computed differently. + AttestationFormatTPM AttestationFormat = "tpm" + + // AttestationFormatAndroidKey is the attestation statement format for platform authenticators on versions "N", and + // later, which may provide this proprietary "hardware attestation" statement. + AttestationFormatAndroidKey AttestationFormat = "android-key" + + // AttestationFormatAndroidSafetyNet is the attestation statement format that Android-based platform authenticators + // MAY produce an attestation statement based on the Android SafetyNet API. + AttestationFormatAndroidSafetyNet AttestationFormat = "android-safetynet" + + // AttestationFormatFIDOUniversalSecondFactor is the attestation statement format that is used with FIDO U2F + // authenticators. + AttestationFormatFIDOUniversalSecondFactor AttestationFormat = "fido-u2f" + + // AttestationFormatApple is the attestation statement format that is used with Apple devices' platform + // authenticators. + AttestationFormatApple AttestationFormat = "apple" + + // AttestationFormatNone is the attestation statement format that is used to replace any authenticator-provided + // attestation statement when a WebAuthn Relying Party indicates it does not wish to receive attestation information. + AttestationFormatNone AttestationFormat = "none" +) + +func ExtractAttestationFormats(p *types.Params) []AttestationFormat { + var formats []AttestationFormat + for _, v := range p.AttestationFormats { + formats = append(formats, parseAttestationFormat(v)) + } + return formats +} + +func parseAttestationFormat(s string) AttestationFormat { + switch s { + case "packed": + return AttestationFormatPacked + case "tpm": + return AttestationFormatTPM + case "android-key": + return AttestationFormatAndroidKey + case "android-safetynet": + return AttestationFormatAndroidSafetyNet + case "fido-u2f": + return AttestationFormatFIDOUniversalSecondFactor + case "apple": + return AttestationFormatApple + case "none": + return AttestationFormatNone + default: + return AttestationFormatPacked + } +} + +type CredentialType string + +const ( + CredentialTypePublicKeyCredential CredentialType = "public-key" +) + +type ConveyancePreference string + +const ( + // PreferNoAttestation is a ConveyancePreference value. + // + // This value indicates that the Relying Party is not interested in authenticator attestation. For example, in order + // to potentially avoid having to obtain user consent to relay identifying information to the Relying Party, or to + // save a round trip to an Attestation CA or Anonymization CA. + // + // This is the default value. + // + // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-none) + PreferNoAttestation ConveyancePreference = "none" + + // PreferIndirectAttestation is a ConveyancePreference value. + // + // This value indicates that the Relying Party prefers an attestation conveyance yielding verifiable attestation + // statements, but allows the client to decide how to obtain such attestation statements. The client MAY replace the + // authenticator-generated attestation statements with attestation statements generated by an Anonymization CA, in + // order to protect the user’s privacy, or to assist Relying Parties with attestation verification in a + // heterogeneous ecosystem. + // + // Note: There is no guarantee that the Relying Party will obtain a verifiable attestation statement in this case. + // For example, in the case that the authenticator employs self attestation. + // + // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-indirect) + PreferIndirectAttestation ConveyancePreference = "indirect" + + // PreferDirectAttestation is a ConveyancePreference value. + // + // This value indicates that the Relying Party wants to receive the attestation statement as generated by the + // authenticator. + // + // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-direct) + PreferDirectAttestation ConveyancePreference = "direct" + + // PreferEnterpriseAttestation is a ConveyancePreference value. + // + // This value indicates that the Relying Party wants to receive an attestation statement that may include uniquely + // identifying information. This is intended for controlled deployments within an enterprise where the organization + // wishes to tie registrations to specific authenticators. User agents MUST NOT provide such an attestation unless + // the user agent or authenticator configuration permits it for the requested RP ID. + // + // If permitted, the user agent SHOULD signal to the authenticator (at invocation time) that enterprise + // attestation is requested, and convey the resulting AAGUID and attestation statement, unaltered, to the Relying + // Party. + // + // Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-enterprise) + PreferEnterpriseAttestation ConveyancePreference = "enterprise" +) + +func ExtractConveyancePreference(p *types.Params) ConveyancePreference { + switch p.ConveyancePreference { + case "none": + return PreferNoAttestation + case "indirect": + return PreferIndirectAttestation + case "direct": + return PreferDirectAttestation + case "enterprise": + return PreferEnterpriseAttestation + default: + return PreferNoAttestation + } +} + +type PublicKeyCredentialHints string + +const ( + // PublicKeyCredentialHintSecurityKey is a PublicKeyCredentialHint that indicates that the Relying Party believes + // that users will satisfy this request with a physical security key. For example, an enterprise Relying Party may + // set this hint if they have issued security keys to their employees and will only accept those authenticators for + // registration and authentication. + // + // For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the + // authenticatorAttachment SHOULD be set to cross-platform. + PublicKeyCredentialHintSecurityKey PublicKeyCredentialHints = "security-key" + + // PublicKeyCredentialHintClientDevice is a PublicKeyCredentialHint that indicates that the Relying Party believes + // that users will satisfy this request with a platform authenticator attached to the client device. + // + // For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the + // authenticatorAttachment SHOULD be set to platform. + PublicKeyCredentialHintClientDevice PublicKeyCredentialHints = "client-device" + + // PublicKeyCredentialHintHybrid is a PublicKeyCredentialHint that indicates that the Relying Party believes that + // users will satisfy this request with general-purpose authenticators such as smartphones. For example, a consumer + // Relying Party may believe that only a small fraction of their customers possesses dedicated security keys. This + // option also implies that the local platform authenticator should not be promoted in the UI. + // + // For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the + // authenticatorAttachment SHOULD be set to cross-platform. + PublicKeyCredentialHintHybrid PublicKeyCredentialHints = "hybrid" +) + +func ParsePublicKeyCredentialHints(s string) PublicKeyCredentialHints { + switch s { + case "security-key": + return PublicKeyCredentialHintSecurityKey + case "client-device": + return PublicKeyCredentialHintClientDevice + case "hybrid": + return PublicKeyCredentialHintHybrid + default: + return "" + } +} + +type AttestedCredentialData struct { + AAGUID []byte `json:"aaguid"` + CredentialID []byte `json:"credential_id"` + + // The raw credential public key bytes received from the attestation data. + CredentialPublicKey []byte `json:"public_key"` +} + +type ResidentKeyRequirement string + +const ( + // ResidentKeyRequirementDiscouraged indicates the Relying Party prefers creating a server-side credential, but will + // accept a client-side discoverable credential. This is the default. + ResidentKeyRequirementDiscouraged ResidentKeyRequirement = "discouraged" + + // ResidentKeyRequirementPreferred indicates to the client we would prefer a discoverable credential. + ResidentKeyRequirementPreferred ResidentKeyRequirement = "preferred" + + // ResidentKeyRequirementRequired indicates the Relying Party requires a client-side discoverable credential, and is + // prepared to receive an error if a client-side discoverable credential cannot be created. + ResidentKeyRequirementRequired ResidentKeyRequirement = "required" +) + +func ParseResidentKeyRequirement(s string) ResidentKeyRequirement { + switch s { + case "discouraged": + return ResidentKeyRequirementDiscouraged + case "preferred": + return ResidentKeyRequirementPreferred + default: + return ResidentKeyRequirementRequired + } +} + +type ( + AuthenticationExtensions map[string]any + UserVerificationRequirement string +) + +const ( + // VerificationRequired User verification is required to create/release a credential + VerificationRequired UserVerificationRequirement = "required" + + // VerificationPreferred User verification is preferred to create/release a credential + VerificationPreferred UserVerificationRequirement = "preferred" // This is the default + + // VerificationDiscouraged The authenticator should not verify the user for the credential + VerificationDiscouraged UserVerificationRequirement = "discouraged" +) diff --git a/x/did/builder/macroon.go b/x/did/builder/macroon.go new file mode 100644 index 000000000..aacdbfb2a --- /dev/null +++ b/x/did/builder/macroon.go @@ -0,0 +1,48 @@ +package builder + +import ( + "net/http" + + "github.com/labstack/echo/v4" + "gopkg.in/macaroon.v2" + + "gopkg.in/macaroon-bakery.v2/bakery/checkers" +) + +var PermissionNamespace *checkers.Namespace + +func ValidateMacaroonMiddleware(secretKey []byte, location string) echo.MiddlewareFunc { + return func(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + // Extract the macaroon from the Authorization header + auth := c.Request().Header.Get("Authorization") + if auth == "" { + return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Missing Authorization header"}) + } + + // Decode the macaroon + mac, err := macaroon.Base64Decode([]byte(auth)) + if err != nil { + return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon encoding"}) + } + + token, err := macaroon.New(secretKey, mac, location, macaroon.LatestVersion) + if err != nil { + return c.JSON(http.StatusBadRequest, map[string]string{"error": "Invalid macaroon"}) + } + + // Verify the macaroon + err = token.Verify(secretKey, func(caveat string) error { + // Implement your caveat verification logic here + // For example, you might check if the caveat is still valid (e.g., not expired) + return nil // Return nil if the caveat is valid + }, nil) + if err != nil { + return c.JSON(http.StatusUnauthorized, map[string]string{"error": "Invalid macaroon"}) + } + + // Macaroon is valid, proceed to the next handler + return next(c) + } + } +} diff --git a/x/did/builder/openid.go b/x/did/builder/openid.go new file mode 100644 index 000000000..acd3ba380 --- /dev/null +++ b/x/did/builder/openid.go @@ -0,0 +1,27 @@ +package builder + +import ( + "fmt" + + "github.com/onsonr/sonr/x/did/types/oidc" +) + +func GetDiscovery(origin string) *oidc.DiscoveryDocument { + baseURL := "https://" + origin // Ensure this is the correct base URL for your service + discoveryDoc := &oidc.DiscoveryDocument{ + Issuer: baseURL, + AuthorizationEndpoint: fmt.Sprintf("%s/auth", baseURL), + TokenEndpoint: fmt.Sprintf("%s/token", baseURL), + UserinfoEndpoint: fmt.Sprintf("%s/userinfo", baseURL), + JwksUri: fmt.Sprintf("%s/jwks", baseURL), + RegistrationEndpoint: fmt.Sprintf("%s/register", baseURL), + ScopesSupported: []string{"openid", "profile", "email", "web3", "sonr"}, + ResponseTypesSupported: []string{"code"}, + ResponseModesSupported: []string{"query", "form_post"}, + GrantTypesSupported: []string{"authorization_code", "refresh_token"}, + AcrValuesSupported: []string{"passkey"}, + SubjectTypesSupported: []string{"public"}, + ClaimsSupported: []string{"sub", "iss", "name", "email"}, + } + return discoveryDoc +} diff --git a/x/did/builder/options.go b/x/did/builder/options.go new file mode 100644 index 000000000..828af608e --- /dev/null +++ b/x/did/builder/options.go @@ -0,0 +1,82 @@ +package builder + +import ( + "encoding/json" + + "github.com/onsonr/sonr/x/did/types" +) + +type AuthenticatorResponse struct { + // From the spec https://www.w3.org/TR/webauthn/#dom-authenticatorresponse-clientdatajson + // This attribute contains a JSON serialization of the client data passed to the authenticator + // by the client in its call to either create() or get(). + ClientDataJSON URLEncodedBase64 `json:"clientDataJSON"` +} + +type AuthenticatorAttestationResponse struct { + // The byte slice of clientDataJSON, which becomes CollectedClientData + AuthenticatorResponse + + Transports []string `json:"transports,omitempty"` + + AuthenticatorData URLEncodedBase64 `json:"authenticatorData"` + + PublicKey URLEncodedBase64 `json:"publicKey"` + + PublicKeyAlgorithm int64 `json:"publicKeyAlgorithm"` + + // AttestationObject is the byte slice version of attestationObject. + // This attribute contains an attestation object, which is opaque to, and + // cryptographically protected against tampering by, the client. The + // attestation object contains both authenticator data and an attestation + // statement. The former contains the AAGUID, a unique credential ID, and + // the credential public key. The contents of the attestation statement are + // determined by the attestation statement format used by the authenticator. + // It also contains any additional information that the Relying Party's server + // requires to validate the attestation statement, as well as to decode and + // validate the authenticator data along with the JSON-serialized client data. + AttestationObject URLEncodedBase64 `json:"attestationObject"` +} + +type PublicKeyCredentialCreationOptions struct { + RelyingParty RelyingPartyEntity `json:"rp"` + User UserEntity `json:"user"` + Challenge URLEncodedBase64 `json:"challenge"` + Parameters []CredentialParameter `json:"pubKeyCredParams,omitempty"` + Timeout int `json:"timeout,omitempty"` + CredentialExcludeList []CredentialDescriptor `json:"excludeCredentials,omitempty"` + AuthenticatorSelection AuthenticatorSelection `json:"authenticatorSelection,omitempty"` + Hints []PublicKeyCredentialHints `json:"hints,omitempty"` + Attestation ConveyancePreference `json:"attestation,omitempty"` + AttestationFormats []AttestationFormat `json:"attestationFormats,omitempty"` + Extensions AuthenticationExtensions `json:"extensions,omitempty"` +} + +func GetPublicKeyCredentialCreationOptions(origin string, subject string, vaultCID string, params *types.Params) (*PublicKeyCredentialCreationOptions, error) { + chal, err := CreateChallenge() + if err != nil { + return nil, err + } + return &PublicKeyCredentialCreationOptions{ + RelyingParty: NewRelayingParty(origin, subject), + User: NewUserEntity(subject, subject, vaultCID), + Parameters: ExtractCredentialParameters(params), + Timeout: 20, + CredentialExcludeList: nil, + Challenge: chal, + AuthenticatorSelection: AuthenticatorSelection{}, + Hints: nil, + Attestation: ExtractConveyancePreference(params), + AttestationFormats: ExtractAttestationFormats(params), + Extensions: nil, + }, nil +} + +func UnmarshalAuthenticatorResponse(data []byte) (*AuthenticatorResponse, error) { + var ar AuthenticatorResponse + err := json.Unmarshal(data, &ar) + if err != nil { + return nil, err + } + return &ar, nil +} diff --git a/x/did/builder/pubkey.go b/x/did/builder/pubkey.go new file mode 100644 index 000000000..2c408b1ab --- /dev/null +++ b/x/did/builder/pubkey.go @@ -0,0 +1,81 @@ +package builder + +import ( + "fmt" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + didv1 "github.com/onsonr/sonr/api/did/v1" + "github.com/onsonr/sonr/x/did/types" + + "github.com/go-webauthn/webauthn/protocol/webauthncose" +) + +// PublicKey is an interface for a public key +type PublicKey interface { + cryptotypes.PubKey + Clone() cryptotypes.PubKey + GetRaw() []byte + GetRole() types.KeyRole + GetAlgorithm() types.KeyAlgorithm + GetEncoding() types.KeyEncoding + GetCurve() types.KeyCurve + GetKeyType() types.KeyType +} + +// CreateAuthnVerification creates a new verification method for an authn method +func CreateAuthnVerification(namespace types.DIDNamespace, issuer string, controller string, pubkey *types.PubKey, identifier string) *types.VerificationMethod { + return &types.VerificationMethod{ + Method: namespace, + Controller: controller, + PublicKey: pubkey, + Id: identifier, + Issuer: issuer, + } +} + +// CreateWalletVerification creates a new verification method for a wallet +func CreateWalletVerification(namespace types.DIDNamespace, controller string, pubkey *types.PubKey, identifier string) *didv1.VerificationMethod { + return &didv1.VerificationMethod{ + Method: APIFormatDIDNamespace(namespace), + Controller: controller, + PublicKey: APIFormatPubKey(pubkey), + Id: identifier, + } +} + +// ExtractWebAuthnPublicKey parses the raw public key bytes and returns a JWK representation +func ExtractWebAuthnPublicKey(keyBytes []byte) (*types.PubKey_JWK, error) { + key, err := webauthncose.ParsePublicKey(keyBytes) + if err != nil { + return nil, fmt.Errorf("failed to parse public key: %w", err) + } + + switch k := key.(type) { + case *webauthncose.EC2PublicKeyData: + return FormatEC2PublicKey(k) + case *webauthncose.RSAPublicKeyData: + return FormatRSAPublicKey(k) + case *webauthncose.OKPPublicKeyData: + return FormatOKPPublicKey(k) + default: + return nil, fmt.Errorf("unsupported key type") + } +} + +// NewInitialWalletAccounts creates a new set of verification methods for a wallet +func NewInitialWalletAccounts(controller string, pubkey *types.PubKey) ([]*didv1.VerificationMethod, error) { + var verificationMethods []*didv1.VerificationMethod + for method, chain := range types.InitialChainCodes { + nk, err := computeBip32AccountPublicKey(pubkey, chain, 0) + if err != nil { + return nil, err + } + + addr, err := chain.FormatAddress(nk) + if err != nil { + return nil, nil + } + verificationMethods = append(verificationMethods, CreateWalletVerification(method, controller, nk, method.FormatDID(addr))) + } + return verificationMethods, nil +} diff --git a/x/did/builder/scopes.go b/x/did/builder/scopes.go new file mode 100644 index 000000000..2635d6204 --- /dev/null +++ b/x/did/builder/scopes.go @@ -0,0 +1,56 @@ +package builder + +import ( + "github.com/onsonr/sonr/x/did/types" + "gopkg.in/macaroon-bakery.v2/bakery/checkers" +) + +var ( + GenericPermissionScopeStrings = [...]string{ + "profile.name", + "identifiers.email", + "identifiers.phone", + "transactions.read", + "transactions.write", + "wallets.read", + "wallets.create", + "wallets.subscribe", + "wallets.update", + "transactions.verify", + "transactions.broadcast", + "admin.user", + "admin.validator", + } + + StringToModulePermissionScope = map[string]types.PermissionScope{ + "PERMISSION_SCOPE_UNSPECIFIED": types.PermissionScope_PERMISSION_SCOPE_UNSPECIFIED, + "PERMISSION_SCOPE_BASIC_INFO": types.PermissionScope_PERMISSION_SCOPE_BASIC_INFO, + "PERMISSION_SCOPE_IDENTIFIERS_EMAIL": types.PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ, + "PERMISSION_SCOPE_IDENTIFIERS_PHONE": types.PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE, + "PERMISSION_SCOPE_TRANSACTIONS_READ": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ, + "PERMISSION_SCOPE_TRANSACTIONS_WRITE": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE, + "PERMISSION_SCOPE_WALLETS_READ": types.PermissionScope_PERMISSION_SCOPE_WALLETS_READ, + "PERMISSION_SCOPE_WALLETS_CREATE": types.PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE, + "PERMISSION_SCOPE_WALLETS_SUBSCRIBE": types.PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE, + "PERMISSION_SCOPE_WALLETS_UPDATE": types.PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE, + "PERMISSION_SCOPE_TRANSACTIONS_VERIFY": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY, + "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": types.PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST, + "PERMISSION_SCOPE_ADMIN_USER": types.PermissionScope_PERMISSION_SCOPE_ADMIN_USER, + "PERMISSION_SCOPE_ADMIN_VALIDATOR": types.PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR, + } +) + +func ResolvePermissionScope(scope string) (types.PermissionScope, bool) { + uriToPrefix := make(map[string]string) + for _, scope := range GenericPermissionScopeStrings { + uriToPrefix["https://example.com/auth/"+scope] = scope + } + PermissionNamespace := checkers.NewNamespace(uriToPrefix) + + prefix, ok := PermissionNamespace.Resolve("https://example.com/auth/" + scope) + if !ok { + return 0, false + } + permScope, ok := StringToModulePermissionScope[prefix] + return permScope, ok +} diff --git a/x/did/builder/service.go b/x/did/builder/service.go new file mode 100644 index 000000000..b5e33a96f --- /dev/null +++ b/x/did/builder/service.go @@ -0,0 +1,103 @@ +package builder + +import ( + "crypto/rand" + "strings" + + "github.com/onsonr/sonr/x/did/types" +) + +// ChallengeLength - Length of bytes to generate for a challenge. +const ChallengeLength = 32 + +// CreateChallenge creates a new challenge that should be signed and returned by the authenticator. The spec recommends +// using at least 16 bytes with 100 bits of entropy. We use 32 bytes. +func CreateChallenge() (challenge URLEncodedBase64, err error) { + challenge = make([]byte, ChallengeLength) + + if _, err = rand.Read(challenge); err != nil { + return nil, err + } + + return challenge, nil +} + +type CredentialEntity struct { + // A human-palatable name for the entity. Its function depends on what the PublicKeyCredentialEntity represents: + // + // When inherited by PublicKeyCredentialRpEntity it is a human-palatable identifier for the Relying Party, + // intended only for display. For example, "ACME Corporation", "Wonderful Widgets, Inc." or "ОАО Примертех". + // + // When inherited by PublicKeyCredentialUserEntity, it is a human-palatable identifier for a user account. It is + // intended only for display, i.e., aiding the user in determining the difference between user accounts with similar + // displayNames. For example, "alexm", "alex.p.mueller@example.com" or "+14255551234". + Name string `json:"name"` +} + +func NewCredentialEntity(name string) CredentialEntity { + return CredentialEntity{ + Name: name, + } +} + +type CredentialParameter struct { + Type CredentialType `json:"type"` + Algorithm types.COSEAlgorithmIdentifier `json:"alg"` +} + +func NewCredentialParameter(ki *types.KeyInfo) CredentialParameter { + return CredentialParameter{ + Type: CredentialTypePublicKeyCredential, + Algorithm: ki.Algorithm.CoseIdentifier(), + } +} + +func ExtractCredentialParameters(p *types.Params) []CredentialParameter { + var keys []*types.KeyInfo + for k, v := range p.AllowedPublicKeys { + if strings.Contains(k, "webauthn") { + keys = append(keys, v) + } + } + var cparams []CredentialParameter + for _, ki := range keys { + cparams = append(cparams, NewCredentialParameter(ki)) + } + return cparams +} + +type RelyingPartyEntity struct { + CredentialEntity + + // A unique identifier for the Relying Party entity, which sets the RP ID. + ID string `json:"id"` +} + +func NewRelayingParty(name string, origin string) RelyingPartyEntity { + return RelyingPartyEntity{ + CredentialEntity: NewCredentialEntity(origin), + ID: origin, + } +} + +type UserEntity struct { + CredentialEntity + // A human-palatable name for the user account, intended only for display. + // For example, "Alex P. Müller" or "田中 倫". The Relying Party SHOULD let + // the user choose this, and SHOULD NOT restrict the choice more than necessary. + DisplayName string `json:"displayName"` + + // ID is the user handle of the user account entity. To ensure secure operation, + // authentication and authorization decisions MUST be made on the basis of this id + // member, not the displayName nor name members. See Section 6.1 of + // [RFC8266](https://www.w3.org/TR/webauthn/#biblio-rfc8266). + ID any `json:"id"` +} + +func NewUserEntity(name string, subject string, cid string) UserEntity { + return UserEntity{ + CredentialEntity: NewCredentialEntity(name), + DisplayName: subject, + ID: cid, + } +} diff --git a/x/did/builder/signer.go b/x/did/builder/signer.go new file mode 100644 index 000000000..b7b3fc33a --- /dev/null +++ b/x/did/builder/signer.go @@ -0,0 +1,59 @@ +package builder + +import ( + "github.com/onsonr/crypto" + "github.com/onsonr/sonr/x/did/types" +) + +type Signer interface { + Sign(msg []byte) ([]byte, error) + Verify(msg []byte, sig []byte) error + PublicKey() []byte +} + +type signer struct { + user *types.Keyshare + val *types.Keyshare +} + +func (k signer) Sign(msg []byte) ([]byte, error) { + valSignFunc, err := crypto.GetSignFunc(k.val, msg) + if err != nil { + return nil, err + } + usrSignFunc, err := crypto.GetSignFunc(k.user, msg) + if err != nil { + return nil, err + } + sig, err := crypto.RunMPCSign(valSignFunc, usrSignFunc) + if err != nil { + return nil, err + } + return crypto.SerializeMPCSignature(sig) +} + +func (k signer) Verify(msg []byte, sig []byte) error { + sigMpc, err := crypto.DeserializeMPCSignature(sig) + if err != nil { + return err + } + pk, err := crypto.GetECDSAPublicKey(k.val) + if err != nil { + return err + } + ok := crypto.VerifyMPCSignature(sigMpc, msg, pk) + if !ok { + return types.ErrInvalidSignature + } + return nil +} + +func (k signer) PublicKey() []byte { + if k.user != nil { + return k.user.PublicKey + } + if k.val != nil { + return k.val.PublicKey + } + return nil +} diff --git a/x/did/builder/webauthn.go b/x/did/builder/webauthn.go new file mode 100644 index 000000000..098f91356 --- /dev/null +++ b/x/did/builder/webauthn.go @@ -0,0 +1,169 @@ +package builder + +import ( + "bytes" + "encoding/base64" + "reflect" + + "github.com/go-webauthn/webauthn/protocol" +) + +// Credential contains all needed information about a WebAuthn credential for storage. +type Credential struct { + Subject string `json:"handle"` + AttestationType string `json:"attestationType"` + Origin string `json:"origin"` + CredentialID []byte `json:"id"` + PublicKey []byte `json:"publicKey"` + Transport []string `json:"transport"` + SignCount uint32 `json:"signCount"` + UserPresent bool `json:"userPresent"` + UserVerified bool `json:"userVerified"` + BackupEligible bool `json:"backupEligible"` + BackupState bool `json:"backupState"` + CloneWarning bool `json:"cloneWarning"` +} + +// NewCredential will return a credential pointer on successful validation of a registration response. +func NewCredential(c *protocol.ParsedCredentialCreationData, origin, handle string) *Credential { + return &Credential{ + Subject: handle, + Origin: origin, + AttestationType: c.Response.AttestationObject.Format, + CredentialID: c.Response.AttestationObject.AuthData.AttData.CredentialID, + PublicKey: c.Response.AttestationObject.AuthData.AttData.CredentialPublicKey, + Transport: NormalizeTransports(c.Response.Transports), + SignCount: c.Response.AttestationObject.AuthData.Counter, + UserPresent: c.Response.AttestationObject.AuthData.Flags.HasUserPresent(), + UserVerified: c.Response.AttestationObject.AuthData.Flags.HasUserVerified(), + BackupEligible: c.Response.AttestationObject.AuthData.Flags.HasBackupEligible(), + BackupState: c.Response.AttestationObject.AuthData.Flags.HasAttestedCredentialData(), + } +} + +// Descriptor converts a Credential into a protocol.CredentialDescriptor. +func (c *Credential) Descriptor() protocol.CredentialDescriptor { + return protocol.CredentialDescriptor{ + Type: protocol.PublicKeyCredentialType, + CredentialID: c.CredentialID, + Transport: ModuleTransportsToProtocol(c.Transport), + AttestationType: c.AttestationType, + } +} + +// This is a signal that the authenticator may be cloned, see CloneWarning above for more information. +func (a *Credential) UpdateCounter(authDataCount uint32) { + if authDataCount <= a.SignCount && (authDataCount != 0 || a.SignCount != 0) { + a.CloneWarning = true + return + } + + a.SignCount = authDataCount +} + +type CredentialDescriptor struct { + // The valid credential types. + Type CredentialType `json:"type"` + + // CredentialID The ID of a credential to allow/disallow. + CredentialID URLEncodedBase64 `json:"id"` + + // The authenticator transports that can be used. + Transport []AuthenticatorTransport `json:"transports,omitempty"` + + // The AttestationType from the Credential. Used internally only. + AttestationType string `json:"-"` +} + +func NewCredentialDescriptor(credentialID string, transports []AuthenticatorTransport, attestationType string) *CredentialDescriptor { + return &CredentialDescriptor{ + CredentialID: URLEncodedBase64(credentialID), + Transport: transports, + AttestationType: attestationType, + Type: CredentialTypePublicKeyCredential, + } +} + +type AuthenticatorSelection struct { + // AuthenticatorAttachment If this member is present, eligible authenticators are filtered to only + // authenticators attached with the specified AuthenticatorAttachment enum. + AuthenticatorAttachment AuthenticatorAttachment `json:"authenticatorAttachment,omitempty"` + + // RequireResidentKey this member describes the Relying Party's requirements regarding resident + // credentials. If the parameter is set to true, the authenticator MUST create a client-side-resident + // public key credential source when creating a public key credential. + RequireResidentKey *bool `json:"requireResidentKey,omitempty"` + + // ResidentKey this member describes the Relying Party's requirements regarding resident + // credentials per Webauthn Level 2. + ResidentKey ResidentKeyRequirement `json:"residentKey,omitempty"` + + // UserVerification This member describes the Relying Party's requirements regarding user verification for + // the create() operation. Eligible authenticators are filtered to only those capable of satisfying this + // requirement. + UserVerification UserVerificationRequirement `json:"userVerification,omitempty"` +} + +type AuthenticatorData struct { + RPIDHash []byte `json:"rpid"` + Flags AuthenticatorFlags `json:"flags"` + Counter uint32 `json:"sign_count"` + AttData AttestedCredentialData `json:"att_data"` + ExtData []byte `json:"ext_data"` +} + +type AttestationObject struct { + // The authenticator data, including the newly created public key. See AuthenticatorData for more info + AuthData AuthenticatorData + + // The byteform version of the authenticator data, used in part for signature validation + RawAuthData []byte `json:"authData"` + + // The format of the Attestation data. + Format string `json:"fmt"` + + // The attestation statement data sent back if attestation is requested. + AttStatement map[string]any `json:"attStmt,omitempty"` +} + +type URLEncodedBase64 []byte + +func (e URLEncodedBase64) String() string { + return base64.RawURLEncoding.EncodeToString(e) +} + +// UnmarshalJSON base64 decodes a URL-encoded value, storing the result in the +// provided byte slice. +func (e *URLEncodedBase64) UnmarshalJSON(data []byte) error { + if bytes.Equal(data, []byte("null")) { + return nil + } + + // Trim the leading spaces. + data = bytes.Trim(data, "\"") + + // Trim the trailing equal characters. + data = bytes.TrimRight(data, "=") + + out := make([]byte, base64.RawURLEncoding.DecodedLen(len(data))) + + n, err := base64.RawURLEncoding.Decode(out, data) + if err != nil { + return err + } + + v := reflect.ValueOf(e).Elem() + v.SetBytes(out[:n]) + + return nil +} + +// MarshalJSON base64 encodes a non URL-encoded value, storing the result in the +// provided byte slice. +func (e URLEncodedBase64) MarshalJSON() ([]byte, error) { + if e == nil { + return []byte("null"), nil + } + + return []byte(`"` + base64.RawURLEncoding.EncodeToString(e) + `"`), nil +} diff --git a/x/did/depinject.go b/x/did/depinject.go index 49c633393..5e523d471 100644 --- a/x/did/depinject.go +++ b/x/did/depinject.go @@ -3,22 +3,22 @@ package module import ( "os" - "github.com/cosmos/cosmos-sdk/codec" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" "cosmossdk.io/core/store" "cosmossdk.io/depinject" "cosmossdk.io/log" + nftkeeper "cosmossdk.io/x/nft/keeper" + "github.com/cosmos/cosmos-sdk/codec" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - modulev1 "github.com/onsonr/hway/api/did/module/v1" - "github.com/onsonr/hway/x/did/keeper" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + + modulev1 "github.com/onsonr/sonr/api/did/module/v1" + "github.com/onsonr/sonr/x/did/keeper" ) var _ appmodule.AppModule = AppModule{} @@ -44,6 +44,7 @@ type ModuleInputs struct { AddressCodec address.Codec AccountKeeper authkeeper.AccountKeeper + NFTKeeper nftkeeper.Keeper StakingKeeper stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper } @@ -58,8 +59,8 @@ type ModuleOutputs struct { func ProvideModule(in ModuleInputs) ModuleOutputs { govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() - k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper, log.NewLogger(os.Stderr), govAddr) - m := NewAppModule(in.Cdc, k) + k := keeper.NewKeeper(in.Cdc, in.StoreService, in.AccountKeeper, in.NFTKeeper, &in.StakingKeeper, log.NewLogger(os.Stderr), govAddr) + m := NewAppModule(in.Cdc, k, in.NFTKeeper) return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}} } diff --git a/x/did/keeper/context.go b/x/did/keeper/context.go new file mode 100644 index 000000000..07bc22f72 --- /dev/null +++ b/x/did/keeper/context.go @@ -0,0 +1,60 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/onsonr/sonr/x/did/builder" + "github.com/onsonr/sonr/x/did/types" + "google.golang.org/grpc/peer" +) + +type Context struct { + SDKCtx sdk.Context + Keeper Keeper + Peer *peer.Peer +} + +func (k Keeper) CurrentCtx(goCtx context.Context) Context { + ctx := sdk.UnwrapSDKContext(goCtx) + peer, _ := peer.FromContext(goCtx) + return Context{SDKCtx: ctx, Peer: peer, Keeper: k} +} + +func (c Context) Params() *types.Params { + return c.Keeper.GetParams(c.SDK()) +} + +func (c Context) SDK() sdk.Context { + return c.SDKCtx +} + +func (c Context) IsAnonymous() bool { + if c.Peer == nil { + return true + } + return c.Peer.Addr == nil +} + +func (c Context) PeerID() string { + if c.Peer == nil { + return "" + } + return c.Peer.Addr.String() +} + +func (c Context) GetService(origin string) (*types.Service, error) { + rec, err := c.Keeper.OrmDB.ServiceRecordTable().GetByOrigin(c.SDK(), origin) + if err != nil { + return nil, err + } + return builder.ModuleFormatAPIServiceRecord(rec), nil +} + +func (c Context) GetServiceInfo(origin string) *types.ServiceInfo { + rec, _ := c.GetService(origin) + if rec == nil { + return &types.ServiceInfo{Exists: false, Origin: origin, Fingerprint: types.ComputeOriginTXTRecord(origin)} + } + return &types.ServiceInfo{Exists: true, Origin: origin, Fingerprint: types.ComputeOriginTXTRecord(origin), Service: rec} +} diff --git a/x/did/keeper/genesis.go b/x/did/keeper/genesis.go index 4259878eb..381f971e5 100644 --- a/x/did/keeper/genesis.go +++ b/x/did/keeper/genesis.go @@ -2,9 +2,12 @@ package keeper import ( "context" + "time" "cosmossdk.io/log" - "github.com/onsonr/hway/x/did/types" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/onsonr/sonr/x/did/types" ) // Logger returns the logger @@ -35,3 +38,39 @@ func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState { Params: params, } } + +// CheckValidatorExists checks if a validator exists +func (k Keeper) CheckValidatorExists(ctx sdk.Context, addr string) bool { + address, err := sdk.ValAddressFromBech32(addr) + if err != nil { + return false + } + ok, err := k.StakingKeeper.Validator(ctx, address) + if err != nil { + return false + } + if ok != nil { + return true + } + return false +} + +// GetAverageBlockTime returns the average block time in seconds +func (k Keeper) GetAverageBlockTime(ctx sdk.Context) float64 { + return float64(ctx.BlockTime().Sub(ctx.BlockTime()).Seconds()) +} + +// GetParams returns the module parameters. +func (k Keeper) GetParams(ctx sdk.Context) *types.Params { + p, err := k.Params.Get(ctx) + if err != nil { + p = types.DefaultParams() + } + params := p.ActiveParams(k.HasIPFSConnection()) + return ¶ms +} + +// GetExpirationBlockHeight returns the block height at which the given duration will have passed +func (k Keeper) GetExpirationBlockHeight(ctx sdk.Context, duration time.Duration) int64 { + return ctx.BlockHeight() + int64(duration.Seconds()/k.GetAverageBlockTime(ctx)) +} diff --git a/x/did/keeper/genesis_test.go b/x/did/keeper/genesis_test.go index 806c86474..e92aaf280 100644 --- a/x/did/keeper/genesis_test.go +++ b/x/did/keeper/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onsonr/hway/x/did/types" + "github.com/onsonr/sonr/x/did/types" ) func TestGenesis(t *testing.T) { @@ -20,7 +20,6 @@ func TestGenesis(t *testing.T) { err := f.k.InitGenesis(f.ctx, genesisState) require.NoError(t, err) - got := f.k.ExportGenesis(f.ctx) require.NotNil(t, got) diff --git a/x/did/keeper/ipfs.go b/x/did/keeper/ipfs.go new file mode 100644 index 000000000..c02b39dea --- /dev/null +++ b/x/did/keeper/ipfs.go @@ -0,0 +1,106 @@ +package keeper + +import ( + "context" + "fmt" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ipfs/boxo/files" + "github.com/ipfs/boxo/path" + "github.com/ipfs/kubo/client/rpc" + "github.com/ipfs/kubo/core/coreiface/options" + "github.com/onsonr/sonr/internal/vfs" +) + +// assembleInitialVault assembles the initial vault +func (k Keeper) assembleInitialVault(ctx sdk.Context) (string, int64, error) { + cid, err := k.ipfsClient.Unixfs().Add(context.Background(), vfs.AssembleDirectory()) + if err != nil { + return "", 0, err + } + return cid.String(), k.GetExpirationBlockHeight(ctx, time.Second*15), nil +} + +// pinInitialVault pins the initial vault to the local IPFS node +func (k Keeper) pinInitialVault(_ sdk.Context, cid string, address string) (bool, error) { + // Resolve the path + path, err := path.NewPath(cid) + if err != nil { + return false, err + } + + // 1. Initialize vault.db sqlite database in local IPFS with Mount + + // 2. Insert the InitialWalletAccounts + + // 3. Publish the path to the IPNS + _, err = k.ipfsClient.Name().Publish(context.Background(), path, options.Name.Key(address)) + if err != nil { + return false, err + } + + // 4. Insert the accounts into x/auth + + // 5. Insert the controller into state + return true, nil +} + +// GetFromIPFS gets a file from the local IPFS node +func (k Keeper) GetFromIPFS(ctx sdk.Context, cid string) (files.Directory, error) { + path, err := path.NewPath(cid) + if err != nil { + return nil, err + } + node, err := k.ipfsClient.Unixfs().Get(ctx, path) + if err != nil { + return nil, err + } + dir, ok := node.(files.Directory) + if !ok { + return nil, fmt.Errorf("retrieved node is not a directory") + } + return dir, nil +} + +// HasIPFSConnection returns true if the IPFS client is initialized +func (k *Keeper) HasIPFSConnection() bool { + if k.ipfsClient == nil { + ipfsClient, err := rpc.NewLocalApi() + if err != nil { + return false + } + k.ipfsClient = ipfsClient + } + return k.ipfsClient != nil +} + +// HasPathInIPFS checks if a file is in the local IPFS node +func (k Keeper) HasPathInIPFS(ctx sdk.Context, cid string) (bool, error) { + path, err := path.NewPath(cid) + if err != nil { + return false, err + } + v, err := k.ipfsClient.Unixfs().Get(ctx, path) + if err != nil { + return false, err + } + + if v == nil { + return false, nil + } + return true, nil +} + +// PinToIPFS pins a file to the local IPFS node +func (k Keeper) PinToIPFS(ctx sdk.Context, cid string, name string) error { + path, err := path.NewPath(cid) + if err != nil { + return err + } + err = k.ipfsClient.Pin().Add(ctx, path, options.Pin.Name(name)) + if err != nil { + return err + } + return nil +} diff --git a/x/did/keeper/keeper.go b/x/did/keeper/keeper.go index 96989763d..8ca420cb8 100644 --- a/x/did/keeper/keeper.go +++ b/x/did/keeper/keeper.go @@ -5,13 +5,18 @@ import ( storetypes "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/orm/model/ormdb" + nftkeeper "cosmossdk.io/x/nft/keeper" "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - apiv1 "github.com/onsonr/hway/api/did/v1" - "github.com/onsonr/hway/x/did/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + stakkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/ipfs/kubo/client/rpc" + + apiv1 "github.com/onsonr/sonr/api/did/v1" + "github.com/onsonr/sonr/x/did/types" ) // Keeper defines the middleware keeper. @@ -26,18 +31,32 @@ type Keeper struct { Schema collections.Schema AccountKeeper authkeeper.AccountKeeper + NftKeeper nftkeeper.Keeper + StakingKeeper *stakkeeper.Keeper - authority string + authority string + ipfsClient *rpc.HttpApi } // NewKeeper creates a new poa Keeper instance -func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, accKeeper authkeeper.AccountKeeper, logger log.Logger, authority string) Keeper { +func NewKeeper( + cdc codec.BinaryCodec, + storeService storetypes.KVStoreService, + accKeeper authkeeper.AccountKeeper, + nftKeeper nftkeeper.Keeper, + stkKeeper *stakkeeper.Keeper, + 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}) + db, err := ormdb.NewModuleDB( + &types.ORMModuleSchema, + ormdb.ModuleDBOptions{KVStoreService: storeService}, + ) if err != nil { panic(err) } @@ -45,13 +64,24 @@ func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, ac if err != nil { panic(err) } + + // Initialize IPFS client + ipfsClient, _ := rpc.NewLocalApi() k := Keeper{ - cdc: cdc, - logger: logger, - Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), + ipfsClient: ipfsClient, + cdc: cdc, + logger: logger, + Params: collections.NewItem( + sb, + types.ParamsKey, + "params", + codec.CollValue[types.Params](cdc), + ), authority: authority, OrmDB: store, AccountKeeper: accKeeper, + NftKeeper: nftKeeper, + StakingKeeper: stkKeeper, } schema, err := sb.Build() if err != nil { @@ -61,3 +91,51 @@ func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, ac k.Schema = schema return k } + +// IsClaimedServiceOrigin checks if a service origin is unclaimed +func (k Keeper) IsUnclaimedServiceOrigin(ctx sdk.Context, origin string) bool { + rec, _ := k.OrmDB.ServiceRecordTable().GetByOrigin(ctx, origin) + return rec == nil +} + +// IsValidServiceOrigin checks if a service origin is valid +func (k Keeper) IsValidServiceOrigin(ctx sdk.Context, origin string) bool { + rec, err := k.OrmDB.ServiceRecordTable().GetByOrigin(ctx, origin) + if err != nil { + return false + } + if rec == nil { + return false + } + return true +} + +// VerifyMinimumStake checks if a validator has a minimum stake +func (k Keeper) VerifyMinimumStake(ctx sdk.Context, addr string) bool { + address, err := sdk.AccAddressFromBech32(addr) + if err != nil { + return false + } + addval, err := sdk.ValAddressFromBech32(addr) + if err != nil { + return false + } + del, err := k.StakingKeeper.GetDelegation(ctx, address, addval) + if err != nil { + return false + } + if del.Shares.IsZero() { + return false + } + return del.Shares.IsPositive() +} + +// VerifyServicePermissions checks if a service has permission +func (k Keeper) VerifyServicePermissions( + ctx sdk.Context, + addr string, + service string, + permissions string, +) bool { + return false +} diff --git a/x/did/keeper/keeper_test.go b/x/did/keeper/keeper_test.go index 60f152f6c..79a46262c 100644 --- a/x/did/keeper/keeper_test.go +++ b/x/did/keeper/keeper_test.go @@ -3,12 +3,10 @@ package keeper_test import ( "testing" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - + "cosmossdk.io/core/store" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" - + nftkeeper "cosmossdk.io/x/nft/keeper" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -23,13 +21,13 @@ import ( 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" - - "cosmossdk.io/core/store" - - module "github.com/onsonr/hway/x/did" - "github.com/onsonr/hway/x/did/keeper" - "github.com/onsonr/hway/x/did/types" "github.com/strangelove-ventures/poa" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + module "github.com/onsonr/sonr/x/did" + "github.com/onsonr/sonr/x/did/keeper" + "github.com/onsonr/sonr/x/did/types" ) var maccPerms = map[string][]string{ @@ -51,6 +49,7 @@ type testFixture struct { accountkeeper authkeeper.AccountKeeper bankkeeper bankkeeper.BaseKeeper + nftKeeper nftkeeper.Keeper stakingKeeper *stakingkeeper.Keeper mintkeeper mintkeeper.Keeper @@ -80,10 +79,10 @@ func SetupTest(t *testing.T) *testFixture { registerBaseSDKModules(f, encCfg, storeService, logger, require) // Setup POA Keeper. - f.k = keeper.NewKeeper(encCfg.Codec, storeService, f.accountkeeper, logger, f.govModAddr) + f.k = keeper.NewKeeper(encCfg.Codec, storeService, f.accountkeeper, f.nftKeeper, f.stakingKeeper, logger, f.govModAddr) f.msgServer = keeper.NewMsgServerImpl(f.k) f.queryServer = keeper.NewQuerier(f.k) - f.appModule = module.NewAppModule(encCfg.Codec, f.k) + f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.nftKeeper) return f } diff --git a/x/did/keeper/querier.go b/x/did/keeper/querier.go index 9833169ce..243910c13 100644 --- a/x/did/keeper/querier.go +++ b/x/did/keeper/querier.go @@ -3,10 +3,7 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" - - // "github.com/onsonr/hway/internal/local" - "github.com/onsonr/hway/x/did/types" + "github.com/onsonr/sonr/x/did/types" ) var _ types.QueryServer = Querier{} @@ -20,17 +17,65 @@ func NewQuerier(keeper Keeper) Querier { } // Params returns the total set of did parameters. -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 +func (k Querier) Params( + goCtx context.Context, + req *types.QueryRequest, +) (*types.QueryParamsResponse, error) { + ctx := k.CurrentCtx(goCtx) + return &types.QueryParamsResponse{Params: k.GetParams(ctx.SDK())}, nil } +// Resolve implements types.QueryServer. +func (k Querier) Resolve( + goCtx context.Context, + req *types.QueryRequest, +) (*types.QueryResponse, error) { + ctx := k.CurrentCtx(goCtx) + return &types.QueryResponse{Params: k.GetParams(ctx.SDK())}, nil +} + +// Service implements types.QueryServer. +func (k Querier) Service( + goCtx context.Context, + req *types.QueryRequest, +) (*types.QueryResponse, error) { + ctx := k.CurrentCtx(goCtx) + return &types.QueryResponse{Service: ctx.GetServiceInfo(req.GetOrigin()), Params: ctx.Params()}, nil +} + +// ParamsAssets implements types.QueryServer. +func (k Querier) ParamsAssets(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("ParamsAssets is unimplemented") + return &types.QueryResponse{}, nil +} + +// ParamsByAsset implements types.QueryServer. +func (k Querier) ParamsByAsset(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("ParamsByAsset is unimplemented") + return &types.QueryResponse{}, nil +} + +// ParamsKeys implements types.QueryServer. +func (k Querier) ParamsKeys(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("ParamsKeys is unimplemented") + return &types.QueryResponse{}, nil +} + +// ParamsByKey implements types.QueryServer. +func (k Querier) ParamsByKey(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("ParamsByKey is unimplemented") + return &types.QueryResponse{}, nil +} + +// RegistrationOptionsByKey implements types.QueryServer. +func (k Querier) RegistrationOptionsByKey(goCtx context.Context, req *types.QueryRequest) (*types.QueryResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + panic("RegistrationOptionsByKey is unimplemented") + return &types.QueryResponse{}, nil // Accounts implements types.QueryServer. func (k Querier) Accounts(goCtx context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error) { // ctx := sdk.UnwrapSDKContext(goCtx) diff --git a/x/did/keeper/server.go b/x/did/keeper/server.go index 9538e3013..7d5e70b36 100644 --- a/x/did/keeper/server.go +++ b/x/did/keeper/server.go @@ -2,6 +2,14 @@ package keeper import ( "context" + "encoding/json" + + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + "github.com/onsonr/sonr/x/did/builder" + "github.com/onsonr/sonr/x/did/types" sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -22,12 +30,107 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{k: keeper} } -// UpdateParams updates the x/did module parameters. -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) +// # AuthorizeService +// +// AuthorizeService implements types.MsgServer. +func (ms msgServer) AuthorizeService(goCtx context.Context, msg *types.MsgAuthorizeService) (*types.MsgAuthorizeServiceResponse, error) { + if ms.k.authority != msg.Controller { + return nil, errors.Wrapf( + govtypes.ErrInvalidSigner, + "invalid authority; expected %s, got %s", + ms.k.authority, + msg.Controller, + ) + } + return &types.MsgAuthorizeServiceResponse{}, nil +} + +// # AllocateVault +// +// AllocateVault implements types.MsgServer. +func (ms msgServer) AllocateVault( + goCtx context.Context, + msg *types.MsgAllocateVault, +) (*types.MsgAllocateVaultResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // 1.Check if the service origin is valid + if ms.k.IsValidServiceOrigin(ctx, msg.Origin) { + return nil, types.ErrInvalidServiceOrigin } + cid, expiryBlock, err := ms.k.assembleInitialVault(ctx) + if err != nil { + return nil, err + } + + regOpts, err := builder.GetPublicKeyCredentialCreationOptions(msg.Origin, msg.Subject, cid, ms.k.GetParams(ctx)) + if err != nil { + return nil, err + } + + // Convert to string + regOptsJSON, err := json.Marshal(regOpts) + if err != nil { + return nil, err + } + + return &types.MsgAllocateVaultResponse{ + ExpiryBlock: expiryBlock, + Cid: cid, + RegistrationOptions: string(regOptsJSON), + }, nil +} + +// # RegisterController +// +// RegisterController implements types.MsgServer. +func (ms msgServer) RegisterController( + goCtx context.Context, + msg *types.MsgRegisterController, +) (*types.MsgRegisterControllerResponse, error) { + _ = sdk.UnwrapSDKContext(goCtx) + return &types.MsgRegisterControllerResponse{}, nil +} + +// # RegisterService +// +// RegisterService implements types.MsgServer. +func (ms msgServer) RegisterService( + goCtx context.Context, + msg *types.MsgRegisterService, +) (*types.MsgRegisterServiceResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // 1.Check if the service origin is valid + if !ms.k.IsValidServiceOrigin(ctx, msg.Service.Origin) { + return nil, types.ErrInvalidServiceOrigin + } + return ms.k.insertService(ctx, msg.Service) +} + +// # SyncController +// +// SyncController implements types.MsgServer. +func (ms msgServer) SyncController(ctx context.Context, msg *types.MsgSyncController) (*types.MsgSyncControllerResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + return &types.MsgSyncControllerResponse{}, nil +} + +// # UpdateParams +// +// UpdateParams updates the x/did module parameters. +func (ms msgServer) UpdateParams( + ctx context.Context, + 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/did/keeper/server_test.go b/x/did/keeper/server_test.go deleted file mode 100644 index f403f0cb5..000000000 --- a/x/did/keeper/server_test.go +++ /dev/null @@ -1,55 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/onsonr/hway/x/did/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/did/keeper/state.go b/x/did/keeper/state.go index b64f6c9e5..f8d8ac04b 100644 --- a/x/did/keeper/state.go +++ b/x/did/keeper/state.go @@ -1,5 +1,26 @@ package keeper +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/onsonr/sonr/x/did/builder" + "github.com/onsonr/sonr/x/did/types" +) + +// insertService inserts a service record into the database +func (k Keeper) insertService( + ctx sdk.Context, + svc *types.Service, +) (*types.MsgRegisterServiceResponse, error) { + record := builder.APIFormatServiceRecord(svc) + err := k.OrmDB.ServiceRecordTable().Insert(ctx, record) + if err != nil { + return nil, err + } + return &types.MsgRegisterServiceResponse{ + Success: true, + Did: record.Id, + }, nil func (k Keeper) insertAliasFromDisplayName() { } diff --git a/x/did/module.go b/x/did/module.go index fbde2aad2..8592126a1 100644 --- a/x/did/module.go +++ b/x/did/module.go @@ -4,13 +4,14 @@ import ( "context" "encoding/json" - "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" abci "github.com/cometbft/cometbft/abci/types" "cosmossdk.io/client/v2/autocli" errorsmod "cosmossdk.io/errors" + "cosmossdk.io/x/nft" + nftkeeper "cosmossdk.io/x/nft/keeper" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -18,23 +19,21 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/onsonr/hway/x/did/keeper" - "github.com/onsonr/hway/x/did/types" + "github.com/onsonr/sonr/x/did/keeper" + "github.com/onsonr/sonr/x/did/types" // this line is used by starport scaffolding # 1 ) const ( - // ConsensusVersion defines the current x/did module consensus version. ConsensusVersion = 1 // this line is used by starport scaffolding # simapp/module/const ) var ( - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleGenesis = AppModule{} - _ module.AppModule = AppModule{} - + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleGenesis = AppModule{} + _ module.AppModule = AppModule{} _ autocli.HasAutoCLIConfig = AppModule{} ) @@ -46,17 +45,20 @@ type AppModuleBasic struct { type AppModule struct { AppModuleBasic - keeper keeper.Keeper + keeper keeper.Keeper + nftKeeper nftkeeper.Keeper } // NewAppModule constructor func NewAppModule( cdc codec.Codec, keeper keeper.Keeper, + nftKeeper nftkeeper.Keeper, ) *AppModule { return &AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc}, keeper: keeper, + nftKeeper: nftKeeper, } } @@ -66,7 +68,8 @@ func (a AppModuleBasic) Name() string { func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { return cdc.MustMarshalJSON(&types.GenesisState{ - Params: types.DefaultParams(), + GlobalIntegrity: types.DefaultGlobalIntegrity(), + Params: types.DefaultParams(), }) } @@ -82,28 +85,13 @@ func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEn return nil } -func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { -} - func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) if err != nil { - // same behavior as in cosmos-sdk panic(err) } } -// Disable in favor of autocli.go. If you wish to use these, it will override AutoCLI methods. -/* -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() -} - -func (a AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} -*/ - func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { types.RegisterLegacyAminoCodec(cdc) } @@ -113,11 +101,15 @@ func (a AppModuleBasic) RegisterInterfaces(r codectypes.InterfaceRegistry) { } func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate { - genesisState := types.DefaultGenesis() - if err := a.keeper.Params.Set(ctx, genesisState.Params); err != nil { + didGenesisState := types.DefaultGenesis() + if err := a.keeper.Params.Set(ctx, didGenesisState.Params); err != nil { panic(err) } - + nftGenesisState := nft.DefaultGenesisState() + if err := types.DefaultNFTClasses(nftGenesisState); err != nil { + panic(err) + } + a.nftKeeper.InitGenesis(ctx, nftGenesisState) return nil } diff --git a/x/did/types/accounts.pb.go b/x/did/types/accounts.pb.go index bdef8a1e6..4b9328774 100644 --- a/x/did/types/accounts.pb.go +++ b/x/did/types/accounts.pb.go @@ -6,6 +6,9 @@ package types import ( fmt "fmt" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" math "math" ) @@ -20,6 +23,602 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type BtcAccount struct { +} + +func (m *BtcAccount) Reset() { *m = BtcAccount{} } +func (m *BtcAccount) String() string { return proto.CompactTextString(m) } +func (*BtcAccount) ProtoMessage() {} +func (*BtcAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_2125a09fb14c3bc3, []int{0} +} +func (m *BtcAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BtcAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BtcAccount.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 *BtcAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_BtcAccount.Merge(m, src) +} +func (m *BtcAccount) XXX_Size() int { + return m.Size() +} +func (m *BtcAccount) XXX_DiscardUnknown() { + xxx_messageInfo_BtcAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_BtcAccount proto.InternalMessageInfo + +type EthAccount struct { +} + +func (m *EthAccount) Reset() { *m = EthAccount{} } +func (m *EthAccount) String() string { return proto.CompactTextString(m) } +func (*EthAccount) ProtoMessage() {} +func (*EthAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_2125a09fb14c3bc3, []int{1} +} +func (m *EthAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EthAccount.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 *EthAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_EthAccount.Merge(m, src) +} +func (m *EthAccount) XXX_Size() int { + return m.Size() +} +func (m *EthAccount) XXX_DiscardUnknown() { + xxx_messageInfo_EthAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_EthAccount proto.InternalMessageInfo + +type IBCAccount struct { +} + +func (m *IBCAccount) Reset() { *m = IBCAccount{} } +func (m *IBCAccount) String() string { return proto.CompactTextString(m) } +func (*IBCAccount) ProtoMessage() {} +func (*IBCAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_2125a09fb14c3bc3, []int{2} +} +func (m *IBCAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IBCAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IBCAccount.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 *IBCAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_IBCAccount.Merge(m, src) +} +func (m *IBCAccount) XXX_Size() int { + return m.Size() +} +func (m *IBCAccount) XXX_DiscardUnknown() { + xxx_messageInfo_IBCAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_IBCAccount proto.InternalMessageInfo + +type SnrAccount struct { +} + +func (m *SnrAccount) Reset() { *m = SnrAccount{} } +func (m *SnrAccount) String() string { return proto.CompactTextString(m) } +func (*SnrAccount) ProtoMessage() {} +func (*SnrAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_2125a09fb14c3bc3, []int{3} +} +func (m *SnrAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnrAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnrAccount.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 *SnrAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnrAccount.Merge(m, src) +} +func (m *SnrAccount) XXX_Size() int { + return m.Size() +} +func (m *SnrAccount) XXX_DiscardUnknown() { + xxx_messageInfo_SnrAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_SnrAccount proto.InternalMessageInfo + +func init() { + proto.RegisterType((*BtcAccount)(nil), "did.v1.BtcAccount") + proto.RegisterType((*EthAccount)(nil), "did.v1.EthAccount") + proto.RegisterType((*IBCAccount)(nil), "did.v1.IBCAccount") + proto.RegisterType((*SnrAccount)(nil), "did.v1.SnrAccount") +} + +func init() { proto.RegisterFile("did/v1/accounts.proto", fileDescriptor_2125a09fb14c3bc3) } + +var fileDescriptor_2125a09fb14c3bc3 = []byte{ + // 145 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4d, 0xc9, 0x4c, 0xd1, + 0x2f, 0x33, 0xd4, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x62, 0x4b, 0xc9, 0x4c, 0xd1, 0x2b, 0x33, 0x54, 0xe2, 0xe1, 0xe2, 0x72, 0x2a, 0x49, + 0x76, 0x84, 0x48, 0x82, 0x78, 0xae, 0x25, 0x19, 0x48, 0x3c, 0x4f, 0x27, 0x67, 0x24, 0x5e, 0x70, + 0x5e, 0x11, 0x94, 0xe7, 0x64, 0x73, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, + 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, + 0x4a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xf9, 0x79, 0xc5, 0xf9, + 0x79, 0x45, 0xfa, 0x60, 0xa2, 0x42, 0x1f, 0xe4, 0x92, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, + 0xb0, 0x23, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x82, 0x7e, 0x89, 0x0a, 0x9d, 0x00, 0x00, + 0x00, +} + +func (m *BtcAccount) 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 *BtcAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BtcAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *EthAccount) 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 *EthAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *IBCAccount) 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 *IBCAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IBCAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *SnrAccount) 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 *SnrAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnrAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintAccounts(dAtA []byte, offset int, v uint64) int { + offset -= sovAccounts(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BtcAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *EthAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *IBCAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *SnrAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovAccounts(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAccounts(x uint64) (n int) { + return sovAccounts(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BtcAccount) 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 ErrIntOverflowAccounts + } + 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: BtcAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BtcAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipAccounts(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccounts + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EthAccount) 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 ErrIntOverflowAccounts + } + 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: EthAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EthAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipAccounts(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccounts + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IBCAccount) 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 ErrIntOverflowAccounts + } + 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: IBCAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IBCAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipAccounts(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccounts + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnrAccount) 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 ErrIntOverflowAccounts + } + 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: SnrAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnrAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipAccounts(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccounts + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAccounts(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, ErrIntOverflowAccounts + } + 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, ErrIntOverflowAccounts + } + 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, ErrIntOverflowAccounts + } + 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, ErrInvalidLengthAccounts + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAccounts + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAccounts + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAccounts = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAccounts = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAccounts = fmt.Errorf("proto: unexpected end of group") +) func init() { proto.RegisterFile("did/v1/accounts.proto", fileDescriptor_2125a09fb14c3bc3) } var fileDescriptor_2125a09fb14c3bc3 = []byte{ diff --git a/x/did/types/codec.go b/x/did/types/codec.go index 4e875afeb..b985400f8 100644 --- a/x/did/types/codec.go +++ b/x/did/types/codec.go @@ -1,11 +1,25 @@ package types import ( + "crypto/ecdsa" + "crypto/sha256" + "encoding/hex" + "strings" + + fmt "fmt" + + ethcrypto "github.com/ethereum/go-ethereum/crypto" + "golang.org/x/crypto/sha3" + + "github.com/cosmos/btcutil/bech32" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" + "github.com/mr-tron/base58/base58" + "github.com/onsonr/crypto" // this line is used by starport scaffolding # 1 ) @@ -26,16 +40,198 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { } func RegisterInterfaces(registry types.InterfaceRegistry) { - //registry.RegisterImplementations( - //(*cryptotypes.PubKey)(nil), - // &PublicKey{}, - //) + registry.RegisterImplementations( + (*cryptotypes.PubKey)(nil), + &PubKey{}, + ) registry.RegisterImplementations( (*sdk.Msg)(nil), &MsgUpdateParams{}, &MsgRegisterController{}, &MsgRegisterService{}, + &MsgAllocateVault{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } + +type ChainCode uint32 + +const ( + ChainCodeBTC ChainCode = 0 + ChainCodeETH ChainCode = 60 + ChainCodeIBC ChainCode = 118 + ChainCodeSNR ChainCode = 703 +) + +var InitialChainCodes = map[DIDNamespace]ChainCode{ + DIDNamespace_DID_NAMESPACE_BITCOIN: ChainCodeBTC, + DIDNamespace_DID_NAMESPACE_IBC: ChainCodeIBC, + DIDNamespace_DID_NAMESPACE_ETHEREUM: ChainCodeETH, + DIDNamespace_DID_NAMESPACE_SONR: ChainCodeSNR, +} + +func (c ChainCode) FormatAddress(pubKey *PubKey) (string, error) { + switch c { + case ChainCodeBTC: + return bech32.Encode("bc", pubKey.Bytes()) + + case ChainCodeETH: + epk, err := pubKey.ECDSA() + if err != nil { + return "", err + } + return ComputeEthAddress(*epk), nil + + case ChainCodeSNR: + return bech32.Encode("idx", pubKey.Bytes()) + + case ChainCodeIBC: + return bech32.Encode("cosmos", pubKey.Bytes()) + + } + return "", ErrUnsopportedChainCode +} + +func (n DIDNamespace) ChainCode() (uint32, error) { + switch n { + case DIDNamespace_DID_NAMESPACE_BITCOIN: + return 0, nil + case DIDNamespace_DID_NAMESPACE_ETHEREUM: + return 64, nil + case DIDNamespace_DID_NAMESPACE_IBC: + return 118, nil + case DIDNamespace_DID_NAMESPACE_SONR: + return 703, nil + default: + return 0, fmt.Errorf("unsupported chain") + } +} + +func (n DIDNamespace) DIDMethod() string { + switch n { + case DIDNamespace_DID_NAMESPACE_IPFS: + return "ipfs" + case DIDNamespace_DID_NAMESPACE_SONR: + return "sonr" + case DIDNamespace_DID_NAMESPACE_BITCOIN: + return "btcr" + case DIDNamespace_DID_NAMESPACE_ETHEREUM: + return "ethr" + case DIDNamespace_DID_NAMESPACE_IBC: + return "ibcr" + case DIDNamespace_DID_NAMESPACE_WEBAUTHN: + return "webauthn" + case DIDNamespace_DID_NAMESPACE_DWN: + return "motr" + case DIDNamespace_DID_NAMESPACE_SERVICE: + return "web" + default: + return "n/a" + } +} + +func (n DIDNamespace) FormatDID(subject string) string { + return fmt.Sprintf("%s:%s", n.DIDMethod(), subject) +} + +type EncodedKey []byte + +func (e KeyEncoding) EncodeRaw(data []byte) (EncodedKey, error) { + switch e { + case KeyEncoding_KEY_ENCODING_RAW: + return data, nil + case KeyEncoding_KEY_ENCODING_HEX: + return []byte(hex.EncodeToString(data)), nil + case KeyEncoding_KEY_ENCODING_MULTIBASE: + return []byte(base58.Encode(data)), nil + default: + return nil, nil + } +} + +func (e KeyEncoding) DecodeRaw(data EncodedKey) ([]byte, error) { + switch e { + case KeyEncoding_KEY_ENCODING_RAW: + return data, nil + case KeyEncoding_KEY_ENCODING_HEX: + return hex.DecodeString(string(data)) + case KeyEncoding_KEY_ENCODING_MULTIBASE: + return base58.Decode(string(data)) + default: + return nil, nil + } +} + +type COSEAlgorithmIdentifier int + +func (k KeyAlgorithm) CoseIdentifier() COSEAlgorithmIdentifier { + switch k { + case KeyAlgorithm_KEY_ALGORITHM_ES256: + return COSEAlgorithmIdentifier(-7) + case KeyAlgorithm_KEY_ALGORITHM_ES384: + return COSEAlgorithmIdentifier(-35) + case KeyAlgorithm_KEY_ALGORITHM_ES512: + return COSEAlgorithmIdentifier(-36) + case KeyAlgorithm_KEY_ALGORITHM_EDDSA: + return COSEAlgorithmIdentifier(-8) + case KeyAlgorithm_KEY_ALGORITHM_ES256K: + return COSEAlgorithmIdentifier(-10) + default: + return COSEAlgorithmIdentifier(0) + } +} + +func (k KeyCurve) ComputePublicKey(data []byte) (*PubKey, error) { + return nil, ErrUnsupportedKeyCurve +} + +func (k *Keyshare) Equals(o crypto.MPCShare) bool { + opk := o.GetPublicKey() + if opk != nil && k.PublicKey == nil { + return false + } + return k.GetRole() == o.GetRole() +} + +func (k *Keyshare) IsUser() bool { + return k.Role == 2 +} + +func (k *Keyshare) IsValidator() bool { + return k.Role == 1 +} + +// ComputeOriginTXTRecord generates a fingerprint for a given origin +func ComputeOriginTXTRecord(origin string) string { + h := sha256.New() + h.Write([]byte(origin)) + return fmt.Sprintf("v=sonr,o=%s,p=%x", origin, h.Sum(nil)) +} + +func ComputeEthAddress(pk ecdsa.PublicKey) string { + // Generate Ethereum address + address := ethcrypto.PubkeyToAddress(pk) + + // Apply ERC-55 checksum encoding + addr := address.Hex() + addr = strings.ToLower(addr) + addr = strings.TrimPrefix(addr, "0x") + hash := sha3.NewLegacyKeccak256() + hash.Write([]byte(addr)) + hashBytes := hash.Sum(nil) + + result := "0x" + for i, c := range addr { + if c >= '0' && c <= '9' { + result += string(c) + } else { + if hashBytes[i/2]>>(4-i%2*4)&0xf >= 8 { + result += strings.ToUpper(string(c)) + } else { + result += string(c) + } + } + } + return result +} diff --git a/pkg/coins/coins.go b/x/did/types/coins.go similarity index 54% rename from pkg/coins/coins.go rename to x/did/types/coins.go index 73edd38e3..f5e03ab09 100644 --- a/pkg/coins/coins.go +++ b/x/did/types/coins.go @@ -1,4 +1,4 @@ -package coins +package types // Coin represents a cryptocurrency type Coin interface { @@ -21,44 +21,6 @@ type Coin interface { GetName() string } -// DefaultCoins is a list of default coins used in the vault -var DefaultCoins = []Coin{ - CoinBTC, - CoinETH, - CoinSNR, -} - -var ( - // Bitcoin mainnet - CoinBTC = &coin{ - Name: "Bitcoin", - Index: 0, - Path: 0x80000000, - Symbol: "BTC", - Hrp: "bc", - Method: "btcr", - } - - // Ethereum - CoinETH = &coin{ - Name: "Ethereum", - Index: 60, - Path: 0x8000003c, - Symbol: "ETH", - Method: "ethr", - } - - // Sonr - CoinSNR = &coin{ - Name: "Sonr", - Index: 703, - Path: 0x800002bf, - Symbol: "SNR", - Hrp: "idx", - Method: "sonr", - } -) - // CoinBTCType is the coin type for BTC const CoinBTCType = int64(0) diff --git a/x/did/types/errors.go b/x/did/types/errors.go index 9a8789fce..76d33bbd6 100644 --- a/x/did/types/errors.go +++ b/x/did/types/errors.go @@ -7,9 +7,11 @@ var ( ErrInvalidETHAddressFormat = sdkerrors.Register(ModuleName, 200, "invalid ETH address format") ErrInvalidBTCAddressFormat = sdkerrors.Register(ModuleName, 201, "invalid BTC address format") ErrInvalidIDXAddressFormat = sdkerrors.Register(ModuleName, 202, "invalid IDX address format") - ErrInvalidEmailFormat = sdkerrors.Register(ModuleName, 203, "invalid email format") - ErrInvalidPhoneFormat = sdkerrors.Register(ModuleName, 204, "invalid phone format") - ErrMinimumAssertions = sdkerrors.Register(ModuleName, 300, "at least one assertion is required for account initialization") - ErrInvalidControllers = sdkerrors.Register(ModuleName, 301, "no more than one controller can be used for account initialization") - ErrMaximumAuthenticators = sdkerrors.Register(ModuleName, 302, "more authenticators provided than the total accepted count") + ErrInvalidOriginFormat = sdkerrors.Register(ModuleName, 203, "invalid origin format") + ErrInvalidServiceOrigin = sdkerrors.Register(ModuleName, 300, "invalid service origin") + ErrUnrecognizedService = sdkerrors.Register(ModuleName, 301, "unrecognized service") + ErrUnsupportedKeyEncoding = sdkerrors.Register(ModuleName, 400, "unsupported key encoding") + ErrUnsopportedChainCode = sdkerrors.Register(ModuleName, 401, "unsupported chain code") + ErrUnsupportedKeyCurve = sdkerrors.Register(ModuleName, 402, "unsupported key curve") + ErrInvalidSignature = sdkerrors.Register(ModuleName, 403, "invalid signature") ) diff --git a/x/did/types/genesis.go b/x/did/types/genesis.go index 27328baac..826dd9d4d 100644 --- a/x/did/types/genesis.go +++ b/x/did/types/genesis.go @@ -1,6 +1,31 @@ package types -import "encoding/json" +import ( + "encoding/json" + fmt "fmt" + + ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" + "cosmossdk.io/collections" + "cosmossdk.io/x/nft" +) + +// ParamsKey saves the current module params. +var ParamsKey = collections.NewPrefix(0) + +const ( + ModuleName = "did" + + StoreKey = ModuleName + + QuerierRoute = ModuleName +) + +var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{ + SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ + {Id: 1, ProtoFileName: "did/v1/state.proto"}, + }, + Prefix: []byte{0}, +} // this line is used by starport scaffolding # genesis/types/import @@ -11,7 +36,8 @@ const DefaultIndex uint64 = 1 func DefaultGenesis() *GenesisState { return &GenesisState{ // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), + GlobalIntegrity: DefaultGlobalIntegrity(), + Params: DefaultParams(), } } @@ -19,13 +45,151 @@ func DefaultGenesis() *GenesisState { // failure. func (gs GenesisState) Validate() error { // this line is used by starport scaffolding # genesis/types/validate - + if gs.GlobalIntegrity == nil { + return fmt.Errorf("global integrity proof is nil") + } return gs.Params.Validate() } +// DefaultNFTClasses configures the Initial DIDNamespace NFT classes +func DefaultNFTClasses(nftGenesis *nft.GenesisState) error { + for _, n := range DIDNamespace_value { + nftGenesis.Classes = append(nftGenesis.Classes, DIDNamespace(n).GetNFTClass()) + } + return nil +} + // DefaultParams returns default module parameters. func DefaultParams() Params { - return Params{} + return Params{ + WhitelistedAssets: DefaultAssets(), + AllowedPublicKeys: DefaultKeyInfos(), + LocalhostRegistrationEnabled: true, + ConveyancePreference: "direct", + AttestationFormats: []string{"packed", "android-key", "fido-u2f", "apple"}, + } +} + +// DefaultGlobalIntegrity returns the default global integrity proof +func DefaultGlobalIntegrity() *GlobalIntegrity { + return &GlobalIntegrity{ + Controller: "did:sonr:0x0", + Seed: DefaultSeedMessage(), + Accumulator: []byte{}, + Count: 0, + } +} + +// DefaultSeedMessage returns the default seed message +func DefaultSeedMessage() string { + l1 := "The Sonr Network shall make no protocol that respects the establishment of centralized authority," + l2 := "or prohibits the free exercise of decentralized identity; or abridges the freedom of data sovereignty," + l3 := "or of encrypted communication; or the right of the users to peaceally interact and transact," + l4 := "and to petition the Network for the redress of vulnerabilities." + return fmt.Sprintf("%s %s %s %s", l1, l2, l3, l4) +} + +// DefaultAssets returns the default asset infos: BTC, ETH, SNR, and USDC +func DefaultAssets() []*AssetInfo { + return []*AssetInfo{ + { + Name: "Bitcoin", + Symbol: "BTC", + Hrp: "bc", + Index: 0, + AssetType: AssetType_ASSET_TYPE_NATIVE, + IconUrl: "https://cdn.sonr.land/BTC.svg", + }, + { + Name: "Ethereum", + Symbol: "ETH", + Hrp: "eth", + Index: 64, + AssetType: AssetType_ASSET_TYPE_NATIVE, + IconUrl: "https://cdn.sonr.land/ETH.svg", + }, + { + Name: "Sonr", + Symbol: "SNR", + Hrp: "idx", + Index: 703, + AssetType: AssetType_ASSET_TYPE_NATIVE, + IconUrl: "https://cdn.sonr.land/SNR.svg", + }, + } +} + +// DefaultKeyInfos returns the default key infos: secp256k1, ed25519, keccak256, and bls12381. +func DefaultKeyInfos() map[string]*KeyInfo { + return map[string]*KeyInfo{ + // Identity Key Info + // Sonr Controller Key Info - From MPC + "auth.dwn": { + Role: KeyRole_KEY_ROLE_INVOCATION, + Curve: KeyCurve_KEY_CURVE_P256, + Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, + Encoding: KeyEncoding_KEY_ENCODING_HEX, + Type: KeyType_KEY_TYPE_MPC, + }, + + // Sonr Vault Shared Key Info - From Registration + "auth.zk": { + Role: KeyRole_KEY_ROLE_ASSERTION, + Curve: KeyCurve_KEY_CURVE_BLS12381, + Algorithm: KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED, + Encoding: KeyEncoding_KEY_ENCODING_MULTIBASE, + Type: KeyType_KEY_TYPE_ZK, + }, + + // Blockchain Key Info + // Ethereum Key Info + "auth.ethereum": { + Role: KeyRole_KEY_ROLE_DELEGATION, + Curve: KeyCurve_KEY_CURVE_KECCAK256, + Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, + Encoding: KeyEncoding_KEY_ENCODING_HEX, + Type: KeyType_KEY_TYPE_BIP32, + }, + // Bitcoin/IBC Key Info + "auth.bitcoin": { + Role: KeyRole_KEY_ROLE_DELEGATION, + Curve: KeyCurve_KEY_CURVE_SECP256K1, + Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, + Encoding: KeyEncoding_KEY_ENCODING_HEX, + Type: KeyType_KEY_TYPE_BIP32, + }, + + // Authentication Key Info + // Browser based WebAuthn + "webauthn.browser": { + Role: KeyRole_KEY_ROLE_AUTHENTICATION, + Curve: KeyCurve_KEY_CURVE_P256, + Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256, + Encoding: KeyEncoding_KEY_ENCODING_RAW, + Type: KeyType_KEY_TYPE_WEBAUTHN, + }, + // FIDO U2F + "webauthn.fido": { + Role: KeyRole_KEY_ROLE_AUTHENTICATION, + Curve: KeyCurve_KEY_CURVE_P256, + Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256, + Encoding: KeyEncoding_KEY_ENCODING_RAW, + Type: KeyType_KEY_TYPE_WEBAUTHN, + }, + // Cross-Platform Passkeys + "webauthn.passkey": { + Role: KeyRole_KEY_ROLE_AUTHENTICATION, + Curve: KeyCurve_KEY_CURVE_ED25519, + Algorithm: KeyAlgorithm_KEY_ALGORITHM_EDDSA, + Encoding: KeyEncoding_KEY_ENCODING_RAW, + Type: KeyType_KEY_TYPE_WEBAUTHN, + }, + } +} + +func (p Params) ActiveParams(ipfsActive bool) Params { + p.IpfsActive = ipfsActive + return p } // Stringer method for Params. @@ -43,3 +207,31 @@ func (p Params) Validate() error { // TODO: return nil } + +// +// # Genesis Structures +// + +// Equal returns true if two asset infos are equal +func (a *AssetInfo) Equal(b *AssetInfo) bool { + if a == nil && b == nil { + return true + } + return false +} + +// Equal returns true if two key infos are equal +func (k *KeyInfo) Equal(b *KeyInfo) bool { + if k == nil && b == nil { + return true + } + return false +} + +// Equal returns true if two validator infos are equal +func (v *ValidatorInfo) Equal(b *ValidatorInfo) bool { + if v == nil && b == nil { + return true + } + return false +} diff --git a/x/did/types/genesis.pb.go b/x/did/types/genesis.pb.go index 7dd981913..83c8c78ca 100644 --- a/x/did/types/genesis.pb.go +++ b/x/did/types/genesis.pb.go @@ -24,10 +24,401 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified +type AssetType int32 + +const ( + AssetType_ASSET_TYPE_UNSPECIFIED AssetType = 0 + AssetType_ASSET_TYPE_NATIVE AssetType = 1 + AssetType_ASSET_TYPE_WRAPPED AssetType = 2 + AssetType_ASSET_TYPE_STAKING AssetType = 3 + AssetType_ASSET_TYPE_POOL AssetType = 4 + AssetType_ASSET_TYPE_IBC AssetType = 5 + AssetType_ASSET_TYPE_CW20 AssetType = 6 +) + +var AssetType_name = map[int32]string{ + 0: "ASSET_TYPE_UNSPECIFIED", + 1: "ASSET_TYPE_NATIVE", + 2: "ASSET_TYPE_WRAPPED", + 3: "ASSET_TYPE_STAKING", + 4: "ASSET_TYPE_POOL", + 5: "ASSET_TYPE_IBC", + 6: "ASSET_TYPE_CW20", +} + +var AssetType_value = map[string]int32{ + "ASSET_TYPE_UNSPECIFIED": 0, + "ASSET_TYPE_NATIVE": 1, + "ASSET_TYPE_WRAPPED": 2, + "ASSET_TYPE_STAKING": 3, + "ASSET_TYPE_POOL": 4, + "ASSET_TYPE_IBC": 5, + "ASSET_TYPE_CW20": 6, +} + +func (x AssetType) String() string { + return proto.EnumName(AssetType_name, int32(x)) +} + +func (AssetType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{0} +} + +// DIDNamespace define the different namespaces of DID +type DIDNamespace int32 + +const ( + DIDNamespace_DID_NAMESPACE_UNSPECIFIED DIDNamespace = 0 + DIDNamespace_DID_NAMESPACE_IPFS DIDNamespace = 1 + DIDNamespace_DID_NAMESPACE_SONR DIDNamespace = 2 + DIDNamespace_DID_NAMESPACE_BITCOIN DIDNamespace = 3 + DIDNamespace_DID_NAMESPACE_ETHEREUM DIDNamespace = 4 + DIDNamespace_DID_NAMESPACE_IBC DIDNamespace = 5 + DIDNamespace_DID_NAMESPACE_WEBAUTHN DIDNamespace = 6 + DIDNamespace_DID_NAMESPACE_DWN DIDNamespace = 7 + DIDNamespace_DID_NAMESPACE_SERVICE DIDNamespace = 8 +) + +var DIDNamespace_name = map[int32]string{ + 0: "DID_NAMESPACE_UNSPECIFIED", + 1: "DID_NAMESPACE_IPFS", + 2: "DID_NAMESPACE_SONR", + 3: "DID_NAMESPACE_BITCOIN", + 4: "DID_NAMESPACE_ETHEREUM", + 5: "DID_NAMESPACE_IBC", + 6: "DID_NAMESPACE_WEBAUTHN", + 7: "DID_NAMESPACE_DWN", + 8: "DID_NAMESPACE_SERVICE", +} + +var DIDNamespace_value = map[string]int32{ + "DID_NAMESPACE_UNSPECIFIED": 0, + "DID_NAMESPACE_IPFS": 1, + "DID_NAMESPACE_SONR": 2, + "DID_NAMESPACE_BITCOIN": 3, + "DID_NAMESPACE_ETHEREUM": 4, + "DID_NAMESPACE_IBC": 5, + "DID_NAMESPACE_WEBAUTHN": 6, + "DID_NAMESPACE_DWN": 7, + "DID_NAMESPACE_SERVICE": 8, +} + +func (x DIDNamespace) String() string { + return proto.EnumName(DIDNamespace_name, int32(x)) +} + +func (DIDNamespace) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{1} +} + +// KeyAlgorithm defines the key algorithm +type KeyAlgorithm int32 + +const ( + KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED KeyAlgorithm = 0 + KeyAlgorithm_KEY_ALGORITHM_ES256 KeyAlgorithm = 1 + KeyAlgorithm_KEY_ALGORITHM_ES384 KeyAlgorithm = 2 + KeyAlgorithm_KEY_ALGORITHM_ES512 KeyAlgorithm = 3 + KeyAlgorithm_KEY_ALGORITHM_EDDSA KeyAlgorithm = 4 + KeyAlgorithm_KEY_ALGORITHM_ES256K KeyAlgorithm = 5 + KeyAlgorithm_KEY_ALGORITHM_ECDSA KeyAlgorithm = 6 +) + +var KeyAlgorithm_name = map[int32]string{ + 0: "KEY_ALGORITHM_UNSPECIFIED", + 1: "KEY_ALGORITHM_ES256", + 2: "KEY_ALGORITHM_ES384", + 3: "KEY_ALGORITHM_ES512", + 4: "KEY_ALGORITHM_EDDSA", + 5: "KEY_ALGORITHM_ES256K", + 6: "KEY_ALGORITHM_ECDSA", +} + +var KeyAlgorithm_value = map[string]int32{ + "KEY_ALGORITHM_UNSPECIFIED": 0, + "KEY_ALGORITHM_ES256": 1, + "KEY_ALGORITHM_ES384": 2, + "KEY_ALGORITHM_ES512": 3, + "KEY_ALGORITHM_EDDSA": 4, + "KEY_ALGORITHM_ES256K": 5, + "KEY_ALGORITHM_ECDSA": 6, +} + +func (x KeyAlgorithm) String() string { + return proto.EnumName(KeyAlgorithm_name, int32(x)) +} + +func (KeyAlgorithm) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{2} +} + +// KeyCurve defines the key curve +type KeyCurve int32 + +const ( + KeyCurve_KEY_CURVE_UNSPECIFIED KeyCurve = 0 + KeyCurve_KEY_CURVE_P256 KeyCurve = 1 + KeyCurve_KEY_CURVE_P384 KeyCurve = 2 + KeyCurve_KEY_CURVE_P521 KeyCurve = 3 + KeyCurve_KEY_CURVE_X25519 KeyCurve = 4 + KeyCurve_KEY_CURVE_X448 KeyCurve = 5 + KeyCurve_KEY_CURVE_ED25519 KeyCurve = 6 + KeyCurve_KEY_CURVE_ED448 KeyCurve = 7 + KeyCurve_KEY_CURVE_SECP256K1 KeyCurve = 8 + KeyCurve_KEY_CURVE_BLS12381 KeyCurve = 9 + KeyCurve_KEY_CURVE_KECCAK256 KeyCurve = 10 +) + +var KeyCurve_name = map[int32]string{ + 0: "KEY_CURVE_UNSPECIFIED", + 1: "KEY_CURVE_P256", + 2: "KEY_CURVE_P384", + 3: "KEY_CURVE_P521", + 4: "KEY_CURVE_X25519", + 5: "KEY_CURVE_X448", + 6: "KEY_CURVE_ED25519", + 7: "KEY_CURVE_ED448", + 8: "KEY_CURVE_SECP256K1", + 9: "KEY_CURVE_BLS12381", + 10: "KEY_CURVE_KECCAK256", +} + +var KeyCurve_value = map[string]int32{ + "KEY_CURVE_UNSPECIFIED": 0, + "KEY_CURVE_P256": 1, + "KEY_CURVE_P384": 2, + "KEY_CURVE_P521": 3, + "KEY_CURVE_X25519": 4, + "KEY_CURVE_X448": 5, + "KEY_CURVE_ED25519": 6, + "KEY_CURVE_ED448": 7, + "KEY_CURVE_SECP256K1": 8, + "KEY_CURVE_BLS12381": 9, + "KEY_CURVE_KECCAK256": 10, +} + +func (x KeyCurve) String() string { + return proto.EnumName(KeyCurve_name, int32(x)) +} + +func (KeyCurve) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{3} +} + +// KeyEncoding defines the key encoding +type KeyEncoding int32 + +const ( + KeyEncoding_KEY_ENCODING_UNSPECIFIED KeyEncoding = 0 + KeyEncoding_KEY_ENCODING_RAW KeyEncoding = 1 + KeyEncoding_KEY_ENCODING_HEX KeyEncoding = 2 + KeyEncoding_KEY_ENCODING_MULTIBASE KeyEncoding = 3 +) + +var KeyEncoding_name = map[int32]string{ + 0: "KEY_ENCODING_UNSPECIFIED", + 1: "KEY_ENCODING_RAW", + 2: "KEY_ENCODING_HEX", + 3: "KEY_ENCODING_MULTIBASE", +} + +var KeyEncoding_value = map[string]int32{ + "KEY_ENCODING_UNSPECIFIED": 0, + "KEY_ENCODING_RAW": 1, + "KEY_ENCODING_HEX": 2, + "KEY_ENCODING_MULTIBASE": 3, +} + +func (x KeyEncoding) String() string { + return proto.EnumName(KeyEncoding_name, int32(x)) +} + +func (KeyEncoding) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{4} +} + +// KeyRole defines the kind of key +type KeyRole int32 + +const ( + KeyRole_KEY_ROLE_UNSPECIFIED KeyRole = 0 + KeyRole_KEY_ROLE_AUTHENTICATION KeyRole = 1 + KeyRole_KEY_ROLE_ASSERTION KeyRole = 2 + KeyRole_KEY_ROLE_DELEGATION KeyRole = 3 + KeyRole_KEY_ROLE_INVOCATION KeyRole = 4 +) + +var KeyRole_name = map[int32]string{ + 0: "KEY_ROLE_UNSPECIFIED", + 1: "KEY_ROLE_AUTHENTICATION", + 2: "KEY_ROLE_ASSERTION", + 3: "KEY_ROLE_DELEGATION", + 4: "KEY_ROLE_INVOCATION", +} + +var KeyRole_value = map[string]int32{ + "KEY_ROLE_UNSPECIFIED": 0, + "KEY_ROLE_AUTHENTICATION": 1, + "KEY_ROLE_ASSERTION": 2, + "KEY_ROLE_DELEGATION": 3, + "KEY_ROLE_INVOCATION": 4, +} + +func (x KeyRole) String() string { + return proto.EnumName(KeyRole_name, int32(x)) +} + +func (KeyRole) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{5} +} + +// KeyType defines the key type +type KeyType int32 + +const ( + KeyType_KEY_TYPE_UNSPECIFIED KeyType = 0 + KeyType_KEY_TYPE_OCTET KeyType = 1 + KeyType_KEY_TYPE_ELLIPTIC KeyType = 2 + KeyType_KEY_TYPE_RSA KeyType = 3 + KeyType_KEY_TYPE_SYMMETRIC KeyType = 4 + KeyType_KEY_TYPE_HMAC KeyType = 5 + KeyType_KEY_TYPE_MPC KeyType = 6 + KeyType_KEY_TYPE_ZK KeyType = 7 + KeyType_KEY_TYPE_WEBAUTHN KeyType = 8 + KeyType_KEY_TYPE_BIP32 KeyType = 9 +) + +var KeyType_name = map[int32]string{ + 0: "KEY_TYPE_UNSPECIFIED", + 1: "KEY_TYPE_OCTET", + 2: "KEY_TYPE_ELLIPTIC", + 3: "KEY_TYPE_RSA", + 4: "KEY_TYPE_SYMMETRIC", + 5: "KEY_TYPE_HMAC", + 6: "KEY_TYPE_MPC", + 7: "KEY_TYPE_ZK", + 8: "KEY_TYPE_WEBAUTHN", + 9: "KEY_TYPE_BIP32", +} + +var KeyType_value = map[string]int32{ + "KEY_TYPE_UNSPECIFIED": 0, + "KEY_TYPE_OCTET": 1, + "KEY_TYPE_ELLIPTIC": 2, + "KEY_TYPE_RSA": 3, + "KEY_TYPE_SYMMETRIC": 4, + "KEY_TYPE_HMAC": 5, + "KEY_TYPE_MPC": 6, + "KEY_TYPE_ZK": 7, + "KEY_TYPE_WEBAUTHN": 8, + "KEY_TYPE_BIP32": 9, +} + +func (x KeyType) String() string { + return proto.EnumName(KeyType_name, int32(x)) +} + +func (KeyType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{6} +} + +type KeyshareRole int32 + +const ( + KeyshareRole_KEYSHARE_ROLE_UNSPECIFIED KeyshareRole = 0 + KeyshareRole_KEYSHARE_ROLE_USER KeyshareRole = 1 + KeyshareRole_KEYSHARE_ROLE_VALIDATOR KeyshareRole = 2 +) + +var KeyshareRole_name = map[int32]string{ + 0: "KEYSHARE_ROLE_UNSPECIFIED", + 1: "KEYSHARE_ROLE_USER", + 2: "KEYSHARE_ROLE_VALIDATOR", +} + +var KeyshareRole_value = map[string]int32{ + "KEYSHARE_ROLE_UNSPECIFIED": 0, + "KEYSHARE_ROLE_USER": 1, + "KEYSHARE_ROLE_VALIDATOR": 2, +} + +func (x KeyshareRole) String() string { + return proto.EnumName(KeyshareRole_name, int32(x)) +} + +func (KeyshareRole) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{7} +} + +// PermissionScope define the Capabilities Controllers can grant for Services +type PermissionScope int32 + +const ( + PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0 + PermissionScope_PERMISSION_SCOPE_BASIC_INFO PermissionScope = 1 + PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ PermissionScope = 2 + PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE PermissionScope = 3 + PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ PermissionScope = 4 + PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE PermissionScope = 5 + PermissionScope_PERMISSION_SCOPE_WALLETS_READ PermissionScope = 6 + PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE PermissionScope = 7 + PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE PermissionScope = 8 + PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE PermissionScope = 9 + PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY PermissionScope = 10 + PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST PermissionScope = 11 + PermissionScope_PERMISSION_SCOPE_ADMIN_USER PermissionScope = 12 + PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR PermissionScope = 13 +) + +var PermissionScope_name = map[int32]string{ + 0: "PERMISSION_SCOPE_UNSPECIFIED", + 1: "PERMISSION_SCOPE_BASIC_INFO", + 2: "PERMISSION_SCOPE_PERMISSIONS_READ", + 3: "PERMISSION_SCOPE_PERMISSIONS_WRITE", + 4: "PERMISSION_SCOPE_TRANSACTIONS_READ", + 5: "PERMISSION_SCOPE_TRANSACTIONS_WRITE", + 6: "PERMISSION_SCOPE_WALLETS_READ", + 7: "PERMISSION_SCOPE_WALLETS_CREATE", + 8: "PERMISSION_SCOPE_WALLETS_SUBSCRIBE", + 9: "PERMISSION_SCOPE_WALLETS_UPDATE", + 10: "PERMISSION_SCOPE_TRANSACTIONS_VERIFY", + 11: "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST", + 12: "PERMISSION_SCOPE_ADMIN_USER", + 13: "PERMISSION_SCOPE_ADMIN_VALIDATOR", +} + +var PermissionScope_value = map[string]int32{ + "PERMISSION_SCOPE_UNSPECIFIED": 0, + "PERMISSION_SCOPE_BASIC_INFO": 1, + "PERMISSION_SCOPE_PERMISSIONS_READ": 2, + "PERMISSION_SCOPE_PERMISSIONS_WRITE": 3, + "PERMISSION_SCOPE_TRANSACTIONS_READ": 4, + "PERMISSION_SCOPE_TRANSACTIONS_WRITE": 5, + "PERMISSION_SCOPE_WALLETS_READ": 6, + "PERMISSION_SCOPE_WALLETS_CREATE": 7, + "PERMISSION_SCOPE_WALLETS_SUBSCRIBE": 8, + "PERMISSION_SCOPE_WALLETS_UPDATE": 9, + "PERMISSION_SCOPE_TRANSACTIONS_VERIFY": 10, + "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": 11, + "PERMISSION_SCOPE_ADMIN_USER": 12, + "PERMISSION_SCOPE_ADMIN_VALIDATOR": 13, +} + +func (x PermissionScope) String() string { + return proto.EnumName(PermissionScope_name, int32(x)) +} + +func (PermissionScope) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{8} +} + // 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"` + // GlobalIntegrity defines a zkp integrity proof for the entire DID namespace + GlobalIntegrity *GlobalIntegrity `protobuf:"bytes,2,opt,name=global_integrity,json=globalIntegrity,proto3" json:"global_integrity,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -70,18 +461,102 @@ func (m *GenesisState) GetParams() Params { return Params{} } +func (m *GenesisState) GetGlobalIntegrity() *GlobalIntegrity { + if m != nil { + return m.GlobalIntegrity + } + return nil +} + +// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace +type GlobalIntegrity struct { + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + Seed string `protobuf:"bytes,2,opt,name=seed,proto3" json:"seed,omitempty"` + Accumulator []byte `protobuf:"bytes,3,opt,name=accumulator,proto3" json:"accumulator,omitempty"` + Count uint64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` +} + +func (m *GlobalIntegrity) Reset() { *m = GlobalIntegrity{} } +func (m *GlobalIntegrity) String() string { return proto.CompactTextString(m) } +func (*GlobalIntegrity) ProtoMessage() {} +func (*GlobalIntegrity) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{1} +} +func (m *GlobalIntegrity) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GlobalIntegrity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GlobalIntegrity.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GlobalIntegrity) XXX_Merge(src proto.Message) { + xxx_messageInfo_GlobalIntegrity.Merge(m, src) +} +func (m *GlobalIntegrity) XXX_Size() int { + return m.Size() +} +func (m *GlobalIntegrity) XXX_DiscardUnknown() { + xxx_messageInfo_GlobalIntegrity.DiscardUnknown(m) +} + +var xxx_messageInfo_GlobalIntegrity proto.InternalMessageInfo + +func (m *GlobalIntegrity) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *GlobalIntegrity) GetSeed() string { + if m != nil { + return m.Seed + } + return "" +} + +func (m *GlobalIntegrity) GetAccumulator() []byte { + if m != nil { + return m.Accumulator + } + return nil +} + +func (m *GlobalIntegrity) GetCount() uint64 { + if m != nil { + return m.Count + } + return 0 +} + // Params defines the set of module parameters. type Params struct { // Whitelisted Assets WhitelistedAssets []*AssetInfo `protobuf:"bytes,1,rep,name=whitelisted_assets,json=whitelistedAssets,proto3" json:"whitelisted_assets,omitempty"` - // Whitelisted Blockchains - WhitelistedChains []*ChainInfo `protobuf:"bytes,2,rep,name=whitelisted_chains,json=whitelistedChains,proto3" json:"whitelisted_chains,omitempty"` + // Whitelisted Key Types + AllowedPublicKeys map[string]*KeyInfo `protobuf:"bytes,2,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // IpfsActive is a flag to enable/disable ipfs + IpfsActive bool `protobuf:"varint,3,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"` + // Localhost Registration Enabled + LocalhostRegistrationEnabled bool `protobuf:"varint,4,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"` + // ConveyancePreference defines the conveyance preference + ConveyancePreference string `protobuf:"bytes,5,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` + // AttestationFormats defines the attestation formats + AttestationFormats []string `protobuf:"bytes,6,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` } func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_fda181cae44f7c00, []int{1} + return fileDescriptor_fda181cae44f7c00, []int{2} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -117,21 +592,674 @@ func (m *Params) GetWhitelistedAssets() []*AssetInfo { return nil } -func (m *Params) GetWhitelistedChains() []*ChainInfo { +func (m *Params) GetAllowedPublicKeys() map[string]*KeyInfo { if m != nil { - return m.WhitelistedChains + return m.AllowedPublicKeys } return nil } +func (m *Params) GetIpfsActive() bool { + if m != nil { + return m.IpfsActive + } + return false +} + +func (m *Params) GetLocalhostRegistrationEnabled() bool { + if m != nil { + return m.LocalhostRegistrationEnabled + } + return false +} + +func (m *Params) GetConveyancePreference() string { + if m != nil { + return m.ConveyancePreference + } + return "" +} + +func (m *Params) GetAttestationFormats() []string { + if m != nil { + return m.AttestationFormats + } + return nil +} + +// 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 AssetType `protobuf:"varint,4,opt,name=asset_type,json=assetType,proto3,enum=did.v1.AssetType" json:"asset_type,omitempty"` + // The name of the asset + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + // The 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_fda181cae44f7c00, []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() AssetType { + if m != nil { + return m.AssetType + } + return AssetType_ASSET_TYPE_UNSPECIFIED +} + +func (m *AssetInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *AssetInfo) GetIconUrl() string { + if m != nil { + return m.IconUrl + } + return "" +} + +// KeyInfo defines information for accepted PubKey types +type KeyInfo struct { + Role KeyRole `protobuf:"varint,1,opt,name=role,proto3,enum=did.v1.KeyRole" json:"role,omitempty"` + Algorithm KeyAlgorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=did.v1.KeyAlgorithm" json:"algorithm,omitempty"` + Encoding KeyEncoding `protobuf:"varint,3,opt,name=encoding,proto3,enum=did.v1.KeyEncoding" json:"encoding,omitempty"` + Curve KeyCurve `protobuf:"varint,4,opt,name=curve,proto3,enum=did.v1.KeyCurve" json:"curve,omitempty"` + Type KeyType `protobuf:"varint,5,opt,name=type,proto3,enum=did.v1.KeyType" json:"type,omitempty"` +} + +func (m *KeyInfo) Reset() { *m = KeyInfo{} } +func (m *KeyInfo) String() string { return proto.CompactTextString(m) } +func (*KeyInfo) ProtoMessage() {} +func (*KeyInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{4} +} +func (m *KeyInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KeyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_KeyInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *KeyInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_KeyInfo.Merge(m, src) +} +func (m *KeyInfo) XXX_Size() int { + return m.Size() +} +func (m *KeyInfo) XXX_DiscardUnknown() { + xxx_messageInfo_KeyInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_KeyInfo proto.InternalMessageInfo + +func (m *KeyInfo) GetRole() KeyRole { + if m != nil { + return m.Role + } + return KeyRole_KEY_ROLE_UNSPECIFIED +} + +func (m *KeyInfo) GetAlgorithm() KeyAlgorithm { + if m != nil { + return m.Algorithm + } + return KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED +} + +func (m *KeyInfo) GetEncoding() KeyEncoding { + if m != nil { + return m.Encoding + } + return KeyEncoding_KEY_ENCODING_UNSPECIFIED +} + +func (m *KeyInfo) GetCurve() KeyCurve { + if m != nil { + return m.Curve + } + return KeyCurve_KEY_CURVE_UNSPECIFIED +} + +func (m *KeyInfo) GetType() KeyType { + if m != nil { + return m.Type + } + return KeyType_KEY_TYPE_UNSPECIFIED +} + +// ValidatorInfo defines information for accepted Validator nodes +type ValidatorInfo struct { + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + GrpcEndpoints []*ValidatorInfo_Endpoint `protobuf:"bytes,2,rep,name=grpc_endpoints,json=grpcEndpoints,proto3" json:"grpc_endpoints,omitempty"` + RestEndpoints []*ValidatorInfo_Endpoint `protobuf:"bytes,3,rep,name=rest_endpoints,json=restEndpoints,proto3" json:"rest_endpoints,omitempty"` + Explorer *ValidatorInfo_ExplorerInfo `protobuf:"bytes,4,opt,name=explorer,proto3" json:"explorer,omitempty"` + FeeInfo *ValidatorInfo_FeeInfo `protobuf:"bytes,5,opt,name=fee_info,json=feeInfo,proto3" json:"fee_info,omitempty"` + IbcChannel *ValidatorInfo_IBCChannel `protobuf:"bytes,6,opt,name=ibc_channel,json=ibcChannel,proto3" json:"ibc_channel,omitempty"` +} + +func (m *ValidatorInfo) Reset() { *m = ValidatorInfo{} } +func (m *ValidatorInfo) String() string { return proto.CompactTextString(m) } +func (*ValidatorInfo) ProtoMessage() {} +func (*ValidatorInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{5} +} +func (m *ValidatorInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorInfo.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 *ValidatorInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorInfo.Merge(m, src) +} +func (m *ValidatorInfo) XXX_Size() int { + return m.Size() +} +func (m *ValidatorInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorInfo proto.InternalMessageInfo + +func (m *ValidatorInfo) GetMoniker() string { + if m != nil { + return m.Moniker + } + return "" +} + +func (m *ValidatorInfo) GetGrpcEndpoints() []*ValidatorInfo_Endpoint { + if m != nil { + return m.GrpcEndpoints + } + return nil +} + +func (m *ValidatorInfo) GetRestEndpoints() []*ValidatorInfo_Endpoint { + if m != nil { + return m.RestEndpoints + } + return nil +} + +func (m *ValidatorInfo) GetExplorer() *ValidatorInfo_ExplorerInfo { + if m != nil { + return m.Explorer + } + return nil +} + +func (m *ValidatorInfo) GetFeeInfo() *ValidatorInfo_FeeInfo { + if m != nil { + return m.FeeInfo + } + return nil +} + +func (m *ValidatorInfo) GetIbcChannel() *ValidatorInfo_IBCChannel { + if m != nil { + return m.IbcChannel + } + return nil +} + +// Endpoint defines an endpoint +type ValidatorInfo_Endpoint struct { + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + IsPrimary bool `protobuf:"varint,2,opt,name=is_primary,json=isPrimary,proto3" json:"is_primary,omitempty"` +} + +func (m *ValidatorInfo_Endpoint) Reset() { *m = ValidatorInfo_Endpoint{} } +func (m *ValidatorInfo_Endpoint) String() string { return proto.CompactTextString(m) } +func (*ValidatorInfo_Endpoint) ProtoMessage() {} +func (*ValidatorInfo_Endpoint) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{5, 0} +} +func (m *ValidatorInfo_Endpoint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorInfo_Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorInfo_Endpoint.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 *ValidatorInfo_Endpoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorInfo_Endpoint.Merge(m, src) +} +func (m *ValidatorInfo_Endpoint) XXX_Size() int { + return m.Size() +} +func (m *ValidatorInfo_Endpoint) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorInfo_Endpoint.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorInfo_Endpoint proto.InternalMessageInfo + +func (m *ValidatorInfo_Endpoint) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *ValidatorInfo_Endpoint) GetIsPrimary() bool { + if m != nil { + return m.IsPrimary + } + return false +} + +// ExplorerInfo defines the explorer info +type ValidatorInfo_ExplorerInfo struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` +} + +func (m *ValidatorInfo_ExplorerInfo) Reset() { *m = ValidatorInfo_ExplorerInfo{} } +func (m *ValidatorInfo_ExplorerInfo) String() string { return proto.CompactTextString(m) } +func (*ValidatorInfo_ExplorerInfo) ProtoMessage() {} +func (*ValidatorInfo_ExplorerInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{5, 1} +} +func (m *ValidatorInfo_ExplorerInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorInfo_ExplorerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorInfo_ExplorerInfo.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 *ValidatorInfo_ExplorerInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorInfo_ExplorerInfo.Merge(m, src) +} +func (m *ValidatorInfo_ExplorerInfo) XXX_Size() int { + return m.Size() +} +func (m *ValidatorInfo_ExplorerInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorInfo_ExplorerInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorInfo_ExplorerInfo proto.InternalMessageInfo + +func (m *ValidatorInfo_ExplorerInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ValidatorInfo_ExplorerInfo) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +// FeeInfo defines a fee info +type ValidatorInfo_FeeInfo struct { + BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + FeeRates []string `protobuf:"bytes,2,rep,name=fee_rates,json=feeRates,proto3" json:"fee_rates,omitempty"` + InitGasLimit int32 `protobuf:"varint,3,opt,name=init_gas_limit,json=initGasLimit,proto3" json:"init_gas_limit,omitempty"` + IsSimulable bool `protobuf:"varint,4,opt,name=is_simulable,json=isSimulable,proto3" json:"is_simulable,omitempty"` + GasMultiply float64 `protobuf:"fixed64,5,opt,name=gas_multiply,json=gasMultiply,proto3" json:"gas_multiply,omitempty"` +} + +func (m *ValidatorInfo_FeeInfo) Reset() { *m = ValidatorInfo_FeeInfo{} } +func (m *ValidatorInfo_FeeInfo) String() string { return proto.CompactTextString(m) } +func (*ValidatorInfo_FeeInfo) ProtoMessage() {} +func (*ValidatorInfo_FeeInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{5, 2} +} +func (m *ValidatorInfo_FeeInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorInfo_FeeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorInfo_FeeInfo.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 *ValidatorInfo_FeeInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorInfo_FeeInfo.Merge(m, src) +} +func (m *ValidatorInfo_FeeInfo) XXX_Size() int { + return m.Size() +} +func (m *ValidatorInfo_FeeInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorInfo_FeeInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorInfo_FeeInfo proto.InternalMessageInfo + +func (m *ValidatorInfo_FeeInfo) GetBaseDenom() string { + if m != nil { + return m.BaseDenom + } + return "" +} + +func (m *ValidatorInfo_FeeInfo) GetFeeRates() []string { + if m != nil { + return m.FeeRates + } + return nil +} + +func (m *ValidatorInfo_FeeInfo) GetInitGasLimit() int32 { + if m != nil { + return m.InitGasLimit + } + return 0 +} + +func (m *ValidatorInfo_FeeInfo) GetIsSimulable() bool { + if m != nil { + return m.IsSimulable + } + return false +} + +func (m *ValidatorInfo_FeeInfo) GetGasMultiply() float64 { + if m != nil { + return m.GasMultiply + } + return 0 +} + +// IBCChannel defines the IBC channel info +type ValidatorInfo_IBCChannel struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Port string `protobuf:"bytes,2,opt,name=port,proto3" json:"port,omitempty"` +} + +func (m *ValidatorInfo_IBCChannel) Reset() { *m = ValidatorInfo_IBCChannel{} } +func (m *ValidatorInfo_IBCChannel) String() string { return proto.CompactTextString(m) } +func (*ValidatorInfo_IBCChannel) ProtoMessage() {} +func (*ValidatorInfo_IBCChannel) Descriptor() ([]byte, []int) { + return fileDescriptor_fda181cae44f7c00, []int{5, 3} +} +func (m *ValidatorInfo_IBCChannel) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorInfo_IBCChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorInfo_IBCChannel.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 *ValidatorInfo_IBCChannel) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorInfo_IBCChannel.Merge(m, src) +} +func (m *ValidatorInfo_IBCChannel) XXX_Size() int { + return m.Size() +} +func (m *ValidatorInfo_IBCChannel) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorInfo_IBCChannel.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorInfo_IBCChannel proto.InternalMessageInfo + +func (m *ValidatorInfo_IBCChannel) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ValidatorInfo_IBCChannel) GetPort() string { + if m != nil { + return m.Port + } + return "" +} + func init() { + proto.RegisterEnum("did.v1.AssetType", AssetType_name, AssetType_value) + proto.RegisterEnum("did.v1.DIDNamespace", DIDNamespace_name, DIDNamespace_value) + proto.RegisterEnum("did.v1.KeyAlgorithm", KeyAlgorithm_name, KeyAlgorithm_value) + proto.RegisterEnum("did.v1.KeyCurve", KeyCurve_name, KeyCurve_value) + proto.RegisterEnum("did.v1.KeyEncoding", KeyEncoding_name, KeyEncoding_value) + proto.RegisterEnum("did.v1.KeyRole", KeyRole_name, KeyRole_value) + proto.RegisterEnum("did.v1.KeyType", KeyType_name, KeyType_value) + proto.RegisterEnum("did.v1.KeyshareRole", KeyshareRole_name, KeyshareRole_value) + proto.RegisterEnum("did.v1.PermissionScope", PermissionScope_name, PermissionScope_value) proto.RegisterType((*GenesisState)(nil), "did.v1.GenesisState") + proto.RegisterType((*GlobalIntegrity)(nil), "did.v1.GlobalIntegrity") proto.RegisterType((*Params)(nil), "did.v1.Params") + proto.RegisterMapType((map[string]*KeyInfo)(nil), "did.v1.Params.AllowedPublicKeysEntry") + proto.RegisterType((*AssetInfo)(nil), "did.v1.AssetInfo") + proto.RegisterType((*KeyInfo)(nil), "did.v1.KeyInfo") + proto.RegisterType((*ValidatorInfo)(nil), "did.v1.ValidatorInfo") + proto.RegisterType((*ValidatorInfo_Endpoint)(nil), "did.v1.ValidatorInfo.Endpoint") + proto.RegisterType((*ValidatorInfo_ExplorerInfo)(nil), "did.v1.ValidatorInfo.ExplorerInfo") + proto.RegisterType((*ValidatorInfo_FeeInfo)(nil), "did.v1.ValidatorInfo.FeeInfo") + proto.RegisterType((*ValidatorInfo_IBCChannel)(nil), "did.v1.ValidatorInfo.IBCChannel") } func init() { proto.RegisterFile("did/v1/genesis.proto", fileDescriptor_fda181cae44f7c00) } var fileDescriptor_fda181cae44f7c00 = []byte{ + // 1869 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x4d, 0x6f, 0xdb, 0xc8, + 0x19, 0x36, 0xf5, 0x65, 0xe9, 0x95, 0x63, 0x8f, 0x27, 0xde, 0x44, 0x71, 0x12, 0xdb, 0x71, 0x92, + 0x5d, 0xc3, 0x2d, 0xec, 0x58, 0x49, 0x8a, 0x74, 0x5b, 0x14, 0xa5, 0xa8, 0xb1, 0x4d, 0x58, 0x5f, + 0x18, 0xd2, 0xf6, 0x66, 0x2f, 0x04, 0x45, 0x8d, 0x65, 0x22, 0x14, 0x29, 0x90, 0xb4, 0x37, 0x3a, + 0x14, 0x68, 0xaf, 0x7b, 0xea, 0xb1, 0xc7, 0xbd, 0xf5, 0xd2, 0x43, 0xfb, 0x1f, 0x7a, 0xd8, 0x4b, + 0x81, 0x3d, 0xb6, 0x97, 0xc5, 0x22, 0x39, 0xb4, 0x7f, 0xa1, 0xb7, 0x62, 0x86, 0xa4, 0x44, 0xc9, + 0x8a, 0xd1, 0x8b, 0x31, 0xf3, 0x3c, 0xcf, 0xfb, 0xce, 0xfb, 0x35, 0x43, 0x0b, 0xd6, 0x7a, 0x76, + 0x6f, 0xff, 0xfa, 0x60, 0xbf, 0xcf, 0x5c, 0x16, 0xd8, 0xc1, 0xde, 0xd0, 0xf7, 0x42, 0x0f, 0x17, + 0x7a, 0x76, 0x6f, 0xef, 0xfa, 0x60, 0x7d, 0xd5, 0x1c, 0xd8, 0xae, 0xb7, 0x2f, 0xfe, 0x46, 0xd4, + 0xfa, 0x5a, 0xdf, 0xeb, 0x7b, 0x62, 0xb9, 0xcf, 0x57, 0x11, 0xba, 0xfd, 0x7b, 0x09, 0x96, 0x8e, + 0x22, 0x17, 0x5a, 0x68, 0x86, 0x0c, 0xff, 0x1c, 0x0a, 0x43, 0xd3, 0x37, 0x07, 0x41, 0x45, 0xda, + 0x92, 0x76, 0xca, 0xd5, 0xe5, 0xbd, 0xc8, 0xe5, 0x5e, 0x47, 0xa0, 0xb5, 0xdc, 0xf7, 0x3f, 0x6e, + 0x2e, 0xd0, 0x58, 0x83, 0x6b, 0x80, 0xfa, 0x8e, 0xd7, 0x35, 0x1d, 0xc3, 0x76, 0x43, 0xd6, 0xf7, + 0xed, 0x70, 0x54, 0xc9, 0x08, 0xbb, 0xfb, 0x89, 0xdd, 0x91, 0xe0, 0xd5, 0x84, 0xa6, 0x2b, 0xfd, + 0x69, 0x60, 0xfb, 0x77, 0xb0, 0x32, 0xa3, 0xc1, 0x1b, 0x00, 0x96, 0xe7, 0x86, 0xbe, 0xe7, 0x38, + 0xcc, 0x17, 0x81, 0x94, 0x68, 0x0a, 0xc1, 0x18, 0x72, 0x01, 0x63, 0x3d, 0x71, 0x54, 0x89, 0x8a, + 0x35, 0xde, 0x82, 0xb2, 0x69, 0x59, 0x57, 0x83, 0x2b, 0xc7, 0x0c, 0x3d, 0xbf, 0x92, 0xdd, 0x92, + 0x76, 0x96, 0x68, 0x1a, 0xc2, 0x6b, 0x90, 0xb7, 0xbc, 0x2b, 0x37, 0xac, 0xe4, 0xb6, 0xa4, 0x9d, + 0x1c, 0x8d, 0x36, 0xdb, 0x3f, 0x66, 0xa1, 0x10, 0xe5, 0x86, 0x7f, 0x0b, 0xf8, 0x9b, 0x4b, 0x3b, + 0x64, 0x8e, 0x1d, 0x84, 0xac, 0x67, 0x98, 0x41, 0xc0, 0x42, 0x5e, 0x87, 0xec, 0x4e, 0xb9, 0xba, + 0x9a, 0xe4, 0x23, 0x73, 0x54, 0x75, 0x2f, 0x3c, 0xba, 0x9a, 0x12, 0x0b, 0x34, 0xc0, 0xa7, 0x70, + 0xd7, 0x74, 0x1c, 0xef, 0x1b, 0xd6, 0x33, 0x86, 0x57, 0x5d, 0xc7, 0xb6, 0x8c, 0x77, 0x6c, 0x14, + 0x54, 0x32, 0xc2, 0xc5, 0xf3, 0xe9, 0x52, 0xee, 0xc9, 0x91, 0xb2, 0x23, 0x84, 0x27, 0x6c, 0x14, + 0x10, 0x37, 0xf4, 0x47, 0x74, 0xd5, 0x9c, 0xc5, 0xf1, 0x26, 0x94, 0xed, 0xe1, 0x45, 0x60, 0x98, + 0x56, 0x68, 0x5f, 0x33, 0x91, 0x5b, 0x91, 0x02, 0x87, 0x64, 0x81, 0xe0, 0x3a, 0x6c, 0x38, 0x9e, + 0x65, 0x3a, 0x97, 0x5e, 0x10, 0x1a, 0x3e, 0xeb, 0xdb, 0x41, 0xe8, 0x9b, 0xa1, 0xed, 0xb9, 0x06, + 0x73, 0xcd, 0xae, 0xc3, 0x7a, 0x22, 0xe7, 0x22, 0x7d, 0x34, 0x56, 0xd1, 0x94, 0x88, 0x44, 0x1a, + 0xfc, 0x12, 0x3e, 0xb3, 0x3c, 0xf7, 0x9a, 0x8d, 0x4c, 0xd7, 0x62, 0xc6, 0xd0, 0x67, 0x17, 0xcc, + 0x67, 0xae, 0xc5, 0x2a, 0x79, 0x51, 0xe7, 0xb5, 0x09, 0xd9, 0x19, 0x73, 0x78, 0x1f, 0xee, 0x9a, + 0x61, 0xc8, 0x82, 0x30, 0x3a, 0xef, 0xc2, 0xf3, 0x07, 0x66, 0x18, 0x54, 0x0a, 0x5b, 0xd9, 0x9d, + 0x12, 0xc5, 0x29, 0xea, 0x30, 0x62, 0xd6, 0x4f, 0xe1, 0xde, 0xfc, 0xcc, 0x31, 0x82, 0xec, 0x3b, + 0x36, 0x8a, 0xfb, 0xcd, 0x97, 0xf8, 0x39, 0xe4, 0xaf, 0x4d, 0xe7, 0x8a, 0xc5, 0x43, 0xb5, 0x92, + 0x54, 0xf0, 0x84, 0x8d, 0x44, 0x0b, 0x22, 0xf6, 0xcb, 0xcc, 0x1b, 0xe9, 0xcb, 0xfb, 0x7f, 0xfa, + 0x6e, 0x73, 0xe1, 0x3f, 0xdf, 0x6d, 0x4a, 0xdf, 0xfe, 0xfb, 0xaf, 0xbb, 0xc0, 0x6f, 0x47, 0x34, + 0xa3, 0xdb, 0x7f, 0x91, 0xa0, 0x34, 0x6e, 0x1a, 0x1f, 0x02, 0xdb, 0xed, 0xb1, 0xf7, 0xe2, 0x94, + 0x2c, 0x8d, 0x36, 0xfc, 0xe4, 0x4b, 0x7f, 0x18, 0xcf, 0x13, 0x5f, 0xe2, 0x7b, 0x50, 0x08, 0x46, + 0x83, 0xae, 0xe7, 0x88, 0x6a, 0x97, 0x68, 0xbc, 0xc3, 0x2f, 0x00, 0xc4, 0x5c, 0x18, 0xe1, 0x68, + 0xc8, 0x44, 0x55, 0x97, 0x67, 0x66, 0x43, 0x1f, 0x0d, 0x19, 0x2d, 0x99, 0xc9, 0x92, 0x0f, 0xab, + 0x6b, 0x0e, 0x92, 0x22, 0x8a, 0x35, 0x7e, 0x00, 0x45, 0xdb, 0xf2, 0x5c, 0xe3, 0xca, 0x77, 0x2a, + 0x05, 0x81, 0x2f, 0xf2, 0xfd, 0xa9, 0xef, 0x6c, 0xff, 0x24, 0xc1, 0x62, 0x9c, 0x1e, 0x7e, 0x0a, + 0x39, 0xdf, 0x73, 0x98, 0x88, 0x75, 0x79, 0x2a, 0x7b, 0xea, 0x39, 0x8c, 0x0a, 0x12, 0x57, 0xa1, + 0x64, 0x3a, 0x7d, 0xcf, 0xb7, 0xc3, 0xcb, 0x81, 0xc8, 0x60, 0xb9, 0xba, 0x96, 0x52, 0xca, 0x09, + 0x47, 0x27, 0x32, 0xbc, 0x0f, 0x45, 0xe6, 0x5a, 0x5e, 0xcf, 0x76, 0xfb, 0x22, 0xbf, 0xe5, 0xea, + 0xdd, 0x94, 0x09, 0x89, 0x29, 0x3a, 0x16, 0xe1, 0xcf, 0x21, 0x6f, 0x5d, 0xf9, 0xd7, 0x49, 0xc6, + 0x28, 0xa5, 0x56, 0x38, 0x4e, 0x23, 0x9a, 0x47, 0x2c, 0x0a, 0x93, 0xbf, 0x11, 0xb1, 0x28, 0x8b, + 0x20, 0xb7, 0xff, 0x91, 0x87, 0x3b, 0x67, 0xa6, 0x63, 0xf7, 0xf8, 0xb5, 0x14, 0x89, 0x56, 0x60, + 0x71, 0xe0, 0xb9, 0xf6, 0xbb, 0xf1, 0x6d, 0x4f, 0xb6, 0x98, 0xc0, 0x72, 0xdf, 0x1f, 0x5a, 0x06, + 0x73, 0x7b, 0x43, 0xcf, 0x76, 0xc3, 0xe4, 0x32, 0x6d, 0x24, 0xae, 0xa7, 0x1c, 0xed, 0x91, 0x58, + 0x46, 0xef, 0x70, 0xab, 0x64, 0x17, 0x70, 0x37, 0x3e, 0x0b, 0xc2, 0x94, 0x9b, 0xec, 0xff, 0xe7, + 0x86, 0x5b, 0x4d, 0xdc, 0xfc, 0x06, 0x8a, 0xec, 0xfd, 0xd0, 0xf1, 0x7c, 0xe6, 0x8b, 0x4a, 0x94, + 0xab, 0xdb, 0x9f, 0x70, 0x10, 0xab, 0xc4, 0x94, 0x8e, 0x6d, 0xf0, 0x1b, 0x28, 0x5e, 0x30, 0x66, + 0xd8, 0xee, 0x85, 0x27, 0x4a, 0x54, 0xae, 0x3e, 0x9e, 0x6f, 0x7f, 0xc8, 0x98, 0x30, 0x5d, 0xbc, + 0x88, 0x16, 0x58, 0x86, 0xb2, 0xdd, 0xb5, 0x0c, 0xeb, 0xd2, 0x74, 0x5d, 0x16, 0x0d, 0x4d, 0xb9, + 0xba, 0x35, 0xdf, 0x58, 0xad, 0x29, 0x4a, 0xa4, 0xa3, 0x60, 0x77, 0xad, 0x78, 0xbd, 0xfe, 0x2b, + 0x28, 0x26, 0x99, 0xf0, 0x81, 0xe7, 0xb3, 0x17, 0x5f, 0xb5, 0x2b, 0xdf, 0xc1, 0x8f, 0x01, 0xec, + 0xc0, 0x18, 0xfa, 0xf6, 0xc0, 0xf4, 0xa3, 0x47, 0xbc, 0x48, 0x4b, 0x76, 0xd0, 0x89, 0x80, 0xf5, + 0x57, 0xb0, 0x94, 0xce, 0x69, 0x3c, 0xd5, 0x52, 0x6a, 0xaa, 0x63, 0xa7, 0x99, 0xb1, 0xd3, 0xf5, + 0xbf, 0x49, 0xb0, 0x18, 0xa7, 0xc2, 0x0f, 0xe8, 0x9a, 0x01, 0x33, 0x7a, 0xcc, 0xf5, 0x06, 0xb1, + 0x5d, 0x89, 0x23, 0x75, 0x0e, 0xe0, 0x87, 0x50, 0xe2, 0xa5, 0xf1, 0xcd, 0x90, 0x45, 0x3d, 0x2e, + 0x51, 0x5e, 0x2b, 0xca, 0xf7, 0xf8, 0x19, 0x2c, 0xdb, 0xae, 0x1d, 0x1a, 0x7d, 0x33, 0x30, 0x1c, + 0x7b, 0x60, 0x87, 0x62, 0x6a, 0xf3, 0x74, 0x89, 0xa3, 0x47, 0x66, 0xd0, 0xe0, 0x18, 0x7e, 0x02, + 0x4b, 0x76, 0x60, 0x04, 0x36, 0x7f, 0xf0, 0xbb, 0x0e, 0x8b, 0xdf, 0xbc, 0xb2, 0x1d, 0x68, 0x09, + 0xc4, 0x25, 0xdc, 0xc7, 0xe0, 0xca, 0x09, 0xed, 0xa1, 0x33, 0x12, 0x4d, 0x90, 0x68, 0xb9, 0x6f, + 0x06, 0xcd, 0x18, 0x5a, 0x7f, 0x01, 0x30, 0x29, 0x20, 0x5e, 0x86, 0x8c, 0xdd, 0x8b, 0xa3, 0xcd, + 0xd8, 0x3d, 0x9e, 0xf7, 0xd0, 0xf3, 0xc3, 0xe4, 0xd3, 0xc3, 0xd7, 0xbb, 0xe3, 0x17, 0x46, 0xdc, + 0xf7, 0x75, 0xb8, 0x27, 0x6b, 0x1a, 0xd1, 0x0d, 0xfd, 0x6d, 0x87, 0x18, 0xa7, 0x2d, 0xad, 0x43, + 0x14, 0xf5, 0x50, 0x25, 0x75, 0xb4, 0x80, 0x3f, 0x83, 0xd5, 0x14, 0xd7, 0x92, 0x75, 0xf5, 0x8c, + 0x20, 0x09, 0xdf, 0x03, 0x9c, 0x82, 0xcf, 0xa9, 0xdc, 0xe9, 0x90, 0x3a, 0xca, 0xcc, 0xe0, 0x9a, + 0x2e, 0x9f, 0xa8, 0xad, 0x23, 0x94, 0xc5, 0x77, 0x61, 0x25, 0x85, 0x77, 0xda, 0xed, 0x06, 0xca, + 0x61, 0x0c, 0xcb, 0x29, 0x50, 0xad, 0x29, 0x28, 0x3f, 0x23, 0x54, 0xce, 0xab, 0x2f, 0x50, 0x61, + 0xf7, 0xbf, 0x12, 0x2c, 0xd5, 0xd5, 0x7a, 0xcb, 0x1c, 0xb0, 0x60, 0x68, 0x5a, 0x0c, 0x3f, 0x86, + 0x07, 0x75, 0xb5, 0x6e, 0xb4, 0xe4, 0x26, 0xd1, 0x3a, 0xb2, 0x32, 0x1b, 0xf4, 0x3d, 0xc0, 0xd3, + 0xb4, 0xda, 0x39, 0xd4, 0xa2, 0xa8, 0xa7, 0x71, 0xad, 0xdd, 0xa2, 0x28, 0x83, 0x1f, 0xc0, 0x67, + 0xd3, 0x78, 0x4d, 0xd5, 0x95, 0xb6, 0xda, 0x42, 0x59, 0x5e, 0x9b, 0x69, 0x8a, 0xe8, 0xc7, 0x84, + 0x92, 0xd3, 0x26, 0xca, 0xf1, 0xda, 0xcc, 0x1c, 0x23, 0x52, 0xb8, 0x61, 0x72, 0x4e, 0x6a, 0xf2, + 0xa9, 0x7e, 0xdc, 0x42, 0x85, 0x9b, 0x26, 0xf5, 0xf3, 0x16, 0x5a, 0xbc, 0x19, 0x80, 0x46, 0xe8, + 0x99, 0xaa, 0x10, 0x54, 0xdc, 0xfd, 0xbb, 0x04, 0x4b, 0xe9, 0x47, 0x91, 0xe7, 0x7e, 0x42, 0xde, + 0x1a, 0x72, 0xe3, 0xa8, 0x4d, 0x55, 0xfd, 0xb8, 0x39, 0x93, 0xfb, 0x7d, 0xb8, 0x3b, 0x4d, 0x13, + 0xad, 0xfa, 0xfa, 0x17, 0x48, 0x9a, 0x47, 0xbc, 0x7c, 0xf3, 0x0a, 0x65, 0xe6, 0x11, 0xaf, 0x0f, + 0xaa, 0x28, 0x3b, 0x87, 0xa8, 0xd7, 0x35, 0x19, 0xe5, 0x70, 0x05, 0xd6, 0xe6, 0x9c, 0x71, 0x82, + 0xf2, 0x73, 0x4c, 0x14, 0x6e, 0x52, 0xd8, 0xfd, 0x43, 0x06, 0x8a, 0xc9, 0xd3, 0xcb, 0xd3, 0xe5, + 0x2a, 0xe5, 0x94, 0x9e, 0xcd, 0xb6, 0x0e, 0xc3, 0xf2, 0x84, 0xea, 0x44, 0x91, 0x4f, 0x63, 0x51, + 0xd0, 0xd3, 0xd8, 0xeb, 0xea, 0x01, 0xca, 0xe2, 0x35, 0x40, 0x13, 0xec, 0xab, 0xea, 0xeb, 0xd7, + 0x07, 0xbf, 0x8c, 0xa6, 0x2c, 0x85, 0xbe, 0x7a, 0xf5, 0x06, 0xe5, 0x79, 0x1b, 0x26, 0x18, 0xa9, + 0x47, 0xd2, 0x02, 0x1f, 0xbe, 0x34, 0xcc, 0xb5, 0x8b, 0x49, 0x4a, 0x11, 0xa8, 0x11, 0x85, 0x07, + 0x75, 0x72, 0x80, 0x8a, 0x7c, 0x9a, 0x26, 0x44, 0xad, 0xa1, 0x1d, 0x54, 0x5f, 0xbe, 0x39, 0x40, + 0xa5, 0x69, 0x83, 0x13, 0xa2, 0x28, 0xf2, 0x09, 0xcf, 0x03, 0x76, 0x03, 0x28, 0xa7, 0xbe, 0x55, + 0xf8, 0x11, 0x54, 0xb8, 0x8e, 0xb4, 0x94, 0x76, 0x5d, 0x6d, 0x1d, 0xcd, 0x14, 0x22, 0x4e, 0x66, + 0xcc, 0x52, 0xf9, 0x1c, 0x49, 0x37, 0xd0, 0x63, 0xf2, 0x15, 0xca, 0xf0, 0x89, 0x9b, 0x42, 0x9b, + 0xa7, 0x0d, 0x5d, 0xad, 0xc9, 0x1a, 0x41, 0xd9, 0xdd, 0x6f, 0xa3, 0xaf, 0x33, 0xff, 0xfc, 0x26, + 0x7d, 0xa3, 0xed, 0xc6, 0x6c, 0xd9, 0x1f, 0xc2, 0xfd, 0x31, 0xc3, 0x67, 0x95, 0xb4, 0x74, 0x55, + 0x91, 0x75, 0xb5, 0xdd, 0x8a, 0xae, 0xcd, 0x84, 0xd4, 0x34, 0x42, 0x05, 0x3e, 0x1e, 0x1c, 0x81, + 0xd7, 0x49, 0x83, 0x1c, 0x45, 0x06, 0xd9, 0x29, 0x42, 0x6d, 0x9d, 0xb5, 0x63, 0x4f, 0xb9, 0xdd, + 0x7f, 0x45, 0xc1, 0x88, 0x57, 0x27, 0x0e, 0x66, 0xce, 0x9b, 0x13, 0x77, 0x4c, 0x30, 0x6d, 0x45, + 0x27, 0x3a, 0x92, 0x92, 0x8e, 0x09, 0x8c, 0x34, 0x1a, 0x6a, 0x47, 0x57, 0x15, 0x94, 0xc1, 0x08, + 0x96, 0xc6, 0x30, 0xd5, 0x64, 0x94, 0x4d, 0x82, 0x8d, 0xde, 0x9f, 0xb7, 0xcd, 0x26, 0xd1, 0xa9, + 0xaa, 0xa0, 0x1c, 0x5e, 0x85, 0x3b, 0x63, 0xfc, 0xb8, 0x29, 0xf3, 0x8b, 0x9a, 0x36, 0x6e, 0x76, + 0x14, 0x54, 0xc0, 0x2b, 0x50, 0x1e, 0x23, 0x5f, 0x9f, 0xa0, 0xc5, 0xa9, 0x63, 0xc7, 0xd7, 0xb8, + 0x38, 0x15, 0x61, 0x4d, 0xed, 0xbc, 0xac, 0xa2, 0xd2, 0x6e, 0x57, 0xdc, 0xd3, 0xe0, 0xd2, 0xf4, + 0x99, 0x28, 0x76, 0x74, 0x4f, 0xb5, 0x63, 0x99, 0x92, 0x79, 0x15, 0x8f, 0xe2, 0x4c, 0xd3, 0x1a, + 0xa1, 0x48, 0x8a, 0x3b, 0x91, 0xc2, 0xcf, 0xe4, 0x86, 0x5a, 0x97, 0xf5, 0x36, 0x45, 0x99, 0xdd, + 0x3f, 0xe7, 0x60, 0xa5, 0xc3, 0xfc, 0x81, 0x1d, 0x04, 0xb6, 0xe7, 0x6a, 0x96, 0x37, 0x64, 0x78, + 0x0b, 0x1e, 0x75, 0x08, 0x6d, 0xaa, 0x9a, 0xa6, 0xb6, 0x5b, 0x86, 0xa6, 0xb4, 0x6f, 0xd4, 0x73, + 0x13, 0x1e, 0xde, 0x50, 0xd4, 0x64, 0x4d, 0x55, 0x0c, 0xb5, 0x75, 0xd8, 0x46, 0x12, 0x7e, 0x0e, + 0x4f, 0x6e, 0x08, 0x26, 0x80, 0x66, 0x50, 0x22, 0xf3, 0xc7, 0xfd, 0x73, 0xd8, 0xbe, 0x55, 0x76, + 0x4e, 0x55, 0x9d, 0xa0, 0xec, 0x5c, 0x9d, 0x4e, 0xe5, 0x96, 0x26, 0x2b, 0xfa, 0xc4, 0x5f, 0x0e, + 0x7f, 0x01, 0x4f, 0x6f, 0xd7, 0x45, 0x0e, 0xf3, 0xf8, 0x09, 0x3c, 0xbe, 0x21, 0x3c, 0x97, 0x1b, + 0x0d, 0xa2, 0xc7, 0xbe, 0x0a, 0xf8, 0x29, 0x6c, 0x7e, 0x52, 0xa2, 0x50, 0x22, 0xeb, 0x04, 0x2d, + 0xce, 0x0d, 0x2c, 0x11, 0x69, 0xa7, 0x35, 0x4d, 0xa1, 0x6a, 0x8d, 0xa0, 0xe2, 0xad, 0xce, 0x4e, + 0x3b, 0x75, 0xee, 0xac, 0x84, 0x77, 0xe0, 0xd9, 0xed, 0xd1, 0x9f, 0x11, 0xaa, 0x1e, 0xbe, 0x45, + 0x80, 0x7f, 0x06, 0x5f, 0xdc, 0xae, 0xac, 0xd1, 0xb6, 0x5c, 0x57, 0x64, 0x4d, 0x47, 0xe5, 0xb9, + 0xcd, 0x92, 0xeb, 0x4d, 0xb5, 0x15, 0x0d, 0xc8, 0x12, 0x7e, 0x06, 0x5b, 0x9f, 0x10, 0x4c, 0x26, + 0xe5, 0x4e, 0xed, 0xd7, 0xdf, 0x7f, 0xd8, 0x90, 0x7e, 0xf8, 0xb0, 0x21, 0xfd, 0xf4, 0x61, 0x43, + 0xfa, 0xe3, 0xc7, 0x8d, 0x85, 0x1f, 0x3e, 0x6e, 0x2c, 0xfc, 0xf3, 0xe3, 0xc6, 0xc2, 0xd7, 0xdb, + 0x7d, 0x3b, 0xbc, 0xbc, 0xea, 0xee, 0x59, 0xde, 0x60, 0xdf, 0x73, 0x03, 0xcf, 0xf5, 0xf7, 0xc5, + 0x9f, 0xf7, 0xfb, 0xfc, 0x27, 0x08, 0xff, 0x77, 0x37, 0xe8, 0x16, 0xc4, 0x6f, 0xed, 0x97, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0xff, 0xaa, 0xef, 0xb3, 0x35, 0xb4, 0x0f, 0x00, 0x00, // 289 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x49, 0xc9, 0x4c, 0xd1, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, @@ -181,11 +1309,28 @@ func (this *Params) Equal(that interface{}) bool { return false } } - if len(this.WhitelistedChains) != len(that1.WhitelistedChains) { + if len(this.AllowedPublicKeys) != len(that1.AllowedPublicKeys) { return false } - for i := range this.WhitelistedChains { - if !this.WhitelistedChains[i].Equal(that1.WhitelistedChains[i]) { + for i := range this.AllowedPublicKeys { + if !this.AllowedPublicKeys[i].Equal(that1.AllowedPublicKeys[i]) { + return false + } + } + if this.IpfsActive != that1.IpfsActive { + return false + } + if this.LocalhostRegistrationEnabled != that1.LocalhostRegistrationEnabled { + return false + } + if this.ConveyancePreference != that1.ConveyancePreference { + return false + } + if len(this.AttestationFormats) != len(that1.AttestationFormats) { + return false + } + for i := range this.AttestationFormats { + if this.AttestationFormats[i] != that1.AttestationFormats[i] { return false } } @@ -211,6 +1356,18 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.GlobalIntegrity != nil { + { + size, err := m.GlobalIntegrity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -224,6 +1381,55 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GlobalIntegrity) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GlobalIntegrity) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GlobalIntegrity) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Count != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x20 + } + if len(m.Accumulator) > 0 { + i -= len(m.Accumulator) + copy(dAtA[i:], m.Accumulator) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Accumulator))) + i-- + dAtA[i] = 0x1a + } + if len(m.Seed) > 0 { + i -= len(m.Seed) + copy(dAtA[i:], m.Seed) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Seed))) + i-- + dAtA[i] = 0x12 + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -244,16 +1450,64 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.WhitelistedChains) > 0 { - for iNdEx := len(m.WhitelistedChains) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.WhitelistedChains[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.AttestationFormats) > 0 { + for iNdEx := len(m.AttestationFormats) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AttestationFormats[iNdEx]) + copy(dAtA[i:], m.AttestationFormats[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.AttestationFormats[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.ConveyancePreference) > 0 { + i -= len(m.ConveyancePreference) + copy(dAtA[i:], m.ConveyancePreference) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ConveyancePreference))) + i-- + dAtA[i] = 0x2a + } + if m.LocalhostRegistrationEnabled { + i-- + if m.LocalhostRegistrationEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.IpfsActive { + i-- + if m.IpfsActive { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.AllowedPublicKeys) > 0 { + for k := range m.AllowedPublicKeys { + v := m.AllowedPublicKeys[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGenesis(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenesis(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x12 } @@ -275,6 +1529,383 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 m.AssetType != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.AssetType)) + i-- + dAtA[i] = 0x20 + } + 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 (m *KeyInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KeyInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KeyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Type != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x28 + } + if m.Curve != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Curve)) + i-- + dAtA[i] = 0x20 + } + if m.Encoding != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Encoding)) + i-- + dAtA[i] = 0x18 + } + if m.Algorithm != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Algorithm)) + i-- + dAtA[i] = 0x10 + } + if m.Role != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ValidatorInfo) 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 *ValidatorInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IbcChannel != nil { + { + size, err := m.IbcChannel.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.FeeInfo != nil { + { + size, err := m.FeeInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Explorer != nil { + { + size, err := m.Explorer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.RestEndpoints) > 0 { + for iNdEx := len(m.RestEndpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RestEndpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.GrpcEndpoints) > 0 { + for iNdEx := len(m.GrpcEndpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GrpcEndpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Moniker) > 0 { + i -= len(m.Moniker) + copy(dAtA[i:], m.Moniker) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Moniker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorInfo_Endpoint) 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 *ValidatorInfo_Endpoint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorInfo_Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsPrimary { + i-- + if m.IsPrimary { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorInfo_ExplorerInfo) 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 *ValidatorInfo_ExplorerInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorInfo_ExplorerInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorInfo_FeeInfo) 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 *ValidatorInfo_FeeInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorInfo_FeeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GasMultiply != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.GasMultiply)))) + i-- + dAtA[i] = 0x29 + } + if m.IsSimulable { + i-- + if m.IsSimulable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.InitGasLimit != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.InitGasLimit)) + i-- + dAtA[i] = 0x18 + } + if len(m.FeeRates) > 0 { + for iNdEx := len(m.FeeRates) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.FeeRates[iNdEx]) + copy(dAtA[i:], m.FeeRates[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.FeeRates[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.BaseDenom) > 0 { + i -= len(m.BaseDenom) + copy(dAtA[i:], m.BaseDenom) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.BaseDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorInfo_IBCChannel) 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 *ValidatorInfo_IBCChannel) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorInfo_IBCChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Port) > 0 { + i -= len(m.Port) + copy(dAtA[i:], m.Port) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Port))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { offset -= sovGenesis(v) base := offset @@ -294,6 +1925,34 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) + if m.GlobalIntegrity != nil { + l = m.GlobalIntegrity.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *GlobalIntegrity) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Seed) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Accumulator) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Count != 0 { + n += 1 + sovGenesis(uint64(m.Count)) + } return n } @@ -309,12 +1968,207 @@ func (m *Params) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.AllowedPublicKeys) > 0 { + for k, v := range m.AllowedPublicKeys { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovGenesis(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovGenesis(uint64(len(k))) + l + n += mapEntrySize + 1 + sovGenesis(uint64(mapEntrySize)) + } + } + if m.IpfsActive { + n += 2 + } + if m.LocalhostRegistrationEnabled { + n += 2 + } + l = len(m.ConveyancePreference) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.AttestationFormats) > 0 { + for _, s := range m.AttestationFormats { + l = len(s) + 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)) + } + if m.AssetType != 0 { + n += 1 + sovGenesis(uint64(m.AssetType)) + } + 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 (m *KeyInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Role != 0 { + n += 1 + sovGenesis(uint64(m.Role)) + } + if m.Algorithm != 0 { + n += 1 + sovGenesis(uint64(m.Algorithm)) + } + if m.Encoding != 0 { + n += 1 + sovGenesis(uint64(m.Encoding)) + } + if m.Curve != 0 { + n += 1 + sovGenesis(uint64(m.Curve)) + } + if m.Type != 0 { + n += 1 + sovGenesis(uint64(m.Type)) + } + return n +} + +func (m *ValidatorInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Moniker) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.GrpcEndpoints) > 0 { + for _, e := range m.GrpcEndpoints { if len(m.WhitelistedChains) > 0 { for _, e := range m.WhitelistedChains { l = e.Size() n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.RestEndpoints) > 0 { + for _, e := range m.RestEndpoints { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.Explorer != nil { + l = m.Explorer.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.FeeInfo != nil { + l = m.FeeInfo.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.IbcChannel != nil { + l = m.IbcChannel.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *ValidatorInfo_Endpoint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Url) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.IsPrimary { + n += 2 + } + return n +} + +func (m *ValidatorInfo_ExplorerInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Url) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *ValidatorInfo_FeeInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BaseDenom) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.FeeRates) > 0 { + for _, s := range m.FeeRates { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.InitGasLimit != 0 { + n += 1 + sovGenesis(uint64(m.InitGasLimit)) + } + if m.IsSimulable { + n += 2 + } + if m.GasMultiply != 0 { + n += 9 + } + return n +} + +func (m *ValidatorInfo_IBCChannel) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.Port) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } return n } @@ -386,6 +2240,209 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GlobalIntegrity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.GlobalIntegrity == nil { + m.GlobalIntegrity = &GlobalIntegrity{} + } + if err := m.GlobalIntegrity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GlobalIntegrity) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GlobalIntegrity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GlobalIntegrity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Seed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Seed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accumulator", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accumulator = append(m.Accumulator[:0], dAtA[iNdEx:postIndex]...) + if m.Accumulator == nil { + m.Accumulator = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) @@ -472,7 +2529,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedChains", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowedPublicKeys", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -499,6 +2556,826 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.AllowedPublicKeys == nil { + m.AllowedPublicKeys = make(map[string]*KeyInfo) + } + var mapkey string + var mapvalue *KeyInfo + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenesis + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenesis + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenesis + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenesis + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &KeyInfo{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AllowedPublicKeys[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IpfsActive = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalhostRegistrationEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LocalhostRegistrationEnabled = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConveyancePreference = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AttestationFormats = append(m.AttestationFormats, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetType", wireType) + } + m.AssetType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetType |= AssetType(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 (m *KeyInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KeyInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KeyInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + m.Role = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Role |= KeyRole(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) + } + m.Algorithm = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Algorithm |= KeyAlgorithm(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) + } + m.Encoding = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Encoding |= KeyEncoding(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) + } + m.Curve = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Curve |= KeyCurve(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= KeyType(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 *ValidatorInfo) 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: ValidatorInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Moniker", 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.Moniker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GrpcEndpoints", 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.GrpcEndpoints = append(m.GrpcEndpoints, &ValidatorInfo_Endpoint{}) + if err := m.GrpcEndpoints[len(m.GrpcEndpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RestEndpoints", 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.RestEndpoints = append(m.RestEndpoints, &ValidatorInfo_Endpoint{}) + if err := m.RestEndpoints[len(m.RestEndpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Explorer", 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.Explorer == nil { + m.Explorer = &ValidatorInfo_ExplorerInfo{} + } + if err := m.Explorer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeInfo", 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.FeeInfo == nil { + m.FeeInfo = &ValidatorInfo_FeeInfo{} + } + if err := m.FeeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IbcChannel", 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.IbcChannel == nil { + m.IbcChannel = &ValidatorInfo_IBCChannel{} + } + if err := m.IbcChannel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { m.WhitelistedChains = append(m.WhitelistedChains, &ChainInfo{}) if err := m.WhitelistedChains[len(m.WhitelistedChains)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -525,6 +3402,500 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } +func (m *ValidatorInfo_Endpoint) 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: Endpoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Endpoint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", 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.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsPrimary", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsPrimary = bool(v != 0) + 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 *ValidatorInfo_ExplorerInfo) 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: ExplorerInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExplorerInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", 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.Url = 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 *ValidatorInfo_FeeInfo) 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: FeeInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FeeInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseDenom", 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.BaseDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeRates", 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.FeeRates = append(m.FeeRates, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InitGasLimit", wireType) + } + m.InitGasLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InitGasLimit |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsSimulable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsSimulable = bool(v != 0) + case 5: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field GasMultiply", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.GasMultiply = float64(math.Float64frombits(v)) + 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 *ValidatorInfo_IBCChannel) 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: IBCChannel: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IBCChannel: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", 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.Port = 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/did/types/genesis_test.go b/x/did/types/genesis_test.go index 998a9d4a3..01d5a476d 100644 --- a/x/did/types/genesis_test.go +++ b/x/did/types/genesis_test.go @@ -3,7 +3,7 @@ package types_test import ( "testing" - "github.com/onsonr/hway/x/did/types" + "github.com/onsonr/sonr/x/did/types" "github.com/stretchr/testify/require" ) @@ -19,14 +19,6 @@ func TestGenesisState_Validate(t *testing.T) { 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 { diff --git a/x/did/types/integrity.go b/x/did/types/integrity.go new file mode 100644 index 000000000..e7eeb1eff --- /dev/null +++ b/x/did/types/integrity.go @@ -0,0 +1,27 @@ +package types + +import "lukechampine.com/blake3" + +func (g *GlobalIntegrity) Update(address string) bool { + return true +} + +func (g *GlobalIntegrity) getProof() (*Proof, error) { + if g.Accumulator == nil { + return NewProof(g.Controller, g.proofProperty(), g.seedKdf()) + } + return &Proof{ + Issuer: g.Controller, + Property: g.proofProperty(), + Accumulator: g.Accumulator, + }, nil +} + +func (g *GlobalIntegrity) proofProperty() string { + return "did:sonr:integrity" +} + +func (g *GlobalIntegrity) seedKdf() []byte { + res := blake3.Sum256([]byte(g.Seed)) + return res[:] +} diff --git a/x/did/types/keys.go b/x/did/types/keys.go deleted file mode 100644 index 1f1d7198b..000000000 --- a/x/did/types/keys.go +++ /dev/null @@ -1,62 +0,0 @@ -package types - -import ( - fmt "fmt" - "math/big" - - "cosmossdk.io/collections" - "github.com/onsonr/crypto/core/curves" - "github.com/onsonr/crypto/signatures/ecdsa" - "golang.org/x/crypto/sha3" - - ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1" -) - -// ParamsKey saves the current module params. -var ParamsKey = collections.NewPrefix(0) - -const ( - ModuleName = "did" - - StoreKey = ModuleName - - QuerierRoute = ModuleName -) - -var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{ - SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{ - {Id: 1, ProtoFileName: "did/v1/state.proto"}, - }, - Prefix: []byte{0}, -} - -// VerifySignature verifies the signature of a message -func VerifySignature(key []byte, msg []byte, sig []byte) bool { - pp, err := BuildEcPoint(key) - if err != nil { - return false - } - sigEd, err := ecdsa.DeserializeSecp256k1Signature(sig) - if err != nil { - return false - } - hash := sha3.New256() - _, err = hash.Write(msg) - if err != nil { - return false - } - digest := hash.Sum(nil) - return curves.VerifyEcdsa(pp, digest[:], sigEd) -} - -// BuildEcPoint builds an elliptic curve point from a compressed byte slice -func BuildEcPoint(pubKey []byte) (*curves.EcPoint, error) { - crv := curves.K256() - x := new(big.Int).SetBytes(pubKey[1:33]) - y := new(big.Int).SetBytes(pubKey[33:]) - ecCurve, err := crv.ToEllipticCurve() - if err != nil { - return nil, fmt.Errorf("error converting curve: %v", err) - } - return &curves.EcPoint{X: x, Y: y, Curve: ecCurve}, nil -} diff --git a/x/did/types/models.pb.go b/x/did/types/models.pb.go new file mode 100644 index 000000000..ba75c43a3 --- /dev/null +++ b/x/did/types/models.pb.go @@ -0,0 +1,4991 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: did/v1/models.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// Alias defines a subject/origin pair +type Alias struct { + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"` +} + +func (m *Alias) Reset() { *m = Alias{} } +func (m *Alias) String() string { return proto.CompactTextString(m) } +func (*Alias) ProtoMessage() {} +func (*Alias) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{0} +} +func (m *Alias) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Alias) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Alias.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 *Alias) XXX_Merge(src proto.Message) { + xxx_messageInfo_Alias.Merge(m, src) +} +func (m *Alias) XXX_Size() int { + return m.Size() +} +func (m *Alias) XXX_DiscardUnknown() { + xxx_messageInfo_Alias.DiscardUnknown(m) +} + +var xxx_messageInfo_Alias proto.InternalMessageInfo + +func (m *Alias) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *Alias) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *Alias) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +type Credential struct { + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + AttestationType string `protobuf:"bytes,2,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"` + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` + CredentialId []byte `protobuf:"bytes,4,opt,name=credential_id,json=credentialId,proto3" json:"credential_id,omitempty"` + PublicKey []byte `protobuf:"bytes,5,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Transport []string `protobuf:"bytes,6,rep,name=transport,proto3" json:"transport,omitempty"` + SignCount uint32 `protobuf:"varint,7,opt,name=sign_count,json=signCount,proto3" json:"sign_count,omitempty"` + UserPresent bool `protobuf:"varint,8,opt,name=user_present,json=userPresent,proto3" json:"user_present,omitempty"` + UserVerified bool `protobuf:"varint,9,opt,name=user_verified,json=userVerified,proto3" json:"user_verified,omitempty"` + BackupEligible bool `protobuf:"varint,10,opt,name=backup_eligible,json=backupEligible,proto3" json:"backup_eligible,omitempty"` + BackupState bool `protobuf:"varint,11,opt,name=backup_state,json=backupState,proto3" json:"backup_state,omitempty"` + CloneWarning bool `protobuf:"varint,12,opt,name=clone_warning,json=cloneWarning,proto3" json:"clone_warning,omitempty"` +} + +func (m *Credential) Reset() { *m = Credential{} } +func (m *Credential) String() string { return proto.CompactTextString(m) } +func (*Credential) ProtoMessage() {} +func (*Credential) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{1} +} +func (m *Credential) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Credential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Credential.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 *Credential) XXX_Merge(src proto.Message) { + xxx_messageInfo_Credential.Merge(m, src) +} +func (m *Credential) XXX_Size() int { + return m.Size() +} +func (m *Credential) XXX_DiscardUnknown() { + xxx_messageInfo_Credential.DiscardUnknown(m) +} + +var xxx_messageInfo_Credential proto.InternalMessageInfo + +func (m *Credential) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *Credential) GetAttestationType() string { + if m != nil { + return m.AttestationType + } + return "" +} + +func (m *Credential) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *Credential) GetCredentialId() []byte { + if m != nil { + return m.CredentialId + } + return nil +} + +func (m *Credential) GetPublicKey() []byte { + if m != nil { + return m.PublicKey + } + return nil +} + +func (m *Credential) GetTransport() []string { + if m != nil { + return m.Transport + } + return nil +} + +func (m *Credential) GetSignCount() uint32 { + if m != nil { + return m.SignCount + } + return 0 +} + +func (m *Credential) GetUserPresent() bool { + if m != nil { + return m.UserPresent + } + return false +} + +func (m *Credential) GetUserVerified() bool { + if m != nil { + return m.UserVerified + } + return false +} + +func (m *Credential) GetBackupEligible() bool { + if m != nil { + return m.BackupEligible + } + return false +} + +func (m *Credential) GetBackupState() bool { + if m != nil { + return m.BackupState + } + return false +} + +func (m *Credential) GetCloneWarning() bool { + if m != nil { + return m.CloneWarning + } + return false +} + +// Document defines a DID document +type Document struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"` + AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"` + CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"` + CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"` + Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{2} +} +func (m *Document) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Document.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Document) XXX_Merge(src proto.Message) { + xxx_messageInfo_Document.Merge(m, src) +} +func (m *Document) XXX_Size() int { + return m.Size() +} +func (m *Document) XXX_DiscardUnknown() { + xxx_messageInfo_Document.DiscardUnknown(m) +} + +var xxx_messageInfo_Document proto.InternalMessageInfo + +func (m *Document) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Document) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *Document) GetAuthentication() []string { + if m != nil { + return m.Authentication + } + return nil +} + +func (m *Document) GetAssertionMethod() []string { + if m != nil { + return m.AssertionMethod + } + return nil +} + +func (m *Document) GetCapabilityDelegation() []string { + if m != nil { + return m.CapabilityDelegation + } + return nil +} + +func (m *Document) GetCapabilityInvocation() []string { + if m != nil { + return m.CapabilityInvocation + } + return nil +} + +func (m *Document) GetService() []string { + if m != nil { + return m.Service + } + return nil +} + +// Keyshare defines a keyshare from the MPC protocol +type Keyshare struct { + Metadata map[string]string `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Payloads map[string][]byte `protobuf:"bytes,2,rep,name=payloads,proto3" json:"payloads,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"` + PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Version uint32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` + Role int32 `protobuf:"varint,6,opt,name=role,proto3" json:"role,omitempty"` +} + +func (m *Keyshare) Reset() { *m = Keyshare{} } +func (m *Keyshare) String() string { return proto.CompactTextString(m) } +func (*Keyshare) ProtoMessage() {} +func (*Keyshare) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{3} +} +func (m *Keyshare) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Keyshare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Keyshare.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 *Keyshare) XXX_Merge(src proto.Message) { + xxx_messageInfo_Keyshare.Merge(m, src) +} +func (m *Keyshare) XXX_Size() int { + return m.Size() +} +func (m *Keyshare) XXX_DiscardUnknown() { + xxx_messageInfo_Keyshare.DiscardUnknown(m) +} + +var xxx_messageInfo_Keyshare proto.InternalMessageInfo + +func (m *Keyshare) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Keyshare) GetPayloads() map[string][]byte { + if m != nil { + return m.Payloads + } + return nil +} + +func (m *Keyshare) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" +} + +func (m *Keyshare) GetPublicKey() []byte { + if m != nil { + return m.PublicKey + } + return nil +} + +func (m *Keyshare) GetVersion() uint32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *Keyshare) GetRole() int32 { + if m != nil { + return m.Role + } + return 0 +} + +// Permissions contains a list of grants and access control rules for +// a Service. +type Permissions struct { + Grants []DIDNamespace `protobuf:"varint,1,rep,packed,name=grants,proto3,enum=did.v1.DIDNamespace" json:"grants,omitempty"` + Scopes []PermissionScope `protobuf:"varint,2,rep,packed,name=scopes,proto3,enum=did.v1.PermissionScope" json:"scopes,omitempty"` +} + +func (m *Permissions) Reset() { *m = Permissions{} } +func (m *Permissions) String() string { return proto.CompactTextString(m) } +func (*Permissions) ProtoMessage() {} +func (*Permissions) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{4} +} +func (m *Permissions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Permissions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Permissions.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 *Permissions) XXX_Merge(src proto.Message) { + xxx_messageInfo_Permissions.Merge(m, src) +} +func (m *Permissions) XXX_Size() int { + return m.Size() +} +func (m *Permissions) XXX_DiscardUnknown() { + xxx_messageInfo_Permissions.DiscardUnknown(m) +} + +var xxx_messageInfo_Permissions proto.InternalMessageInfo + +func (m *Permissions) GetGrants() []DIDNamespace { + if m != nil { + return m.Grants + } + return nil +} + +func (m *Permissions) GetScopes() []PermissionScope { + if m != nil { + return m.Scopes + } + return nil +} + +// PubKey defines a public key for a did +type PubKey struct { + Role KeyRole `protobuf:"varint,1,opt,name=role,proto3,enum=did.v1.KeyRole" json:"role,omitempty"` + Algorithm KeyAlgorithm `protobuf:"varint,2,opt,name=algorithm,proto3,enum=did.v1.KeyAlgorithm" json:"algorithm,omitempty"` + Encoding KeyEncoding `protobuf:"varint,3,opt,name=encoding,proto3,enum=did.v1.KeyEncoding" json:"encoding,omitempty"` + Curve KeyCurve `protobuf:"varint,4,opt,name=curve,proto3,enum=did.v1.KeyCurve" json:"curve,omitempty"` + KeyType KeyType `protobuf:"varint,5,opt,name=key_type,json=keyType,proto3,enum=did.v1.KeyType" json:"key_type,omitempty"` + Raw []byte `protobuf:"bytes,6,opt,name=raw,proto3" json:"raw,omitempty"` + Jwk *PubKey_JWK `protobuf:"bytes,7,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_739bb5ab5cb60751, []int{5} +} +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() KeyRole { + if m != nil { + return m.Role + } + return KeyRole_KEY_ROLE_UNSPECIFIED +} + +func (m *PubKey) GetAlgorithm() KeyAlgorithm { + if m != nil { + return m.Algorithm + } + return KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED +} + +func (m *PubKey) GetEncoding() KeyEncoding { + if m != nil { + return m.Encoding + } + return KeyEncoding_KEY_ENCODING_UNSPECIFIED +} + +func (m *PubKey) GetCurve() KeyCurve { + if m != nil { + return m.Curve + } + return KeyCurve_KEY_CURVE_UNSPECIFIED +} + +func (m *PubKey) GetKeyType() KeyType { + if m != nil { + return m.KeyType + } + return KeyType_KEY_TYPE_UNSPECIFIED +} + +func (m *PubKey) GetRaw() []byte { + if m != nil { + return m.Raw + } + return nil +} + +func (m *PubKey) GetJwk() *PubKey_JWK { + if m != nil { + return m.Jwk + } + return nil +} + +// JWK represents a JSON Web Key +type PubKey_JWK 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 *PubKey_JWK) Reset() { *m = PubKey_JWK{} } +func (m *PubKey_JWK) String() string { return proto.CompactTextString(m) } +func (*PubKey_JWK) ProtoMessage() {} +func (*PubKey_JWK) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{5, 0} +} +func (m *PubKey_JWK) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubKey_JWK) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey_JWK.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_JWK) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey_JWK.Merge(m, src) +} +func (m *PubKey_JWK) XXX_Size() int { + return m.Size() +} +func (m *PubKey_JWK) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey_JWK.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey_JWK proto.InternalMessageInfo + +func (m *PubKey_JWK) GetKty() string { + if m != nil { + return m.Kty + } + return "" +} + +func (m *PubKey_JWK) GetCrv() string { + if m != nil { + return m.Crv + } + return "" +} + +func (m *PubKey_JWK) GetX() string { + if m != nil { + return m.X + } + return "" +} + +func (m *PubKey_JWK) GetY() string { + if m != nil { + return m.Y + } + return "" +} + +func (m *PubKey_JWK) GetN() string { + if m != nil { + return m.N + } + return "" +} + +func (m *PubKey_JWK) GetE() string { + if m != nil { + return m.E + } + return "" +} + +// Service defines a Decentralized Service on the Sonr Blockchain +type Service struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + ServiceEndpoints map[string]string `protobuf:"bytes,6,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Permissions *Permissions `protobuf:"bytes,7,opt,name=permissions,proto3" json:"permissions,omitempty"` +} + +func (m *Service) Reset() { *m = Service{} } +func (m *Service) String() string { return proto.CompactTextString(m) } +func (*Service) ProtoMessage() {} +func (*Service) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{6} +} +func (m *Service) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Service.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 *Service) XXX_Merge(src proto.Message) { + xxx_messageInfo_Service.Merge(m, src) +} +func (m *Service) XXX_Size() int { + return m.Size() +} +func (m *Service) XXX_DiscardUnknown() { + xxx_messageInfo_Service.DiscardUnknown(m) +} + +var xxx_messageInfo_Service proto.InternalMessageInfo + +func (m *Service) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Service) GetServiceType() string { + if m != nil { + return m.ServiceType + } + return "" +} + +func (m *Service) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *Service) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *Service) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Service) GetServiceEndpoints() map[string]string { + if m != nil { + return m.ServiceEndpoints + } + return nil +} + +func (m *Service) GetPermissions() *Permissions { + if m != nil { + return m.Permissions + } + return nil +} + +// ServicceInfo defines a Decentralized Service on the Sonr Blockchain +type ServiceInfo struct { + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Fingerprint string `protobuf:"bytes,3,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` + Service *Service `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` +} + +func (m *ServiceInfo) Reset() { *m = ServiceInfo{} } +func (m *ServiceInfo) String() string { return proto.CompactTextString(m) } +func (*ServiceInfo) ProtoMessage() {} +func (*ServiceInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{7} +} +func (m *ServiceInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ServiceInfo.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 *ServiceInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceInfo.Merge(m, src) +} +func (m *ServiceInfo) XXX_Size() int { + return m.Size() +} +func (m *ServiceInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceInfo proto.InternalMessageInfo + +func (m *ServiceInfo) GetExists() bool { + if m != nil { + return m.Exists + } + return false +} + +func (m *ServiceInfo) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *ServiceInfo) GetFingerprint() string { + if m != nil { + return m.Fingerprint + } + return "" +} + +func (m *ServiceInfo) GetService() *Service { + if m != nil { + return m.Service + } + return nil +} + +// FirstPartyCaveat defines a first party caveat +type FirstPartyCaveat struct { + Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` + Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` + Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` +} + +func (m *FirstPartyCaveat) Reset() { *m = FirstPartyCaveat{} } +func (m *FirstPartyCaveat) String() string { return proto.CompactTextString(m) } +func (*FirstPartyCaveat) ProtoMessage() {} +func (*FirstPartyCaveat) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{8} +} +func (m *FirstPartyCaveat) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FirstPartyCaveat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FirstPartyCaveat.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 *FirstPartyCaveat) XXX_Merge(src proto.Message) { + xxx_messageInfo_FirstPartyCaveat.Merge(m, src) +} +func (m *FirstPartyCaveat) XXX_Size() int { + return m.Size() +} +func (m *FirstPartyCaveat) XXX_DiscardUnknown() { + xxx_messageInfo_FirstPartyCaveat.DiscardUnknown(m) +} + +var xxx_messageInfo_FirstPartyCaveat proto.InternalMessageInfo + +func (m *FirstPartyCaveat) GetScope() *Permissions { + if m != nil { + return m.Scope + } + return nil +} + +func (m *FirstPartyCaveat) GetExp() int64 { + if m != nil { + return m.Exp + } + return 0 +} + +func (m *FirstPartyCaveat) GetCnf() string { + if m != nil { + return m.Cnf + } + return "" +} + +func (m *FirstPartyCaveat) GetAud() string { + if m != nil { + return m.Aud + } + return "" +} + +// ThirdPartyCaveat defines a third party caveat +type ThirdPartyCaveat struct { + Scope *Permissions `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` + Exp int64 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp,omitempty"` + Cnf string `protobuf:"bytes,3,opt,name=cnf,proto3" json:"cnf,omitempty"` + Aud string `protobuf:"bytes,4,opt,name=aud,proto3" json:"aud,omitempty"` +} + +func (m *ThirdPartyCaveat) Reset() { *m = ThirdPartyCaveat{} } +func (m *ThirdPartyCaveat) String() string { return proto.CompactTextString(m) } +func (*ThirdPartyCaveat) ProtoMessage() {} +func (*ThirdPartyCaveat) Descriptor() ([]byte, []int) { + return fileDescriptor_739bb5ab5cb60751, []int{9} +} +func (m *ThirdPartyCaveat) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ThirdPartyCaveat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ThirdPartyCaveat.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ThirdPartyCaveat) XXX_Merge(src proto.Message) { + xxx_messageInfo_ThirdPartyCaveat.Merge(m, src) +} +func (m *ThirdPartyCaveat) XXX_Size() int { + return m.Size() +} +func (m *ThirdPartyCaveat) XXX_DiscardUnknown() { + xxx_messageInfo_ThirdPartyCaveat.DiscardUnknown(m) +} + +var xxx_messageInfo_ThirdPartyCaveat proto.InternalMessageInfo + +func (m *ThirdPartyCaveat) GetScope() *Permissions { + if m != nil { + return m.Scope + } + return nil +} + +func (m *ThirdPartyCaveat) GetExp() int64 { + if m != nil { + return m.Exp + } + return 0 +} + +func (m *ThirdPartyCaveat) GetCnf() string { + if m != nil { + return m.Cnf + } + return "" +} + +func (m *ThirdPartyCaveat) GetAud() string { + if m != nil { + return m.Aud + } + return "" +} + +func init() { + proto.RegisterType((*Alias)(nil), "did.v1.Alias") + proto.RegisterType((*Credential)(nil), "did.v1.Credential") + proto.RegisterType((*Document)(nil), "did.v1.Document") + proto.RegisterType((*Keyshare)(nil), "did.v1.Keyshare") + proto.RegisterMapType((map[string]string)(nil), "did.v1.Keyshare.MetadataEntry") + proto.RegisterMapType((map[string][]byte)(nil), "did.v1.Keyshare.PayloadsEntry") + proto.RegisterType((*Permissions)(nil), "did.v1.Permissions") + proto.RegisterType((*PubKey)(nil), "did.v1.PubKey") + proto.RegisterType((*PubKey_JWK)(nil), "did.v1.PubKey.JWK") + proto.RegisterType((*Service)(nil), "did.v1.Service") + proto.RegisterMapType((map[string]string)(nil), "did.v1.Service.ServiceEndpointsEntry") + proto.RegisterType((*ServiceInfo)(nil), "did.v1.ServiceInfo") + proto.RegisterType((*FirstPartyCaveat)(nil), "did.v1.FirstPartyCaveat") + proto.RegisterType((*ThirdPartyCaveat)(nil), "did.v1.ThirdPartyCaveat") +} + +func init() { proto.RegisterFile("did/v1/models.proto", fileDescriptor_739bb5ab5cb60751) } + +var fileDescriptor_739bb5ab5cb60751 = []byte{ + // 1146 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6e, 0xdb, 0xc6, + 0x13, 0x0e, 0x45, 0x4b, 0x96, 0x46, 0x8a, 0xec, 0xdf, 0xc6, 0xf9, 0x95, 0x30, 0x52, 0x41, 0x51, + 0xda, 0x54, 0x29, 0x0a, 0x09, 0x51, 0x50, 0xa0, 0x48, 0x7b, 0x49, 0x6d, 0x17, 0x70, 0x8c, 0x14, + 0x06, 0x13, 0x34, 0x68, 0x2f, 0xc2, 0x8a, 0x1c, 0xcb, 0x1b, 0x53, 0x5c, 0x62, 0x77, 0xa9, 0x98, + 0xc7, 0x5e, 0x7b, 0x6a, 0x9f, 0xa1, 0x2f, 0xd3, 0x63, 0x8e, 0x3d, 0x16, 0x49, 0xfb, 0x1e, 0xc5, + 0xfe, 0xa1, 0x44, 0x2b, 0x4d, 0x8b, 0x5e, 0x7a, 0xb1, 0x77, 0xbe, 0xf9, 0x86, 0x33, 0xfc, 0x66, + 0x66, 0x29, 0xb8, 0x11, 0xb3, 0x78, 0xbc, 0xbc, 0x3f, 0x5e, 0xf0, 0x18, 0x13, 0x39, 0xca, 0x04, + 0x57, 0x9c, 0x34, 0x62, 0x16, 0x8f, 0x96, 0xf7, 0xf7, 0xf7, 0x9c, 0x73, 0x8e, 0x29, 0x4a, 0xe6, + 0xbc, 0xfb, 0x7b, 0x73, 0x3e, 0xe7, 0xe6, 0x38, 0xd6, 0x27, 0x8b, 0x0e, 0xbe, 0x85, 0xfa, 0xa3, + 0x84, 0x51, 0x49, 0x02, 0xd8, 0x96, 0xf9, 0xec, 0x05, 0x46, 0x2a, 0xf0, 0xfa, 0xde, 0xb0, 0x15, + 0x96, 0x26, 0xf9, 0x3f, 0x34, 0xb8, 0x60, 0x73, 0x96, 0x06, 0x35, 0xe3, 0x70, 0x16, 0xe9, 0x01, + 0x44, 0x3c, 0x55, 0x82, 0x27, 0x09, 0x8a, 0xc0, 0x37, 0xbe, 0x0a, 0x32, 0xf8, 0xd9, 0x07, 0x38, + 0x10, 0x18, 0x63, 0xaa, 0x18, 0x4d, 0xfe, 0x26, 0xc1, 0x3d, 0xd8, 0xa5, 0x4a, 0xa1, 0x54, 0x54, + 0x31, 0x9e, 0x4e, 0x55, 0x91, 0xa1, 0x4b, 0xb5, 0x53, 0xc1, 0x9f, 0x15, 0x19, 0x56, 0x6a, 0xf1, + 0xaf, 0xd4, 0x72, 0x07, 0xae, 0x47, 0xab, 0x54, 0x53, 0x16, 0x07, 0x5b, 0x7d, 0x6f, 0xd8, 0x09, + 0x3b, 0x6b, 0xf0, 0x38, 0x26, 0xef, 0x03, 0x64, 0xf9, 0x2c, 0x61, 0xd1, 0xf4, 0x02, 0x8b, 0xa0, + 0x6e, 0x18, 0x2d, 0x8b, 0x9c, 0x60, 0x41, 0x6e, 0x41, 0x4b, 0x09, 0x9a, 0xca, 0x8c, 0x0b, 0x15, + 0x34, 0xfa, 0xfe, 0xb0, 0x15, 0xae, 0x01, 0x1d, 0x2c, 0xd9, 0x3c, 0x9d, 0x46, 0x3c, 0x4f, 0x55, + 0xb0, 0xdd, 0xf7, 0x86, 0xd7, 0xc3, 0x96, 0x46, 0x0e, 0x34, 0x40, 0x6e, 0x43, 0x27, 0x97, 0x28, + 0xa6, 0x99, 0x40, 0x89, 0xa9, 0x0a, 0x9a, 0x7d, 0x6f, 0xd8, 0x0c, 0xdb, 0x1a, 0x3b, 0xb5, 0x90, + 0xae, 0xd1, 0x50, 0x96, 0x28, 0xd8, 0x19, 0xc3, 0x38, 0x68, 0x19, 0x8e, 0x89, 0xfb, 0xc6, 0x61, + 0xe4, 0x23, 0xd8, 0x99, 0xd1, 0xe8, 0x22, 0xcf, 0xa6, 0x98, 0xb0, 0x39, 0x9b, 0x25, 0x18, 0x80, + 0xa1, 0x75, 0x2d, 0x7c, 0xe4, 0x50, 0x9d, 0xd0, 0x11, 0xb5, 0x3e, 0x18, 0xb4, 0x6d, 0x42, 0x8b, + 0x3d, 0xd5, 0x90, 0x11, 0x25, 0xe1, 0x29, 0x4e, 0x5f, 0x52, 0x91, 0xb2, 0x74, 0x1e, 0x74, 0x6c, + 0x42, 0x03, 0x3e, 0xb7, 0xd8, 0xe0, 0xa7, 0x1a, 0x34, 0x0f, 0x79, 0x94, 0x2f, 0x74, 0x89, 0x5d, + 0xa8, 0xb1, 0xd8, 0xb5, 0xa7, 0xc6, 0xe2, 0x8d, 0x16, 0xd7, 0x36, 0x5b, 0x4c, 0xee, 0x42, 0x97, + 0xe6, 0xea, 0x5c, 0x2b, 0x1c, 0x99, 0x26, 0x05, 0xbe, 0xd1, 0x6d, 0x03, 0x35, 0x1d, 0x96, 0x12, + 0x85, 0xe9, 0xef, 0x02, 0xd5, 0x39, 0xd7, 0x1d, 0xf2, 0x4d, 0x87, 0x4b, 0xfc, 0x89, 0x81, 0xc9, + 0x03, 0xb8, 0x19, 0xd1, 0x8c, 0xce, 0x58, 0xc2, 0x54, 0x31, 0x8d, 0x31, 0xc1, 0xb9, 0x7d, 0x72, + 0xdd, 0xf0, 0xf7, 0xd6, 0xce, 0xc3, 0x95, 0x6f, 0x23, 0x88, 0xa5, 0x4b, 0xee, 0xca, 0x69, 0x6c, + 0x06, 0x1d, 0xaf, 0x7c, 0x66, 0x20, 0x51, 0x2c, 0x59, 0x84, 0xc1, 0xb6, 0xa1, 0x95, 0xe6, 0xe0, + 0x8f, 0x1a, 0x34, 0x4f, 0xb0, 0x90, 0xe7, 0x54, 0x20, 0x79, 0x08, 0xcd, 0x05, 0x2a, 0x1a, 0x53, + 0x45, 0x03, 0xaf, 0xef, 0x0f, 0xdb, 0x93, 0xde, 0xc8, 0x2e, 0xda, 0xa8, 0xe4, 0x8c, 0x9e, 0x38, + 0xc2, 0x51, 0xaa, 0x44, 0x11, 0xae, 0xf8, 0x3a, 0x36, 0xa3, 0x45, 0xc2, 0x69, 0x2c, 0x83, 0xda, + 0x3b, 0x62, 0x4f, 0x1d, 0xc1, 0xc5, 0x96, 0x7c, 0xb2, 0x0f, 0x4d, 0xb3, 0xa2, 0x11, 0x4f, 0xdc, + 0xb0, 0xaf, 0xec, 0x8d, 0x49, 0xde, 0xda, 0x9c, 0xe4, 0x00, 0xb6, 0x97, 0x28, 0xa4, 0x55, 0x4d, + 0x0f, 0x6a, 0x69, 0x12, 0x02, 0x5b, 0x82, 0x27, 0x18, 0x34, 0xfa, 0xde, 0xb0, 0x1e, 0x9a, 0xf3, + 0xfe, 0xe7, 0x70, 0xfd, 0x4a, 0xfd, 0x64, 0x17, 0x7c, 0xfd, 0x58, 0x3b, 0x06, 0xfa, 0x48, 0xf6, + 0xa0, 0xbe, 0xa4, 0x49, 0x5e, 0xae, 0xa5, 0x35, 0x1e, 0xd6, 0x3e, 0xf3, 0x74, 0xf0, 0x95, 0x17, + 0xf8, 0xa7, 0xe0, 0x4e, 0x25, 0x78, 0x90, 0x40, 0xfb, 0x14, 0xc5, 0x82, 0x49, 0x5d, 0x9b, 0x24, + 0x9f, 0x40, 0x63, 0x2e, 0x68, 0xaa, 0xa4, 0xd1, 0xb9, 0x3b, 0xd9, 0x2b, 0xb5, 0x3a, 0x3c, 0x3e, + 0xfc, 0x9a, 0x2e, 0x50, 0x66, 0x34, 0xc2, 0xd0, 0x71, 0xc8, 0x18, 0x1a, 0x32, 0xe2, 0x19, 0x5a, + 0x65, 0xbb, 0x93, 0xf7, 0x4a, 0xf6, 0xfa, 0x91, 0x4f, 0xb5, 0x3f, 0x74, 0xb4, 0xc1, 0xf7, 0x3e, + 0x34, 0x4e, 0xf3, 0x99, 0x16, 0xe8, 0x8e, 0x93, 0x41, 0x57, 0xd9, 0x9d, 0xec, 0x54, 0x7a, 0x12, + 0xf2, 0x04, 0xad, 0x2e, 0x64, 0x02, 0x2d, 0x9a, 0xcc, 0xb9, 0x60, 0xea, 0x7c, 0x61, 0x6a, 0xaf, + 0x54, 0x74, 0x82, 0xc5, 0xa3, 0xd2, 0x17, 0xae, 0x69, 0x64, 0x0c, 0x4d, 0x4c, 0x23, 0x1e, 0xeb, + 0x6d, 0xf3, 0x4d, 0xc8, 0x8d, 0x4a, 0xc8, 0x91, 0x73, 0x85, 0x2b, 0x12, 0xb9, 0x0b, 0xf5, 0x28, + 0x17, 0x4b, 0x34, 0x4d, 0xec, 0x4e, 0x76, 0x2b, 0xec, 0x03, 0x8d, 0x87, 0xd6, 0x4d, 0x3e, 0x86, + 0xe6, 0x05, 0x16, 0xf6, 0x6e, 0xac, 0xbf, 0x55, 0xb5, 0xbe, 0x1b, 0xc3, 0xed, 0x0b, 0x7b, 0xd0, + 0x2d, 0x10, 0xf4, 0xa5, 0xe9, 0x71, 0x27, 0xd4, 0x47, 0xf2, 0x01, 0xf8, 0x2f, 0x5e, 0x5e, 0x98, + 0x5b, 0xab, 0x3d, 0x21, 0x2b, 0xa1, 0x8c, 0x18, 0xa3, 0xc7, 0xcf, 0x4f, 0x42, 0xed, 0xde, 0xa7, + 0xe0, 0x3f, 0x7e, 0x7e, 0x62, 0x3a, 0xa8, 0xd6, 0x1d, 0x54, 0xa6, 0xa7, 0x91, 0x58, 0xba, 0xe6, + 0xeb, 0x23, 0xe9, 0x80, 0x77, 0xe9, 0xa6, 0xd2, 0xbb, 0xd4, 0x96, 0x9d, 0xc2, 0x56, 0xe8, 0x15, + 0xda, 0xb2, 0x73, 0xd7, 0x0a, 0xbd, 0x54, 0x5b, 0x76, 0xdc, 0x5a, 0xa1, 0x87, 0x83, 0xdf, 0x6b, + 0xb0, 0xfd, 0xd4, 0x6e, 0xd9, 0x5b, 0x97, 0xcd, 0x6d, 0xe8, 0xb8, 0x05, 0xac, 0x7e, 0x02, 0xda, + 0x0e, 0x33, 0x6f, 0x76, 0x0b, 0x5a, 0xfa, 0x66, 0xd1, 0x62, 0x17, 0x2e, 0xfd, 0x1a, 0xa8, 0x7c, + 0x1c, 0xb6, 0xae, 0x7c, 0x1c, 0xfa, 0xd0, 0x8e, 0x51, 0x46, 0x82, 0x65, 0xaa, 0x5c, 0x89, 0x56, + 0x58, 0x85, 0x48, 0x08, 0xff, 0x2b, 0x53, 0x63, 0x1a, 0x67, 0x9c, 0xe9, 0x21, 0x6c, 0x98, 0x85, + 0xfd, 0xb0, 0x54, 0xcb, 0x95, 0x5d, 0xfe, 0x3f, 0x2a, 0x79, 0x76, 0x6f, 0x77, 0xe5, 0x06, 0x4c, + 0x3e, 0x85, 0x76, 0xb6, 0x1e, 0x6e, 0xa7, 0xfd, 0x8d, 0xb7, 0x87, 0x54, 0x86, 0x55, 0xde, 0xfe, + 0x01, 0xdc, 0xfc, 0xcb, 0x0c, 0xff, 0x66, 0x2b, 0x07, 0x3f, 0x78, 0xd0, 0x76, 0x4f, 0x39, 0x4e, + 0xcf, 0xb8, 0x56, 0x06, 0x2f, 0x99, 0x34, 0x9b, 0xa5, 0x3f, 0x01, 0xce, 0x7a, 0xe7, 0xa7, 0xbd, + 0x0f, 0xed, 0x33, 0x96, 0xce, 0x51, 0x64, 0x82, 0xa5, 0xca, 0x29, 0x5d, 0x85, 0xc8, 0xbd, 0xf5, + 0xe5, 0xb9, 0x65, 0xde, 0x6c, 0x67, 0x43, 0xa7, 0xf5, 0x6d, 0x2a, 0x61, 0xf7, 0x2b, 0x26, 0xa4, + 0x3a, 0xa5, 0x42, 0x15, 0x07, 0x74, 0x89, 0x54, 0x87, 0xd7, 0xcd, 0x56, 0x9a, 0x7a, 0xde, 0x21, + 0x8b, 0x65, 0xe8, 0xf7, 0xc6, 0xcb, 0xcc, 0x14, 0xe8, 0x87, 0xfa, 0x68, 0xc6, 0x31, 0x3d, 0x73, + 0x55, 0xe9, 0xa3, 0x46, 0x68, 0x1e, 0xbb, 0xb6, 0xeb, 0xa3, 0x4e, 0xfa, 0xec, 0x9c, 0x89, 0xf8, + 0xbf, 0x4c, 0xfa, 0xe5, 0x17, 0xbf, 0xbc, 0xee, 0x79, 0xaf, 0x5e, 0xf7, 0xbc, 0xdf, 0x5e, 0xf7, + 0xbc, 0x1f, 0xdf, 0xf4, 0xae, 0xbd, 0x7a, 0xd3, 0xbb, 0xf6, 0xeb, 0x9b, 0xde, 0xb5, 0xef, 0x06, + 0x73, 0xa6, 0xce, 0xf3, 0xd9, 0x28, 0xe2, 0x8b, 0x31, 0x4f, 0x25, 0x4f, 0xc5, 0xd8, 0xfc, 0xb9, + 0x1c, 0xeb, 0xdf, 0x6a, 0x7a, 0xdc, 0xe5, 0xac, 0x61, 0xae, 0xf7, 0x07, 0x7f, 0x06, 0x00, 0x00, + 0xff, 0xff, 0x38, 0x84, 0xad, 0x32, 0xdc, 0x09, 0x00, 0x00, +} + +func (m *Alias) Marshal() (dAtA []byte, err error) { + 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 *Alias) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Alias) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintModels(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x1a + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintModels(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintModels(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Credential) 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 *Credential) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Credential) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CloneWarning { + i-- + if m.CloneWarning { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if m.BackupState { + i-- + if m.BackupState { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.BackupEligible { + i-- + if m.BackupEligible { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.UserVerified { + i-- + if m.UserVerified { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if m.UserPresent { + i-- + if m.UserPresent { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.SignCount != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.SignCount)) + i-- + dAtA[i] = 0x38 + } + if len(m.Transport) > 0 { + for iNdEx := len(m.Transport) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Transport[iNdEx]) + copy(dAtA[i:], m.Transport[iNdEx]) + i = encodeVarintModels(dAtA, i, uint64(len(m.Transport[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintModels(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x2a + } + if len(m.CredentialId) > 0 { + i -= len(m.CredentialId) + copy(dAtA[i:], m.CredentialId) + i = encodeVarintModels(dAtA, i, uint64(len(m.CredentialId))) + i-- + dAtA[i] = 0x22 + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintModels(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x1a + } + if len(m.AttestationType) > 0 { + i -= len(m.AttestationType) + copy(dAtA[i:], m.AttestationType) + i = encodeVarintModels(dAtA, i, uint64(len(m.AttestationType))) + i-- + dAtA[i] = 0x12 + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintModels(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Document) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Document) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Service) > 0 { + for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Service[iNdEx]) + copy(dAtA[i:], m.Service[iNdEx]) + i = encodeVarintModels(dAtA, i, uint64(len(m.Service[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.CapabilityInvocation) > 0 { + for iNdEx := len(m.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CapabilityInvocation[iNdEx]) + copy(dAtA[i:], m.CapabilityInvocation[iNdEx]) + i = encodeVarintModels(dAtA, i, uint64(len(m.CapabilityInvocation[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.CapabilityDelegation) > 0 { + for iNdEx := len(m.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CapabilityDelegation[iNdEx]) + copy(dAtA[i:], m.CapabilityDelegation[iNdEx]) + i = encodeVarintModels(dAtA, i, uint64(len(m.CapabilityDelegation[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.AssertionMethod) > 0 { + for iNdEx := len(m.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AssertionMethod[iNdEx]) + copy(dAtA[i:], m.AssertionMethod[iNdEx]) + i = encodeVarintModels(dAtA, i, uint64(len(m.AssertionMethod[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Authentication) > 0 { + for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Authentication[iNdEx]) + copy(dAtA[i:], m.Authentication[iNdEx]) + i = encodeVarintModels(dAtA, i, uint64(len(m.Authentication[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintModels(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintModels(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Keyshare) 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 *Keyshare) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Keyshare) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Role != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x30 + } + if m.Version != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x28 + } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintModels(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x22 + } + if len(m.Protocol) > 0 { + i -= len(m.Protocol) + copy(dAtA[i:], m.Protocol) + i = encodeVarintModels(dAtA, i, uint64(len(m.Protocol))) + i-- + dAtA[i] = 0x1a + } + if len(m.Payloads) > 0 { + for k := range m.Payloads { + v := m.Payloads[k] + baseI := i + if len(v) > 0 { + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintModels(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintModels(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintModels(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Metadata) > 0 { + for k := range m.Metadata { + v := m.Metadata[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintModels(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintModels(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintModels(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Permissions) 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 *Permissions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Permissions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Scopes) > 0 { + dAtA2 := make([]byte, len(m.Scopes)*10) + var j1 int + for _, num := range m.Scopes { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintModels(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0x12 + } + if len(m.Grants) > 0 { + dAtA4 := make([]byte, len(m.Grants)*10) + var j3 int + for _, num := range m.Grants { + for num >= 1<<7 { + dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j3++ + } + dAtA4[j3] = uint8(num) + j3++ + } + i -= j3 + copy(dAtA[i:], dAtA4[:j3]) + i = encodeVarintModels(dAtA, i, uint64(j3)) + 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 = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.Raw) > 0 { + i -= len(m.Raw) + copy(dAtA[i:], m.Raw) + i = encodeVarintModels(dAtA, i, uint64(len(m.Raw))) + i-- + dAtA[i] = 0x32 + } + if m.KeyType != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.KeyType)) + i-- + dAtA[i] = 0x28 + } + if m.Curve != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Curve)) + i-- + dAtA[i] = 0x20 + } + if m.Encoding != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Encoding)) + i-- + dAtA[i] = 0x18 + } + if m.Algorithm != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Algorithm)) + i-- + dAtA[i] = 0x10 + } + if m.Role != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Role)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PubKey_JWK) 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_JWK) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubKey_JWK) 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 = encodeVarintModels(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 = encodeVarintModels(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 = encodeVarintModels(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 = encodeVarintModels(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 = encodeVarintModels(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 = encodeVarintModels(dAtA, i, uint64(len(m.Kty))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Service) 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 *Service) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Permissions != nil { + { + size, err := m.Permissions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.ServiceEndpoints) > 0 { + for k := range m.ServiceEndpoints { + v := m.ServiceEndpoints[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintModels(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintModels(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintModels(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintModels(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x2a + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintModels(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x22 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintModels(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x1a + } + if len(m.ServiceType) > 0 { + i -= len(m.ServiceType) + copy(dAtA[i:], m.ServiceType) + i = encodeVarintModels(dAtA, i, uint64(len(m.ServiceType))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintModels(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ServiceInfo) 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 *ServiceInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Service != nil { + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Fingerprint) > 0 { + i -= len(m.Fingerprint) + copy(dAtA[i:], m.Fingerprint) + i = encodeVarintModels(dAtA, i, uint64(len(m.Fingerprint))) + i-- + dAtA[i] = 0x1a + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintModels(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x12 + } + if m.Exists { + i-- + if m.Exists { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *FirstPartyCaveat) 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 *FirstPartyCaveat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FirstPartyCaveat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Aud) > 0 { + i -= len(m.Aud) + copy(dAtA[i:], m.Aud) + i = encodeVarintModels(dAtA, i, uint64(len(m.Aud))) + i-- + dAtA[i] = 0x22 + } + if len(m.Cnf) > 0 { + i -= len(m.Cnf) + copy(dAtA[i:], m.Cnf) + i = encodeVarintModels(dAtA, i, uint64(len(m.Cnf))) + i-- + dAtA[i] = 0x1a + } + if m.Exp != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Exp)) + i-- + dAtA[i] = 0x10 + } + if m.Scope != nil { + { + size, err := m.Scope.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ThirdPartyCaveat) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ThirdPartyCaveat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ThirdPartyCaveat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Aud) > 0 { + i -= len(m.Aud) + copy(dAtA[i:], m.Aud) + i = encodeVarintModels(dAtA, i, uint64(len(m.Aud))) + i-- + dAtA[i] = 0x22 + } + if len(m.Cnf) > 0 { + i -= len(m.Cnf) + copy(dAtA[i:], m.Cnf) + i = encodeVarintModels(dAtA, i, uint64(len(m.Cnf))) + i-- + dAtA[i] = 0x1a + } + if m.Exp != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Exp)) + i-- + dAtA[i] = 0x10 + } + if m.Scope != nil { + { + size, err := m.Scope.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintModels(dAtA []byte, offset int, v uint64) int { + offset -= sovModels(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Alias) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *Credential) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.AttestationType) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.CredentialId) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if len(m.Transport) > 0 { + for _, s := range m.Transport { + l = len(s) + n += 1 + l + sovModels(uint64(l)) + } + } + if m.SignCount != 0 { + n += 1 + sovModels(uint64(m.SignCount)) + } + if m.UserPresent { + n += 2 + } + if m.UserVerified { + n += 2 + } + if m.BackupEligible { + n += 2 + } + if m.BackupState { + n += 2 + } + if m.CloneWarning { + n += 2 + } + return n +} + +func (m *Document) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if len(m.Authentication) > 0 { + for _, s := range m.Authentication { + l = len(s) + n += 1 + l + sovModels(uint64(l)) + } + } + if len(m.AssertionMethod) > 0 { + for _, s := range m.AssertionMethod { + l = len(s) + n += 1 + l + sovModels(uint64(l)) + } + } + if len(m.CapabilityDelegation) > 0 { + for _, s := range m.CapabilityDelegation { + l = len(s) + n += 1 + l + sovModels(uint64(l)) + } + } + if len(m.CapabilityInvocation) > 0 { + for _, s := range m.CapabilityInvocation { + l = len(s) + n += 1 + l + sovModels(uint64(l)) + } + } + if len(m.Service) > 0 { + for _, s := range m.Service { + l = len(s) + n += 1 + l + sovModels(uint64(l)) + } + } + return n +} + +func (m *Keyshare) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovModels(uint64(len(k))) + 1 + len(v) + sovModels(uint64(len(v))) + n += mapEntrySize + 1 + sovModels(uint64(mapEntrySize)) + } + } + if len(m.Payloads) > 0 { + for k, v := range m.Payloads { + _ = k + _ = v + l = 0 + if len(v) > 0 { + l = 1 + len(v) + sovModels(uint64(len(v))) + } + mapEntrySize := 1 + len(k) + sovModels(uint64(len(k))) + l + n += mapEntrySize + 1 + sovModels(uint64(mapEntrySize)) + } + } + l = len(m.Protocol) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if m.Version != 0 { + n += 1 + sovModels(uint64(m.Version)) + } + if m.Role != 0 { + n += 1 + sovModels(uint64(m.Role)) + } + return n +} + +func (m *Permissions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Grants) > 0 { + l = 0 + for _, e := range m.Grants { + l += sovModels(uint64(e)) + } + n += 1 + sovModels(uint64(l)) + l + } + if len(m.Scopes) > 0 { + l = 0 + for _, e := range m.Scopes { + l += sovModels(uint64(e)) + } + n += 1 + sovModels(uint64(l)) + l + } + return n +} + +func (m *PubKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Role != 0 { + n += 1 + sovModels(uint64(m.Role)) + } + if m.Algorithm != 0 { + n += 1 + sovModels(uint64(m.Algorithm)) + } + if m.Encoding != 0 { + n += 1 + sovModels(uint64(m.Encoding)) + } + if m.Curve != 0 { + n += 1 + sovModels(uint64(m.Curve)) + } + if m.KeyType != 0 { + n += 1 + sovModels(uint64(m.KeyType)) + } + l = len(m.Raw) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if m.Jwk != nil { + l = m.Jwk.Size() + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *PubKey_JWK) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Kty) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Crv) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.X) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Y) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.N) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.E) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *Service) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.ServiceType) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if len(m.ServiceEndpoints) > 0 { + for k, v := range m.ServiceEndpoints { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovModels(uint64(len(k))) + 1 + len(v) + sovModels(uint64(len(v))) + n += mapEntrySize + 1 + sovModels(uint64(mapEntrySize)) + } + } + if m.Permissions != nil { + l = m.Permissions.Size() + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *ServiceInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Exists { + n += 2 + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Fingerprint) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if m.Service != nil { + l = m.Service.Size() + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *FirstPartyCaveat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Scope != nil { + l = m.Scope.Size() + n += 1 + l + sovModels(uint64(l)) + } + if m.Exp != 0 { + n += 1 + sovModels(uint64(m.Exp)) + } + l = len(m.Cnf) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Aud) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func (m *ThirdPartyCaveat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Scope != nil { + l = m.Scope.Size() + n += 1 + l + sovModels(uint64(l)) + } + if m.Exp != 0 { + n += 1 + sovModels(uint64(m.Exp)) + } + l = len(m.Cnf) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + l = len(m.Aud) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + return n +} + +func sovModels(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModels(x uint64) (n int) { + return sovModels(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Alias) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Alias: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Alias: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Credential) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Credential: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Credential: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttestationType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AttestationType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CredentialId = append(m.CredentialId[:0], dAtA[iNdEx:postIndex]...) + if m.CredentialId == nil { + m.CredentialId = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.PublicKey == nil { + m.PublicKey = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Transport", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Transport = append(m.Transport, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SignCount", wireType) + } + m.SignCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SignCount |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserPresent", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UserPresent = bool(v != 0) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserVerified", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UserVerified = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BackupEligible", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BackupEligible = bool(v != 0) + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BackupState", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BackupState = bool(v != 0) + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CloneWarning", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CloneWarning = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Document) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Document: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authentication = append(m.Authentication, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssertionMethod", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssertionMethod = append(m.AssertionMethod, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CapabilityDelegation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CapabilityDelegation = append(m.CapabilityDelegation, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CapabilityInvocation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CapabilityInvocation = append(m.CapabilityInvocation, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Service = append(m.Service, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Keyshare) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Keyshare: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Keyshare: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + 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 ErrIntOverflowModels + } + 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 ErrInvalidLengthModels + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthModels + } + 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 ErrIntOverflowModels + } + 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 ErrInvalidLengthModels + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthModels + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payloads", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Payloads == nil { + m.Payloads = make(map[string][]byte) + } + var mapkey string + mapvalue := []byte{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + 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 ErrInvalidLengthModels + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthModels + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapbyteLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapbyteLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intMapbyteLen := int(mapbyteLen) + if intMapbyteLen < 0 { + return ErrInvalidLengthModels + } + postbytesIndex := iNdEx + intMapbyteLen + if postbytesIndex < 0 { + return ErrInvalidLengthModels + } + if postbytesIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = make([]byte, mapbyteLen) + copy(mapvalue, dAtA[iNdEx:postbytesIndex]) + iNdEx = postbytesIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Payloads[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Protocol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.PublicKey == nil { + m.PublicKey = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + m.Role = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Role |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Permissions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Permissions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Permissions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v DIDNamespace + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= DIDNamespace(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Grants = append(m.Grants, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + if elementCount != 0 && len(m.Grants) == 0 { + m.Grants = make([]DIDNamespace, 0, elementCount) + } + for iNdEx < postIndex { + var v DIDNamespace + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= DIDNamespace(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Grants = append(m.Grants, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Grants", wireType) + } + case 2: + if wireType == 0 { + var v PermissionScope + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= PermissionScope(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Scopes = append(m.Scopes, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + if elementCount != 0 && len(m.Scopes) == 0 { + m.Scopes = make([]PermissionScope, 0, elementCount) + } + for iNdEx < postIndex { + var v PermissionScope + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= PermissionScope(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Scopes = append(m.Scopes, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *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 ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) + } + m.Role = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Role |= KeyRole(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Algorithm", wireType) + } + m.Algorithm = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Algorithm |= KeyAlgorithm(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Encoding", wireType) + } + m.Encoding = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Encoding |= KeyEncoding(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Curve", wireType) + } + m.Curve = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Curve |= KeyCurve(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyType", wireType) + } + m.KeyType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.KeyType |= KeyType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Raw = append(m.Raw[:0], dAtA[iNdEx:postIndex]...) + if m.Raw == nil { + m.Raw = []byte{} + } + iNdEx = postIndex + case 7: + 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 ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Jwk == nil { + m.Jwk = &PubKey_JWK{} + } + if err := m.Jwk.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PubKey_JWK) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JWK: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JWK: 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 ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.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 ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.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 ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.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 ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.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 ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.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 ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.E = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Service) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Service: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceEndpoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ServiceEndpoints == nil { + m.ServiceEndpoints = 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 ErrIntOverflowModels + } + 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 ErrIntOverflowModels + } + 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 ErrInvalidLengthModels + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthModels + } + 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 ErrIntOverflowModels + } + 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 ErrInvalidLengthModels + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthModels + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.ServiceEndpoints[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Permissions == nil { + m.Permissions = &Permissions{} + } + if err := m.Permissions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServiceInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServiceInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exists", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exists = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fingerprint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fingerprint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Service == nil { + m.Service = &Service{} + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FirstPartyCaveat) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FirstPartyCaveat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FirstPartyCaveat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scope == nil { + m.Scope = &Permissions{} + } + if err := m.Scope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) + } + m.Exp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cnf", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cnf = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aud", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Aud = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ThirdPartyCaveat) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ThirdPartyCaveat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ThirdPartyCaveat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scope == nil { + m.Scope = &Permissions{} + } + if err := m.Scope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exp", wireType) + } + m.Exp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cnf", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cnf = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aud", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Aud = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModels(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, ErrIntOverflowModels + } + 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, ErrIntOverflowModels + } + 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, ErrIntOverflowModels + } + 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, ErrInvalidLengthModels + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModels + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModels + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModels = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModels = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModels = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/did/types/msgs.go b/x/did/types/msgs.go index e308bb52a..725651343 100644 --- a/x/did/types/msgs.go +++ b/x/did/types/msgs.go @@ -48,6 +48,91 @@ func (msg *MsgUpdateParams) Validate() error { return msg.Params.Validate() } +// +// [RegisterService] +// + +// NewMsgRegisterController creates a new instance of MsgRegisterController +func NewMsgRegisterService( + sender sdk.Address, +) (*MsgRegisterService, error) { + return &MsgRegisterService{ + Controller: sender.String(), + }, nil +} + +// Route returns the name of the module +func (msg MsgRegisterService) Route() string { return ModuleName } + +// Type returns the the action +func (msg MsgRegisterService) Type() string { return "register_service" } + +// GetSignBytes implements the LegacyMsg interface. +func (msg MsgRegisterService) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (msg *MsgRegisterService) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Controller) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (msg *MsgRegisterService) Validate() error { + return nil +} + +// +// [AllocateVault] +// + +// NewMsgAllocateVault creates a new instance of MsgAllocateVault +func NewMsgAllocateVault( + sender sdk.Address, +) (*MsgAllocateVault, error) { + return &MsgAllocateVault{ +// [RegisterController] +// + +// NewMsgRegisterController creates a new instance of MsgRegisterController +func NewMsgRegisterController( + sender sdk.Address, +) (*MsgRegisterController, error) { + return &MsgRegisterController{ + Authority: sender.String(), + }, nil +} + +// Route returns the name of the module +func (msg MsgAllocateVault) Route() string { return ModuleName } + +// Type returns the the action +func (msg MsgAllocateVault) Type() string { return "allocate_vault" } + +// GetSignBytes implements the LegacyMsg interface. +func (msg MsgAllocateVault) GetSignBytes() []byte { +func (msg MsgRegisterController) Route() string { return ModuleName } + +// Type returns the the action +func (msg MsgRegisterController) Type() string { return "initialize_controller" } + +// GetSignBytes implements the LegacyMsg interface. +func (msg MsgRegisterController) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (msg *MsgAllocateVault) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + +// Vaalidate does a sanity check on the provided data. +func (msg *MsgAllocateVault) Validate() error { + return nil +} + // // [RegisterController] // @@ -65,7 +150,7 @@ func NewMsgRegisterController( func (msg MsgRegisterController) Route() string { return ModuleName } // Type returns the the action -func (msg MsgRegisterController) Type() string { return "initialize_controller" } +func (msg MsgRegisterController) Type() string { return "register_controller" } // GetSignBytes implements the LegacyMsg interface. func (msg MsgRegisterController) GetSignBytes() []byte { diff --git a/x/did/types/namespace.go b/x/did/types/namespace.go new file mode 100644 index 000000000..1e6da75c9 --- /dev/null +++ b/x/did/types/namespace.go @@ -0,0 +1,102 @@ +package types + +import ( + "cosmossdk.io/x/nft" +) + +func (n DIDNamespace) ID() string { + switch n { + case DIDNamespace_DID_NAMESPACE_DWN: + return "did:dwn:0" + case DIDNamespace_DID_NAMESPACE_SONR: + return "did:sonr:0" + case DIDNamespace_DID_NAMESPACE_BITCOIN: + return "did:btc:0" + case DIDNamespace_DID_NAMESPACE_ETHEREUM: + return "did:eth:0" + case DIDNamespace_DID_NAMESPACE_IBC: + return "did:ibc:0" + case DIDNamespace_DID_NAMESPACE_WEBAUTHN: + return "did:authn:0" + case DIDNamespace_DID_NAMESPACE_SERVICE: + return "did:web:0" + case DIDNamespace_DID_NAMESPACE_IPFS: + return "did:ipfs:0" + } + return "" +} + +func (n DIDNamespace) Name() string { + switch n { + case DIDNamespace_DID_NAMESPACE_DWN: + return "DecentralizedWebNode" + case DIDNamespace_DID_NAMESPACE_SONR: + return "SonrNetwork" + case DIDNamespace_DID_NAMESPACE_BITCOIN: + return "BitcoinNetwork" + case DIDNamespace_DID_NAMESPACE_ETHEREUM: + return "EthereumNetwork" + case DIDNamespace_DID_NAMESPACE_IBC: + return "IBCNetwork" + case DIDNamespace_DID_NAMESPACE_WEBAUTHN: + return "WebAuthentication" + case DIDNamespace_DID_NAMESPACE_SERVICE: + return "DecentrlizedService" + case DIDNamespace_DID_NAMESPACE_IPFS: + return "IPFSStorage" + } + return "" +} + +func (n DIDNamespace) Symbol() string { + switch n { + case DIDNamespace_DID_NAMESPACE_DWN: + return "DWN" + case DIDNamespace_DID_NAMESPACE_SONR: + return "SONR" + case DIDNamespace_DID_NAMESPACE_BITCOIN: + return "BTC" + case DIDNamespace_DID_NAMESPACE_ETHEREUM: + return "ETH" + case DIDNamespace_DID_NAMESPACE_IBC: + return "IBC" + case DIDNamespace_DID_NAMESPACE_WEBAUTHN: + return "WEBAUTHN" + case DIDNamespace_DID_NAMESPACE_SERVICE: + return "SERVICE" + case DIDNamespace_DID_NAMESPACE_IPFS: + return "IPFS" + } + return "" +} + +func (n DIDNamespace) Description() string { + switch n { + case DIDNamespace_DID_NAMESPACE_DWN: + return "DWN Service Provider" + case DIDNamespace_DID_NAMESPACE_SONR: + return "Sonr Network Gateway" + case DIDNamespace_DID_NAMESPACE_BITCOIN: + return "Bitcoin Network Gateway" + case DIDNamespace_DID_NAMESPACE_ETHEREUM: + return "Ethereum Network Gateway" + case DIDNamespace_DID_NAMESPACE_IBC: + return "IBC Network Gateway" + case DIDNamespace_DID_NAMESPACE_WEBAUTHN: + return "Web Authentication Key" + case DIDNamespace_DID_NAMESPACE_SERVICE: + return "Decentrlized Service" + case DIDNamespace_DID_NAMESPACE_IPFS: + return "Data Storage on IPFS" + } + return "" +} + +func (n DIDNamespace) GetNFTClass() *nft.Class { + return &nft.Class{ + Id: n.ID(), + Name: n.Name(), + Symbol: n.Symbol(), + Description: n.Description(), + } +} diff --git a/x/did/types/oidc/DiscoveryDocument.pkl.go b/x/did/types/oidc/DiscoveryDocument.pkl.go new file mode 100644 index 000000000..d25cce456 --- /dev/null +++ b/x/did/types/oidc/DiscoveryDocument.pkl.go @@ -0,0 +1,34 @@ +// Code generated from Pkl module `oidc`. DO NOT EDIT. +package oidc + +type DiscoveryDocument struct { + Issuer string `pkl:"issuer" json:"issuer,omitempty" param:"issuer"` + + AuthorizationEndpoint string `pkl:"authorization_endpoint" json:"authorization_endpoint,omitempty" param:"authorization_endpoint"` + + TokenEndpoint string `pkl:"token_endpoint" json:"token_endpoint,omitempty" param:"token_endpoint"` + + UserinfoEndpoint string `pkl:"userinfo_endpoint" json:"userinfo_endpoint,omitempty" param:"userinfo_endpoint"` + + JwksUri string `pkl:"jwks_uri" json:"jwks_uri,omitempty" param:"jwks_uri"` + + RegistrationEndpoint string `pkl:"registration_endpoint" json:"registration_endpoint,omitempty" param:"registration_endpoint"` + + ScopesSupported []string `pkl:"scopes_supported" json:"scopes_supported,omitempty" param:"scopes_supported"` + + ResponseTypesSupported []string `pkl:"response_types_supported" json:"response_types_supported,omitempty" param:"response_types_supported"` + + ResponseModesSupported []string `pkl:"response_modes_supported" json:"response_modes_supported,omitempty" param:"response_modes_supported"` + + SubjectTypesSupported []string `pkl:"subject_types_supported" json:"subject_types_supported,omitempty" param:"subject_types_supported"` + + IdTokenSigningAlgValuesSupported []string `pkl:"id_token_signing_alg_values_supported" json:"id_token_signing_alg_values_supported,omitempty" param:"id_token_signing_alg_values_supported"` + + ClaimsSupported []string `pkl:"claims_supported" json:"claims_supported,omitempty" param:"claims_supported"` + + GrantTypesSupported []string `pkl:"grant_types_supported" json:"grant_types_supported,omitempty" param:"grant_types_supported"` + + AcrValuesSupported []string `pkl:"acr_values_supported" json:"acr_values_supported,omitempty" param:"acr_values_supported"` + + TokenEndpointAuthMethodsSupported []string `pkl:"token_endpoint_auth_methods_supported" json:"token_endpoint_auth_methods_supported,omitempty" param:"token_endpoint_auth_methods_supported"` +} diff --git a/x/did/types/oidc/Oidc.pkl.go b/x/did/types/oidc/Oidc.pkl.go new file mode 100644 index 000000000..3a4e4a67a --- /dev/null +++ b/x/did/types/oidc/Oidc.pkl.go @@ -0,0 +1,36 @@ +// Code generated from Pkl module `oidc`. DO NOT EDIT. +package oidc + +import ( + "context" + + "github.com/apple/pkl-go/pkl" +) + +type Oidc struct { +} + +// LoadFromPath loads the pkl module at the given path and evaluates it into a Oidc +func LoadFromPath(ctx context.Context, path string) (ret *Oidc, err error) { + evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) + if err != nil { + return nil, err + } + defer func() { + cerr := evaluator.Close() + if err == nil { + err = cerr + } + }() + ret, err = Load(ctx, evaluator, pkl.FileSource(path)) + return ret, err +} + +// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Oidc +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Oidc, error) { + var ret Oidc + if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { + return nil, err + } + return &ret, nil +} diff --git a/x/did/types/oidc/init.pkl.go b/x/did/types/oidc/init.pkl.go new file mode 100644 index 000000000..0f351c673 --- /dev/null +++ b/x/did/types/oidc/init.pkl.go @@ -0,0 +1,9 @@ +// Code generated from Pkl module `oidc`. DO NOT EDIT. +package oidc + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("oidc", Oidc{}) + pkl.RegisterMapping("oidc#DiscoveryDocument", DiscoveryDocument{}) +} diff --git a/x/did/types/pubkey.go b/x/did/types/pubkey.go new file mode 100644 index 000000000..8d75ac1fb --- /dev/null +++ b/x/did/types/pubkey.go @@ -0,0 +1,153 @@ +package types + +import ( + "crypto/ecdsa" + "encoding/hex" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/mr-tron/base58/base58" + "github.com/onsonr/crypto" + "github.com/onsonr/crypto/macaroon" +) + +var WalletKeyInfo = &KeyInfo{ + Role: KeyRole_KEY_ROLE_DELEGATION, + Curve: KeyCurve_KEY_CURVE_SECP256K1, + Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, + Encoding: KeyEncoding_KEY_ENCODING_HEX, + Type: KeyType_KEY_TYPE_BIP32, +} + +var EthKeyInfo = &KeyInfo{ + Role: KeyRole_KEY_ROLE_DELEGATION, + Curve: KeyCurve_KEY_CURVE_KECCAK256, + Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, + Encoding: KeyEncoding_KEY_ENCODING_HEX, + Type: KeyType_KEY_TYPE_BIP32, +} + +var SonrKeyInfo = &KeyInfo{ + Role: KeyRole_KEY_ROLE_INVOCATION, + Curve: KeyCurve_KEY_CURVE_P256, + Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA, + Encoding: KeyEncoding_KEY_ENCODING_HEX, + Type: KeyType_KEY_TYPE_MPC, +} + +var ChainCodeKeyInfos = map[ChainCode]*KeyInfo{ + ChainCodeBTC: WalletKeyInfo, + ChainCodeETH: EthKeyInfo, + ChainCodeSNR: SonrKeyInfo, + ChainCodeIBC: WalletKeyInfo, +} + +// NewEthPublicKey returns a new ethereum public key +func NewPublicKey(data []byte, keyInfo *KeyInfo) (*PubKey, error) { + encKey, err := keyInfo.Encoding.EncodeRaw(data) + if err != nil { + return nil, err + } + + return &PubKey{ + Raw: encKey, + Role: keyInfo.Role, + Encoding: keyInfo.Encoding, + Algorithm: keyInfo.Algorithm, + Curve: keyInfo.Curve, + KeyType: keyInfo.Type, + }, nil +} + +// Address returns the address of the public key +func (k *PubKey) Address() cryptotypes.Address { + return nil +} + +// Bytes returns the raw bytes of the public key +func (k *PubKey) Bytes() []byte { + bz, _ := k.GetEncoding().DecodeRaw(k.GetRaw()) + return bz +} + +// Clone returns a copy of the public key +func (k *PubKey) Clone() cryptotypes.PubKey { + return &PubKey{ + Raw: k.GetRaw(), + Role: k.GetRole(), + Encoding: k.GetEncoding(), + Algorithm: k.GetAlgorithm(), + Curve: k.GetCurve(), + KeyType: k.GetKeyType(), + } +} + +// IssueMacaroon returns a macaroon for the public key with the given id and location +func (pk *PubKey) IssueMacaroon(subject string, origin string) (*macaroon.Macaroon, error) { + return macaroon.New(pk.Bytes(), []byte(subject), origin, macaroon.LatestVersion) +} + +// ECDSA returns the ECDSA public key +func (k *PubKey) ECDSA() (*ecdsa.PublicKey, error) { + return crypto.ComputeEcdsaPublicKey(k.Bytes()) +} + +// VerifySignature verifies a signature over the given message +func (k *PubKey) VerifySignature(msg []byte, sig []byte) bool { + pk, err := crypto.ComputeEcdsaPublicKey(k.Bytes()) + sigMpc, err := crypto.DeserializeMPCSignature(sig) + if err != nil { + return false + } + return crypto.VerifyMPCSignature(sigMpc, msg, pk) +} + +// Equals returns true if two public keys are equal +func (k *PubKey) Equals(k2 cryptotypes.PubKey) bool { + if k == nil && k2 == nil { + return true + } + return false +} + +// Type returns the type of the public key +func (k *PubKey) Type() string { + return k.KeyType.String() +} + +// DecodePublicKey extracts the public key from the given data +func (k *KeyInfo) DecodePublicKey(data interface{}) ([]byte, error) { + var bz []byte + switch v := data.(type) { + case string: + bz = []byte(v) + case []byte: + bz = v + default: + return nil, ErrUnsupportedKeyEncoding + } + + if k.Encoding == KeyEncoding_KEY_ENCODING_RAW { + return bz, nil + } + if k.Encoding == KeyEncoding_KEY_ENCODING_HEX { + return hex.DecodeString(string(bz)) + } + if k.Encoding == KeyEncoding_KEY_ENCODING_MULTIBASE { + return base58.Decode(string(bz)) + } + return nil, ErrUnsupportedKeyEncoding +} + +// EncodePublicKey encodes the public key according to the KeyInfo's encoding +func (k *KeyInfo) EncodePublicKey(data []byte) (string, error) { + if k.Encoding == KeyEncoding_KEY_ENCODING_RAW { + return string(data), nil + } + if k.Encoding == KeyEncoding_KEY_ENCODING_HEX { + return hex.EncodeToString(data), nil + } + if k.Encoding == KeyEncoding_KEY_ENCODING_MULTIBASE { + return base58.Encode(data), nil + } + return "", ErrUnsupportedKeyEncoding +} diff --git a/x/did/types/query.pb.go b/x/did/types/query.pb.go index c820c2b90..1df81f82b 100644 --- a/x/did/types/query.pb.go +++ b/x/did/types/query.pb.go @@ -28,22 +28,26 @@ var _ = math.Inf // 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 { +// Queryequest is the request type for the Query/Params RPC method. +type QueryRequest struct { + Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Asset string `protobuf:"bytes,4,opt,name=asset,proto3" json:"asset,omitempty"` } -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { return fileDescriptor_ae1fa9bb626e2869, []int{0} } -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -53,21 +57,125 @@ func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) +func (m *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) } -func (m *QueryParamsRequest) XXX_Size() int { +func (m *QueryRequest) XXX_Size() int { return m.Size() } -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +func (m *QueryRequest) GetDid() string { + if m != nil { + return m.Did + } + return "" +} + +func (m *QueryRequest) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *QueryRequest) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *QueryRequest) GetAsset() string { + if m != nil { + return m.Asset + } + return "" +} + +// QueryResolveResponse is the response type for the Query/Resolve RPC method. +type QueryResponse struct { + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` + Document *Document `protobuf:"bytes,3,opt,name=document,proto3" json:"document,omitempty"` + Service *ServiceInfo `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` + Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{1} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.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 *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +func (m *QueryResponse) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + +func (m *QueryResponse) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +func (m *QueryResponse) GetService() *ServiceInfo { + if m != nil { + return m.Service + } + return nil +} + +func (m *QueryResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} // 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"` } @@ -75,7 +183,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ae1fa9bb626e2869, []int{1} + return fileDescriptor_ae1fa9bb626e2869, []int{2} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -111,6 +219,22 @@ func (m *QueryParamsResponse) GetParams() *Params { return nil } +type QueryParamsAssetsResponse struct { + Assets []*AssetInfo `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` +} + +func (m *QueryParamsAssetsResponse) Reset() { *m = QueryParamsAssetsResponse{} } +func (m *QueryParamsAssetsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsAssetsResponse) ProtoMessage() {} +func (*QueryParamsAssetsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{3} +} +func (m *QueryParamsAssetsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsAssetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsAssetsResponse.Marshal(b, m, deterministic) // QueryAccountsRequest is the request type for the Query/Exists RPC method. type QueryAccountsRequest struct { Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` @@ -182,6 +306,19 @@ func (m *QueryAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } +func (m *QueryParamsAssetsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsAssetsResponse.Merge(m, src) +} +func (m *QueryParamsAssetsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsAssetsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsAssetsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsAssetsResponse proto.InternalMessageInfo + +func (m *QueryParamsAssetsResponse) GetAssets() []*AssetInfo { func (m *QueryAccountsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryAccountsResponse.Merge(m, src) } @@ -196,11 +333,20 @@ var xxx_messageInfo_QueryAccountsResponse proto.InternalMessageInfo func (m *QueryAccountsResponse) GetExists() bool { if m != nil { - return m.Exists + return m.Assets } - return false + return nil } +type QueryParamsKeysResponse struct { + Keys map[string]*KeyInfo `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *QueryParamsKeysResponse) Reset() { *m = QueryParamsKeysResponse{} } +func (m *QueryParamsKeysResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsKeysResponse) ProtoMessage() {} +func (*QueryParamsKeysResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{4} // QueryCredentialsRequest is the request type for the Query/Exists RPC method. type QueryCredentialsRequest struct { Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` @@ -408,12 +554,12 @@ func (*QueryResolveRequest) ProtoMessage() {} func (*QueryResolveRequest) Descriptor() ([]byte, []int) { return fileDescriptor_ae1fa9bb626e2869, []int{8} } -func (m *QueryResolveRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryParamsKeysResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryResolveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryParamsKeysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryResolveRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryParamsKeysResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -423,25 +569,37 @@ func (m *QueryResolveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryResolveRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResolveRequest.Merge(m, src) +func (m *QueryParamsKeysResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsKeysResponse.Merge(m, src) } -func (m *QueryResolveRequest) XXX_Size() int { +func (m *QueryParamsKeysResponse) XXX_Size() int { return m.Size() } -func (m *QueryResolveRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResolveRequest.DiscardUnknown(m) +func (m *QueryParamsKeysResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsKeysResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryResolveRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryParamsKeysResponse proto.InternalMessageInfo +func (m *QueryParamsKeysResponse) GetKeys() map[string]*KeyInfo { + if m != nil { + return m.Keys func (m *QueryResolveRequest) GetDid() string { if m != nil { return m.Did } - return "" + return nil } +type QueryParamsByKeyResponse struct { + Key *KeyInfo `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *QueryParamsByKeyResponse) Reset() { *m = QueryParamsByKeyResponse{} } +func (m *QueryParamsByKeyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsByKeyResponse) ProtoMessage() {} +func (*QueryParamsByKeyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{5} // QueryResolveResponse is the response type for the Query/Resolve RPC method. type QueryResolveResponse struct { // document is the DID document @@ -454,12 +612,12 @@ func (*QueryResolveResponse) ProtoMessage() {} func (*QueryResolveResponse) Descriptor() ([]byte, []int) { return fileDescriptor_ae1fa9bb626e2869, []int{9} } -func (m *QueryResolveResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryParamsByKeyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryResolveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryParamsByKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryResolveResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryParamsByKeyResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -469,25 +627,42 @@ func (m *QueryResolveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *QueryResolveResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResolveResponse.Merge(m, src) +func (m *QueryParamsByKeyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsByKeyResponse.Merge(m, src) } -func (m *QueryResolveResponse) XXX_Size() int { +func (m *QueryParamsByKeyResponse) XXX_Size() int { return m.Size() } -func (m *QueryResolveResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResolveResponse.DiscardUnknown(m) +func (m *QueryParamsByKeyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsByKeyResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryResolveResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryParamsByKeyResponse proto.InternalMessageInfo +func (m *QueryParamsByKeyResponse) GetKey() *KeyInfo { func (m *QueryResolveResponse) GetDocument() *Document { if m != nil { - return m.Document + return m.Key } return nil } +type QueryParamsByAssetResponse struct { + Asset *AssetInfo `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` +} + +func (m *QueryParamsByAssetResponse) Reset() { *m = QueryParamsByAssetResponse{} } +func (m *QueryParamsByAssetResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsByAssetResponse) ProtoMessage() {} +func (*QueryParamsByAssetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{6} +} +func (m *QueryParamsByAssetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsByAssetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsByAssetResponse.Marshal(b, m, deterministic) // QueryServiceRequest is the request type for the Query/LoginOptions RPC method. type QueryServiceRequest struct { Origin string `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"` @@ -514,6 +689,21 @@ func (m *QueryServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } +func (m *QueryParamsByAssetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsByAssetResponse.Merge(m, src) +} +func (m *QueryParamsByAssetResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsByAssetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsByAssetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsByAssetResponse proto.InternalMessageInfo + +func (m *QueryParamsByAssetResponse) GetAsset() *AssetInfo { + if m != nil { + return m.Asset func (m *QueryServiceRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryServiceRequest.Merge(m, src) } @@ -530,9 +720,25 @@ func (m *QueryServiceRequest) GetOrigin() string { if m != nil { return m.Origin } - return "" + return nil } +type QueryRegistrationOptionsByKeyResponse struct { + RegistrationOptions []string `protobuf:"bytes,1,rep,name=registration_options,json=registrationOptions,proto3" json:"registration_options,omitempty"` +} + +func (m *QueryRegistrationOptionsByKeyResponse) Reset() { *m = QueryRegistrationOptionsByKeyResponse{} } +func (m *QueryRegistrationOptionsByKeyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRegistrationOptionsByKeyResponse) ProtoMessage() {} +func (*QueryRegistrationOptionsByKeyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ae1fa9bb626e2869, []int{7} +} +func (m *QueryRegistrationOptionsByKeyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRegistrationOptionsByKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRegistrationOptionsByKeyResponse.Marshal(b, m, deterministic) // QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. type QueryServiceResponse struct { // options is the PublicKeyCredentialAttestationOptions @@ -560,6 +766,19 @@ func (m *QueryServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } +func (m *QueryRegistrationOptionsByKeyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRegistrationOptionsByKeyResponse.Merge(m, src) +} +func (m *QueryRegistrationOptionsByKeyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRegistrationOptionsByKeyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRegistrationOptionsByKeyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRegistrationOptionsByKeyResponse proto.InternalMessageInfo + +func (m *QueryRegistrationOptionsByKeyResponse) GetRegistrationOptions() []string { func (m *QueryServiceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryServiceResponse.Merge(m, src) } @@ -574,14 +793,21 @@ var xxx_messageInfo_QueryServiceResponse proto.InternalMessageInfo func (m *QueryServiceResponse) GetOptions() string { if m != nil { - return m.Options + return m.RegistrationOptions } - return "" + return nil } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "did.v1.QueryParamsRequest") + proto.RegisterType((*QueryRequest)(nil), "did.v1.QueryRequest") + proto.RegisterType((*QueryResponse)(nil), "did.v1.QueryResponse") proto.RegisterType((*QueryParamsResponse)(nil), "did.v1.QueryParamsResponse") + proto.RegisterType((*QueryParamsAssetsResponse)(nil), "did.v1.QueryParamsAssetsResponse") + proto.RegisterType((*QueryParamsKeysResponse)(nil), "did.v1.QueryParamsKeysResponse") + proto.RegisterMapType((map[string]*KeyInfo)(nil), "did.v1.QueryParamsKeysResponse.KeysEntry") + proto.RegisterType((*QueryParamsByKeyResponse)(nil), "did.v1.QueryParamsByKeyResponse") + proto.RegisterType((*QueryParamsByAssetResponse)(nil), "did.v1.QueryParamsByAssetResponse") + proto.RegisterType((*QueryRegistrationOptionsByKeyResponse)(nil), "did.v1.QueryRegistrationOptionsByKeyResponse") proto.RegisterType((*QueryAccountsRequest)(nil), "did.v1.QueryAccountsRequest") proto.RegisterType((*QueryAccountsResponse)(nil), "did.v1.QueryAccountsResponse") proto.RegisterType((*QueryCredentialsRequest)(nil), "did.v1.QueryCredentialsRequest") @@ -598,6 +824,52 @@ func init() { func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) } var fileDescriptor_ae1fa9bb626e2869 = []byte{ + // 708 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x95, 0xdf, 0x4e, 0x13, 0x41, + 0x14, 0xc6, 0x59, 0xa0, 0x2d, 0x3d, 0x2d, 0xff, 0x4e, 0x2b, 0x2e, 0xd5, 0x54, 0xd9, 0x04, 0x81, + 0x44, 0x3b, 0xa1, 0xde, 0x18, 0x23, 0x17, 0x12, 0x31, 0x2a, 0x26, 0xc8, 0x92, 0x78, 0x41, 0x4c, + 0xb4, 0x74, 0xc7, 0xba, 0x69, 0xbb, 0x53, 0x76, 0xb6, 0x8d, 0x9b, 0xa6, 0x37, 0x3e, 0x81, 0x89, + 0x6f, 0xe0, 0xa3, 0x18, 0x2f, 0xbc, 0x24, 0xf1, 0xc6, 0x4b, 0x03, 0x3e, 0x88, 0xd9, 0xb3, 0x33, + 0x74, 0x2b, 0x60, 0xd2, 0x1b, 0xe8, 0x9c, 0xf9, 0xce, 0xef, 0x9c, 0x39, 0xf3, 0x75, 0x0a, 0xe8, + 0xb8, 0x0e, 0xeb, 0x6d, 0xb2, 0xe3, 0x2e, 0xf7, 0xc3, 0x4a, 0xc7, 0x17, 0x81, 0xc0, 0xb4, 0xe3, + 0x3a, 0x95, 0xde, 0x66, 0xa9, 0xa8, 0xf6, 0x1a, 0xdc, 0xe3, 0xd2, 0x95, 0xf1, 0x6e, 0xa9, 0xa0, + 0xa2, 0x6d, 0xe1, 0xf0, 0x96, 0x0e, 0xde, 0x6c, 0x08, 0xd1, 0x68, 0x71, 0x56, 0xeb, 0xb8, 0xac, + 0xe6, 0x79, 0x22, 0xa8, 0x05, 0xae, 0xf0, 0xd4, 0xae, 0xf5, 0x0e, 0xf2, 0xfb, 0x11, 0xdf, 0xe6, + 0xc7, 0x5d, 0x2e, 0x03, 0x5c, 0x80, 0x29, 0xc7, 0x75, 0x4c, 0xe3, 0xb6, 0xb1, 0x9e, 0xb5, 0xa3, + 0x8f, 0xb8, 0x04, 0x69, 0xe1, 0xbb, 0x0d, 0xd7, 0x33, 0x27, 0x29, 0xa8, 0x56, 0x91, 0xb2, 0xc9, + 0x43, 0x73, 0x2a, 0x56, 0x36, 0x79, 0x88, 0x45, 0x48, 0xd5, 0xa4, 0xe4, 0x81, 0x39, 0x4d, 0xb1, + 0x78, 0x61, 0x7d, 0x37, 0x60, 0x56, 0x95, 0x90, 0x1d, 0xe1, 0x49, 0x8e, 0x26, 0x64, 0x64, 0xb7, + 0x5e, 0xe7, 0x52, 0x52, 0x9d, 0x19, 0x5b, 0x2f, 0x23, 0x02, 0x9d, 0x56, 0x95, 0x8a, 0x17, 0x78, + 0x17, 0x66, 0x1c, 0x51, 0xef, 0xb6, 0xb9, 0x17, 0x50, 0xb9, 0x5c, 0x75, 0xa1, 0x12, 0xcf, 0xa1, + 0xf2, 0x44, 0xc5, 0xed, 0x73, 0x05, 0xde, 0x83, 0x8c, 0xe4, 0x7e, 0xcf, 0xad, 0x73, 0xea, 0x23, + 0x57, 0x2d, 0x68, 0xf1, 0x41, 0x1c, 0x7e, 0xee, 0xbd, 0x17, 0xb6, 0xd6, 0xe0, 0x1d, 0x48, 0x77, + 0x6a, 0x7e, 0xad, 0x2d, 0xcd, 0x14, 0xa9, 0xe7, 0xb4, 0xfa, 0x15, 0x45, 0x6d, 0xb5, 0x6b, 0x6d, + 0x41, 0x81, 0x4e, 0xa1, 0xc2, 0xfa, 0x2c, 0xc3, 0x74, 0xe3, 0xbf, 0xe9, 0x4f, 0x61, 0x39, 0x91, + 0xfe, 0x38, 0x9a, 0xcc, 0x10, 0xb2, 0x01, 0x69, 0x9a, 0x55, 0x04, 0x99, 0x5a, 0xcf, 0x55, 0x17, + 0x35, 0x84, 0x74, 0xd4, 0xaf, 0x12, 0x58, 0x5f, 0x0d, 0xb8, 0x9e, 0x00, 0xed, 0xf2, 0x70, 0x88, + 0xd9, 0x82, 0xe9, 0x26, 0x0f, 0x35, 0x64, 0x43, 0x43, 0xae, 0x90, 0x57, 0xa2, 0xc5, 0x8e, 0x17, + 0xf8, 0xa1, 0x4d, 0x69, 0xa5, 0x67, 0x90, 0x3d, 0x0f, 0xe9, 0xdb, 0x35, 0x86, 0xb7, 0xbb, 0x0a, + 0xa9, 0x5e, 0xad, 0xd5, 0xe5, 0x74, 0x37, 0xb9, 0xea, 0xbc, 0xc6, 0xef, 0xf2, 0x90, 0x3a, 0x8c, + 0x77, 0x1f, 0x4e, 0x3e, 0x30, 0xac, 0x2d, 0x30, 0x13, 0x45, 0xb7, 0xc3, 0x5d, 0x3e, 0xbc, 0xfc, + 0x95, 0x21, 0xf8, 0x12, 0x48, 0xb4, 0x67, 0xed, 0x40, 0x69, 0x24, 0x9d, 0xa6, 0x70, 0x0e, 0x58, + 0xd3, 0x2e, 0x8b, 0x11, 0x97, 0xcc, 0x4a, 0x19, 0xef, 0x10, 0x56, 0x95, 0xef, 0x1a, 0xae, 0x0c, + 0x7c, 0xb2, 0xfd, 0x5e, 0x87, 0xcc, 0x3f, 0xda, 0xd2, 0x26, 0x14, 0xfd, 0x84, 0xe6, 0xad, 0x88, + 0x45, 0x34, 0xc7, 0xac, 0x5d, 0xf0, 0x2f, 0xe6, 0x57, 0xbf, 0xa5, 0x20, 0x45, 0x70, 0x7c, 0x09, + 0xe9, 0xb8, 0x4f, 0x2c, 0x8e, 0x0c, 0x5c, 0x7d, 0xa1, 0x4a, 0x37, 0x2e, 0xb9, 0x06, 0x5d, 0xd9, + 0x9a, 0xff, 0xf4, 0xf3, 0xcf, 0x97, 0xc9, 0x2c, 0x66, 0x58, 0x6c, 0x13, 0x3c, 0x80, 0x7c, 0xd2, + 0x21, 0x57, 0x30, 0xaf, 0xfd, 0x13, 0x55, 0xb4, 0x25, 0xa2, 0x2d, 0xe0, 0x9c, 0xa2, 0xb1, 0xd8, + 0x33, 0xf8, 0x06, 0x66, 0x47, 0x46, 0x39, 0x1e, 0xb5, 0x4c, 0x54, 0x13, 0x97, 0x46, 0xa9, 0xac, + 0x4f, 0xff, 0x07, 0xb8, 0x07, 0x30, 0x34, 0xd7, 0x78, 0xe8, 0x22, 0xa1, 0xe7, 0x30, 0xaf, 0xd1, + 0x91, 0x0f, 0xf1, 0x35, 0xe4, 0x12, 0xc6, 0x19, 0x8f, 0x58, 0x22, 0x62, 0x11, 0x31, 0x49, 0x64, + 0xfd, 0x26, 0x0f, 0x07, 0xd8, 0x01, 0xf3, 0x2a, 0x2b, 0x8c, 0x57, 0x64, 0x8d, 0x8a, 0xac, 0xe0, + 0xad, 0x8b, 0x45, 0x58, 0xd2, 0x2c, 0xf8, 0x02, 0x32, 0x36, 0x97, 0xa2, 0xd5, 0xe3, 0xe3, 0x15, + 0x40, 0x2a, 0x90, 0x47, 0x60, 0xd1, 0x83, 0xde, 0x77, 0x5c, 0x67, 0x80, 0xfb, 0x90, 0x51, 0xef, + 0xd7, 0x78, 0xac, 0x65, 0x62, 0x15, 0x70, 0x91, 0xa9, 0x17, 0x8f, 0xf5, 0xe3, 0x07, 0x7c, 0xb0, + 0xfd, 0xe8, 0xc7, 0x69, 0xd9, 0x38, 0x39, 0x2d, 0x1b, 0xbf, 0x4f, 0xcb, 0xc6, 0xe7, 0xb3, 0xf2, + 0xc4, 0xc9, 0x59, 0x79, 0xe2, 0xd7, 0x59, 0x79, 0xe2, 0xd0, 0x6a, 0xb8, 0xc1, 0x87, 0xee, 0x51, + 0xa5, 0x2e, 0xda, 0x4c, 0x78, 0x52, 0x78, 0x3e, 0xa3, 0x3f, 0x1f, 0xa9, 0xa1, 0x20, 0xec, 0x70, + 0x79, 0x94, 0xa6, 0x1f, 0x90, 0xfb, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x71, 0x4f, 0x30, + 0xa7, 0x06, 0x00, 0x00, // 665 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0x4f, 0x4f, 0xd4, 0x4e, 0x18, 0xc7, 0xe9, 0xf2, 0x63, 0xe1, 0xf7, 0xac, 0x1a, 0x32, 0x2c, 0xb0, 0x29, 0x50, 0x70, 0x0e, @@ -656,6 +928,23 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { // Params queries all parameters of the module. + Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // ParamsAssets queries all parameters of the module. + ParamsAssets(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByAsset(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // ParamsKeys queries all parameters of the module. + ParamsKeys(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Params queries all parameters of the module. + RegistrationOptionsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Resolve queries the DID document by its id. + Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) + // Service returns associated ServiceInfo for a given Origin + // if the servie is not found, a fingerprint is generated to be used + // as a TXT record in DNS. v=sonr, o=origin, p=protocol + Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Accounts returns associated wallet accounts with the DID. Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) @@ -677,7 +966,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { +func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Params", in, out, opts...) if err != nil { @@ -686,6 +975,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } +func (c *queryClient) ParamsAssets(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/ParamsAssets", in, out, opts...) func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) { out := new(QueryAccountsResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Accounts", in, out, opts...) @@ -695,6 +987,9 @@ func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, op return out, nil } +func (c *queryClient) ParamsByAsset(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/ParamsByAsset", in, out, opts...) func (c *queryClient) Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) { out := new(QueryCredentialsResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Credentials", in, out, opts...) @@ -704,6 +999,9 @@ func (c *queryClient) Credentials(ctx context.Context, in *QueryCredentialsReque return out, nil } +func (c *queryClient) ParamsKeys(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/ParamsKeys", in, out, opts...) func (c *queryClient) Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error) { out := new(QueryIdentitiesResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Identities", in, out, opts...) @@ -713,6 +1011,26 @@ func (c *queryClient) Identities(ctx context.Context, in *QueryIdentitiesRequest return out, nil } +func (c *queryClient) ParamsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/ParamsByKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RegistrationOptionsByKey(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/did.v1.Query/RegistrationOptionsByKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) func (c *queryClient) Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) { out := new(QueryResolveResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Resolve", in, out, opts...) @@ -722,6 +1040,8 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryResolveRequest, opts return out, nil } +func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) { out := new(QueryServiceResponse) err := c.cc.Invoke(ctx, "/did.v1.Query/Service", in, out, opts...) @@ -734,6 +1054,23 @@ func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts // QueryServer is the server API for Query service. type QueryServer interface { // Params queries all parameters of the module. + Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) + // ParamsAssets queries all parameters of the module. + ParamsAssets(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByAsset(context.Context, *QueryRequest) (*QueryResponse, error) + // ParamsKeys queries all parameters of the module. + ParamsKeys(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + ParamsByKey(context.Context, *QueryRequest) (*QueryResponse, error) + // Params queries all parameters of the module. + RegistrationOptionsByKey(context.Context, *QueryRequest) (*QueryResponse, error) + // Resolve queries the DID document by its id. + Resolve(context.Context, *QueryRequest) (*QueryResponse, error) + // Service returns associated ServiceInfo for a given Origin + // if the servie is not found, a fingerprint is generated to be used + // as a TXT record in DNS. v=sonr, o=origin, p=protocol + Service(context.Context, *QueryRequest) (*QueryResponse, error) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Accounts returns associated wallet accounts with the DID. Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) @@ -751,9 +1088,28 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (*UnimplementedQueryServer) ParamsAssets(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsAssets not implemented") +} +func (*UnimplementedQueryServer) ParamsByAsset(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsByAsset not implemented") +} +func (*UnimplementedQueryServer) ParamsKeys(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsKeys not implemented") +} +func (*UnimplementedQueryServer) ParamsByKey(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ParamsByKey not implemented") +} +func (*UnimplementedQueryServer) RegistrationOptionsByKey(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegistrationOptionsByKey not implemented") +} +func (*UnimplementedQueryServer) Resolve(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") +} +func (*UnimplementedQueryServer) Service(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { func (*UnimplementedQueryServer) Accounts(ctx context.Context, req *QueryAccountsRequest) (*QueryAccountsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented") } @@ -775,7 +1131,7 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { } func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) + in := new(QueryRequest) if err := dec(in); err != nil { return nil, err } @@ -787,11 +1143,13 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf FullMethod: "/did.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + return srv.(QueryServer).Params(ctx, req.(*QueryRequest)) } return interceptor(ctx, in, info, handler) } +func _Query_ParamsAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryAccountsRequest) if err := dec(in); err != nil { @@ -852,6 +1210,14 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter return nil, err } if interceptor == nil { + return srv.(QueryServer).ParamsAssets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/ParamsAssets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsAssets(ctx, req.(*QueryRequest)) return srv.(QueryServer).Resolve(ctx, in) } info := &grpc.UnaryServerInfo{ @@ -864,12 +1230,112 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Query_ParamsByAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryServiceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { + return srv.(QueryServer).ParamsByAsset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/ParamsByAsset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsByAsset(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ParamsKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsKeys(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/ParamsKeys", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsKeys(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ParamsByKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ParamsByKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/ParamsByKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ParamsByKey(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RegistrationOptionsByKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RegistrationOptionsByKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/RegistrationOptionsByKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RegistrationOptionsByKey(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Resolve(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/Resolve", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Resolve(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Service(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Query/Service", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Service(ctx, req.(*QueryRequest)) return srv.(QueryServer).Service(ctx, in) } info := &grpc.UnaryServerInfo{ @@ -891,6 +1357,24 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Params_Handler, }, { + MethodName: "ParamsAssets", + Handler: _Query_ParamsAssets_Handler, + }, + { + MethodName: "ParamsByAsset", + Handler: _Query_ParamsByAsset_Handler, + }, + { + MethodName: "ParamsKeys", + Handler: _Query_ParamsKeys_Handler, + }, + { + MethodName: "ParamsByKey", + Handler: _Query_ParamsByKey_Handler, + }, + { + MethodName: "RegistrationOptionsByKey", + Handler: _Query_RegistrationOptionsByKey_Handler, MethodName: "Accounts", Handler: _Query_Accounts_Handler, }, @@ -915,7 +1399,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "did/v1/query.proto", } -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -925,16 +1409,120 @@ func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Asset) > 0 { + i -= len(m.Asset) + copy(dAtA[i:], m.Asset) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Asset))) + i-- + dAtA[i] = 0x22 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x1a + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Did))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) 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] = 0x2a + } + if m.Service != nil { + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Document != nil { + { + size, err := m.Document.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Query))) + 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 } @@ -973,6 +1561,7 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryParamsAssetsResponse) Marshal() (dAtA []byte, err error) { func (m *QueryAccountsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -983,16 +1572,31 @@ func (m *QueryAccountsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } +func (m *QueryParamsAssetsResponse) MarshalTo(dAtA []byte) (int, error) { func (m *QueryAccountsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } +func (m *QueryParamsAssetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { func (m *QueryAccountsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Assets) > 0 { + for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Assets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } if len(m.Did) > 0 { i -= len(m.Did) copy(dAtA[i:], m.Did) @@ -1003,6 +1607,7 @@ func (m *QueryAccountsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryParamsKeysResponse) Marshal() (dAtA []byte, err error) { func (m *QueryAccountsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1013,29 +1618,83 @@ func (m *QueryAccountsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } +func (m *QueryParamsKeysResponse) MarshalTo(dAtA []byte) (int, error) { func (m *QueryAccountsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } +func (m *QueryParamsKeysResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { func (m *QueryAccountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Exists { - i-- - if m.Exists { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.Keys) > 0 { + for k := range m.Keys { + v := m.Keys[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0x8 } return len(dAtA) - i, nil } +func (m *QueryParamsByKeyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsByKeyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsByKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Key != nil { + { + size, err := m.Key.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsByAssetResponse) Marshal() (dAtA []byte, err error) { func (m *QueryCredentialsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1204,16 +1863,25 @@ func (m *QueryResolveRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryResolveRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryParamsByAssetResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryResolveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryParamsByAssetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.Asset != nil { + { + size, err := m.Asset.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } if len(m.Did) > 0 { i -= len(m.Did) copy(dAtA[i:], m.Did) @@ -1224,7 +1892,7 @@ func (m *QueryResolveRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryResolveResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryRegistrationOptionsByKeyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1234,16 +1902,24 @@ func (m *QueryResolveResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryResolveResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryRegistrationOptionsByKeyResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryResolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryRegistrationOptionsByKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.RegistrationOptions) > 0 { + for iNdEx := len(m.RegistrationOptions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RegistrationOptions[iNdEx]) + copy(dAtA[i:], m.RegistrationOptions[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RegistrationOptions[iNdEx]))) + i-- + dAtA[i] = 0xa + } if m.Document != nil { { size, err := m.Document.MarshalToSizedBuffer(dAtA[:i]) @@ -1330,12 +2006,56 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryParamsRequest) Size() (n int) { +func (m *QueryRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Did) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Asset) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success { + n += 2 + } + l = len(m.Query) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Document != nil { + l = m.Document.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Service != nil { + l = m.Service.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -1352,12 +2072,52 @@ func (m *QueryParamsResponse) Size() (n int) { return n } +func (m *QueryParamsAssetsResponse) Size() (n int) { func (m *QueryAccountsRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l + if len(m.Assets) > 0 { + for _, e := range m.Assets { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryParamsKeysResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Keys) > 0 { + for k, v := range m.Keys { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovQuery(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + +func (m *QueryParamsByKeyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Key != nil { + l = m.Key.Size() l = len(m.Did) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -1365,12 +2125,15 @@ func (m *QueryAccountsRequest) Size() (n int) { return n } +func (m *QueryParamsByAssetResponse) Size() (n int) { func (m *QueryAccountsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l + if m.Asset != nil { + l = m.Asset.Size() if m.Exists { n += 2 } @@ -1459,12 +2222,17 @@ func (m *QueryResolveRequest) Size() (n int) { return n } -func (m *QueryResolveResponse) Size() (n int) { +func (m *QueryRegistrationOptionsByKeyResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l + if len(m.RegistrationOptions) > 0 { + for _, s := range m.RegistrationOptions { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } if m.Document != nil { l = m.Document.Size() n += 1 + l + sovQuery(uint64(l)) @@ -1504,7 +2272,7 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1527,12 +2295,350 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Asset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 *QueryResponse) 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: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: 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 Query", 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.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", 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.Document == nil { + m.Document = &Document{} + } + if err := m.Document.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service == nil { + m.Service = &ServiceInfo{} + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + 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:]) @@ -1640,6 +2746,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryParamsAssetsResponse) Unmarshal(dAtA []byte) error { func (m *QueryAccountsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1663,6 +2770,10 @@ func (m *QueryAccountsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { + return fmt.Errorf("proto: QueryParamsAssetsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsAssetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) return fmt.Errorf("proto: QueryAccountsRequest: wiretype end group for non-group") } if fieldNum <= 0 { @@ -1671,9 +2782,10 @@ func (m *QueryAccountsRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1683,22 +2795,25 @@ func (m *QueryAccountsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } + m.Assets = append(m.Assets, &AssetInfo{}) + if err := m.Assets[len(m.Assets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } m.Did = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: @@ -1722,6 +2837,7 @@ func (m *QueryAccountsRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryParamsKeysResponse) Unmarshal(dAtA []byte) error { func (m *QueryAccountsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1745,6 +2861,10 @@ func (m *QueryAccountsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { + return fmt.Errorf("proto: QueryParamsKeysResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsKeysResponse: illegal tag %d (wire type %d)", fieldNum, wire) return fmt.Errorf("proto: QueryAccountsResponse: wiretype end group for non-group") } if fieldNum <= 0 { @@ -2301,90 +3421,9 @@ func (m *QueryResolveRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) 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 - 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 *QueryResolveResponse) 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: QueryResolveResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryResolveResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) - } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { @@ -2410,6 +3449,190 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Keys == nil { + m.Keys = make(map[string]*KeyInfo) + } + var mapkey string + var mapvalue *KeyInfo + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthQuery + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthQuery + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &KeyInfo{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Keys[mapkey] = mapvalue + m.Did = 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 *QueryParamsByKeyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsByKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsByKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Key == nil { + m.Key = &KeyInfo{} + } + if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { if m.Document == nil { m.Document = &Document{} } @@ -2438,6 +3661,7 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryParamsByAssetResponse) Unmarshal(dAtA []byte) error { func (m *QueryServiceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2461,6 +3685,10 @@ func (m *QueryServiceRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { + return fmt.Errorf("proto: QueryParamsByAssetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsByAssetResponse: illegal tag %d (wire type %d)", fieldNum, wire) return fmt.Errorf("proto: QueryServiceRequest: wiretype end group for non-group") } if fieldNum <= 0 { @@ -2469,9 +3697,10 @@ func (m *QueryServiceRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2481,22 +3710,27 @@ func (m *QueryServiceRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } + if m.Asset == nil { + m.Asset = &AssetInfo{} + } + if err := m.Asset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } m.Origin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: @@ -2520,6 +3754,7 @@ func (m *QueryServiceRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryRegistrationOptionsByKeyResponse) Unmarshal(dAtA []byte) error { func (m *QueryServiceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2543,6 +3778,10 @@ func (m *QueryServiceResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { + return fmt.Errorf("proto: QueryRegistrationOptionsByKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRegistrationOptionsByKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) return fmt.Errorf("proto: QueryServiceResponse: wiretype end group for non-group") } if fieldNum <= 0 { @@ -2551,7 +3790,7 @@ func (m *QueryServiceResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RegistrationOptions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2579,7 +3818,7 @@ func (m *QueryServiceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Options = string(dAtA[iNdEx:postIndex]) + m.RegistrationOptions = append(m.RegistrationOptions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/did/types/query.pb.gw.go b/x/did/types/query.pb.gw.go index 5a8f31c40..1c38f0316 100644 --- a/x/did/types/query.pb.gw.go +++ b/x/did/types/query.pb.gw.go @@ -33,24 +33,58 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +var ( + filter_Query_Params_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + 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 protoReq QueryRequest var metadata runtime.ServerMetadata + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Params_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + 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 protoReq QueryRequest var metadata runtime.ServerMetadata + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Params_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.Params(ctx, &protoReq) return msg, metadata, err } +var ( + filter_Query_ParamsAssets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ParamsAssets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ParamsAssets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) func request_Query_Accounts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryAccountsRequest var metadata runtime.ServerMetadata @@ -262,6 +296,18 @@ func request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marshaler, c } +func local_request_Query_ParamsAssets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ParamsAssets(ctx, &protoReq) func local_request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryResolveRequest var metadata runtime.ServerMetadata @@ -289,6 +335,12 @@ func local_request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marsha } +var ( + filter_Query_ParamsByAsset_0 = &utilities.DoubleArray{Encoding: map[string]int{"asset": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_ParamsByAsset_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest func request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryServiceRequest var metadata runtime.ServerMetadata @@ -300,6 +352,344 @@ func request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, c _ = err ) + val, ok = pathParams["asset"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "asset") + } + + protoReq.Asset, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "asset", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsByAsset_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ParamsByAsset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + val, ok = pathParams["origin"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin") + } + + protoReq.Origin, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err) + } + + msg, err := client.Service(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ParamsByAsset_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest +func local_request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryServiceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["asset"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "asset") + } + + protoReq.Asset, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "asset", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsByAsset_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ParamsByAsset(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ParamsKeys_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ParamsKeys_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsKeys_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ParamsKeys(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ParamsKeys_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsKeys_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ParamsKeys(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ParamsByKey_0 = &utilities.DoubleArray{Encoding: map[string]int{"key": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_ParamsByKey_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsByKey_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ParamsByKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ParamsByKey_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ParamsByKey_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ParamsByKey(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RegistrationOptionsByKey_0 = &utilities.DoubleArray{Encoding: map[string]int{"key": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_RegistrationOptionsByKey_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RegistrationOptionsByKey_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RegistrationOptionsByKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RegistrationOptionsByKey_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key") + } + + protoReq.Key, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RegistrationOptionsByKey_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RegistrationOptionsByKey(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Resolve_0 = &utilities.DoubleArray{Encoding: map[string]int{"did": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Resolve_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Resolve(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["did"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + } + + protoReq.Did, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Resolve_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Resolve(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Service_0 = &utilities.DoubleArray{Encoding: map[string]int{"origin": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + val, ok = pathParams["origin"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin") @@ -311,13 +701,20 @@ func request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, c return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Service_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.Service(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } func local_request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryServiceRequest + var protoReq QueryRequest var metadata runtime.ServerMetadata var ( @@ -338,6 +735,24 @@ func local_request_Query_Service_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Service_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + val, ok = pathParams["origin"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin") + } + + protoReq.Origin, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err) + } + msg, err := server.Service(ctx, &protoReq) return msg, metadata, err @@ -372,6 +787,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ParamsAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_Query_Accounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -383,6 +799,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_ParamsAssets_0(rctx, inboundMarshaler, server, req, pathParams) resp, md, err := local_request_Query_Accounts_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) @@ -391,6 +808,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } + forward_Query_ParamsAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsByAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { forward_Query_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -406,6 +828,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_ParamsByAsset_0(rctx, inboundMarshaler, server, req, pathParams) resp, md, err := local_request_Query_Credentials_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) @@ -414,6 +837,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } + forward_Query_ParamsByAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { forward_Query_Credentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -429,6 +857,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_ParamsKeys_0(rctx, inboundMarshaler, server, req, pathParams) resp, md, err := local_request_Query_Identities_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) @@ -437,6 +866,53 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } + forward_Query_ParamsKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsByKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ParamsByKey_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ParamsByKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RegistrationOptionsByKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RegistrationOptionsByKey_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RegistrationOptionsByKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_Query_Identities_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -548,6 +1024,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ParamsAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_Query_Accounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -557,6 +1034,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } + resp, md, err := request_Query_ParamsAssets_0(rctx, inboundMarshaler, client, req, pathParams) resp, md, err := request_Query_Accounts_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -564,6 +1042,11 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie return } + forward_Query_ParamsAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsByAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { forward_Query_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -577,6 +1060,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } + resp, md, err := request_Query_ParamsByAsset_0(rctx, inboundMarshaler, client, req, pathParams) resp, md, err := request_Query_Credentials_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -584,6 +1068,11 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie return } + forward_Query_ParamsByAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { forward_Query_Credentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -597,6 +1086,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } + resp, md, err := request_Query_ParamsKeys_0(rctx, inboundMarshaler, client, req, pathParams) resp, md, err := request_Query_Identities_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -604,6 +1094,47 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie return } + forward_Query_ParamsKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ParamsByKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ParamsByKey_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ParamsByKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RegistrationOptionsByKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RegistrationOptionsByKey_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RegistrationOptionsByKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_Query_Identities_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -652,8 +1183,21 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"did", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ParamsAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"params", "assets"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ParamsByAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"params", "assets", "asset"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ParamsKeys_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"params", "keys"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ParamsByKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"params", "keys", "key"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_RegistrationOptionsByKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"params", "keys", "key", "registration"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Resolve_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0}, []string{"did"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Service_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"service", "origin"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Accounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 2, 1}, []string{"did", "accounts"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Credentials_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"did", "origin", "credentials"}, "", runtime.AssumeColonVerbOpt(false))) @@ -668,6 +1212,15 @@ var ( var ( forward_Query_Params_0 = runtime.ForwardResponseMessage + forward_Query_ParamsAssets_0 = runtime.ForwardResponseMessage + + forward_Query_ParamsByAsset_0 = runtime.ForwardResponseMessage + + forward_Query_ParamsKeys_0 = runtime.ForwardResponseMessage + + forward_Query_ParamsByKey_0 = runtime.ForwardResponseMessage + + forward_Query_RegistrationOptionsByKey_0 = runtime.ForwardResponseMessage forward_Query_Accounts_0 = runtime.ForwardResponseMessage forward_Query_Credentials_0 = runtime.ForwardResponseMessage diff --git a/x/did/types/scopes.go b/x/did/types/scopes.go new file mode 100644 index 000000000..c64c97922 --- /dev/null +++ b/x/did/types/scopes.go @@ -0,0 +1,53 @@ +package types + +import "gopkg.in/macaroon-bakery.v2/bakery/checkers" + +var ( + PermissionScopeStrings = [...]string{ + "profile.name", + "identifiers.email", + "identifiers.phone", + "transactions.read", + "transactions.write", + "wallets.read", + "wallets.create", + "wallets.subscribe", + "wallets.update", + "transactions.verify", + "transactions.broadcast", + "admin.user", + "admin.validator", + } + + StringToPermissionScope = map[string]PermissionScope{ + "PERMISSION_SCOPE_UNSPECIFIED": PermissionScope_PERMISSION_SCOPE_UNSPECIFIED, + "PERMISSION_SCOPE_BASIC_INFO": PermissionScope_PERMISSION_SCOPE_BASIC_INFO, + "PERMISSION_SCOPE_IDENTIFIERS_EMAIL": PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ, + "PERMISSION_SCOPE_IDENTIFIERS_PHONE": PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE, + "PERMISSION_SCOPE_TRANSACTIONS_READ": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ, + "PERMISSION_SCOPE_TRANSACTIONS_WRITE": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE, + "PERMISSION_SCOPE_WALLETS_READ": PermissionScope_PERMISSION_SCOPE_WALLETS_READ, + "PERMISSION_SCOPE_WALLETS_CREATE": PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE, + "PERMISSION_SCOPE_WALLETS_SUBSCRIBE": PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE, + "PERMISSION_SCOPE_WALLETS_UPDATE": PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE, + "PERMISSION_SCOPE_TRANSACTIONS_VERIFY": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY, + "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST, + "PERMISSION_SCOPE_ADMIN_USER": PermissionScope_PERMISSION_SCOPE_ADMIN_USER, + "PERMISSION_SCOPE_ADMIN_VALIDATOR": PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR, + } +) + +func ResolvePermissionScope(scope string) (PermissionScope, bool) { + uriToPrefix := make(map[string]string) + for _, scope := range PermissionScopeStrings { + uriToPrefix["https://example.com/auth/"+scope] = scope + } + PermissionNamespace := checkers.NewNamespace(uriToPrefix) + + prefix, ok := PermissionNamespace.Resolve("https://example.com/auth/" + scope) + if !ok { + return 0, false + } + permScope, ok := StringToPermissionScope[prefix] + return permScope, ok +} diff --git a/x/did/types/state.go b/x/did/types/state.go deleted file mode 100644 index 4768c695c..000000000 --- a/x/did/types/state.go +++ /dev/null @@ -1,4 +0,0 @@ -package types - -// ByteArray is a list of byte arrays -type ByteArray = [][]byte diff --git a/x/did/types/state.pb.go b/x/did/types/state.pb.go index 7acc6adfb..02b7eb7c7 100644 --- a/x/did/types/state.pb.go +++ b/x/did/types/state.pb.go @@ -23,10 +23,24 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Aliases represents the `alsoKnownAs` property associated with a DID Controller -type Aliases struct { - // The unique identifier of the alias +// Account represents a wallet account associated with a DID Controller +type Account struct { + // The unique identifier of the account Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The controller of the account + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + // The value of the linked identifier + PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // The address of the account + Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` + // The label of the account + Label string `protobuf:"bytes,5,opt,name=label,proto3" json:"label,omitempty"` + // The bip32 chain code + ChainCode uint32 `protobuf:"varint,6,opt,name=chain_code,json=chainCode,proto3" json:"chain_code,omitempty"` + // The index of the account + Index uint32 `protobuf:"varint,7,opt,name=index,proto3" json:"index,omitempty"` + // The supported chains of the account + Chains []string `protobuf:"bytes,8,rep,name=chains,proto3" json:"chains,omitempty"` // Origin is the Alias provider Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` // Subject is the user defined alias @@ -37,18 +51,18 @@ type Aliases struct { Expiration uint64 `protobuf:"varint,5,opt,name=expiration,proto3" json:"expiration,omitempty"` } -func (m *Aliases) Reset() { *m = Aliases{} } -func (m *Aliases) String() string { return proto.CompactTextString(m) } -func (*Aliases) ProtoMessage() {} -func (*Aliases) Descriptor() ([]byte, []int) { +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_f44bb702879c34b4, []int{0} } -func (m *Aliases) XXX_Unmarshal(b []byte) error { +func (m *Account) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Aliases) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Aliases.Marshal(b, m, deterministic) + return xxx_messageInfo_Account.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -58,25 +72,26 @@ func (m *Aliases) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Aliases) XXX_Merge(src proto.Message) { - xxx_messageInfo_Aliases.Merge(m, src) +func (m *Account) XXX_Merge(src proto.Message) { + xxx_messageInfo_Account.Merge(m, src) } -func (m *Aliases) XXX_Size() int { +func (m *Account) XXX_Size() int { return m.Size() } -func (m *Aliases) XXX_DiscardUnknown() { - xxx_messageInfo_Aliases.DiscardUnknown(m) +func (m *Account) XXX_DiscardUnknown() { + xxx_messageInfo_Account.DiscardUnknown(m) } -var xxx_messageInfo_Aliases proto.InternalMessageInfo +var xxx_messageInfo_Account proto.InternalMessageInfo -func (m *Aliases) GetId() string { +func (m *Account) GetId() string { if m != nil { return m.Id } return "" } +func (m *Account) GetController() string { func (m *Aliases) GetOrigin() string { if m != nil { return m.Origin @@ -98,196 +113,69 @@ func (m *Aliases) GetController() string { return "" } -func (m *Aliases) GetExpiration() uint64 { +func (m *Account) GetPublicKey() *PubKey { if m != nil { - return m.Expiration + return m.PublicKey + } + return nil +} + +func (m *Account) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Account) GetLabel() string { + if m != nil { + return m.Label + } + return "" +} + +func (m *Account) GetChainCode() uint32 { + if m != nil { + return m.ChainCode } return 0 } -// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) -type Assertion struct { - // The unique identifier of the attestation - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave") - KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` - // The value of the linked identifier - Credential []byte `protobuf:"bytes,3,opt,name=credential,proto3" json:"credential,omitempty"` - // Metadata is optional additional information about the assertion - Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // The controller of the attestation - Controller string `protobuf:"bytes,5,opt,name=controller,proto3" json:"controller,omitempty"` -} - -func (m *Assertion) Reset() { *m = Assertion{} } -func (m *Assertion) String() string { return proto.CompactTextString(m) } -func (*Assertion) ProtoMessage() {} -func (*Assertion) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{1} -} -func (m *Assertion) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Assertion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Assertion.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 *Assertion) XXX_Merge(src proto.Message) { - xxx_messageInfo_Assertion.Merge(m, src) -} -func (m *Assertion) XXX_Size() int { - return m.Size() -} -func (m *Assertion) XXX_DiscardUnknown() { - xxx_messageInfo_Assertion.DiscardUnknown(m) -} - -var xxx_messageInfo_Assertion proto.InternalMessageInfo - -func (m *Assertion) GetId() string { +func (m *Account) GetIndex() uint32 { if m != nil { - return m.Id + return m.Index } - return "" + return 0 } -func (m *Assertion) GetKeyType() string { +func (m *Account) GetChains() []string { if m != nil { - return m.KeyType - } - return "" -} - -func (m *Assertion) GetCredential() []byte { - if m != nil { - return m.Credential + return m.Chains } return nil } -func (m *Assertion) GetMetadata() map[string]string { - if m != nil { - return m.Metadata - } - return nil -} - -func (m *Assertion) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - -// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) -type Attestation struct { - // The unique identifier of the attestation - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The type of the linked identifier (e.g., "crypto", "github", "email", "phone") - KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"` - // The value of the linked identifier - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - // The proof or verification method for this attestation - Proof string `protobuf:"bytes,4,opt,name=proof,proto3" json:"proof,omitempty"` - // The controller of the attestation - Controller string `protobuf:"bytes,5,opt,name=controller,proto3" json:"controller,omitempty"` -} - -func (m *Attestation) Reset() { *m = Attestation{} } -func (m *Attestation) String() string { return proto.CompactTextString(m) } -func (*Attestation) ProtoMessage() {} -func (*Attestation) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{2} -} -func (m *Attestation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Attestation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Attestation.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 *Attestation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Attestation.Merge(m, src) -} -func (m *Attestation) XXX_Size() int { - return m.Size() -} -func (m *Attestation) XXX_DiscardUnknown() { - xxx_messageInfo_Attestation.DiscardUnknown(m) -} - -var xxx_messageInfo_Attestation proto.InternalMessageInfo - -func (m *Attestation) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Attestation) GetKeyType() string { - if m != nil { - return m.KeyType - } - return "" -} - -func (m *Attestation) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -func (m *Attestation) GetProof() string { - if m != nil { - return m.Proof - } - return "" -} - -func (m *Attestation) GetController() string { - if m != nil { - return m.Controller - } - return "" -} - // Controller represents a Sonr DWN Vault type Controller struct { // The unique identifier of the controller Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The DID of the controller - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` - // The public key of the controller - PublicKeyMultibase string `protobuf:"bytes,3,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // Aliases of the controller + Aliases []*Alias `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"` + // PubKey is the verification method + PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // The vault address or identifier - VaultCid string `protobuf:"bytes,4,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` - // Fingerprint is the Accumulator of discrete credential identifiers - Fingerprint []byte `protobuf:"bytes,5,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` + VaultCid string `protobuf:"bytes,5,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"` + // The Authentications of the controller + Authentication []*Credential `protobuf:"bytes,6,rep,name=authentication,proto3" json:"authentication,omitempty"` } func (m *Controller) Reset() { *m = Controller{} } func (m *Controller) String() string { return proto.CompactTextString(m) } func (*Controller) ProtoMessage() {} func (*Controller) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{3} + return fileDescriptor_f44bb702879c34b4, []int{1} } func (m *Controller) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -323,18 +211,25 @@ func (m *Controller) GetId() string { return "" } -func (m *Controller) GetDid() string { +func (m *Controller) GetAddress() string { if m != nil { - return m.Did + return m.Address } return "" } -func (m *Controller) GetPublicKeyMultibase() string { +func (m *Controller) GetAliases() []*Alias { if m != nil { - return m.PublicKeyMultibase + return m.Aliases } - return "" + return nil +} + +func (m *Controller) GetPublicKey() *PubKey { + if m != nil { + return m.PublicKey + } + return nil } func (m *Controller) GetVaultCid() string { @@ -344,45 +239,41 @@ func (m *Controller) GetVaultCid() string { return "" } -func (m *Controller) GetFingerprint() []byte { +func (m *Controller) GetAuthentication() []*Credential { if m != nil { - return m.Fingerprint + return m.Authentication } return nil } -// Delegation represents IBC Account Controllers for various chains (e.g., ETH, BTC) -type Delegation struct { - // The unique identifier of the delegation +// Proof represents a verifiable credential +type Proof struct { + // The unique identifier of the proof Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The Decentralized Identifier of the delegated account - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` - // The chain type (e.g., "ETH", "BTC") - ChainType string `protobuf:"bytes,3,opt,name=chain_type,json=chainType,proto3" json:"chain_type,omitempty"` - // The address on the target chain - ChainAddress string `protobuf:"bytes,4,opt,name=chain_address,json=chainAddress,proto3" json:"chain_address,omitempty"` - // The controller DID - ControllerDid string `protobuf:"bytes,5,opt,name=controller_did,json=controllerDid,proto3" json:"controller_did,omitempty"` - // The delegation proof or verification method - PublicKeyMultibase string `protobuf:"bytes,6,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"` - // Public Key JWKS is a map of the associated public keys - PublicKeyJwks map[string]string `protobuf:"bytes,7,rep,name=public_key_jwks,json=publicKeyJwks,proto3" json:"public_key_jwks,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // IBC Channel ID - ChannelId uint64 `protobuf:"varint,8,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // The controller of the proof + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + // The value of the linked identifier + Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` + // The property of the proof + Property string `protobuf:"bytes,4,opt,name=property,proto3" json:"property,omitempty"` + // The accumulator of the proof + Accumulator []byte `protobuf:"bytes,5,opt,name=accumulator,proto3" json:"accumulator,omitempty"` + // The secret key of the proof + Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` } -func (m *Delegation) Reset() { *m = Delegation{} } -func (m *Delegation) String() string { return proto.CompactTextString(m) } -func (*Delegation) ProtoMessage() {} -func (*Delegation) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{4} +func (m *Proof) Reset() { *m = Proof{} } +func (m *Proof) String() string { return proto.CompactTextString(m) } +func (*Proof) ProtoMessage() {} +func (*Proof) Descriptor() ([]byte, []int) { + return fileDescriptor_f44bb702879c34b4, []int{2} } -func (m *Delegation) XXX_Unmarshal(b []byte) error { +func (m *Proof) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Delegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Delegation.Marshal(b, m, deterministic) + return xxx_messageInfo_Proof.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -392,80 +283,76 @@ func (m *Delegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Delegation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Delegation.Merge(m, src) +func (m *Proof) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proof.Merge(m, src) } -func (m *Delegation) XXX_Size() int { +func (m *Proof) XXX_Size() int { return m.Size() } -func (m *Delegation) XXX_DiscardUnknown() { - xxx_messageInfo_Delegation.DiscardUnknown(m) +func (m *Proof) XXX_DiscardUnknown() { + xxx_messageInfo_Proof.DiscardUnknown(m) } -var xxx_messageInfo_Delegation proto.InternalMessageInfo +var xxx_messageInfo_Proof proto.InternalMessageInfo -func (m *Delegation) GetId() string { +func (m *Proof) GetId() string { if m != nil { return m.Id } return "" } -func (m *Delegation) GetDid() string { +func (m *Proof) GetController() string { if m != nil { - return m.Did + return m.Controller } return "" } -func (m *Delegation) GetChainType() string { +func (m *Proof) GetIssuer() string { if m != nil { - return m.ChainType + return m.Issuer } return "" } -func (m *Delegation) GetChainAddress() string { +func (m *Proof) GetProperty() string { if m != nil { - return m.ChainAddress + return m.Property } return "" } -func (m *Delegation) GetControllerDid() string { +func (m *Proof) GetAccumulator() []byte { if m != nil { - return m.ControllerDid - } - return "" -} - -func (m *Delegation) GetPublicKeyMultibase() string { - if m != nil { - return m.PublicKeyMultibase - } - return "" -} - -func (m *Delegation) GetPublicKeyJwks() map[string]string { - if m != nil { - return m.PublicKeyJwks + return m.Accumulator } return nil } -func (m *Delegation) GetChannelId() uint64 { +func (m *Proof) GetKey() []byte { if m != nil { - return m.ChannelId + return m.Key } - return 0 + return nil } -// Service represents a service in a DID Document -type Service struct { +// ServiceRecord represents a decentralized service in a DID Document +type ServiceRecord struct { // The ID of the service Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The type of the service ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` + // The authority DID of the service + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` + // The domain name of the service + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + // The description of the service + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + // The service endpoint + ServiceEndpoints map[string]string `protobuf:"bytes,6,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Scopes is the Authorization Grants of the service + Permissions *Permissions `protobuf:"bytes,7,opt,name=permissions,proto3" json:"permissions,omitempty"` // The controller DID of the service ControllerDid string `protobuf:"bytes,3,opt,name=controller_did,json=controllerDid,proto3" json:"controller_did,omitempty"` // The domain name of the service @@ -476,18 +363,18 @@ type Service struct { Scopes []PermissionScope `protobuf:"varint,6,rep,packed,name=scopes,proto3,enum=did.v1.PermissionScope" json:"scopes,omitempty"` } -func (m *Service) Reset() { *m = Service{} } -func (m *Service) String() string { return proto.CompactTextString(m) } -func (*Service) ProtoMessage() {} -func (*Service) Descriptor() ([]byte, []int) { - return fileDescriptor_f44bb702879c34b4, []int{5} +func (m *ServiceRecord) Reset() { *m = ServiceRecord{} } +func (m *ServiceRecord) String() string { return proto.CompactTextString(m) } +func (*ServiceRecord) ProtoMessage() {} +func (*ServiceRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_f44bb702879c34b4, []int{3} } -func (m *Service) XXX_Unmarshal(b []byte) error { +func (m *ServiceRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ServiceRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Service.Marshal(b, m, deterministic) + return xxx_messageInfo_ServiceRecord.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -497,39 +384,50 @@ func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Service) XXX_Merge(src proto.Message) { - xxx_messageInfo_Service.Merge(m, src) +func (m *ServiceRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceRecord.Merge(m, src) } -func (m *Service) XXX_Size() int { +func (m *ServiceRecord) XXX_Size() int { return m.Size() } -func (m *Service) XXX_DiscardUnknown() { - xxx_messageInfo_Service.DiscardUnknown(m) +func (m *ServiceRecord) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceRecord.DiscardUnknown(m) } -var xxx_messageInfo_Service proto.InternalMessageInfo +var xxx_messageInfo_ServiceRecord proto.InternalMessageInfo -func (m *Service) GetId() string { +func (m *ServiceRecord) GetId() string { if m != nil { return m.Id } return "" } -func (m *Service) GetServiceType() string { +func (m *ServiceRecord) GetServiceType() string { if m != nil { return m.ServiceType } return "" } -func (m *Service) GetControllerDid() string { +func (m *ServiceRecord) GetAuthority() string { if m != nil { - return m.ControllerDid + return m.Authority } return "" } +func (m *ServiceRecord) GetOrigin() string { +func (m *Service) GetControllerDid() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *ServiceRecord) GetDescription() string { + if m != nil { + return m.Description func (m *Service) GetOriginUri() string { if m != nil { return m.OriginUri @@ -537,6 +435,7 @@ func (m *Service) GetOriginUri() string { return "" } +func (m *ServiceRecord) GetServiceEndpoints() map[string]string { func (m *Service) GetServiceEndpoints() map[string]string { if m != nil { return m.ServiceEndpoints @@ -544,6 +443,100 @@ func (m *Service) GetServiceEndpoints() map[string]string { return nil } +func (m *ServiceRecord) GetPermissions() *Permissions { + if m != nil { + return m.Permissions + } + return nil +} + +// Verification reprsents a method of verifying membership in a DID +type VerificationMethod struct { + // The unique identifier of the verification + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The controller of the verification + Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` + // The DIDNamespace of the verification + Method DIDNamespace `protobuf:"varint,3,opt,name=method,proto3,enum=did.v1.DIDNamespace" json:"method,omitempty"` + // The value of the linked identifier + Issuer string `protobuf:"bytes,4,opt,name=issuer,proto3" json:"issuer,omitempty"` + // The subject of the verification + Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` + // The public key of the verification + PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +} + +func (m *VerificationMethod) Reset() { *m = VerificationMethod{} } +func (m *VerificationMethod) String() string { return proto.CompactTextString(m) } +func (*VerificationMethod) ProtoMessage() {} +func (*VerificationMethod) Descriptor() ([]byte, []int) { + return fileDescriptor_f44bb702879c34b4, []int{4} +} +func (m *VerificationMethod) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VerificationMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VerificationMethod.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 *VerificationMethod) XXX_Merge(src proto.Message) { + xxx_messageInfo_VerificationMethod.Merge(m, src) +} +func (m *VerificationMethod) XXX_Size() int { + return m.Size() +} +func (m *VerificationMethod) XXX_DiscardUnknown() { + xxx_messageInfo_VerificationMethod.DiscardUnknown(m) +} + +var xxx_messageInfo_VerificationMethod proto.InternalMessageInfo + +func (m *VerificationMethod) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *VerificationMethod) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *VerificationMethod) GetMethod() DIDNamespace { + if m != nil { + return m.Method + } + return DIDNamespace_DID_NAMESPACE_UNSPECIFIED +} + +func (m *VerificationMethod) GetIssuer() string { + if m != nil { + return m.Issuer + } + return "" +} + +func (m *VerificationMethod) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *VerificationMethod) GetPublicKey() *PubKey { + if m != nil { + return m.PublicKey func (m *Service) GetScopes() []PermissionScope { if m != nil { return m.Scopes @@ -552,11 +545,12 @@ func (m *Service) GetScopes() []PermissionScope { } func init() { - proto.RegisterType((*Aliases)(nil), "did.v1.Aliases") - proto.RegisterType((*Assertion)(nil), "did.v1.Assertion") - proto.RegisterMapType((map[string]string)(nil), "did.v1.Assertion.MetadataEntry") - proto.RegisterType((*Attestation)(nil), "did.v1.Attestation") + proto.RegisterType((*Account)(nil), "did.v1.Account") proto.RegisterType((*Controller)(nil), "did.v1.Controller") + proto.RegisterType((*Proof)(nil), "did.v1.Proof") + proto.RegisterType((*ServiceRecord)(nil), "did.v1.ServiceRecord") + proto.RegisterMapType((map[string]string)(nil), "did.v1.ServiceRecord.ServiceEndpointsEntry") + proto.RegisterType((*VerificationMethod)(nil), "did.v1.VerificationMethod") proto.RegisterType((*Delegation)(nil), "did.v1.Delegation") proto.RegisterMapType((map[string]string)(nil), "did.v1.Delegation.PublicKeyJwksEntry") proto.RegisterType((*Service)(nil), "did.v1.Service") @@ -566,6 +560,59 @@ func init() { func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } var fileDescriptor_f44bb702879c34b4 = []byte{ + // 828 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4f, 0x8f, 0xdb, 0x44, + 0x14, 0x5f, 0xdb, 0x59, 0x67, 0xf3, 0xb2, 0xbb, 0x84, 0xe9, 0xb2, 0x8c, 0x52, 0x88, 0xdc, 0x1c, + 0x20, 0x82, 0x90, 0xb4, 0xcb, 0x1f, 0xa1, 0x88, 0x4b, 0x49, 0x7b, 0x40, 0x15, 0xa8, 0x32, 0x08, + 0x21, 0x24, 0xb4, 0x72, 0x66, 0xa6, 0xbb, 0x03, 0xb6, 0xc7, 0x9a, 0x19, 0x47, 0xf5, 0x67, 0x40, + 0x42, 0xdc, 0xb8, 0x71, 0xe4, 0xb3, 0x20, 0x4e, 0x45, 0x5c, 0x38, 0xa2, 0xdd, 0x6f, 0xc0, 0x27, + 0x40, 0x33, 0x1e, 0x27, 0xde, 0x50, 0xa9, 0xea, 0x25, 0xca, 0xfb, 0xbd, 0x37, 0xf3, 0xde, 0xef, + 0xf7, 0x7e, 0x23, 0x03, 0xa2, 0x9c, 0xce, 0xd7, 0xf7, 0xe6, 0x4a, 0x27, 0x9a, 0xcd, 0x0a, 0x29, + 0xb4, 0x40, 0x21, 0xe5, 0x74, 0xb6, 0xbe, 0x37, 0x7c, 0x9d, 0x08, 0x95, 0x09, 0x35, 0x17, 0x32, + 0x33, 0x25, 0x42, 0x66, 0x75, 0xc1, 0xf0, 0xc4, 0x1d, 0xba, 0x60, 0x39, 0x53, 0x5c, 0x39, 0xf4, + 0x96, 0x43, 0x33, 0x41, 0x59, 0xea, 0xc0, 0xf1, 0x1f, 0x3e, 0x74, 0xef, 0x13, 0x22, 0xca, 0x5c, + 0xa3, 0x63, 0xf0, 0x39, 0xc5, 0x5e, 0xe4, 0x4d, 0x7a, 0xb1, 0xcf, 0x29, 0x1a, 0x01, 0x10, 0x91, + 0x6b, 0x29, 0xd2, 0x94, 0x49, 0xec, 0x5b, 0xbc, 0x85, 0xa0, 0xf7, 0x00, 0x8a, 0x72, 0x95, 0x72, + 0x72, 0xfe, 0x03, 0xab, 0x70, 0x10, 0x79, 0x93, 0xfe, 0xd9, 0xf1, 0xac, 0x1e, 0x6e, 0xf6, 0xb8, + 0x5c, 0x3d, 0x62, 0x55, 0xdc, 0xab, 0x2b, 0x1e, 0xb1, 0x0a, 0x61, 0xe8, 0x26, 0x94, 0x4a, 0xa6, + 0x14, 0xee, 0xd8, 0xbb, 0x9a, 0x10, 0x9d, 0xc0, 0x7e, 0x9a, 0xac, 0x58, 0x8a, 0xf7, 0x2d, 0x5e, + 0x07, 0xe8, 0x4d, 0x00, 0x72, 0x99, 0xf0, 0xfc, 0x9c, 0x08, 0xca, 0x70, 0x18, 0x79, 0x93, 0xa3, + 0xb8, 0x67, 0x91, 0xa5, 0xa0, 0xcc, 0x1c, 0xe2, 0x39, 0x65, 0x4f, 0x71, 0xd7, 0x66, 0xea, 0x00, + 0x9d, 0x42, 0x68, 0x4b, 0x14, 0x3e, 0x88, 0x82, 0x49, 0x2f, 0x76, 0xd1, 0x82, 0xfc, 0xfb, 0xeb, + 0x5f, 0x3f, 0x05, 0xdf, 0x41, 0xc7, 0x70, 0x44, 0xa7, 0x30, 0xd8, 0xf2, 0x98, 0xda, 0x76, 0x03, + 0x0f, 0x7b, 0x08, 0x03, 0x6a, 0xe1, 0x6e, 0xbc, 0x81, 0x8f, 0x3d, 0x74, 0x07, 0x6e, 0xb7, 0x32, + 0xdb, 0xb9, 0xa6, 0xb6, 0xed, 0x20, 0xc0, 0x1e, 0xf6, 0xc6, 0xbf, 0xf8, 0x00, 0xcb, 0xad, 0x3e, + 0xbb, 0x7a, 0xb6, 0x04, 0xf0, 0x6f, 0x0a, 0xf0, 0x36, 0x74, 0x93, 0x94, 0x27, 0x8a, 0x29, 0x1c, + 0x44, 0xc1, 0xa4, 0x7f, 0x76, 0xd4, 0xc8, 0x78, 0xdf, 0xc0, 0x71, 0x93, 0xdd, 0x91, 0xbc, 0xf3, + 0x22, 0xc9, 0x6f, 0x43, 0x6f, 0x9d, 0x94, 0xa9, 0x3e, 0x27, 0x9c, 0x3a, 0x71, 0x0f, 0x2c, 0xb0, + 0xe4, 0x14, 0x2d, 0xe0, 0x38, 0x29, 0xf5, 0x25, 0xcb, 0x35, 0x27, 0x89, 0xe6, 0x22, 0xc7, 0xa1, + 0xed, 0x8d, 0x9a, 0xfb, 0x96, 0x92, 0x51, 0x93, 0x4d, 0xd2, 0x78, 0xa7, 0x72, 0x31, 0xb3, 0x72, + 0x4e, 0x9c, 0x9c, 0x47, 0x1b, 0x62, 0x56, 0xc5, 0x57, 0x5a, 0x5d, 0x8d, 0x78, 0xd8, 0x1f, 0xff, + 0xe9, 0xc1, 0xfe, 0x63, 0x29, 0xc4, 0x93, 0x97, 0x36, 0xd9, 0x29, 0x84, 0x5c, 0xa9, 0x92, 0x49, + 0x6b, 0xb0, 0x5e, 0xec, 0x22, 0x34, 0x84, 0x83, 0x42, 0x8a, 0x82, 0x49, 0x5d, 0x39, 0x3b, 0x6d, + 0x62, 0x14, 0x41, 0x3f, 0x21, 0xa4, 0xcc, 0xca, 0x34, 0xd1, 0x42, 0x5a, 0xe2, 0x87, 0x71, 0x1b, + 0x42, 0x03, 0x08, 0x8c, 0x80, 0xa1, 0xcd, 0x98, 0xbf, 0x8b, 0xbb, 0x96, 0xd1, 0x3b, 0x8e, 0x51, + 0x04, 0xc3, 0xd6, 0xba, 0xeb, 0x96, 0xd3, 0xe6, 0x7e, 0x43, 0x12, 0x77, 0xc6, 0xbf, 0x05, 0x70, + 0xf4, 0x25, 0x93, 0x6b, 0x4e, 0x58, 0xcc, 0x88, 0x90, 0xf4, 0x7f, 0xdc, 0xee, 0xc0, 0xa1, 0xaa, + 0x0b, 0xce, 0x75, 0x55, 0x30, 0xc7, 0xae, 0xef, 0xb0, 0xaf, 0xaa, 0x82, 0xa1, 0x37, 0xa0, 0x67, + 0xa4, 0x15, 0x92, 0xeb, 0xca, 0x31, 0xdc, 0x02, 0x86, 0xbc, 0x90, 0xfc, 0x82, 0xe7, 0x8e, 0xa2, + 0x8b, 0x0c, 0x41, 0xca, 0x14, 0x91, 0xbc, 0xb0, 0x7b, 0xab, 0x37, 0xdb, 0x86, 0xd0, 0x37, 0xf0, + 0x6a, 0xd3, 0x9a, 0xe5, 0xb4, 0x10, 0x3c, 0xd7, 0xca, 0xed, 0xf7, 0xdd, 0x66, 0xbf, 0x37, 0x86, + 0x6f, 0xa2, 0x87, 0x4d, 0xf5, 0xc3, 0x5c, 0xcb, 0x2a, 0x1e, 0xa8, 0x1d, 0x18, 0x7d, 0x08, 0xfd, + 0x82, 0xc9, 0x8c, 0x2b, 0xc5, 0x45, 0xae, 0xec, 0xeb, 0xeb, 0x9f, 0xdd, 0xda, 0x78, 0x70, 0x9b, + 0x8a, 0xdb, 0x75, 0xc3, 0x25, 0xbc, 0xf6, 0xdc, 0x0e, 0xcd, 0x2a, 0x6a, 0xd5, 0xcc, 0x5f, 0xf3, + 0xb2, 0xd7, 0x49, 0x5a, 0x36, 0x7a, 0xd5, 0xc1, 0xc2, 0xff, 0xd8, 0x5b, 0x7c, 0x60, 0x97, 0x34, + 0x73, 0x4b, 0x3a, 0x6c, 0xd4, 0xb1, 0xae, 0x3b, 0x85, 0xc1, 0x46, 0xb8, 0xa9, 0xc3, 0x8d, 0xf9, + 0x82, 0xf1, 0x8f, 0x3e, 0xa0, 0xaf, 0x99, 0xe4, 0x4f, 0x9c, 0x7b, 0x3f, 0x67, 0xfa, 0x52, 0xd0, + 0x97, 0x76, 0xe2, 0x14, 0xc2, 0xcc, 0x9e, 0xb4, 0x7b, 0x3a, 0x3e, 0x3b, 0x69, 0x38, 0x3f, 0xf8, + 0xec, 0xc1, 0x17, 0x49, 0xc6, 0x54, 0x91, 0x10, 0x16, 0xbb, 0x9a, 0x96, 0x6f, 0x3b, 0x37, 0x7c, + 0x8b, 0xa1, 0xab, 0xca, 0xd5, 0xf7, 0x8c, 0x68, 0xb7, 0xb6, 0x26, 0xdc, 0x79, 0xdb, 0xe1, 0x0b, + 0xde, 0xf6, 0xe2, 0x23, 0xab, 0xc5, 0x5d, 0xa7, 0xc5, 0x5b, 0x10, 0xb5, 0x0c, 0x5b, 0xcf, 0xd0, + 0xf8, 0xd6, 0x35, 0xb0, 0xb6, 0xdd, 0xff, 0xf4, 0x93, 0xdf, 0xaf, 0x46, 0xde, 0xb3, 0xab, 0x91, + 0xf7, 0xcf, 0xd5, 0xc8, 0xfb, 0xf9, 0x7a, 0xb4, 0xf7, 0xec, 0x7a, 0xb4, 0xf7, 0xf7, 0xf5, 0x68, + 0xef, 0xdb, 0xf1, 0x05, 0xd7, 0x97, 0xe5, 0x6a, 0x46, 0x44, 0x36, 0x17, 0xb9, 0x12, 0xb9, 0x9c, + 0xdb, 0x9f, 0xa7, 0x73, 0xf3, 0xe5, 0x30, 0x0e, 0x56, 0xab, 0xd0, 0x7e, 0x36, 0xde, 0xff, 0x2f, + 0x00, 0x00, 0xff, 0xff, 0x31, 0x1c, 0x51, 0xe6, 0x98, 0x06, 0x00, 0x00, // 760 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0xbd, 0x6e, 0x2b, 0x45, 0x14, 0xc7, 0xb3, 0x5e, 0x7f, 0x1e, 0x7f, 0x60, 0x46, 0x81, 0x2c, 0x46, 0x31, 0xc6, 0xe8, 0x4a, @@ -617,7 +664,7 @@ var fileDescriptor_f44bb702879c34b4 = []byte{ 0x54, 0xb1, 0xb7, 0x51, 0x8b, 0x06, 0x00, 0x00, } -func (m *Aliases) Marshal() (dAtA []byte, err error) { +func (m *Account) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -627,16 +674,21 @@ func (m *Aliases) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Aliases) MarshalTo(dAtA []byte) (int, error) { +func (m *Account) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Aliases) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Chains) > 0 { + for iNdEx := len(m.Chains) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Chains[iNdEx]) + copy(dAtA[i:], m.Chains[iNdEx]) + i = encodeVarintState(dAtA, i, uint64(len(m.Chains[iNdEx]))) if m.Expiration != 0 { i = encodeVarintState(dAtA, i, uint64(m.Expiration)) i-- @@ -708,87 +760,50 @@ func (m *Assertion) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], v) i = encodeVarintState(dAtA, i, uint64(len(v))) i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintState(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintState(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 + dAtA[i] = 0x42 } } - if len(m.Credential) > 0 { - i -= len(m.Credential) - copy(dAtA[i:], m.Credential) - i = encodeVarintState(dAtA, i, uint64(len(m.Credential))) + if m.Index != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x38 + } + if m.ChainCode != 0 { + i = encodeVarintState(dAtA, i, uint64(m.ChainCode)) + i-- + dAtA[i] = 0x30 + } + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = encodeVarintState(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0x2a + } + 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] = 0x22 + } + if m.PublicKey != nil { + { + size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } 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.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintState(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Attestation) 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 *Attestation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Attestation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l if len(m.Controller) > 0 { i -= len(m.Controller) copy(dAtA[i:], m.Controller) i = encodeVarintState(dAtA, i, uint64(len(m.Controller))) i-- - dAtA[i] = 0x2a - } - if len(m.Proof) > 0 { - i -= len(m.Proof) - copy(dAtA[i:], m.Proof) - i = encodeVarintState(dAtA, i, uint64(len(m.Proof))) - i-- - dAtA[i] = 0x22 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintState(dAtA, i, uint64(len(m.Value))) - 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.Id) > 0 { @@ -821,31 +836,57 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Fingerprint) > 0 { - i -= len(m.Fingerprint) - copy(dAtA[i:], m.Fingerprint) - i = encodeVarintState(dAtA, i, uint64(len(m.Fingerprint))) - i-- - dAtA[i] = 0x2a + if len(m.Authentication) > 0 { + for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Authentication[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } } if len(m.VaultCid) > 0 { i -= len(m.VaultCid) copy(dAtA[i:], m.VaultCid) i = encodeVarintState(dAtA, i, uint64(len(m.VaultCid))) i-- + dAtA[i] = 0x2a + } + if m.PublicKey != nil { + { + size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x22 } - if len(m.PublicKeyMultibase) > 0 { - i -= len(m.PublicKeyMultibase) - copy(dAtA[i:], m.PublicKeyMultibase) - i = encodeVarintState(dAtA, i, uint64(len(m.PublicKeyMultibase))) - i-- - dAtA[i] = 0x1a + if len(m.Aliases) > 0 { + for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Aliases[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } } - if len(m.Did) > 0 { - i -= len(m.Did) - copy(dAtA[i:], m.Did) - i = encodeVarintState(dAtA, i, uint64(len(m.Did))) + 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 } @@ -859,7 +900,7 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Delegation) Marshal() (dAtA []byte, err error) { +func (m *Proof) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -869,24 +910,96 @@ func (m *Delegation) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Delegation) MarshalTo(dAtA []byte) (int, error) { +func (m *Proof) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Delegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.ChannelId != 0 { - i = encodeVarintState(dAtA, i, uint64(m.ChannelId)) + 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] = 0x40 + dAtA[i] = 0x32 } - if len(m.PublicKeyJwks) > 0 { - for k := range m.PublicKeyJwks { - v := m.PublicKeyJwks[k] + if len(m.Accumulator) > 0 { + i -= len(m.Accumulator) + copy(dAtA[i:], m.Accumulator) + i = encodeVarintState(dAtA, i, uint64(len(m.Accumulator))) + i-- + dAtA[i] = 0x2a + } + if len(m.Property) > 0 { + i -= len(m.Property) + copy(dAtA[i:], m.Property) + i = encodeVarintState(dAtA, i, uint64(len(m.Property))) + i-- + dAtA[i] = 0x22 + } + if len(m.Issuer) > 0 { + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintState(dAtA, i, uint64(len(m.Issuer))) + i-- + dAtA[i] = 0x1a + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintState(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintState(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ServiceRecord) 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 *ServiceRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Permissions != nil { + { + size, err := m.Permissions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.ServiceEndpoints) > 0 { + for k := range m.ServiceEndpoints { + v := m.ServiceEndpoints[k] baseI := i i -= len(v) copy(dAtA[i:], v) @@ -900,41 +1013,34 @@ func (m *Delegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0xa i = encodeVarintState(dAtA, i, uint64(baseI-i)) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x32 } } - if len(m.PublicKeyMultibase) > 0 { - i -= len(m.PublicKeyMultibase) - copy(dAtA[i:], m.PublicKeyMultibase) - i = encodeVarintState(dAtA, i, uint64(len(m.PublicKeyMultibase))) - i-- - dAtA[i] = 0x32 - } - if len(m.ControllerDid) > 0 { - i -= len(m.ControllerDid) - copy(dAtA[i:], m.ControllerDid) - i = encodeVarintState(dAtA, i, uint64(len(m.ControllerDid))) + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintState(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x2a } - if len(m.ChainAddress) > 0 { - i -= len(m.ChainAddress) - copy(dAtA[i:], m.ChainAddress) - i = encodeVarintState(dAtA, i, uint64(len(m.ChainAddress))) + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintState(dAtA, i, uint64(len(m.Origin))) i-- dAtA[i] = 0x22 } - if len(m.ChainType) > 0 { - i -= len(m.ChainType) - copy(dAtA[i:], m.ChainType) - i = encodeVarintState(dAtA, i, uint64(len(m.ChainType))) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintState(dAtA, i, uint64(len(m.Authority))) i-- dAtA[i] = 0x1a } - if len(m.Did) > 0 { - i -= len(m.Did) - copy(dAtA[i:], m.Did) - i = encodeVarintState(dAtA, i, uint64(len(m.Did))) + if len(m.ServiceType) > 0 { + i -= len(m.ServiceType) + copy(dAtA[i:], m.ServiceType) + i = encodeVarintState(dAtA, i, uint64(len(m.ServiceType))) i-- dAtA[i] = 0x12 } @@ -948,7 +1054,7 @@ func (m *Delegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Service) Marshal() (dAtA []byte, err error) { +func (m *VerificationMethod) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -958,16 +1064,46 @@ func (m *Service) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Service) MarshalTo(dAtA []byte) (int, error) { +func (m *VerificationMethod) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *VerificationMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.PublicKey != nil { + { + size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintState(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0x2a + } + if len(m.Issuer) > 0 { + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintState(dAtA, i, uint64(len(m.Issuer))) + i-- + dAtA[i] = 0x22 + } + if m.Method != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Method)) + i-- + dAtA[i] = 0x18 if len(m.Scopes) > 0 { dAtA2 := make([]byte, len(m.Scopes)*10) var j1 int @@ -1019,10 +1155,10 @@ func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.ServiceType) > 0 { - i -= len(m.ServiceType) - copy(dAtA[i:], m.ServiceType) - i = encodeVarintState(dAtA, i, uint64(len(m.ServiceType))) + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintState(dAtA, i, uint64(len(m.Controller))) i-- dAtA[i] = 0x12 } @@ -1047,7 +1183,7 @@ func encodeVarintState(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Aliases) Size() (n int) { +func (m *Account) Size() (n int) { if m == nil { return 0 } @@ -1069,71 +1205,30 @@ func (m *Aliases) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - if m.Expiration != 0 { - n += 1 + sovState(uint64(m.Expiration)) + if m.PublicKey != nil { + l = m.PublicKey.Size() + n += 1 + l + sovState(uint64(l)) } - return n -} - -func (m *Assertion) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) + l = len(m.Address) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.KeyType) + l = len(m.Label) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Credential) - if l > 0 { - n += 1 + l + sovState(uint64(l)) + if m.ChainCode != 0 { + n += 1 + sovState(uint64(m.ChainCode)) } - if len(m.Metadata) > 0 { - for k, v := range m.Metadata { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovState(uint64(len(k))) + 1 + len(v) + sovState(uint64(len(v))) - n += mapEntrySize + 1 + sovState(uint64(mapEntrySize)) + if m.Index != 0 { + n += 1 + sovState(uint64(m.Index)) + } + if len(m.Chains) > 0 { + for _, s := range m.Chains { + l = len(s) + n += 1 + l + sovState(uint64(l)) } } - l = len(m.Controller) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - return n -} - -func (m *Attestation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.KeyType) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Proof) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } - l = len(m.Controller) - if l > 0 { - n += 1 + l + sovState(uint64(l)) - } return n } @@ -1147,26 +1242,34 @@ func (m *Controller) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Did) + l = len(m.Address) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.PublicKeyMultibase) - if l > 0 { + if len(m.Aliases) > 0 { + for _, e := range m.Aliases { + l = e.Size() + n += 1 + l + sovState(uint64(l)) + } + } + if m.PublicKey != nil { + l = m.PublicKey.Size() n += 1 + l + sovState(uint64(l)) } l = len(m.VaultCid) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Fingerprint) - if l > 0 { - n += 1 + l + sovState(uint64(l)) + if len(m.Authentication) > 0 { + for _, e := range m.Authentication { + l = e.Size() + n += 1 + l + sovState(uint64(l)) + } } return n } -func (m *Delegation) Size() (n int) { +func (m *Proof) Size() (n int) { if m == nil { return 0 } @@ -1176,41 +1279,30 @@ func (m *Delegation) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.Did) + l = len(m.Controller) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.ChainType) + l = len(m.Issuer) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.ChainAddress) + l = len(m.Property) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.ControllerDid) + l = len(m.Accumulator) if l > 0 { n += 1 + l + sovState(uint64(l)) } - l = len(m.PublicKeyMultibase) + l = len(m.Key) if l > 0 { n += 1 + l + sovState(uint64(l)) } - if len(m.PublicKeyJwks) > 0 { - for k, v := range m.PublicKeyJwks { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovState(uint64(len(k))) + 1 + len(v) + sovState(uint64(len(v))) - n += mapEntrySize + 1 + sovState(uint64(mapEntrySize)) - } - } - if m.ChannelId != 0 { - n += 1 + sovState(uint64(m.ChannelId)) - } return n } -func (m *Service) Size() (n int) { +func (m *ServiceRecord) Size() (n int) { if m == nil { return 0 } @@ -1224,6 +1316,15 @@ func (m *Service) Size() (n int) { if l > 0 { n += 1 + l + sovState(uint64(l)) } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.Description) l = len(m.ControllerDid) if l > 0 { n += 1 + l + sovState(uint64(l)) @@ -1240,6 +1341,41 @@ func (m *Service) Size() (n int) { n += mapEntrySize + 1 + sovState(uint64(mapEntrySize)) } } + if m.Permissions != nil { + l = m.Permissions.Size() + n += 1 + l + sovState(uint64(l)) + } + return n +} + +func (m *VerificationMethod) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.Method != 0 { + n += 1 + sovState(uint64(m.Method)) + } + l = len(m.Issuer) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.PublicKey != nil { + l = m.PublicKey.Size() + n += 1 + l + sovState(uint64(l)) if len(m.Scopes) > 0 { l = 0 for _, e := range m.Scopes { @@ -1256,7 +1392,7 @@ func sovState(x uint64) (n int) { func sozState(x uint64) (n int) { return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Aliases) Unmarshal(dAtA []byte) error { +func (m *Account) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1279,10 +1415,10 @@ func (m *Aliases) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Aliases: wiretype end group for non-group") + return fmt.Errorf("proto: Account: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Aliases: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1413,176 +1549,9 @@ func (m *Aliases) Unmarshal(dAtA []byte) error { } m.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) - } - m.Expiration = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Expiration |= 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 *Assertion) 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: Assertion: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Assertion: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Id = 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 Credential", 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.Credential = append(m.Credential[:0], dAtA[iNdEx:postIndex]...) - if m.Credential == nil { - m.Credential = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1609,285 +1578,16 @@ func (m *Assertion) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Metadata == nil { - m.Metadata = make(map[string]string) + if m.PublicKey == nil { + m.PublicKey = &PubKey{} } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthState - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthState - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthState - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthState - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipState(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Metadata[mapkey] = mapvalue - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Controller = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipState(dAtA[iNdEx:]) - if err != nil { + if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); 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 *Attestation) 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: Attestation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Attestation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 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.Id = 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 Value", 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.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1915,11 +1615,11 @@ func (m *Attestation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Proof = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1947,7 +1647,77 @@ func (m *Attestation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Controller = string(dAtA[iNdEx:postIndex]) + m.Label = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainCode", wireType) + } + m.ChainCode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainCode |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + 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 ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chains", 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.Chains = append(m.Chains, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -2033,7 +1803,7 @@ func (m *Controller) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2061,13 +1831,13 @@ func (m *Controller) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Did = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyMultibase", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -2077,25 +1847,63 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthState } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - m.PublicKeyMultibase = string(dAtA[iNdEx:postIndex]) + m.Aliases = append(m.Aliases, &Alias{}) + if err := m.Aliases[len(m.Aliases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PublicKey == nil { + m.PublicKey = &PubKey{} + } + if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VaultCid", wireType) } @@ -2127,11 +1935,11 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } m.VaultCid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fingerprint", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -2141,24 +1949,24 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLengthState } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - m.Fingerprint = append(m.Fingerprint[:0], dAtA[iNdEx:postIndex]...) - if m.Fingerprint == nil { - m.Fingerprint = []byte{} + m.Authentication = append(m.Authentication, &Credential{}) + if err := m.Authentication[len(m.Authentication)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex default: @@ -2182,7 +1990,7 @@ func (m *Controller) Unmarshal(dAtA []byte) error { } return nil } -func (m *Delegation) Unmarshal(dAtA []byte) error { +func (m *Proof) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2205,10 +2013,10 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Delegation: wiretype end group for non-group") + return fmt.Errorf("proto: Proof: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Delegation: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2245,7 +2053,7 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2273,11 +2081,11 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Did = string(dAtA[iNdEx:postIndex]) + m.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Issuer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2305,11 +2113,11 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainType = string(dAtA[iNdEx:postIndex]) + m.Issuer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Property", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2337,13 +2145,13 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainAddress = string(dAtA[iNdEx:postIndex]) + m.Property = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ControllerDid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Accumulator", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -2353,27 +2161,113 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthState } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthState } if postIndex > l { return io.ErrUnexpectedEOF } - m.ControllerDid = string(dAtA[iNdEx:postIndex]) + m.Accumulator = append(m.Accumulator[:0], dAtA[iNdEx:postIndex]...) + if m.Accumulator == nil { + m.Accumulator = []byte{} + } iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyMultibase", wireType) + 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 (m *ServiceRecord) 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: ServiceRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2401,11 +2295,139 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PublicKeyMultibase = string(dAtA[iNdEx:postIndex]) + m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKeyJwks", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ServiceType", 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.ServiceType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceEndpoints", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2432,8 +2454,8 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PublicKeyJwks == nil { - m.PublicKeyJwks = make(map[string]string) + if m.ServiceEndpoints == nil { + m.ServiceEndpoints = make(map[string]string) } var mapkey string var mapvalue string @@ -2528,13 +2550,13 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.PublicKeyJwks[mapkey] = mapvalue + m.ServiceEndpoints[mapkey] = mapvalue iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } - m.ChannelId = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowState @@ -2544,11 +2566,28 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ChannelId |= uint64(b&0x7F) << shift + 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.Permissions == nil { + m.Permissions = &Permissions{} + } + if err := m.Permissions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) @@ -2570,7 +2609,7 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { } return nil } -func (m *Service) Unmarshal(dAtA []byte) error { +func (m *VerificationMethod) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2593,10 +2632,10 @@ func (m *Service) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Service: wiretype end group for non-group") + return fmt.Errorf("proto: VerificationMethod: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Service: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VerificationMethod: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2633,7 +2672,7 @@ func (m *Service) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2661,9 +2700,30 @@ func (m *Service) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ServiceType = string(dAtA[iNdEx:postIndex]) + m.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + m.Method = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Method |= DIDNamespace(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Issuer", wireType) if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ControllerDid", wireType) } @@ -2693,7 +2753,75 @@ func (m *Service) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ControllerDid = string(dAtA[iNdEx:postIndex]) + m.Issuer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", 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.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PublicKey == nil { + m.PublicKey = &PubKey{} + } + if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 2 { diff --git a/x/did/types/tx.pb.go b/x/did/types/tx.pb.go index 7ea9d4544..4fc9aadf0 100644 --- a/x/did/types/tx.pb.go +++ b/x/did/types/tx.pb.go @@ -37,9 +37,9 @@ 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"` + // token is the macron token to authenticate the operation. + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` } func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } @@ -89,6 +89,13 @@ func (m *MsgUpdateParams) GetParams() Params { return Params{} } +func (m *MsgUpdateParams) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. // @@ -129,6 +136,28 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// MsgAllocateVault is the message type for the AllocateVault RPC. +type MsgAllocateVault struct { + // authority is the address of the service account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // subject is a unique human-defined identifier to associate with the vault. + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + // origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` +} + +func (m *MsgAllocateVault) Reset() { *m = MsgAllocateVault{} } +func (m *MsgAllocateVault) String() string { return proto.CompactTextString(m) } +func (*MsgAllocateVault) ProtoMessage() {} +func (*MsgAllocateVault) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{2} +} +func (m *MsgAllocateVault) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllocateVault) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllocateVault.Marshal(b, m, deterministic) // MsgAuthenticate is the message type for the Authenticate RPC. type MsgAuthenticate struct { // authority is the address of the governance account. @@ -162,6 +191,19 @@ func (m *MsgAuthenticate) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } +func (m *MsgAllocateVault) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllocateVault.Merge(m, src) +} +func (m *MsgAllocateVault) XXX_Size() int { + return m.Size() +} +func (m *MsgAllocateVault) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllocateVault.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllocateVault proto.InternalMessageInfo + +func (m *MsgAllocateVault) GetAuthority() string { func (m *MsgAuthenticate) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAuthenticate.Merge(m, src) } @@ -181,6 +223,9 @@ func (m *MsgAuthenticate) GetAuthority() string { return "" } +func (m *MsgAllocateVault) GetSubject() string { + if m != nil { + return m.Subject func (m *MsgAuthenticate) GetController() string { if m != nil { return m.Controller @@ -188,6 +233,7 @@ func (m *MsgAuthenticate) GetController() string { return "" } +func (m *MsgAllocateVault) GetOrigin() string { func (m *MsgAuthenticate) GetAddress() string { if m != nil { return m.Address @@ -202,6 +248,30 @@ func (m *MsgAuthenticate) GetOrigin() string { return "" } +// MsgAllocateVaultResponse is the response type for the AllocateVault RPC. +type MsgAllocateVaultResponse struct { + // CID is the content identifier of the vault. + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` + // ExpiryBlock is the block number at which the vault will expire. + ExpiryBlock int64 `protobuf:"varint,2,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"` + // RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn + RegistrationOptions string `protobuf:"bytes,3,opt,name=registration_options,json=registrationOptions,proto3" json:"registration_options,omitempty"` + // IsLocalhost is a flag to indicate if the vault is localhost + Localhost bool `protobuf:"varint,4,opt,name=localhost,proto3" json:"localhost,omitempty"` +} + +func (m *MsgAllocateVaultResponse) Reset() { *m = MsgAllocateVaultResponse{} } +func (m *MsgAllocateVaultResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAllocateVaultResponse) ProtoMessage() {} +func (*MsgAllocateVaultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{3} +} +func (m *MsgAllocateVaultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllocateVaultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllocateVaultResponse.Marshal(b, m, deterministic) // MsgAuthenticateResponse is the response type for the Authenticate RPC. type MsgAuthenticateResponse struct { } @@ -227,6 +297,45 @@ func (m *MsgAuthenticateResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } +func (m *MsgAllocateVaultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllocateVaultResponse.Merge(m, src) +} +func (m *MsgAllocateVaultResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAllocateVaultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllocateVaultResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllocateVaultResponse proto.InternalMessageInfo + +func (m *MsgAllocateVaultResponse) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +func (m *MsgAllocateVaultResponse) GetExpiryBlock() int64 { + if m != nil { + return m.ExpiryBlock + } + return 0 +} + +func (m *MsgAllocateVaultResponse) GetRegistrationOptions() string { + if m != nil { + return m.RegistrationOptions + } + return "" +} + +func (m *MsgAllocateVaultResponse) GetLocalhost() bool { + if m != nil { + return m.Localhost + } + return false +} func (m *MsgAuthenticateResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAuthenticateResponse.Merge(m, src) } @@ -247,6 +356,8 @@ type MsgProveWitness struct { Property string `protobuf:"bytes,2,opt,name=property,proto3" json:"property,omitempty"` // Witness Value is the bytes of the witness. Witness []byte `protobuf:"bytes,3,opt,name=witness,proto3" json:"witness,omitempty"` + // token is the macron token to authenticate the operation. + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` } func (m *MsgProveWitness) Reset() { *m = MsgProveWitness{} } @@ -303,6 +414,13 @@ func (m *MsgProveWitness) GetWitness() []byte { return nil } +func (m *MsgProveWitness) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + // MsgProveWitnessResponse is the response type for the ProveWitness RPC. type MsgProveWitnessResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` @@ -356,6 +474,26 @@ func (m *MsgProveWitnessResponse) GetProperty() string { return "" } +// MsgSyncController is the message type for the SyncController RPC. +type MsgSyncController struct { + // controller is the address of the controller to sync. + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + // Token is the public token to authenticate the operation. + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` +} + +func (m *MsgSyncController) Reset() { *m = MsgSyncController{} } +func (m *MsgSyncController) String() string { return proto.CompactTextString(m) } +func (*MsgSyncController) ProtoMessage() {} +func (*MsgSyncController) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{6} +} +func (m *MsgSyncController) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSyncController) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSyncController.Marshal(b, m, deterministic) // MsgSyncVault is the message type for the SyncVault RPC. type MsgSyncVault struct { // controller is the address of the controller to sync. @@ -387,6 +525,19 @@ func (m *MsgSyncVault) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } +func (m *MsgSyncController) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSyncController.Merge(m, src) +} +func (m *MsgSyncController) XXX_Size() int { + return m.Size() +} +func (m *MsgSyncController) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSyncController.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSyncController proto.InternalMessageInfo + +func (m *MsgSyncController) GetController() string { func (m *MsgSyncVault) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSyncVault.Merge(m, src) } @@ -406,6 +557,9 @@ func (m *MsgSyncVault) GetController() string { return "" } +func (m *MsgSyncController) GetToken() string { + if m != nil { + return m.Token func (m *MsgSyncVault) GetCid() string { if m != nil { return m.Cid @@ -413,6 +567,23 @@ func (m *MsgSyncVault) GetCid() string { return "" } +// MsgSyncControllerResponse is the response type for the SyncController RPC. +type MsgSyncControllerResponse struct { + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (m *MsgSyncControllerResponse) Reset() { *m = MsgSyncControllerResponse{} } +func (m *MsgSyncControllerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSyncControllerResponse) ProtoMessage() {} +func (*MsgSyncControllerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{7} +} +func (m *MsgSyncControllerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSyncControllerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSyncControllerResponse.Marshal(b, m, deterministic) func (m *MsgSyncVault) GetMacron() []byte { if m != nil { return m.Macron @@ -446,6 +617,19 @@ func (m *MsgSyncVaultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } +func (m *MsgSyncControllerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSyncControllerResponse.Merge(m, src) +} +func (m *MsgSyncControllerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSyncControllerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSyncControllerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSyncControllerResponse proto.InternalMessageInfo + +func (m *MsgSyncControllerResponse) GetSuccess() bool { func (m *MsgSyncVaultResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSyncVaultResponse.Merge(m, src) } @@ -470,6 +654,11 @@ 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. + Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` + // Origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"` + // Credential is the list of keyshares to initialize the controller with. + CredentialCreationResponse string `protobuf:"bytes,4,opt,name=credential_creation_response,json=credentialCreationResponse,proto3" json:"credential_creation_response,omitempty"` 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"` @@ -517,6 +706,25 @@ func (m *MsgRegisterController) GetAuthority() string { return "" } +func (m *MsgRegisterController) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +func (m *MsgRegisterController) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *MsgRegisterController) GetCredentialCreationResponse() string { + if m != nil { + return m.CredentialCreationResponse + } + return "" func (m *MsgRegisterController) GetAssertions() [][]byte { if m != nil { return m.Assertions @@ -540,6 +748,12 @@ func (m *MsgRegisterController) GetVerifications() [][]byte { // MsgRegisterControllerResponse is the response type for the InitializeController RPC. type MsgRegisterControllerResponse struct { + // Success returns true if the specified cid is valid and not already encrypted. + 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"` // Controller is the address of the initialized controller. Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` // Accounts are a Address Map and Supported coin Denoms for the controller @@ -579,6 +793,13 @@ func (m *MsgRegisterControllerResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRegisterControllerResponse proto.InternalMessageInfo +func (m *MsgRegisterControllerResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + func (m *MsgRegisterControllerResponse) GetController() string { if m != nil { return m.Controller @@ -593,6 +814,140 @@ func (m *MsgRegisterControllerResponse) GetAccounts() map[string]string { return nil } +// MsgAuthorizeService is the message type for the AuthorizeService RPC. +type MsgAuthorizeService struct { + // Controller is the address of the controller to authenticate. + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + // Origin is the origin of the request in wildcard form. + Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` + // Permissions is the scope of the service. + Scopes *Permissions `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` + // token is the macron token to authenticate the operation. + Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` +} + +func (m *MsgAuthorizeService) Reset() { *m = MsgAuthorizeService{} } +func (m *MsgAuthorizeService) String() string { return proto.CompactTextString(m) } +func (*MsgAuthorizeService) ProtoMessage() {} +func (*MsgAuthorizeService) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{10} +} +func (m *MsgAuthorizeService) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAuthorizeService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAuthorizeService.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 *MsgAuthorizeService) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAuthorizeService.Merge(m, src) +} +func (m *MsgAuthorizeService) XXX_Size() int { + return m.Size() +} +func (m *MsgAuthorizeService) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAuthorizeService.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAuthorizeService proto.InternalMessageInfo + +func (m *MsgAuthorizeService) GetController() string { + if m != nil { + return m.Controller + } + return "" +} + +func (m *MsgAuthorizeService) GetOrigin() string { + if m != nil { + return m.Origin + } + return "" +} + +func (m *MsgAuthorizeService) GetScopes() *Permissions { + if m != nil { + return m.Scopes + } + return nil +} + +func (m *MsgAuthorizeService) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +// MsgAuthorizeServiceResponse is the response type for the AuthorizeService RPC. +type MsgAuthorizeServiceResponse struct { + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` +} + +func (m *MsgAuthorizeServiceResponse) Reset() { *m = MsgAuthorizeServiceResponse{} } +func (m *MsgAuthorizeServiceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAuthorizeServiceResponse) ProtoMessage() {} +func (*MsgAuthorizeServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{11} +} +func (m *MsgAuthorizeServiceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAuthorizeServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAuthorizeServiceResponse.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 *MsgAuthorizeServiceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAuthorizeServiceResponse.Merge(m, src) +} +func (m *MsgAuthorizeServiceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAuthorizeServiceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAuthorizeServiceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAuthorizeServiceResponse proto.InternalMessageInfo + +func (m *MsgAuthorizeServiceResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + +func (m *MsgAuthorizeServiceResponse) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +// MsgRegisterService is the message type for the RegisterService RPC. +type MsgRegisterService struct { + // authority is the address of the governance account. + Controller string `protobuf:"bytes,1,opt,name=controller,proto3" json:"controller,omitempty"` + // origin is the origin of the request in wildcard form. Requires valid TXT record in DNS. + Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` + // token is the macron token to authenticate the operation. + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` // MsgRegisterService is the message type for the RegisterService RPC. type MsgRegisterService struct { // authority is the address of the governance account. @@ -607,6 +962,7 @@ func (m *MsgRegisterService) Reset() { *m = MsgRegisterService{} } func (m *MsgRegisterService) String() string { return proto.CompactTextString(m) } func (*MsgRegisterService) ProtoMessage() {} func (*MsgRegisterService) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{12} return fileDescriptor_d73284df019ff211, []int{10} } func (m *MsgRegisterService) XXX_Unmarshal(b []byte) error { @@ -636,6 +992,9 @@ func (m *MsgRegisterService) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRegisterService proto.InternalMessageInfo +func (m *MsgRegisterService) GetController() string { + if m != nil { + return m.Controller func (m *MsgRegisterService) GetAuthority() string { if m != nil { return m.Authority @@ -643,6 +1002,9 @@ func (m *MsgRegisterService) GetAuthority() string { return "" } +func (m *MsgRegisterService) GetService() *Service { + if m != nil { + return m.Service func (m *MsgRegisterService) GetOriginUri() string { if m != nil { return m.OriginUri @@ -657,6 +1019,17 @@ func (m *MsgRegisterService) GetScopes() []PermissionScope { return nil } +func (m *MsgRegisterService) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +// MsgRegisterServiceResponse is the response type for the RegisterService RPC. +type MsgRegisterServiceResponse struct { + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` // MsgRegisterServiceResponse is the response type for the RegisterService RPC. type MsgRegisterServiceResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` @@ -666,6 +1039,7 @@ func (m *MsgRegisterServiceResponse) Reset() { *m = MsgRegisterServiceRe func (m *MsgRegisterServiceResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterServiceResponse) ProtoMessage() {} func (*MsgRegisterServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d73284df019ff211, []int{13} return fileDescriptor_d73284df019ff211, []int{11} } func (m *MsgRegisterServiceResponse) XXX_Unmarshal(b []byte) error { @@ -702,9 +1076,27 @@ func (m *MsgRegisterServiceResponse) GetSuccess() bool { return false } +func (m *MsgRegisterServiceResponse) GetDid() string { + if m != nil { + return m.Did + } + return "" +} + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "did.v1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "did.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgAllocateVault)(nil), "did.v1.MsgAllocateVault") + proto.RegisterType((*MsgAllocateVaultResponse)(nil), "did.v1.MsgAllocateVaultResponse") + proto.RegisterType((*MsgProveWitness)(nil), "did.v1.MsgProveWitness") + proto.RegisterType((*MsgProveWitnessResponse)(nil), "did.v1.MsgProveWitnessResponse") + proto.RegisterType((*MsgSyncController)(nil), "did.v1.MsgSyncController") + proto.RegisterType((*MsgSyncControllerResponse)(nil), "did.v1.MsgSyncControllerResponse") + 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((*MsgAuthorizeService)(nil), "did.v1.MsgAuthorizeService") + proto.RegisterType((*MsgAuthorizeServiceResponse)(nil), "did.v1.MsgAuthorizeServiceResponse") proto.RegisterType((*MsgAuthenticate)(nil), "did.v1.MsgAuthenticate") proto.RegisterType((*MsgAuthenticateResponse)(nil), "did.v1.MsgAuthenticateResponse") proto.RegisterType((*MsgProveWitness)(nil), "did.v1.MsgProveWitness") @@ -721,6 +1113,64 @@ func init() { func init() { proto.RegisterFile("did/v1/tx.proto", fileDescriptor_d73284df019ff211) } var fileDescriptor_d73284df019ff211 = []byte{ + // 911 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4d, 0x6f, 0xdc, 0x44, + 0x18, 0x8e, 0x77, 0xd3, 0x6d, 0xf2, 0x26, 0xcd, 0x06, 0x27, 0x10, 0xc7, 0x6d, 0xb7, 0xa9, 0x11, + 0x52, 0x28, 0xb0, 0xab, 0xa4, 0x02, 0x55, 0x85, 0x03, 0x49, 0x85, 0x54, 0x09, 0x2d, 0x29, 0x0e, + 0x1f, 0x52, 0x2f, 0x91, 0x77, 0x3c, 0x72, 0x86, 0xf5, 0x7a, 0xac, 0x99, 0xd9, 0x25, 0xe6, 0x04, + 0x9c, 0x39, 0xf0, 0x07, 0x90, 0xb8, 0x70, 0xef, 0x81, 0x1b, 0x7f, 0xa0, 0x12, 0x97, 0x8a, 0x13, + 0x27, 0x84, 0x92, 0x43, 0xff, 0x02, 0x47, 0x34, 0x9e, 0xf1, 0xc7, 0x7e, 0x76, 0x9b, 0x5e, 0x76, + 0xfd, 0xce, 0xf3, 0xce, 0x33, 0xcf, 0x3b, 0xcf, 0x3b, 0x63, 0x43, 0xdd, 0x27, 0x7e, 0x6b, 0xb0, + 0xd7, 0x12, 0x67, 0xcd, 0x98, 0x51, 0x41, 0xcd, 0x9a, 0x4f, 0xfc, 0xe6, 0x60, 0xcf, 0xde, 0x42, + 0x94, 0xf7, 0x28, 0x6f, 0xf5, 0x78, 0x20, 0xf1, 0x1e, 0x0f, 0x54, 0x82, 0xbd, 0xad, 0x80, 0x93, + 0x34, 0x6a, 0xa9, 0x40, 0x43, 0x9b, 0x9a, 0x2c, 0xc0, 0x11, 0xe6, 0x24, 0x1b, 0xdd, 0xd0, 0xa3, + 0x3d, 0xea, 0xe3, 0x30, 0x4f, 0x0d, 0x68, 0x40, 0x15, 0x85, 0x7c, 0x52, 0xa3, 0xce, 0x2f, 0x06, + 0xd4, 0xdb, 0x3c, 0xf8, 0x32, 0xf6, 0x3d, 0x81, 0x1f, 0x79, 0xcc, 0xeb, 0x71, 0xf3, 0x03, 0x58, + 0xf6, 0xfa, 0xe2, 0x94, 0x32, 0x22, 0x12, 0xcb, 0xd8, 0x31, 0x76, 0x97, 0x0f, 0xad, 0xbf, 0x7e, + 0x7f, 0x6f, 0x53, 0xaf, 0x7c, 0xe0, 0xfb, 0x0c, 0x73, 0x7e, 0x2c, 0x18, 0x89, 0x02, 0xb7, 0x48, + 0x35, 0xdf, 0x85, 0x5a, 0x9c, 0x32, 0x58, 0x95, 0x1d, 0x63, 0x77, 0x65, 0x7f, 0xad, 0xa9, 0x2a, + 0x6b, 0x2a, 0xde, 0xc3, 0xc5, 0xa7, 0xff, 0xdc, 0x5a, 0x70, 0x75, 0x8e, 0xb9, 0x09, 0x57, 0x04, + 0xed, 0xe2, 0xc8, 0xaa, 0xca, 0x15, 0x5c, 0x15, 0xdc, 0x5f, 0xfb, 0xf1, 0xf9, 0x93, 0x3b, 0x05, + 0xa7, 0xb3, 0x0d, 0x5b, 0x23, 0xf2, 0x5c, 0xcc, 0x63, 0x1a, 0x71, 0xec, 0xfc, 0x64, 0xc0, 0x7a, + 0x9b, 0x07, 0x07, 0x61, 0x48, 0x91, 0x27, 0xf0, 0x57, 0x5e, 0x3f, 0x14, 0x97, 0xd6, 0x6e, 0xc1, + 0x55, 0xde, 0xef, 0x7c, 0x83, 0x91, 0x48, 0xc5, 0x2f, 0xbb, 0x59, 0x68, 0xbe, 0x01, 0x35, 0xca, + 0x48, 0x40, 0x32, 0xa1, 0x3a, 0x1a, 0x53, 0xfa, 0xab, 0x01, 0xd6, 0xa8, 0x9c, 0x4c, 0xab, 0xb9, + 0x0e, 0x55, 0x44, 0x7c, 0x25, 0xc8, 0x95, 0x8f, 0xe6, 0x6d, 0x58, 0xc5, 0x67, 0x31, 0x61, 0xc9, + 0x49, 0x27, 0xa4, 0xa8, 0x9b, 0xae, 0x5a, 0x75, 0x57, 0xd4, 0xd8, 0xa1, 0x1c, 0x32, 0xf7, 0x60, + 0x93, 0xe1, 0x80, 0x70, 0xc1, 0x3c, 0x41, 0x68, 0x74, 0x42, 0x63, 0xf9, 0xc7, 0xb5, 0x8e, 0x8d, + 0x32, 0x76, 0xa4, 0x20, 0xf3, 0x06, 0x2c, 0xcb, 0xe5, 0xc3, 0x53, 0xca, 0x85, 0xb5, 0xb8, 0x63, + 0xec, 0x2e, 0xb9, 0xc5, 0x80, 0xf3, 0x9b, 0x32, 0xfb, 0x11, 0xa3, 0x03, 0xfc, 0x35, 0x11, 0x11, + 0xe6, 0x97, 0x37, 0xdb, 0x86, 0xa5, 0x98, 0xd1, 0x18, 0x33, 0x91, 0xe8, 0x1d, 0xcb, 0x63, 0xb9, + 0x99, 0xdf, 0x2a, 0xfa, 0x54, 0xeb, 0xaa, 0x9b, 0x85, 0x85, 0xe9, 0x8b, 0xb3, 0x4c, 0x3f, 0x4a, + 0x4d, 0x2f, 0xcb, 0xcc, 0x37, 0x32, 0xf5, 0x09, 0x21, 0x49, 0x6d, 0xa4, 0xe5, 0x65, 0xe1, 0x2c, + 0x41, 0x8e, 0x80, 0xd7, 0xda, 0x3c, 0x38, 0x4e, 0x22, 0xf4, 0x80, 0x46, 0x82, 0xd1, 0x30, 0xc4, + 0xcc, 0xbc, 0x07, 0x80, 0xf2, 0xe8, 0x85, 0xa5, 0x97, 0x72, 0xa7, 0xb4, 0x6e, 0x5d, 0x56, 0x51, + 0x4a, 0x73, 0xde, 0x87, 0xed, 0xb1, 0x55, 0x5f, 0x5c, 0x88, 0xf3, 0xa7, 0x01, 0xaf, 0xb7, 0x79, + 0xe0, 0xa6, 0xf6, 0x62, 0x56, 0x52, 0x7c, 0x59, 0xaf, 0x74, 0xf7, 0x55, 0x8a, 0xee, 0x9b, 0xd2, + 0xd4, 0xe6, 0xc7, 0x70, 0x03, 0x31, 0xec, 0xe3, 0x48, 0x10, 0x2f, 0x3c, 0x41, 0x0c, 0xab, 0xce, + 0x63, 0x5a, 0xb5, 0xb6, 0xcd, 0x2e, 0x72, 0x1e, 0xe8, 0x94, 0xac, 0xae, 0x31, 0x2f, 0x7f, 0xa8, + 0xc0, 0xcd, 0x89, 0xd5, 0xcc, 0x61, 0xe9, 0xb0, 0x43, 0x95, 0x97, 0x70, 0xe8, 0x08, 0x96, 0x3c, + 0x84, 0x68, 0x3f, 0x12, 0xb2, 0x05, 0xab, 0xbb, 0x2b, 0xfb, 0x77, 0xb3, 0xcb, 0x68, 0xa6, 0x98, + 0xe6, 0x81, 0x9e, 0xf5, 0x49, 0x24, 0x58, 0xe2, 0xe6, 0x24, 0xf6, 0x87, 0x70, 0x6d, 0x08, 0x92, + 0x7b, 0xda, 0xc5, 0x49, 0x76, 0xa2, 0xbb, 0x38, 0x91, 0x5d, 0x31, 0xf0, 0xc2, 0x3e, 0xd6, 0xfb, + 0xac, 0x82, 0xfb, 0x95, 0x7b, 0x86, 0xf3, 0x87, 0x01, 0x1b, 0xf2, 0x6a, 0x50, 0x9b, 0xf2, 0x1d, + 0x3e, 0xc6, 0x6c, 0x40, 0x10, 0x7e, 0x85, 0x0e, 0x2c, 0xfc, 0xab, 0x0c, 0xf9, 0xf7, 0x0e, 0xd4, + 0x38, 0xa2, 0x31, 0x56, 0x07, 0x6f, 0x65, 0x7f, 0x23, 0xbf, 0x82, 0x31, 0xeb, 0x11, 0xce, 0xe5, + 0x25, 0xe1, 0xea, 0x94, 0x29, 0x87, 0x71, 0xac, 0x8d, 0xdb, 0x70, 0x7d, 0x82, 0xf8, 0x39, 0xec, + 0xcb, 0xf9, 0x2b, 0x25, 0x7e, 0x79, 0x4f, 0x9a, 0x25, 0x0f, 0x5e, 0x7d, 0x2f, 0xde, 0x86, 0xab, + 0x5c, 0x91, 0xe8, 0xf7, 0x4e, 0x3d, 0x2b, 0x3a, 0x93, 0x9a, 0xe1, 0xf3, 0x1e, 0xdc, 0x87, 0x60, + 0x8f, 0x2b, 0x9c, 0xa3, 0xe0, 0x75, 0xa8, 0xfa, 0xc5, 0x39, 0xf3, 0x89, 0xbf, 0xff, 0x5f, 0x15, + 0xaa, 0x6d, 0x1e, 0x98, 0x0f, 0x61, 0x75, 0xe8, 0x15, 0xbb, 0x55, 0xea, 0xc6, 0x32, 0x60, 0xdf, + 0x9a, 0x02, 0xe4, 0xab, 0x7f, 0x01, 0xeb, 0x63, 0x7d, 0x74, 0xbd, 0x34, 0x69, 0x14, 0xb4, 0xdf, + 0x9c, 0x01, 0xe6, 0xac, 0x9f, 0xc2, 0xb5, 0xe1, 0xf7, 0xa8, 0x55, 0x9e, 0x55, 0x46, 0xec, 0x9d, + 0x69, 0x48, 0x4e, 0xf6, 0x19, 0xac, 0x8d, 0x5c, 0xb5, 0xdb, 0xa5, 0x39, 0xc3, 0x90, 0x7d, 0x7b, + 0x2a, 0x94, 0xf3, 0x3d, 0x06, 0x73, 0xc2, 0x65, 0x78, 0x73, 0xe6, 0x81, 0xb6, 0xdf, 0x9a, 0xeb, + 0xbc, 0x9b, 0x9f, 0x43, 0x7d, 0xb4, 0x13, 0xed, 0x09, 0x33, 0xb3, 0xcd, 0x74, 0xa6, 0x63, 0x19, + 0xa5, 0x7d, 0xe5, 0xfb, 0xe7, 0x4f, 0xee, 0x18, 0x87, 0x1f, 0x3d, 0x3d, 0x6f, 0x18, 0xcf, 0xce, + 0x1b, 0xc6, 0xbf, 0xe7, 0x0d, 0xe3, 0xe7, 0x8b, 0xc6, 0xc2, 0xb3, 0x8b, 0xc6, 0xc2, 0xdf, 0x17, + 0x8d, 0x85, 0xc7, 0x4e, 0x40, 0xc4, 0x69, 0xbf, 0xd3, 0x44, 0xb4, 0xd7, 0xa2, 0x11, 0xa7, 0x11, + 0x6b, 0xa5, 0x3f, 0x67, 0x2d, 0xf9, 0xdd, 0x26, 0x92, 0x18, 0xf3, 0x4e, 0x2d, 0xfd, 0x3c, 0xbb, + 0xfb, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x48, 0x8a, 0xd6, 0x2e, 0x0a, 0x00, 0x00, // 797 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x41, 0x6f, 0xe3, 0x44, 0x14, 0x8e, 0x37, 0xdd, 0x6c, 0xf3, 0x36, 0xdb, 0x20, 0x2b, 0x90, 0xac, 0xb5, 0xcd, 0x56, 0x16, @@ -790,6 +1240,13 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // AuthorizeService asserts the given controller is the owner of the given address. + AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) + // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. + // this operation is called by services initiating a controller registration. + AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) + // SyncController synchronizes the controller with the Vault Motr DWN WASM Wallet. + SyncController(ctx context.Context, in *MsgSyncController, opts ...grpc.CallOption) (*MsgSyncControllerResponse, error) // Authenticate asserts the given controller is the owner of the given address. Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error) // ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators. @@ -819,6 +1276,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) { + out := new(MsgAuthorizeServiceResponse) + err := c.cc.Invoke(ctx, "/did.v1.Msg/AuthorizeService", in, out, opts...) func (c *msgClient) Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error) { out := new(MsgAuthenticateResponse) err := c.cc.Invoke(ctx, "/did.v1.Msg/Authenticate", in, out, opts...) @@ -828,6 +1288,9 @@ func (c *msgClient) Authenticate(ctx context.Context, in *MsgAuthenticate, opts return out, nil } +func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) { + out := new(MsgAllocateVaultResponse) + err := c.cc.Invoke(ctx, "/did.v1.Msg/AllocateVault", in, out, opts...) func (c *msgClient) ProveWitness(ctx context.Context, in *MsgProveWitness, opts ...grpc.CallOption) (*MsgProveWitnessResponse, error) { out := new(MsgProveWitnessResponse) err := c.cc.Invoke(ctx, "/did.v1.Msg/ProveWitness", in, out, opts...) @@ -837,6 +1300,9 @@ func (c *msgClient) ProveWitness(ctx context.Context, in *MsgProveWitness, opts return out, nil } +func (c *msgClient) SyncController(ctx context.Context, in *MsgSyncController, opts ...grpc.CallOption) (*MsgSyncControllerResponse, error) { + out := new(MsgSyncControllerResponse) + err := c.cc.Invoke(ctx, "/did.v1.Msg/SyncController", in, out, opts...) func (c *msgClient) SyncVault(ctx context.Context, in *MsgSyncVault, opts ...grpc.CallOption) (*MsgSyncVaultResponse, error) { out := new(MsgSyncVaultResponse) err := c.cc.Invoke(ctx, "/did.v1.Msg/SyncVault", in, out, opts...) @@ -870,6 +1336,13 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // AuthorizeService asserts the given controller is the owner of the given address. + AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) + // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. + // this operation is called by services initiating a controller registration. + AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) + // SyncController synchronizes the controller with the Vault Motr DWN WASM Wallet. + SyncController(context.Context, *MsgSyncController) (*MsgSyncControllerResponse, error) // Authenticate asserts the given controller is the owner of the given address. Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error) // ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators. @@ -889,6 +1362,14 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) AuthorizeService(ctx context.Context, req *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuthorizeService not implemented") +} +func (*UnimplementedMsgServer) AllocateVault(ctx context.Context, req *MsgAllocateVault) (*MsgAllocateVaultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented") +} +func (*UnimplementedMsgServer) SyncController(ctx context.Context, req *MsgSyncController) (*MsgSyncControllerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SyncController not implemented") func (*UnimplementedMsgServer) Authenticate(ctx context.Context, req *MsgAuthenticate) (*MsgAuthenticateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented") } @@ -927,12 +1408,22 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_AuthorizeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAuthorizeService) func _Msg_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgAuthenticate) if err := dec(in); err != nil { return nil, err } if interceptor == nil { + return srv.(MsgServer).AuthorizeService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Msg/AuthorizeService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AuthorizeService(ctx, req.(*MsgAuthorizeService)) return srv.(MsgServer).Authenticate(ctx, in) } info := &grpc.UnaryServerInfo{ @@ -945,12 +1436,22 @@ func _Msg_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAllocateVault) func _Msg_ProveWitness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgProveWitness) if err := dec(in); err != nil { return nil, err } if interceptor == nil { + return srv.(MsgServer).AllocateVault(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Msg/AllocateVault", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault)) return srv.(MsgServer).ProveWitness(ctx, in) } info := &grpc.UnaryServerInfo{ @@ -963,12 +1464,22 @@ func _Msg_ProveWitness_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_SyncController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSyncController) func _Msg_SyncVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgSyncVault) if err := dec(in); err != nil { return nil, err } if interceptor == nil { + return srv.(MsgServer).SyncController(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/did.v1.Msg/SyncController", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SyncController(ctx, req.(*MsgSyncController)) return srv.(MsgServer).SyncVault(ctx, in) } info := &grpc.UnaryServerInfo{ @@ -1026,6 +1537,16 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_UpdateParams_Handler, }, { + MethodName: "AuthorizeService", + Handler: _Msg_AuthorizeService_Handler, + }, + { + MethodName: "AllocateVault", + Handler: _Msg_AllocateVault_Handler, + }, + { + MethodName: "SyncController", + Handler: _Msg_SyncController_Handler, MethodName: "Authenticate", Handler: _Msg_Authenticate_Handler, }, @@ -1070,6 +1591,13 @@ func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x1a + } { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1113,6 +1641,7 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgAllocateVault) Marshal() (dAtA []byte, err error) { func (m *MsgAuthenticate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1123,11 +1652,13 @@ func (m *MsgAuthenticate) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } +func (m *MsgAllocateVault) MarshalTo(dAtA []byte) (int, error) { func (m *MsgAuthenticate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } +func (m *MsgAllocateVault) MarshalToSizedBuffer(dAtA []byte) (int, error) { func (m *MsgAuthenticate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i @@ -1474,6 +2005,17 @@ func (m *MsgRegisterService) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintTx(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x1a + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintTx(dAtA, i, uint64(len(m.Subject))) if len(m.Scopes) > 0 { dAtA3 := make([]byte, len(m.Scopes)*10) var j2 int @@ -1509,6 +2051,477 @@ func (m *MsgRegisterService) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgAllocateVaultResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgRegisterServiceResponse) 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 *MsgAllocateVaultResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRegisterServiceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAllocateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRegisterServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Localhost { + i-- + if m.Localhost { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.RegistrationOptions) > 0 { + i -= len(m.RegistrationOptions) + copy(dAtA[i:], m.RegistrationOptions) + i = encodeVarintTx(dAtA, i, uint64(len(m.RegistrationOptions))) + i-- + dAtA[i] = 0x1a + } + if m.ExpiryBlock != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ExpiryBlock)) + i-- + dAtA[i] = 0x10 + } + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintTx(dAtA, i, uint64(len(m.Cid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgProveWitness) 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 *MsgProveWitness) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgProveWitness) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x22 + } + if len(m.Witness) > 0 { + i -= len(m.Witness) + copy(dAtA[i:], m.Witness) + i = encodeVarintTx(dAtA, i, uint64(len(m.Witness))) + i-- + dAtA[i] = 0x1a + } + if len(m.Property) > 0 { + i -= len(m.Property) + copy(dAtA[i:], m.Property) + i = encodeVarintTx(dAtA, i, uint64(len(m.Property))) + 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 *MsgProveWitnessResponse) 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 *MsgProveWitnessResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgProveWitnessResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Property) > 0 { + i -= len(m.Property) + copy(dAtA[i:], m.Property) + i = encodeVarintTx(dAtA, i, uint64(len(m.Property))) + 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 (m *MsgSyncController) 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 *MsgSyncController) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSyncController) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x1a + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintTx(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSyncControllerResponse) 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 *MsgSyncControllerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSyncControllerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Success { + i-- + if m.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterController) 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 *MsgRegisterController) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterController) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CredentialCreationResponse) > 0 { + i -= len(m.CredentialCreationResponse) + copy(dAtA[i:], m.CredentialCreationResponse) + i = encodeVarintTx(dAtA, i, uint64(len(m.CredentialCreationResponse))) + i-- + dAtA[i] = 0x22 + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintTx(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x1a + } + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintTx(dAtA, i, uint64(len(m.Cid))) + 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 *MsgRegisterControllerResponse) 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 *MsgRegisterControllerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterControllerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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) + i = encodeVarintTx(dAtA, i, uint64(len(m.Controller))) + 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 (m *MsgAuthorizeService) 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 *MsgAuthorizeService) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAuthorizeService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x22 + } + if m.Scopes != nil { + { + size, err := m.Scopes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Origin) > 0 { + i -= len(m.Origin) + copy(dAtA[i:], m.Origin) + i = encodeVarintTx(dAtA, i, uint64(len(m.Origin))) + i-- + dAtA[i] = 0x12 + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintTx(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAuthorizeServiceResponse) 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 *MsgAuthorizeServiceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAuthorizeServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x12 + } + if m.Success { + i-- + if m.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterService) 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 *MsgRegisterService) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Token) > 0 { + i -= len(m.Token) + copy(dAtA[i:], m.Token) + i = encodeVarintTx(dAtA, i, uint64(len(m.Token))) + i-- + dAtA[i] = 0x1a + } + if m.Service != nil { + { + size, err := m.Service.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Controller) > 0 { + i -= len(m.Controller) + copy(dAtA[i:], m.Controller) + i = encodeVarintTx(dAtA, i, uint64(len(m.Controller))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *MsgRegisterServiceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1529,6 +2542,13 @@ func (m *MsgRegisterServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + if len(m.Did) > 0 { + i -= len(m.Did) + copy(dAtA[i:], m.Did) + i = encodeVarintTx(dAtA, i, uint64(len(m.Did))) + i-- + dAtA[i] = 0x12 + } if m.Success { i-- if m.Success { @@ -1565,6 +2585,10 @@ func (m *MsgUpdateParams) Size() (n int) { } l = m.Params.Size() n += 1 + l + sovTx(uint64(l)) + l = len(m.Token) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1577,6 +2601,7 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } +func (m *MsgAllocateVault) Size() (n int) { func (m *MsgAuthenticate) Size() (n int) { if m == nil { return 0 @@ -1691,6 +2716,13 @@ func (m *MsgRegisterController) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) if len(m.Assertions) > 0 { for _, b := range m.Assertions { l = len(b) @@ -1757,12 +2789,224 @@ func (m *MsgRegisterService) Size() (n int) { return n } +func (m *MsgAllocateVaultResponse) Size() (n int) { func (m *MsgRegisterServiceResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.ExpiryBlock != 0 { + n += 1 + sovTx(uint64(m.ExpiryBlock)) + } + l = len(m.RegistrationOptions) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Localhost { + n += 2 + } + return n +} + +func (m *MsgProveWitness) 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 = len(m.Property) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Witness) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgProveWitnessResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success { + n += 2 + } + l = len(m.Property) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSyncController) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSyncControllerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success { + n += 2 + } + return n +} + +func (m *MsgRegisterController) 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 = len(m.Cid) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CredentialCreationResponse) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRegisterControllerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success { + n += 2 + } + l = len(m.Controller) + 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 +} + +func (m *MsgAuthorizeService) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Origin) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Scopes != nil { + l = m.Scopes.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAuthorizeServiceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success { + n += 2 + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRegisterService) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Controller) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Service != nil { + l = m.Service.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Token) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRegisterServiceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success { + n += 2 + } + l = len(m.Did) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } if m.Success { n += 2 } @@ -1869,6 +3113,38 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1940,6 +3216,7 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAllocateVault) Unmarshal(dAtA []byte) error { func (m *MsgAuthenticate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1963,6 +3240,10 @@ func (m *MsgAuthenticate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { + return fmt.Errorf("proto: MsgAllocateVault: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllocateVault: illegal tag %d (wire type %d)", fieldNum, wire) return fmt.Errorf("proto: MsgAuthenticate: wiretype end group for non-group") } if fieldNum <= 0 { @@ -2003,6 +3284,7 @@ func (m *MsgAuthenticate) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) } var stringLen uint64 @@ -2031,6 +3313,10 @@ func (m *MsgAuthenticate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { m.Controller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: @@ -2118,6 +3404,7 @@ func (m *MsgAuthenticate) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAllocateVaultResponse) Unmarshal(dAtA []byte) error { func (m *MsgAuthenticateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2141,12 +3428,1528 @@ func (m *MsgAuthenticateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { + return fmt.Errorf("proto: MsgAllocateVaultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllocateVaultResponse: illegal tag %d (wire type %d)", fieldNum, wire) return fmt.Errorf("proto: MsgAuthenticateResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MsgAuthenticateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", 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.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpiryBlock", wireType) + } + m.ExpiryBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpiryBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegistrationOptions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.RegistrationOptions = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Localhost", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Localhost = bool(v != 0) + 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 *MsgProveWitness) 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: MsgProveWitness: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgProveWitness: 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 Property", 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.Property = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Witness", 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.Witness = append(m.Witness[:0], dAtA[iNdEx:postIndex]...) + if m.Witness == nil { + m.Witness = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token = string(dAtA[iNdEx:postIndex]) + 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 *MsgProveWitnessResponse) 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: MsgProveWitnessResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgProveWitnessResponse: 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 ErrIntOverflowTx + } + 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 Property", 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.Property = string(dAtA[iNdEx:postIndex]) + 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 *MsgSyncController) 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: MsgSyncController: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSyncController: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token = string(dAtA[iNdEx:postIndex]) + 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 *MsgSyncControllerResponse) 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: MsgSyncControllerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSyncControllerResponse: 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Success = bool(v != 0) + 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 *MsgRegisterController) 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: MsgRegisterController: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterController: 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 Cid", 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.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialCreationResponse", 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.CredentialCreationResponse = string(dAtA[iNdEx:postIndex]) + 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 *MsgRegisterControllerResponse) 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: MsgRegisterControllerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterControllerResponse: 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 ErrIntOverflowTx + } + 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 Controller", 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.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:]) + 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 *MsgAuthorizeService) 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: MsgAuthorizeService: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAuthorizeService: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Origin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scopes", 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.Scopes == nil { + m.Scopes = &Permissions{} + } + if err := m.Scopes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token = string(dAtA[iNdEx:postIndex]) + 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 *MsgAuthorizeServiceResponse) 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: MsgAuthorizeServiceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAuthorizeServiceResponse: 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 ErrIntOverflowTx + } + 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 Token", 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.Token = string(dAtA[iNdEx:postIndex]) + 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 *MsgRegisterService) 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: MsgRegisterService: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterService: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Controller = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", 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.Service == nil { + m.Service = &Service{} + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", 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.Token = string(dAtA[iNdEx:postIndex]) + 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 *MsgRegisterServiceResponse) 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: MsgRegisterServiceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterServiceResponse: 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 ErrIntOverflowTx + } + 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 Did", 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.Did = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/did/types/txns/Msg.pkl.go b/x/did/types/txns/Msg.pkl.go new file mode 100644 index 000000000..316adf06d --- /dev/null +++ b/x/did/types/txns/Msg.pkl.go @@ -0,0 +1,6 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +type Msg interface { + GetTypeUrl() string +} diff --git a/x/did/types/txns/MsgDidAllocateVault.pkl.go b/x/did/types/txns/MsgDidAllocateVault.pkl.go new file mode 100644 index 000000000..dcb4a04e4 --- /dev/null +++ b/x/did/types/txns/MsgDidAllocateVault.pkl.go @@ -0,0 +1,44 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgDidAllocateVault interface { + Msg + + GetAuthority() string + + GetSubject() string + + GetToken() *pkl.Object +} + +var _ MsgDidAllocateVault = (*MsgDidAllocateVaultImpl)(nil) + +type MsgDidAllocateVaultImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + Authority string `pkl:"authority"` + + Subject string `pkl:"subject"` + + Token *pkl.Object `pkl:"token"` +} + +// The type URL for the message +func (rcv *MsgDidAllocateVaultImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgDidAllocateVaultImpl) GetAuthority() string { + return rcv.Authority +} + +func (rcv *MsgDidAllocateVaultImpl) GetSubject() string { + return rcv.Subject +} + +func (rcv *MsgDidAllocateVaultImpl) GetToken() *pkl.Object { + return rcv.Token +} diff --git a/x/did/types/txns/MsgDidAuthorize.pkl.go b/x/did/types/txns/MsgDidAuthorize.pkl.go new file mode 100644 index 000000000..344bbe81a --- /dev/null +++ b/x/did/types/txns/MsgDidAuthorize.pkl.go @@ -0,0 +1,60 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgDidAuthorize interface { + Msg + + GetAuthority() string + + GetController() string + + GetAddress() string + + GetOrigin() string + + GetToken() *pkl.Object +} + +var _ MsgDidAuthorize = (*MsgDidAuthorizeImpl)(nil) + +type MsgDidAuthorizeImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + Authority string `pkl:"authority"` + + Controller string `pkl:"controller"` + + Address string `pkl:"address"` + + Origin string `pkl:"origin"` + + Token *pkl.Object `pkl:"token"` +} + +// The type URL for the message +func (rcv *MsgDidAuthorizeImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgDidAuthorizeImpl) GetAuthority() string { + return rcv.Authority +} + +func (rcv *MsgDidAuthorizeImpl) GetController() string { + return rcv.Controller +} + +func (rcv *MsgDidAuthorizeImpl) GetAddress() string { + return rcv.Address +} + +func (rcv *MsgDidAuthorizeImpl) GetOrigin() string { + return rcv.Origin +} + +func (rcv *MsgDidAuthorizeImpl) GetToken() *pkl.Object { + return rcv.Token +} diff --git a/x/did/types/txns/MsgDidProveWitness.pkl.go b/x/did/types/txns/MsgDidProveWitness.pkl.go new file mode 100644 index 000000000..6ea127769 --- /dev/null +++ b/x/did/types/txns/MsgDidProveWitness.pkl.go @@ -0,0 +1,52 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgDidProveWitness interface { + Msg + + GetAuthority() string + + GetProperty() string + + GetWitness() []int + + GetToken() *pkl.Object +} + +var _ MsgDidProveWitness = (*MsgDidProveWitnessImpl)(nil) + +type MsgDidProveWitnessImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + Authority string `pkl:"authority"` + + Property string `pkl:"property"` + + Witness []int `pkl:"witness"` + + Token *pkl.Object `pkl:"token"` +} + +// The type URL for the message +func (rcv *MsgDidProveWitnessImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgDidProveWitnessImpl) GetAuthority() string { + return rcv.Authority +} + +func (rcv *MsgDidProveWitnessImpl) GetProperty() string { + return rcv.Property +} + +func (rcv *MsgDidProveWitnessImpl) GetWitness() []int { + return rcv.Witness +} + +func (rcv *MsgDidProveWitnessImpl) GetToken() *pkl.Object { + return rcv.Token +} diff --git a/x/did/types/txns/MsgDidRegisterController.pkl.go b/x/did/types/txns/MsgDidRegisterController.pkl.go new file mode 100644 index 000000000..dc6d3651b --- /dev/null +++ b/x/did/types/txns/MsgDidRegisterController.pkl.go @@ -0,0 +1,60 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgDidRegisterController interface { + Msg + + GetAuthority() string + + GetCid() string + + GetOrigin() string + + GetAuthentication() []*pkl.Object + + GetToken() *pkl.Object +} + +var _ MsgDidRegisterController = (*MsgDidRegisterControllerImpl)(nil) + +type MsgDidRegisterControllerImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + Authority string `pkl:"authority"` + + Cid string `pkl:"cid"` + + Origin string `pkl:"origin"` + + Authentication []*pkl.Object `pkl:"authentication"` + + Token *pkl.Object `pkl:"token"` +} + +// The type URL for the message +func (rcv *MsgDidRegisterControllerImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgDidRegisterControllerImpl) GetAuthority() string { + return rcv.Authority +} + +func (rcv *MsgDidRegisterControllerImpl) GetCid() string { + return rcv.Cid +} + +func (rcv *MsgDidRegisterControllerImpl) GetOrigin() string { + return rcv.Origin +} + +func (rcv *MsgDidRegisterControllerImpl) GetAuthentication() []*pkl.Object { + return rcv.Authentication +} + +func (rcv *MsgDidRegisterControllerImpl) GetToken() *pkl.Object { + return rcv.Token +} diff --git a/x/did/types/txns/MsgDidRegisterService.pkl.go b/x/did/types/txns/MsgDidRegisterService.pkl.go new file mode 100644 index 000000000..3d2f849a5 --- /dev/null +++ b/x/did/types/txns/MsgDidRegisterService.pkl.go @@ -0,0 +1,76 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgDidRegisterService interface { + Msg + + GetController() string + + GetOriginUri() string + + GetScopes() *pkl.Object + + GetDescription() string + + GetServiceEndpoints() map[string]string + + GetMetadata() *pkl.Object + + GetToken() *pkl.Object +} + +var _ MsgDidRegisterService = (*MsgDidRegisterServiceImpl)(nil) + +type MsgDidRegisterServiceImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + Controller string `pkl:"controller"` + + OriginUri string `pkl:"originUri"` + + Scopes *pkl.Object `pkl:"scopes"` + + Description string `pkl:"description"` + + ServiceEndpoints map[string]string `pkl:"serviceEndpoints"` + + Metadata *pkl.Object `pkl:"metadata"` + + Token *pkl.Object `pkl:"token"` +} + +// The type URL for the message +func (rcv *MsgDidRegisterServiceImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgDidRegisterServiceImpl) GetController() string { + return rcv.Controller +} + +func (rcv *MsgDidRegisterServiceImpl) GetOriginUri() string { + return rcv.OriginUri +} + +func (rcv *MsgDidRegisterServiceImpl) GetScopes() *pkl.Object { + return rcv.Scopes +} + +func (rcv *MsgDidRegisterServiceImpl) GetDescription() string { + return rcv.Description +} + +func (rcv *MsgDidRegisterServiceImpl) GetServiceEndpoints() map[string]string { + return rcv.ServiceEndpoints +} + +func (rcv *MsgDidRegisterServiceImpl) GetMetadata() *pkl.Object { + return rcv.Metadata +} + +func (rcv *MsgDidRegisterServiceImpl) GetToken() *pkl.Object { + return rcv.Token +} diff --git a/x/did/types/txns/MsgDidSyncVault.pkl.go b/x/did/types/txns/MsgDidSyncVault.pkl.go new file mode 100644 index 000000000..c7f38de0a --- /dev/null +++ b/x/did/types/txns/MsgDidSyncVault.pkl.go @@ -0,0 +1,36 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgDidSyncVault interface { + Msg + + GetController() string + + GetToken() *pkl.Object +} + +var _ MsgDidSyncVault = (*MsgDidSyncVaultImpl)(nil) + +type MsgDidSyncVaultImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + Controller string `pkl:"controller"` + + Token *pkl.Object `pkl:"token"` +} + +// The type URL for the message +func (rcv *MsgDidSyncVaultImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgDidSyncVaultImpl) GetController() string { + return rcv.Controller +} + +func (rcv *MsgDidSyncVaultImpl) GetToken() *pkl.Object { + return rcv.Token +} diff --git a/x/did/types/txns/MsgDidUpdateParams.pkl.go b/x/did/types/txns/MsgDidUpdateParams.pkl.go new file mode 100644 index 000000000..566383b4f --- /dev/null +++ b/x/did/types/txns/MsgDidUpdateParams.pkl.go @@ -0,0 +1,44 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgDidUpdateParams interface { + Msg + + GetAuthority() string + + GetParams() *pkl.Object + + GetToken() *pkl.Object +} + +var _ MsgDidUpdateParams = (*MsgDidUpdateParamsImpl)(nil) + +type MsgDidUpdateParamsImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + Authority string `pkl:"authority"` + + Params *pkl.Object `pkl:"params"` + + Token *pkl.Object `pkl:"token"` +} + +// The type URL for the message +func (rcv *MsgDidUpdateParamsImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgDidUpdateParamsImpl) GetAuthority() string { + return rcv.Authority +} + +func (rcv *MsgDidUpdateParamsImpl) GetParams() *pkl.Object { + return rcv.Params +} + +func (rcv *MsgDidUpdateParamsImpl) GetToken() *pkl.Object { + return rcv.Token +} diff --git a/x/did/types/txns/MsgGovDeposit.pkl.go b/x/did/types/txns/MsgGovDeposit.pkl.go new file mode 100644 index 000000000..237e1ff46 --- /dev/null +++ b/x/did/types/txns/MsgGovDeposit.pkl.go @@ -0,0 +1,44 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgGovDeposit interface { + Msg + + GetProposalId() int + + GetDepositor() string + + GetAmount() []*pkl.Object +} + +var _ MsgGovDeposit = (*MsgGovDepositImpl)(nil) + +type MsgGovDepositImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + ProposalId int `pkl:"proposalId"` + + Depositor string `pkl:"depositor"` + + Amount []*pkl.Object `pkl:"amount"` +} + +// The type URL for the message +func (rcv *MsgGovDepositImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgGovDepositImpl) GetProposalId() int { + return rcv.ProposalId +} + +func (rcv *MsgGovDepositImpl) GetDepositor() string { + return rcv.Depositor +} + +func (rcv *MsgGovDepositImpl) GetAmount() []*pkl.Object { + return rcv.Amount +} diff --git a/x/did/types/txns/MsgGovSubmitProposal.pkl.go b/x/did/types/txns/MsgGovSubmitProposal.pkl.go new file mode 100644 index 000000000..8c7f744fb --- /dev/null +++ b/x/did/types/txns/MsgGovSubmitProposal.pkl.go @@ -0,0 +1,45 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgGovSubmitProposal interface { + Msg + + GetContent() *Proposal + + GetInitialDeposit() []*pkl.Object + + GetProposer() string +} + +var _ MsgGovSubmitProposal = (*MsgGovSubmitProposalImpl)(nil) + +// Gov module messages +type MsgGovSubmitProposalImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + Content *Proposal `pkl:"content"` + + InitialDeposit []*pkl.Object `pkl:"initialDeposit"` + + Proposer string `pkl:"proposer"` +} + +// The type URL for the message +func (rcv *MsgGovSubmitProposalImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgGovSubmitProposalImpl) GetContent() *Proposal { + return rcv.Content +} + +func (rcv *MsgGovSubmitProposalImpl) GetInitialDeposit() []*pkl.Object { + return rcv.InitialDeposit +} + +func (rcv *MsgGovSubmitProposalImpl) GetProposer() string { + return rcv.Proposer +} diff --git a/x/did/types/txns/MsgGovVote.pkl.go b/x/did/types/txns/MsgGovVote.pkl.go new file mode 100644 index 000000000..73ff547b2 --- /dev/null +++ b/x/did/types/txns/MsgGovVote.pkl.go @@ -0,0 +1,42 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +type MsgGovVote interface { + Msg + + GetProposalId() int + + GetVoter() string + + GetOption() int +} + +var _ MsgGovVote = (*MsgGovVoteImpl)(nil) + +type MsgGovVoteImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + ProposalId int `pkl:"proposalId"` + + Voter string `pkl:"voter"` + + Option int `pkl:"option"` +} + +// The type URL for the message +func (rcv *MsgGovVoteImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgGovVoteImpl) GetProposalId() int { + return rcv.ProposalId +} + +func (rcv *MsgGovVoteImpl) GetVoter() string { + return rcv.Voter +} + +func (rcv *MsgGovVoteImpl) GetOption() int { + return rcv.Option +} diff --git a/x/did/types/txns/MsgGroupCreateGroup.pkl.go b/x/did/types/txns/MsgGroupCreateGroup.pkl.go new file mode 100644 index 000000000..19fd7173e --- /dev/null +++ b/x/did/types/txns/MsgGroupCreateGroup.pkl.go @@ -0,0 +1,45 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgGroupCreateGroup interface { + Msg + + GetAdmin() string + + GetMembers() []*pkl.Object + + GetMetadata() string +} + +var _ MsgGroupCreateGroup = (*MsgGroupCreateGroupImpl)(nil) + +// Group module messages +type MsgGroupCreateGroupImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + Admin string `pkl:"admin"` + + Members []*pkl.Object `pkl:"members"` + + Metadata string `pkl:"metadata"` +} + +// The type URL for the message +func (rcv *MsgGroupCreateGroupImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgGroupCreateGroupImpl) GetAdmin() string { + return rcv.Admin +} + +func (rcv *MsgGroupCreateGroupImpl) GetMembers() []*pkl.Object { + return rcv.Members +} + +func (rcv *MsgGroupCreateGroupImpl) GetMetadata() string { + return rcv.Metadata +} diff --git a/x/did/types/txns/MsgGroupSubmitProposal.pkl.go b/x/did/types/txns/MsgGroupSubmitProposal.pkl.go new file mode 100644 index 000000000..2cb9f0729 --- /dev/null +++ b/x/did/types/txns/MsgGroupSubmitProposal.pkl.go @@ -0,0 +1,60 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgGroupSubmitProposal interface { + Msg + + GetGroupPolicyAddress() string + + GetProposers() []string + + GetMetadata() string + + GetMessages() []*pkl.Object + + GetExec() int +} + +var _ MsgGroupSubmitProposal = (*MsgGroupSubmitProposalImpl)(nil) + +type MsgGroupSubmitProposalImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + GroupPolicyAddress string `pkl:"groupPolicyAddress"` + + Proposers []string `pkl:"proposers"` + + Metadata string `pkl:"metadata"` + + Messages []*pkl.Object `pkl:"messages"` + + Exec int `pkl:"exec"` +} + +// The type URL for the message +func (rcv *MsgGroupSubmitProposalImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgGroupSubmitProposalImpl) GetGroupPolicyAddress() string { + return rcv.GroupPolicyAddress +} + +func (rcv *MsgGroupSubmitProposalImpl) GetProposers() []string { + return rcv.Proposers +} + +func (rcv *MsgGroupSubmitProposalImpl) GetMetadata() string { + return rcv.Metadata +} + +func (rcv *MsgGroupSubmitProposalImpl) GetMessages() []*pkl.Object { + return rcv.Messages +} + +func (rcv *MsgGroupSubmitProposalImpl) GetExec() int { + return rcv.Exec +} diff --git a/x/did/types/txns/MsgGroupVote.pkl.go b/x/did/types/txns/MsgGroupVote.pkl.go new file mode 100644 index 000000000..79ae04244 --- /dev/null +++ b/x/did/types/txns/MsgGroupVote.pkl.go @@ -0,0 +1,58 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +type MsgGroupVote interface { + Msg + + GetProposalId() int + + GetVoter() string + + GetOption() int + + GetMetadata() string + + GetExec() int +} + +var _ MsgGroupVote = (*MsgGroupVoteImpl)(nil) + +type MsgGroupVoteImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + ProposalId int `pkl:"proposalId"` + + Voter string `pkl:"voter"` + + Option int `pkl:"option"` + + Metadata string `pkl:"metadata"` + + Exec int `pkl:"exec"` +} + +// The type URL for the message +func (rcv *MsgGroupVoteImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgGroupVoteImpl) GetProposalId() int { + return rcv.ProposalId +} + +func (rcv *MsgGroupVoteImpl) GetVoter() string { + return rcv.Voter +} + +func (rcv *MsgGroupVoteImpl) GetOption() int { + return rcv.Option +} + +func (rcv *MsgGroupVoteImpl) GetMetadata() string { + return rcv.Metadata +} + +func (rcv *MsgGroupVoteImpl) GetExec() int { + return rcv.Exec +} diff --git a/x/did/types/txns/MsgStakingBeginRedelegate.pkl.go b/x/did/types/txns/MsgStakingBeginRedelegate.pkl.go new file mode 100644 index 000000000..fe803db38 --- /dev/null +++ b/x/did/types/txns/MsgStakingBeginRedelegate.pkl.go @@ -0,0 +1,52 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgStakingBeginRedelegate interface { + Msg + + GetDelegatorAddress() string + + GetValidatorSrcAddress() string + + GetValidatorDstAddress() string + + GetAmount() *pkl.Object +} + +var _ MsgStakingBeginRedelegate = (*MsgStakingBeginRedelegateImpl)(nil) + +type MsgStakingBeginRedelegateImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + DelegatorAddress string `pkl:"delegatorAddress"` + + ValidatorSrcAddress string `pkl:"validatorSrcAddress"` + + ValidatorDstAddress string `pkl:"validatorDstAddress"` + + Amount *pkl.Object `pkl:"amount"` +} + +// The type URL for the message +func (rcv *MsgStakingBeginRedelegateImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgStakingBeginRedelegateImpl) GetDelegatorAddress() string { + return rcv.DelegatorAddress +} + +func (rcv *MsgStakingBeginRedelegateImpl) GetValidatorSrcAddress() string { + return rcv.ValidatorSrcAddress +} + +func (rcv *MsgStakingBeginRedelegateImpl) GetValidatorDstAddress() string { + return rcv.ValidatorDstAddress +} + +func (rcv *MsgStakingBeginRedelegateImpl) GetAmount() *pkl.Object { + return rcv.Amount +} diff --git a/x/did/types/txns/MsgStakingCreateValidator.pkl.go b/x/did/types/txns/MsgStakingCreateValidator.pkl.go new file mode 100644 index 000000000..d3c11015c --- /dev/null +++ b/x/did/types/txns/MsgStakingCreateValidator.pkl.go @@ -0,0 +1,77 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgStakingCreateValidator interface { + Msg + + GetDescription() *pkl.Object + + GetCommission() *pkl.Object + + GetMinSelfDelegation() string + + GetDelegatorAddress() string + + GetValidatorAddress() string + + GetPubkey() *pkl.Object + + GetValue() *pkl.Object +} + +var _ MsgStakingCreateValidator = (*MsgStakingCreateValidatorImpl)(nil) + +// Staking module messages +type MsgStakingCreateValidatorImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + Description *pkl.Object `pkl:"description"` + + Commission *pkl.Object `pkl:"commission"` + + MinSelfDelegation string `pkl:"minSelfDelegation"` + + DelegatorAddress string `pkl:"delegatorAddress"` + + ValidatorAddress string `pkl:"validatorAddress"` + + Pubkey *pkl.Object `pkl:"pubkey"` + + Value *pkl.Object `pkl:"value"` +} + +// The type URL for the message +func (rcv *MsgStakingCreateValidatorImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgStakingCreateValidatorImpl) GetDescription() *pkl.Object { + return rcv.Description +} + +func (rcv *MsgStakingCreateValidatorImpl) GetCommission() *pkl.Object { + return rcv.Commission +} + +func (rcv *MsgStakingCreateValidatorImpl) GetMinSelfDelegation() string { + return rcv.MinSelfDelegation +} + +func (rcv *MsgStakingCreateValidatorImpl) GetDelegatorAddress() string { + return rcv.DelegatorAddress +} + +func (rcv *MsgStakingCreateValidatorImpl) GetValidatorAddress() string { + return rcv.ValidatorAddress +} + +func (rcv *MsgStakingCreateValidatorImpl) GetPubkey() *pkl.Object { + return rcv.Pubkey +} + +func (rcv *MsgStakingCreateValidatorImpl) GetValue() *pkl.Object { + return rcv.Value +} diff --git a/x/did/types/txns/MsgStakingDelegate.pkl.go b/x/did/types/txns/MsgStakingDelegate.pkl.go new file mode 100644 index 000000000..b6fb170ec --- /dev/null +++ b/x/did/types/txns/MsgStakingDelegate.pkl.go @@ -0,0 +1,44 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgStakingDelegate interface { + Msg + + GetDelegatorAddress() string + + GetValidatorAddress() string + + GetAmount() *pkl.Object +} + +var _ MsgStakingDelegate = (*MsgStakingDelegateImpl)(nil) + +type MsgStakingDelegateImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + DelegatorAddress string `pkl:"delegatorAddress"` + + ValidatorAddress string `pkl:"validatorAddress"` + + Amount *pkl.Object `pkl:"amount"` +} + +// The type URL for the message +func (rcv *MsgStakingDelegateImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgStakingDelegateImpl) GetDelegatorAddress() string { + return rcv.DelegatorAddress +} + +func (rcv *MsgStakingDelegateImpl) GetValidatorAddress() string { + return rcv.ValidatorAddress +} + +func (rcv *MsgStakingDelegateImpl) GetAmount() *pkl.Object { + return rcv.Amount +} diff --git a/x/did/types/txns/MsgStakingUndelegate.pkl.go b/x/did/types/txns/MsgStakingUndelegate.pkl.go new file mode 100644 index 000000000..c1732c2c2 --- /dev/null +++ b/x/did/types/txns/MsgStakingUndelegate.pkl.go @@ -0,0 +1,44 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +type MsgStakingUndelegate interface { + Msg + + GetDelegatorAddress() string + + GetValidatorAddress() string + + GetAmount() *pkl.Object +} + +var _ MsgStakingUndelegate = (*MsgStakingUndelegateImpl)(nil) + +type MsgStakingUndelegateImpl struct { + // The type URL for the message + TypeUrl string `pkl:"typeUrl"` + + DelegatorAddress string `pkl:"delegatorAddress"` + + ValidatorAddress string `pkl:"validatorAddress"` + + Amount *pkl.Object `pkl:"amount"` +} + +// The type URL for the message +func (rcv *MsgStakingUndelegateImpl) GetTypeUrl() string { + return rcv.TypeUrl +} + +func (rcv *MsgStakingUndelegateImpl) GetDelegatorAddress() string { + return rcv.DelegatorAddress +} + +func (rcv *MsgStakingUndelegateImpl) GetValidatorAddress() string { + return rcv.ValidatorAddress +} + +func (rcv *MsgStakingUndelegateImpl) GetAmount() *pkl.Object { + return rcv.Amount +} diff --git a/x/did/types/txns/Proposal.pkl.go b/x/did/types/txns/Proposal.pkl.go new file mode 100644 index 000000000..70463d42f --- /dev/null +++ b/x/did/types/txns/Proposal.pkl.go @@ -0,0 +1,11 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +// Base class for all proposals +type Proposal struct { + // The title of the proposal + Title string `pkl:"title"` + + // The description of the proposal + Description string `pkl:"description"` +} diff --git a/x/did/types/txns/TxBody.pkl.go b/x/did/types/txns/TxBody.pkl.go new file mode 100644 index 000000000..407ba4179 --- /dev/null +++ b/x/did/types/txns/TxBody.pkl.go @@ -0,0 +1,17 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +// Represents a transaction body +type TxBody struct { + Messages []Msg `pkl:"messages"` + + Memo *string `pkl:"memo"` + + TimeoutHeight *int `pkl:"timeoutHeight"` + + ExtensionOptions *[]*pkl.Object `pkl:"extensionOptions"` + + NonCriticalExtensionOptions *[]*pkl.Object `pkl:"nonCriticalExtensionOptions"` +} diff --git a/x/did/types/txns/Txns.pkl.go b/x/did/types/txns/Txns.pkl.go new file mode 100644 index 000000000..288c5c5bc --- /dev/null +++ b/x/did/types/txns/Txns.pkl.go @@ -0,0 +1,36 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import ( + "context" + + "github.com/apple/pkl-go/pkl" +) + +type Txns struct { +} + +// LoadFromPath loads the pkl module at the given path and evaluates it into a Txns +func LoadFromPath(ctx context.Context, path string) (ret *Txns, err error) { + evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions) + if err != nil { + return nil, err + } + 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 Txns +func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Txns, error) { + var ret Txns + if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil { + return nil, err + } + return &ret, nil +} diff --git a/x/did/types/txns/init.pkl.go b/x/did/types/txns/init.pkl.go new file mode 100644 index 000000000..d92d7649e --- /dev/null +++ b/x/did/types/txns/init.pkl.go @@ -0,0 +1,27 @@ +// Code generated from Pkl module `txns`. DO NOT EDIT. +package txns + +import "github.com/apple/pkl-go/pkl" + +func init() { + pkl.RegisterMapping("txns", Txns{}) + pkl.RegisterMapping("txns#Proposal", Proposal{}) + pkl.RegisterMapping("txns#MsgGovSubmitProposal", MsgGovSubmitProposalImpl{}) + pkl.RegisterMapping("txns#MsgGovVote", MsgGovVoteImpl{}) + pkl.RegisterMapping("txns#MsgGovDeposit", MsgGovDepositImpl{}) + pkl.RegisterMapping("txns#MsgGroupCreateGroup", MsgGroupCreateGroupImpl{}) + pkl.RegisterMapping("txns#MsgGroupSubmitProposal", MsgGroupSubmitProposalImpl{}) + pkl.RegisterMapping("txns#MsgGroupVote", MsgGroupVoteImpl{}) + pkl.RegisterMapping("txns#MsgStakingCreateValidator", MsgStakingCreateValidatorImpl{}) + pkl.RegisterMapping("txns#MsgStakingDelegate", MsgStakingDelegateImpl{}) + pkl.RegisterMapping("txns#MsgStakingUndelegate", MsgStakingUndelegateImpl{}) + pkl.RegisterMapping("txns#MsgStakingBeginRedelegate", MsgStakingBeginRedelegateImpl{}) + pkl.RegisterMapping("txns#MsgDidUpdateParams", MsgDidUpdateParamsImpl{}) + pkl.RegisterMapping("txns#MsgDidAllocateVault", MsgDidAllocateVaultImpl{}) + pkl.RegisterMapping("txns#MsgDidProveWitness", MsgDidProveWitnessImpl{}) + pkl.RegisterMapping("txns#MsgDidSyncVault", MsgDidSyncVaultImpl{}) + pkl.RegisterMapping("txns#MsgDidRegisterController", MsgDidRegisterControllerImpl{}) + pkl.RegisterMapping("txns#MsgDidAuthorize", MsgDidAuthorizeImpl{}) + pkl.RegisterMapping("txns#MsgDidRegisterService", MsgDidRegisterServiceImpl{}) + pkl.RegisterMapping("txns#TxBody", TxBody{}) +} diff --git a/x/did/types/zkprop.go b/x/did/types/zkprop.go new file mode 100644 index 000000000..2674cd60b --- /dev/null +++ b/x/did/types/zkprop.go @@ -0,0 +1,155 @@ +package types + +import ( + "fmt" + + "github.com/onsonr/crypto/accumulator" + "github.com/onsonr/crypto/core/curves" +) + +// Accumulator is the accumulator for the ZKP +type Accumulator []byte + +// Element is the element for the BLS scheme +type Element = accumulator.Element + +// Witness is the witness for the ZKP +type Witness []byte + +// NewProof creates a new Proof which is used for ZKP +func NewProof(issuer, property string, pubKey []byte) (*Proof, error) { + input := append(pubKey, []byte(property)...) + hash := []byte(input) + + curve := curves.BLS12381(&curves.PointBls12381G1{}) + key, err := new(accumulator.SecretKey).New(curve, hash[:]) + if err != nil { + return nil, fmt.Errorf("failed to create secret key: %w", err) + } + + keyBytes, err := key.MarshalBinary() + if err != nil { + return nil, fmt.Errorf("failed to marshal secret key: %w", err) + } + + return &Proof{ + Issuer: issuer, + Property: property, + Accumulator: keyBytes, + }, nil +} + +// CreateAccumulator creates a new accumulator for a Proof +func CreateAccumulator(proof *Proof, values ...string) error { + curve := curves.BLS12381(&curves.PointBls12381G1{}) + acc, err := new(accumulator.Accumulator).New(curve) + if err != nil { + return err + } + + secretKey := new(accumulator.SecretKey) + if err := secretKey.UnmarshalBinary(proof.Accumulator); err != nil { + return err + } + + fin, _, err := acc.Update(secretKey, ConvertValuesToZeroKnowledgeElements(values), nil) + if err != nil { + return err + } + + accBytes, err := fin.MarshalBinary() + if err != nil { + return fmt.Errorf("failed to marshal accumulator: %w", err) + } + + proof.Accumulator = accBytes + return nil +} + +// CreateWitness creates a witness for the accumulator in a Proof for a given value +func CreateWitness(proof *Proof, value string) ([]byte, error) { + curve := curves.BLS12381(&curves.PointBls12381G1{}) + element := curve.Scalar.Hash([]byte(value)) + + secretKey := new(accumulator.SecretKey) + if err := secretKey.UnmarshalBinary(proof.Accumulator); err != nil { + return nil, err + } + + accObj := new(accumulator.Accumulator) + if err := accObj.UnmarshalBinary(proof.Accumulator); err != nil { + return nil, fmt.Errorf("failed to unmarshal accumulator: %w", err) + } + + mw, err := new(accumulator.MembershipWitness).New(element, accObj, secretKey) + if err != nil { + return nil, err + } + + witnessBytes, err := mw.MarshalBinary() + if err != nil { + return nil, fmt.Errorf("failed to marshal witness: %w", err) + } + return witnessBytes, nil +} + +// VerifyWitness proves that a value is a member of the accumulator +func VerifyWitness(proof *Proof, acc Accumulator, witness Witness) error { + secretKey := new(accumulator.SecretKey) + if err := secretKey.UnmarshalBinary([]byte(proof.Id)); err != nil { + return err + } + + curve := curves.BLS12381(&curves.PointBls12381G1{}) + publicKey, err := secretKey.GetPublicKey(curve) + if err != nil { + return err + } + + accObj := new(accumulator.Accumulator) + if err := accObj.UnmarshalBinary(proof.Accumulator); err != nil { + return fmt.Errorf("failed to unmarshal accumulator: %w", err) + } + + witnessObj := new(accumulator.MembershipWitness) + if err := witnessObj.UnmarshalBinary(witness); err != nil { + return fmt.Errorf("failed to unmarshal witness: %w", err) + } + return witnessObj.Verify(publicKey, accObj) +} + +// UpdateAccumulator updates the accumulator in a Proof with new values +func UpdateAccumulator(proof *Proof, addValues []string, removeValues []string) error { + secretKey := new(accumulator.SecretKey) + if err := secretKey.UnmarshalBinary(proof.Accumulator); err != nil { + return err + } + + accObj := new(accumulator.Accumulator) + if err := accObj.UnmarshalBinary(proof.Accumulator); err != nil { + return fmt.Errorf("failed to unmarshal accumulator: %w", err) + } + + updatedAcc, _, err := accObj.Update(secretKey, ConvertValuesToZeroKnowledgeElements(addValues), ConvertValuesToZeroKnowledgeElements(removeValues)) + if err != nil { + return err + } + + updatedAccBytes, err := updatedAcc.MarshalBinary() + if err != nil { + return fmt.Errorf("failed to marshal updated accumulator: %w", err) + } + + proof.Accumulator = updatedAccBytes + return nil +} + +// ConvertValuesToZeroKnowledgeElements converts a slice of strings to a slice of accumulator elements +func ConvertValuesToZeroKnowledgeElements(values []string) []Element { + curve := curves.BLS12381(&curves.PointBls12381G1{}) + elements := make([]accumulator.Element, len(values)) + for i, value := range values { + elements[i] = curve.Scalar.Hash([]byte(value)) + } + return elements +} diff --git a/x/oracle/README.md b/x/oracle/README.md deleted file mode 100644 index 31422a72b..000000000 --- a/x/oracle/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# `x/oracle` - -Our `oracle` module serves as a ICS-20 Compliant middleware which leverages InterChain Accounts and the Transfer module to associate derived wallets with Oracles and facilitate the transfer of tokens between them. - -## Concepts - -Describe specialized concepts and definitions used throughout the spec. - -## State - -Specify and describe structures expected to marshalled into the store, and their keys - -## State Transitions - -Standard state transition operations triggered by hooks, messages, etc. - -## Messages - -Specify message structure(s) and expected state machine behaviour(s). https://api.coingecko.com/api/v3/coins/list - -## 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 services. - -## Future Improvements - -Describe future improvements of this module. - -## Tests - -Acceptance tests. - -## Appendix - -Supplementary details referenced elsewhere within the spec. diff --git a/x/oracle/ibc_middleware.go b/x/oracle/ibc_middleware.go deleted file mode 100644 index e7dd9808f..000000000 --- a/x/oracle/ibc_middleware.go +++ /dev/null @@ -1,168 +0,0 @@ -package oracle - -import ( - "github.com/onsonr/hway/x/oracle/keeper" - - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" -) - -var _ porttypes.Middleware = &IBCMiddleware{} - -// IBCMiddleware implements the ICS26 callbacks for the middleware given the -// keeper and the underlying application. -type IBCMiddleware struct { - app porttypes.IBCModule - keeper keeper.Keeper -} - -// NewIBCMiddleware creates a new IBCMiddleware given the keeper and underlying application. -func NewIBCMiddleware(app porttypes.IBCModule, k keeper.Keeper) IBCMiddleware { - return IBCMiddleware{ - app: app, - keeper: k, - } -} - -// OnChanOpenInit implements the IBCMiddleware interface. -func (im IBCMiddleware) OnChanOpenInit( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID string, - channelID string, - chanCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - version string, -) (string, error) { - return im.app.OnChanOpenInit( - ctx, - order, - connectionHops, - portID, - channelID, - chanCap, - counterparty, - version, - ) -} - -// OnChanOpenTry implements the IBCMiddleware interface. -func (im IBCMiddleware) OnChanOpenTry( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID, channelID string, - chanCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - counterpartyVersion string, -) (version string, err error) { - return im.app.OnChanOpenTry( - ctx, - order, - connectionHops, - portID, - channelID, - chanCap, - counterparty, - counterpartyVersion, - ) -} - -// OnChanOpenAck implements the IBCMiddleware interface. -func (im IBCMiddleware) OnChanOpenAck( - ctx sdk.Context, - portID, channelID string, - counterpartyChannelID string, - counterpartyVersion string, -) error { - return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) -} - -// OnChanOpenConfirm implements the IBCMiddleware interface. -func (im IBCMiddleware) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error { - return im.app.OnChanOpenConfirm(ctx, portID, channelID) -} - -// OnChanCloseInit implements the IBCMiddleware interface. -func (im IBCMiddleware) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error { - return im.app.OnChanCloseInit(ctx, portID, channelID) -} - -// OnChanCloseConfirm implements the IBCMiddleware interface. -func (im IBCMiddleware) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error { - return im.app.OnChanCloseConfirm(ctx, portID, channelID) -} - -// OnRecvPacket implements the IBCMiddleware interface. -func (im IBCMiddleware) OnRecvPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) ibcexported.Acknowledgement { - return im.app.OnRecvPacket(ctx, packet, relayer) -} - -// OnAcknowledgementPacket implements the IBCMiddleware interface. -func (im IBCMiddleware) OnAcknowledgementPacket( - ctx sdk.Context, - packet channeltypes.Packet, - acknowledgement []byte, - relayer sdk.AccAddress, -) error { - return im.app.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) -} - -// OnTimeoutPacket implements the IBCMiddleware interface. -func (im IBCMiddleware) OnTimeoutPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) error { - return im.app.OnTimeoutPacket(ctx, packet, relayer) -} - -// SendPacket implements the ICS4 Wrapper interface. -func (im IBCMiddleware) SendPacket( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - sourcePort string, - sourceChannel string, - timeoutHeight clienttypes.Height, - timeoutTimestamp uint64, - data []byte, -) (sequence uint64, err error) { - return im.keeper.SendPacket( - ctx, - chanCap, - sourceChannel, - sourceChannel, - timeoutHeight, - timeoutTimestamp, - data, - ) -} - -// WriteAcknowledgement implements the ICS4 Wrapper interface. -func (im IBCMiddleware) WriteAcknowledgement( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - packet ibcexported.PacketI, - ack ibcexported.Acknowledgement, -) error { - return im.keeper.WriteAcknowledgement(ctx, chanCap, packet, ack) -} - -// GetAppVersion implements the ICS4 Wrapper interface. -func (im IBCMiddleware) GetAppVersion( - ctx sdk.Context, - portID string, - channelID string, -) (string, bool) { - return im.keeper.GetAppVersion(ctx, portID, channelID) -} diff --git a/x/oracle/keeper/genesis.go b/x/oracle/keeper/genesis.go deleted file mode 100644 index c6b82713e..000000000 --- a/x/oracle/keeper/genesis.go +++ /dev/null @@ -1,16 +0,0 @@ -package keeper - -import ( - "github.com/onsonr/hway/x/oracle/types" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// InitGenesis initializes the middlewares state from a specified GenesisState. -func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) { -} - -// ExportGenesis exports the middlewares state. -func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { - return &types.GenesisState{} -} diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go deleted file mode 100644 index bc3b25aa8..000000000 --- a/x/oracle/keeper/keeper.go +++ /dev/null @@ -1,78 +0,0 @@ -package keeper - -import ( - "github.com/onsonr/hway/x/oracle/types" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - - "cosmossdk.io/log" - - clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" -) - -// Keeper defines the middleware keeper. -type Keeper struct { - cdc codec.BinaryCodec - msgServiceRouter *baseapp.MsgServiceRouter - - ics4Wrapper porttypes.ICS4Wrapper -} - -// NewKeeper creates a new swap Keeper instance. -func NewKeeper( - cdc codec.BinaryCodec, - msgServiceRouter *baseapp.MsgServiceRouter, - ics4Wrapper porttypes.ICS4Wrapper, -) Keeper { - return Keeper{ - cdc: cdc, - msgServiceRouter: msgServiceRouter, - ics4Wrapper: ics4Wrapper, - } -} - -// Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", "x/"+ibcexported.ModuleName+"-"+types.ModuleName) -} - -// SendPacket wraps IBC ChannelKeeper's SendPacket function. -func (k Keeper) SendPacket( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - sourcePort string, - sourceChannel string, - timeoutHeight clienttypes.Height, - timeoutTimestamp uint64, - data []byte, -) (sequence uint64, err error) { - return k.ics4Wrapper.SendPacket( - ctx, - chanCap, - sourcePort, - sourceChannel, - timeoutHeight, - timeoutTimestamp, - data, - ) -} - -// WriteAcknowledgement wraps IBC ChannelKeeper's WriteAcknowledgement function. -func (k Keeper) WriteAcknowledgement( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - packet ibcexported.PacketI, - acknowledgement ibcexported.Acknowledgement, -) error { - return k.ics4Wrapper.WriteAcknowledgement(ctx, chanCap, packet, acknowledgement) -} - -// GetAppVersion wraps IBC ChannelKeeper's GetAppVersion function. -func (k Keeper) GetAppVersion(ctx sdk.Context, portID string, channelID string) (string, bool) { - return k.ics4Wrapper.GetAppVersion(ctx, portID, channelID) -} diff --git a/x/oracle/module.go b/x/oracle/module.go deleted file mode 100644 index 233c4e6d3..000000000 --- a/x/oracle/module.go +++ /dev/null @@ -1,127 +0,0 @@ -package oracle - -import ( - "encoding/json" - - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/onsonr/hway/x/oracle/keeper" - "github.com/onsonr/hway/x/oracle/types" - "github.com/spf13/cobra" - - "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" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - - abci "github.com/cometbft/cometbft/abci/types" -) - -var ( - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModule = AppModule{} - _ module.AppModuleSimulation = AppModule{} -) - -// AppModuleBasic is the middleware AppModuleBasic. -type AppModuleBasic struct{} - -// Name implements AppModuleBasic interface. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -// RegisterLegacyAminoCodec implements AppModuleBasic interface. -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} - -// RegisterInterfaces registers module concrete types into protobuf Any. -func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {} - -// DefaultGenesis returns default genesis state as raw bytes for the swap module. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return nil -} - -// ValidateGenesis performs genesis state validation for the swap module. -func (AppModuleBasic) ValidateGenesis( - cdc codec.JSONCodec, - config client.TxEncodingConfig, - bz json.RawMessage, -) error { - return nil -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the swap module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {} - -// GetTxCmd implements AppModuleBasic interface. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return nil -} - -// GetQueryCmd implements AppModuleBasic interface. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - -// AppModule is the middleware AppModule. -type AppModule struct { - AppModuleBasic - keeper keeper.Keeper -} - -// IsAppModule implements module.AppModule. -func (AppModule) IsAppModule() { -} - -// IsOnePerModuleType implements module.AppModule. -func (AppModule) IsOnePerModuleType() { -} - -// NewAppModule initializes a new AppModule for the middleware. -func NewAppModule(keeper keeper.Keeper) *AppModule { - return &AppModule{ - keeper: keeper, - } -} - -// RegisterInvariants implements the AppModule interface. -func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} - -// RegisterServices registers module services. -func (am AppModule) RegisterServices(cfg module.Configurator) {} - -// InitGenesis performs genesis initialization for the ibc-router module. It returns -// no validator updates. -func (am AppModule) InitGenesis( - ctx sdk.Context, - cdc codec.JSONCodec, - data json.RawMessage, -) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the exported genesis state as raw bytes for the swap module. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - return nil -} - -// ConsensusVersion returns the consensus state breaking version for the swap module. -func (am AppModule) ConsensusVersion() uint64 { return 1 } - -// GenerateGenesisState implements the AppModuleSimulation interface. -func (am AppModule) GenerateGenesisState(simState *module.SimulationState) {} - -// ProposalContents implements the AppModuleSimulation interface. -func (am AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - -// RegisterStoreDecoder implements the AppModuleSimulation interface. -func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) {} - -// WeightedOperations implements the AppModuleSimulation interface. -func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { - return nil -} diff --git a/x/oracle/types/errors.go b/x/oracle/types/errors.go deleted file mode 100644 index f46defe81..000000000 --- a/x/oracle/types/errors.go +++ /dev/null @@ -1,7 +0,0 @@ -package types - -import sdkerrors "cosmossdk.io/errors" - -var ( - ErrInvalidGenesisState = sdkerrors.Register(ModuleName, 1, "invalid genesis state") -) diff --git a/x/oracle/types/expected_keepers.go b/x/oracle/types/expected_keepers.go deleted file mode 100644 index 10772f1be..000000000 --- a/x/oracle/types/expected_keepers.go +++ /dev/null @@ -1,3 +0,0 @@ -package types - -// Define the expected interfaces that the middleware needs in order to properly function here. diff --git a/x/oracle/types/genesis.go b/x/oracle/types/genesis.go deleted file mode 100644 index efb7d8e03..000000000 --- a/x/oracle/types/genesis.go +++ /dev/null @@ -1,16 +0,0 @@ -package types - -// DefaultGenesisState returns the default middleware GenesisState. -func DefaultGenesisState() *GenesisState { - return &GenesisState{} -} - -// NewGenesisState initializes and returns a new GenesisState. -func NewGenesisState() *GenesisState { - return &GenesisState{} -} - -// Validate performs basic validation of the GenesisState. -func (gs *GenesisState) Validate() error { - return nil -} diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go deleted file mode 100644 index 71cd005fc..000000000 --- a/x/oracle/types/genesis.pb.go +++ /dev/null @@ -1,265 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: oracle/v1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "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 middlewares genesis state. -type GenesisState struct { -} - -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 init() { - proto.RegisterType((*GenesisState)(nil), "oracle.v1.GenesisState") -} - -func init() { proto.RegisterFile("oracle/v1/genesis.proto", fileDescriptor_14b982a0a6345d1d) } - -var fileDescriptor_14b982a0a6345d1d = []byte{ - // 147 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x2f, 0x4a, 0x4c, - 0xce, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x84, 0x48, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, - 0x83, 0x45, 0xf5, 0x41, 0x2c, 0x88, 0x02, 0x25, 0x3e, 0x2e, 0x1e, 0x77, 0x88, 0x8e, 0xe0, 0x92, - 0xc4, 0x92, 0x54, 0x27, 0xfb, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, - 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x52, - 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0xcf, 0x2b, 0xce, 0xcf, - 0x2b, 0xd2, 0xcf, 0x28, 0x4f, 0xac, 0xd4, 0xaf, 0xd0, 0x87, 0x5a, 0x5e, 0x52, 0x59, 0x90, 0x5a, - 0x9c, 0xc4, 0x06, 0x36, 0xd7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x25, 0x38, 0x48, 0xfb, 0x93, - 0x00, 0x00, 0x00, -} - -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 - 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 - 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 { - 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/keys.go b/x/oracle/types/keys.go deleted file mode 100644 index d4fedb867..000000000 --- a/x/oracle/types/keys.go +++ /dev/null @@ -1,15 +0,0 @@ -package types - -const ( - // ModuleName defines the name of the middleware. - ModuleName = "oracle" - - // StoreKey is the store key string for the middleware. - StoreKey = ModuleName - - // RouterKey is the message route for the middleware. - RouterKey = ModuleName - - // QuerierRoute is the querier route for the middleware. - QuerierRoute = ModuleName -) diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go deleted file mode 100644 index 83371e3e1..000000000 --- a/x/oracle/types/query.pb.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: oracle/v1/query.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - math "math" -) - -// 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 - -func init() { proto.RegisterFile("oracle/v1/query.proto", fileDescriptor_34238c8dfdfcd7ec) } - -var fileDescriptor_34238c8dfdfcd7ec = []byte{ - // 133 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, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x45, - 0xf5, 0x41, 0x2c, 0x88, 0x02, 0x27, 0xfb, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, - 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, - 0x88, 0x52, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0xcf, 0x2b, - 0xce, 0xcf, 0x2b, 0xd2, 0xcf, 0x28, 0x4f, 0xac, 0xd4, 0xaf, 0xd0, 0x87, 0x5a, 0x55, 0x52, 0x59, - 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x36, 0xc7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x7f, 0x61, - 0xbe, 0x81, 0x00, 0x00, 0x00, -} diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go deleted file mode 100644 index 405cea3d0..000000000 --- a/x/oracle/types/tx.pb.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: oracle/v1/tx.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - math "math" -) - -// 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 - -func init() { proto.RegisterFile("oracle/v1/tx.proto", fileDescriptor_31571edce0094a5d) } - -var fileDescriptor_31571edce0094a5d = []byte{ - // 130 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, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x45, 0xf5, 0x41, 0x2c, - 0x88, 0x02, 0x27, 0xfb, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, - 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x52, 0x4d, - 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0xcf, 0x2b, 0xce, 0xcf, 0x2b, - 0xd2, 0xcf, 0x28, 0x4f, 0xac, 0xd4, 0xaf, 0xd0, 0x87, 0xda, 0x53, 0x52, 0x59, 0x90, 0x5a, 0x9c, - 0xc4, 0x06, 0x36, 0xc7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x39, 0x40, 0x7c, 0x7a, 0x7e, 0x00, - 0x00, 0x00, -}